📄 mainmenu.java,v
字号:
head 1.9;access;symbols;locks rirwin:1.9; strict;comment @# @;1.9date 2005.06.21.18.39.43; author rirwin; state Exp;branches;next 1.8;1.8date 2005.06.21.18.29.29; author rirwin; state Exp;branches;next 1.7;1.7date 2005.06.10.14.41.30; author rirwin; state Exp;branches;next 1.6;1.6date 2005.05.24.14.48.03; author rirwin; state Exp;branches;next 1.5;1.5date 2005.05.24.14.00.53; author rirwin; state Exp;branches;next 1.4;1.4date 2005.03.11.17.53.32; author patil; state Exp;branches;next 1.3;1.3date 2004.12.28.23.56.46; author patil; state Exp;branches;next 1.2;1.2date 2004.12.28.22.05.42; author patil; state Exp;branches;next 1.1;1.1date 2004.12.28.00.04.32; author patil; state Exp;branches;next ;desc@Changes made.@1.9log@Changed switching to Kalman from Particle.@text@/** * file: MainMenu.java * * last edited: Ryan Irwin */// import necessary java libraries//import java.awt.*;import javax.swing.*;import java.awt.event.ActionListener;import java.awt.event.*;import java.util.*;import java.io.*;import java.net.*;import java.applet.*;/** * * implement the menu driven system that drives the applet * * hierarchy: JPanel->SubPanel->MainMenu * */public class MainMenu extends SubPanel implements ActionListener{ // ********************************************************************* // // declare global variables and components // // ********************************************************************* // declare the menu font layout // Font currentFont = getFont(); Font newFont = new Font(currentFont.getName(), currentFont.getStyle(), 12); // declare the menu layout // JMenuBar menuBar; JMenu menu; JMenuItem menuItem; JMenuItem prevMenuItem; JMenuItem nextMenuItem; JCheckBoxMenuItem nearestMenuItem; JCheckBoxMenuItem euclideanMenuItem; JCheckBoxMenuItem pcaMenuItem; JCheckBoxMenuItem pca1MenuItem; JCheckBoxMenuItem ldaMenuItem; JCheckBoxMenuItem lda1MenuItem; JCheckBoxMenuItem ldapcaMenuItem; //I add here for lpa->pca 1 JCheckBoxMenuItem ldapca1MenuItem; JCheckBoxMenuItem icaMenuItem; JCheckBoxMenuItem ica1MenuItem; JCheckBoxMenuItem svmMenuItem; JCheckBoxMenuItem svm1MenuItem; JCheckBoxMenuItem lpMenuItem; //I add here for lp and particle JCheckBoxMenuItem pfMenuItem; JCheckBoxMenuItem kfMenuItem; JRadioButtonMenuItem rbMenuItem; // declare components for the help box // JFrame frame; JTextArea textArea; JScrollPane scrollPane; JButton dismiss; // declare components for the scales frame // JFrame scale; JButton change; // declare components for the gaussian frame // JFrame setgausdlg; JButton applyb; JButton cancel; // declare components for the color selection frame // JFrame setccolorsdlg; JLabel colorselection; JLabel dset1color; JLabel dset2color; JLabel dset3color; JLabel dset4color; JButton setdset1; JButton setdset2; JButton setdset3; JButton setdset4; JButton setcolors; JPanel paneldset1 = new JPanel(); JPanel paneldset2 = new JPanel(); JPanel paneldset3 = new JPanel(); JPanel paneldset4 = new JPanel(); // declare components for the k-mean algorithm // JFrame clusterpara; JButton initcluster; // declare components for the LBG algorithm // JFrame iterpara; JButton inititer; // declare components for the LP algorithm // JFrame lpsetorderpara; JButton initlporder; // declare components for the PF algorithm // JFrame pfsetorderpara; JButton initpforder; // declare components for the KF algorithm // JFrame kfsetorderpara; JButton initkforder; // declare components for the Kalman algorithm // JFrame set_meas_gain_frame; JButton init_meas_gain; // declare components for the Kalman algorithm // JFrame set_state_gain_frame; JButton init_state_gain; // declare components for the Kalman algorithm // JFrame set_var_meas_noise_frame; JButton init_var_meas_noise; // declare components for the Kalman algorithm // JFrame set_var_state_noise_frame; JButton init_var_state_noise; // declare componets for setting interpolation order in the LP algorithm // JFrame ipsetorderpara; JButton initiporder; // global variables for the k-means algorithm // int guesses = 4; int iterations = 4; // global variables for the LBG algorithm // int clusters = 10; // global variables for setting linear and polation order in // the LP algorithm and particle filtering algorithm // int lporder = 8; int iporder = 10; int pforder = 8; int kforder = 8; // Kalman Filter // double meas_gain = 1.0; double state_gain = 1.0; double var_meas_noise = 10; double var_state_noise = 10; // flags // boolean drwptsf = true; boolean drwgaussf = false; boolean zoomi = false; boolean zoomo = false; // global variable for the gaussian distribution // int points = 25; double meanx = 0.0; double meany = 0.0; double cov11 = 0.05; double cov12 = 0.0; double cov21 = 0.0; double cov22 = 0.05; // declare varaibles to read the help file // URL url; Vector urlvec; String document; BufferedReader buff; AppletContext context; // declare components for the time scales // JLabel xMinLabel; // x-axis minimum label JLabel xMaxLabel; // x-axis maximum label JLabel yMinLabel; // y-axis minimum label JLabel yMaxLabel; // y-axis maximum label JTextField xMinField; // x-axis minimum text field JTextField xMaxField; // x-axis maximum text field JTextField yMinField; // y-axis minimum text field JTextField yMaxField; // y-axis maximum text field // declare components for the gaussian distribution // JLabel pointsLabel; // max points in distribution label JLabel meanxLabel; // mean of distribution (x) label JLabel meanyLabel; // mean of distribution (y) label JLabel setgausLabel; //Gaussian Settings Label JLabel covLabel; //Covariance Lable JLabel cov11Label; // covariance c11 of distribution label JLabel cov12Label; // covariance c12 of distribution label JLabel cov21Label; // covariance c21 of distribution label JLabel cov22Label; // covariance c22 of distribution label JTextField pointsField; // max points in distribution text field JTextField meanxField; // mean of distribution (x) text field JTextField meanyField; // mean of distribution (y) text field JTextField cov11Field; // covariance c11 text field JTextField cov12Field; // covariance c12 text field JTextField cov21Field; // covariance c21 text field JTextField cov22Field; // covariance c22 text field // declare components for the k-means algorithm // JLabel guessesLabel; // number of initial guesses label JLabel iterationsLabel; // max number of iterations label JLabel clusterLabel; // max number of clusters JTextField guessesField; // number of initial guesses field JTextField iterationsField; // max number of iterations field JTextField clusterField; // max number of clusters // declare components for lp order in the LP algorithm // JLabel lporderLabel; // LP order label JTextField lporderField; // LP order text field // declare components for pf order in the PF algorithm // JLabel pforderLabel; // PF order label JTextField pforderField; // PF order text field // declare components for kf order in the KF algorithm // JLabel kforderLabel; // KF order label JTextField kforderField; // KF order text field // declare components for meas_gain in the Kalman algorithm // JLabel meas_gain_label; JTextField meas_gain_field; // declare components for state_gain in the Kalman algorithm // JLabel state_gain_label; JTextField state_gain_field; // declare components for var_meas_gain order in the Kalman algorithm // JLabel var_meas_noise_label; JTextField var_meas_noise_field; // declare components for var_state_gain in the Kalman algorithm // JLabel var_state_noise_label; JTextField var_state_noise_field; // declare components for interpolation in the LP and PF algorithm // JLabel iporderLabel; // interpolation order label JTextField iporderField; // interpolation order text field // // declare a checkbox item listener // // // CheckBoxListener myListener = new CheckBoxListener(); // declare strings for the Help menu // String helpOption = new String("Help"); String tutorial = new String("Applet Tutorial"); String overview = new String("Applet Overview"); String release = new String("Release Notes"); String info = new String("Information and Support"); String plugins = new String("About Plug-ins"); String done = new String("Done"); String refresh = new String("Update"); String apply = new String("OK"); String destroy = new String("Cancel"); String setpara = new String("Set K-Means"); String newline = new String("\n"); // declare strings for the color changer dialog // String changeset = new String("Change"); String changeset1 = new String("Change1"); String changeset2 = new String("Change2"); String changeset3 = new String("Change3"); String changeset4 = new String("Change4"); // declare menu title strings // String drwpts = new String("Draw Points"); String drwgauss = new String("Draw Gaussian"); String pearEllipse = new String("Pear And Ellipse"); String twoEllipse = new String("Two Ellipse"); String twoGaussian = new String("Two Gaussian"); String fourGaussian = new String("Four Gaussian"); String overGaussian = new String("Overlapping Gaussian"); String twoEllipses = new String("Two Ellipses"); String fourEllipses = new String("Four Ellipses"); String rotatedEllipses = new String("Rotated Ellipses"); String toroidal = new String("Toroidal"); String yinYang = new String("Yin and Yang"); String class1 = new String("Input Class 0"); String class2 = new String("Input Class 1"); String class3 = new String("Input Class 2"); String class4 = new String("Input Class 3"); String euclidean = new String("Euclidean Distance"); String nearest = new String("Nearest Neighbor"); String kmeans = new String("Clustering: K-Means"); String binary = new String("Clustering: LBG"); String LDA1 = new String("LDA: Class-Independent"); String LDA2 = new String("LDA: Class-Dependent"); String PCA1 = new String("PCA: Class-Independent"); String PCA2 = new String("PCA: Class-Dependent"); String LDAPCA1 = new String("LDA->PCA: Class-Independent"); String LDAPCA2 = new String("LDA->PCA: Class-Dependent"); String ICA1 = new String("ICA: Class-Independent"); String ICA2 = new String("ICA: Class-Dependent"); String SVM1 = new String("SVM: Class-Independent"); String SVM2 = new String("RVM: Relevance Vector Machine"); String LP = new String("LP: Linear Prediction"); String PF = new String("PF: Particle Filtering"); String KF = new String("KF: Kalman Filtering"); String previous = new String("Previous"); String setgaus = new String ("Set Gaussian"); String setccolors = new String ("Set Class Colors"); String setiterations = new String ("Set Iterations"); String setclusters = new String ("Set Clusters"); String setlporders = new String ("Set LP Order"); String setpforders = new String ("Set PF Order"); String setkforders = new String ("Set KF Order"); String setiporders = new String ("Set Interpolation"); String set_meas_gain = new String ("Set Measurement Gain"); String set_state_gain = new String ("Set State Gain"); String set_var_meas_noise = new String("Set Variance of Measurement Noise"); String set_var_state_noise = new String ("Set Variance of State Noise"); String saveiporders = new String ("Save Interpolation Order"); String saveiterations = ("Save Iterations"); String saveclusters = ("Save Clusters"); String savelporders = ("Save LP Order"); String savepforders = ("Save PF Order"); String savekforders = ("Save KF Order"); String save_meas_gain = new String ("Save Measurement Gain"); String save_state_gain = new String ("Save State Gain"); String save_var_meas_noise = new String("Save Variance of Measurement Noise"); String save_var_state_noise = new String ("Save Variance of State Noise"); String clearAll = new String("Clear All"); String clearPlots = new String("Clear Display"); String clearInput = new String("Clear Input"); String clearOutput = new String("Clear Output"); String clearTxt = new String("Clear Description"); String erase = new String("Erase"); String zoomin = new String("Zoom In"); String zoomout = new String("Zoom Out"); String limit = new String("Set Ranges"); String next = new String("Next"); String load = new String("Load"); String save = new String("Save"); String initialize = new String("Initialize"); String viewEuclidean = new String("View Euclidean"); String viewNearest = new String("View Nearest Neighbor"); String viewPCA1 = new String("PCA: Class Independent PCA"); String viewPCA2 = new String("PCA: Class Dependent PCA"); String viewLDA1 = new String("LDA: Class Independent LDA"); String viewLDA2 = new String("LDA: Class Dependent LDA"); String viewLDAPCA1 = new String("LDA->PCA: Class Independent LDA->PCA"); String viewLDAPCA2 = new String("LDA->PCA: Class Dependent LDA->PCA"); String viewICA1 = new String("ICA: Class Independent PCA"); String viewICA2 = new String("ICA: Class Dependent LDA"); String viewSVM1 = new String("SVM: Class Independent PCA"); //String viewSVM2 = new String("SVM: Class Dependent LDA"); String viewSVM2 = new String("SVM: Relevance Vector Machine"); String viewLP = new String("LP: Linear Prediction"); String viewPF = new String("PF: Particle Filtering"); String viewKF = new String("KF: Kalman Filtering"); String viewKMeans = new String("Clustering : K-Means"); String viewLBG = new String("Clustering : LBG");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -