package jas2.util.pluginmanager;

import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.io.*;
import java.util.*;
import java.net.*;
import jas2.util.*;

/**This class is used to supply a gui JFrame for the JPane created by the AppVersionCheck class.
 * JAS uses these classes to allow the user to check if they are running the current version of JAS.*/ 
public class JASVersion extends AppVersionCheck
{
	private JASVersionDialog jasversiondialog;
	private Frame frame;
	/**The JASVersion frame will be created and the AppVersionCheck pane, which controls
	 * the version check functionality, will be added which prompts the user to select from the version check options.
	 */
	public JASVersion(Frame f,String appname,String versionURL,String currentversion,Properties userProp)
	{
		super(appname,versionURL, currentversion,userProp);
		this.frame = f;	
	}
	
	public void showOptionsDialog(){
		jasversiondialog = new JASVersionDialog(frame,"Check JAS Version", true,JASDialog.OK_BUTTON |  JASDialog.CANCEL_BUTTON | JASDialog.HELP_BUTTON);
		jasversiondialog.createVersionFrame();
		
	}
	
	class JASVersionDialog extends JASDialog{
		
		JASVersionDialog(Frame f,String t,boolean modal,int flags)
		{
			super(f,t,modal,flags);
		}
		
		void createVersionFrame()
		{
			JASVersionDialog.this.setHelpTopic("userInterface.versioncheck");
			JPanel pane = JASVersion.this.getVersionCheckOptionPane();
			JASVersionDialog.this.getContentPane().add(pane, BorderLayout.CENTER );
			JASVersionDialog.this.pack();
			JASVersionDialog.this.show();

		}
		public void onOK(){
			JASVersion.this.setUserProperties();
			dispose();
		}
			
		protected void enableHelp(JASState state)
		{
			state.setEnabled(true);
		}

		public void onCancel(){
			dispose();
		}
	}
	
}

 

Ads help maintain this website.