Removed the JMenuItem that allowed users to switch the look and feel of the program. This feature causes lots of problems when using EvA2 as an optimization toolbox within different programs that use another look and fee. Furthermore, none of the professional programs available allows users to switch look and feels (at most the skin of a program). Furthermore, there is the question why should somebody use a look and feel in the style of an application from 1985? This feature was not helpful at all and should therefore not be re-introduced again.
I also updated the about message that was really not up to date.
This commit is contained in:
parent
63e6f72bfc
commit
7a760512dc
@ -84,12 +84,11 @@ import eva2.tools.BasicResourceLoader;
|
|||||||
* @author mkron
|
* @author mkron
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class EvAInfo {
|
public class EvAInfo {
|
||||||
public static final String productName = "EvA2";
|
public static final String productName = "EvA2";
|
||||||
public static final String productLongName = "Evolutionary Algorithms Workbench 2";
|
public static final String productLongName = "Evolutionary Algorithms Workbench 2";
|
||||||
// public static final String fullVersion = "2.043"; // moved to EvA2.props!
|
// public static final String fullVersion = "2.043"; // moved to EvA2.props!
|
||||||
public static final String url = "http://www.ra.cs.uni-tuebingen.de/software/EvA2";
|
public static final String url = "http://www.cogsys.cs.uni-tuebingen.de/software/EvA2";
|
||||||
|
|
||||||
public static final String propertyFile = "resources/EvA2.props";
|
public static final String propertyFile = "resources/EvA2.props";
|
||||||
public static final String LGPLFile = "lgpl-3.0.txt";
|
public static final String LGPLFile = "lgpl-3.0.txt";
|
||||||
@ -98,7 +97,7 @@ public class EvAInfo {
|
|||||||
|
|
||||||
public static final String splashLocation = "resources/images/splashScreen2.png";
|
public static final String splashLocation = "resources/images/splashScreen2.png";
|
||||||
public static final String infoTitle = productName+" Information";
|
public static final String infoTitle = productName+" Information";
|
||||||
public static final String copyrightYear = "2010";
|
public static final String copyrightYear = "2010-2012";
|
||||||
|
|
||||||
////////////// Property handling...
|
////////////// Property handling...
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@ import java.net.URL;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import javax.swing.ButtonGroup;
|
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
@ -41,18 +40,14 @@ import javax.swing.JMenuItem;
|
|||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JProgressBar;
|
import javax.swing.JProgressBar;
|
||||||
import javax.swing.JRadioButtonMenuItem;
|
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JSeparator;
|
import javax.swing.JSeparator;
|
||||||
import javax.swing.JTree;
|
import javax.swing.JTree;
|
||||||
import javax.swing.JWindow;
|
import javax.swing.JWindow;
|
||||||
import javax.swing.KeyStroke;
|
import javax.swing.KeyStroke;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.UIManager;
|
|
||||||
import javax.swing.UnsupportedLookAndFeelException;
|
|
||||||
import javax.swing.event.MenuEvent;
|
import javax.swing.event.MenuEvent;
|
||||||
import javax.swing.event.MenuListener;
|
import javax.swing.event.MenuListener;
|
||||||
import javax.swing.tree.DefaultMutableTreeNode;
|
|
||||||
|
|
||||||
import eva2.EvAInfo;
|
import eva2.EvAInfo;
|
||||||
import eva2.gui.BeanInspector;
|
import eva2.gui.BeanInspector;
|
||||||
@ -87,6 +82,10 @@ import eva2.tools.jproxy.RemoteStateListener;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EvAClient implements RemoteStateListener, Serializable {
|
public class EvAClient implements RemoteStateListener, Serializable {
|
||||||
|
/**
|
||||||
|
* Generated serial version identifier.
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = 8232856334379977970L;
|
||||||
private final int splashScreenTime = 1500;
|
private final int splashScreenTime = 1500;
|
||||||
private final int maxWindowMenuLength = 30;
|
private final int maxWindowMenuLength = 30;
|
||||||
private boolean clientInited = false;
|
private boolean clientInited = false;
|
||||||
@ -511,7 +510,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
if (TRACE) System.out.println("Command line arguments were: ");
|
if (TRACE) System.out.println("Command line arguments were: ");
|
||||||
if (TRACE) System.out.println(" " + BeanInspector.toString(keys));
|
if (TRACE) System.out.println(" " + BeanInspector.toString(keys));
|
||||||
if (TRACE) System.out.println(" " + BeanInspector.toString(values));
|
if (TRACE) System.out.println(" " + BeanInspector.toString(values));
|
||||||
EvAClient Client = new EvAClient(hostName, paramsFile, autorun, nosplash, nogui, treeView);
|
new EvAClient(hostName, paramsFile, autorun, nosplash, nogui, treeView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -660,54 +659,60 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
private void buildMenu() {
|
private void buildMenu() {
|
||||||
m_barMenu = new JMenuBar();
|
m_barMenu = new JMenuBar();
|
||||||
m_Frame.setJMenuBar(m_barMenu);
|
m_Frame.setJMenuBar(m_barMenu);
|
||||||
////////////////////////////////////////////////////////////////////////////
|
// ////////////////////////////////////////////////////////////////////////////
|
||||||
JExtMenu mnuLookAndFeel = new JExtMenu("&Look and Feel");
|
/*
|
||||||
ButtonGroup grpLookAndFeel = new ButtonGroup();
|
* Really, nobody wants to use a Look And Feel from 1985!!!
|
||||||
UIManager.LookAndFeelInfo laf[] = UIManager.getInstalledLookAndFeels();
|
* Which one of the professional programs allows changing the entire
|
||||||
|
* look and feel? At most, one can select a different skin.
|
||||||
|
*/
|
||||||
|
|
||||||
String LAF = Serializer.loadString("LookAndFeel.ser");
|
// JExtMenu mnuLookAndFeel = new JExtMenu("&Look and Feel");
|
||||||
|
// ButtonGroup grpLookAndFeel = new ButtonGroup();
|
||||||
boolean lafSelected = false;
|
// UIManager.LookAndFeelInfo laf[] = UIManager.getInstalledLookAndFeels();
|
||||||
for (int i = 0; i < laf.length; i++) {
|
//
|
||||||
JRadioButtonMenuItem mnuItem = new JRadioButtonMenuItem(laf[i].getName());
|
// String LAF = Serializer.loadString("LookAndFeel.ser");
|
||||||
mnuItem.setActionCommand(laf[i].getClassName());
|
//
|
||||||
if (!lafSelected && laf[i].getClassName().equals(UIManager.getLookAndFeel().getClass().getName())) {
|
// boolean lafSelected = false;
|
||||||
// if (!lafSelected && laf[i].getClassName().equals(UIManager.getSystemLookAndFeelClassName())) {
|
// for (int i = 0; i < laf.length; i++) {
|
||||||
// if (LAF==null) {// do this only if no older selection one could be loaded
|
// JRadioButtonMenuItem mnuItem = new JRadioButtonMenuItem(laf[i].getName());
|
||||||
// LAF = laf[i].getClassName(); // set for later selection
|
// mnuItem.setActionCommand(laf[i].getClassName());
|
||||||
// } // this causes problems with my gnome!
|
// if (!lafSelected && laf[i].getClassName().equals(UIManager.getLookAndFeel().getClass().getName())) {
|
||||||
if (LAF == null) {
|
//// if (!lafSelected && laf[i].getClassName().equals(UIManager.getSystemLookAndFeelClassName())) {
|
||||||
lafSelected = true;
|
//// if (LAF==null) {// do this only if no older selection one could be loaded
|
||||||
mnuItem.setSelected(true);
|
//// LAF = laf[i].getClassName(); // set for later selection
|
||||||
}
|
//// } // this causes problems with my gnome!
|
||||||
}
|
// if (LAF == null) {
|
||||||
mnuItem.addActionListener(new ActionListener() {
|
// lafSelected = true;
|
||||||
public void actionPerformed(ActionEvent e) {
|
// mnuItem.setSelected(true);
|
||||||
try {
|
// }
|
||||||
UIManager.setLookAndFeel(e.getActionCommand());
|
// }
|
||||||
SwingUtilities.updateComponentTreeUI(m_Frame);
|
// mnuItem.addActionListener(new ActionListener() {
|
||||||
// TODO hier noch reinhacken dass alle frame geupdated werden.
|
// public void actionPerformed(ActionEvent e) {
|
||||||
m_Frame.pack();
|
// try {
|
||||||
// m_Frame.setSize(new Dimension(900, 700));
|
// UIManager.setLookAndFeel(e.getActionCommand());
|
||||||
// m_Frame.setVisible(true);
|
// SwingUtilities.updateComponentTreeUI(m_Frame);
|
||||||
Serializer.storeString("LookAndFeel.ser", e.getActionCommand());
|
// // TODO hier noch reinhacken dass alle frame geupdated werden.
|
||||||
} catch (ClassNotFoundException exc) {} catch (InstantiationException exc) {} catch (UnsupportedLookAndFeelException exc) {} catch (
|
|
||||||
IllegalAccessException exc) {}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mnuLookAndFeel.add(mnuItem);
|
|
||||||
grpLookAndFeel.add(mnuItem);
|
|
||||||
}
|
|
||||||
if (LAF != null) {
|
|
||||||
try {
|
|
||||||
UIManager.setLookAndFeel(LAF);
|
|
||||||
SwingUtilities.updateComponentTreeUI(m_Frame);
|
|
||||||
// m_Frame.pack();
|
// m_Frame.pack();
|
||||||
// m_Frame.setSize(new Dimension(900, 700));
|
//// m_Frame.setSize(new Dimension(900, 700));
|
||||||
// m_Frame.setVisible(true);
|
//// m_Frame.setVisible(true);
|
||||||
} catch (ClassNotFoundException exc) {} catch (InstantiationException exc) {} catch (UnsupportedLookAndFeelException exc) {} catch (
|
// Serializer.storeString("LookAndFeel.ser", e.getActionCommand());
|
||||||
IllegalAccessException exc) {}
|
// } catch (ClassNotFoundException exc) {} catch (InstantiationException exc) {} catch (UnsupportedLookAndFeelException exc) {} catch (
|
||||||
}
|
// IllegalAccessException exc) {}
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// mnuLookAndFeel.add(mnuItem);
|
||||||
|
// grpLookAndFeel.add(mnuItem);
|
||||||
|
// }
|
||||||
|
// if (LAF != null) {
|
||||||
|
// try {
|
||||||
|
// UIManager.setLookAndFeel(LAF);
|
||||||
|
// SwingUtilities.updateComponentTreeUI(m_Frame);
|
||||||
|
//// m_Frame.pack();
|
||||||
|
//// m_Frame.setSize(new Dimension(900, 700));
|
||||||
|
//// m_Frame.setVisible(true);
|
||||||
|
// } catch (ClassNotFoundException exc) {} catch (InstantiationException exc) {} catch (UnsupportedLookAndFeelException exc) {} catch (
|
||||||
|
// IllegalAccessException exc) {}
|
||||||
|
// }
|
||||||
m_mnuModule = new JExtMenu("&Module");
|
m_mnuModule = new JExtMenu("&Module");
|
||||||
m_mnuModule.add(m_actModuleLoad);
|
m_mnuModule.add(m_actModuleLoad);
|
||||||
|
|
||||||
@ -783,7 +788,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
// m_barMenu.add(m_Desktop.getWindowMenu());
|
// m_barMenu.add(m_Desktop.getWindowMenu());
|
||||||
|
|
||||||
m_mnuOptions = new JExtMenu("&Options");
|
m_mnuOptions = new JExtMenu("&Options");
|
||||||
m_mnuOptions.add(mnuLookAndFeel);
|
// m_mnuOptions.add(mnuLookAndFeel);
|
||||||
m_mnuOptions.add(m_mnuSelHosts);
|
m_mnuOptions.add(m_mnuSelHosts);
|
||||||
//m_barMenu.add(m_mnuSelHosts);
|
//m_barMenu.add(m_mnuSelHosts);
|
||||||
// this is accessible if no default module is given
|
// this is accessible if no default module is given
|
||||||
@ -1037,11 +1042,11 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
JOptionPane.showMessageDialog
|
JOptionPane.showMessageDialog
|
||||||
(m_Frame,
|
(m_Frame,
|
||||||
EvAInfo.productName + " - " + EvAInfo.productLongName +
|
EvAInfo.productName + " - " + EvAInfo.productLongName +
|
||||||
"\n University of Tübingen\n Chair for Computer Architecture\n " +
|
"\nUniversity of Tuebingen, T\u00FCbingen, Germany\nChair for Cognitive Systems\n" +
|
||||||
"M. Kronfeld, H. Planatscher, M. de Paly, A. Dräger, F. Streichert, H. Ulmer\n " +
|
"Dr. M. Kronfeld, H. Planatscher, M. de Paly, Dr. A. Dr\u00E4ger,\n" +
|
||||||
// "H. Ulmer & F. Streichert & H. Planatscher & M. de Paly & M. Kronfeld\n" +
|
"Dr. F. Streichert, Dr. H. Ulmer, and Prof. Dr. A. Zell \nCoypright \u00A9 " +
|
||||||
"Prof. Dr. Andreas Zell \n (c) " + EvAInfo.copyrightYear + "\n Version " + EvAInfo.getVersion()+
|
EvAInfo.copyrightYear + "\nVersion " + EvAInfo.getVersion()+
|
||||||
"\n URL: " + EvAInfo.url, EvAInfo.infoTitle, 1);
|
"\nSee: " + EvAInfo.url, EvAInfo.infoTitle, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showLicense() {
|
private void showLicense() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user