refs #14
Fixed AboutDialog Deactivated CustomTabPaneUI Changed default Font for the UI.
This commit is contained in:
parent
0ee348e2b6
commit
3fd2e505a8
@ -38,21 +38,18 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.TitledBorder;
|
import javax.swing.border.TitledBorder;
|
||||||
import javax.swing.event.MenuEvent;
|
|
||||||
import javax.swing.event.MenuListener;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EvAClient implements RemoteStateListener, Serializable {
|
public class EvAClient implements RemoteStateListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated serial version identifier.
|
* Generated serial version identifier.
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 8232856334379977970L;
|
private static final long serialVersionUID = 8232856334379977970L;
|
||||||
private final int splashScreenTime = 2500;
|
private final int splashScreenTime = 2500;
|
||||||
private final int maxWindowMenuLength = 30;
|
|
||||||
private boolean clientInited = false;
|
private boolean clientInited = false;
|
||||||
private JExtDesktopPaneToolBar desktopToolBar;
|
private JExtDesktopPaneToolBar desktopToolBar;
|
||||||
private JDesktopPane desktopPane;
|
private JDesktopPane desktopPane;
|
||||||
@ -67,6 +64,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
private transient JExtMenu menuSelHosts;
|
private transient JExtMenu menuSelHosts;
|
||||||
private transient JExtMenu menuModule;
|
private transient JExtMenu menuModule;
|
||||||
private transient JExtMenu menuOptions;
|
private transient JExtMenu menuOptions;
|
||||||
|
private JPanel statusBar;
|
||||||
private transient JProgressBar progressBar;
|
private transient JProgressBar progressBar;
|
||||||
|
|
||||||
// Option
|
// Option
|
||||||
@ -235,7 +233,6 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
// preload some classes (into system cache) in a parallel thread
|
// preload some classes (into system cache) in a parallel thread
|
||||||
preloadClasses();
|
preloadClasses();
|
||||||
|
|
||||||
|
|
||||||
withGUI = !noGui;
|
withGUI = !noGui;
|
||||||
withTreeView = showTreeView;
|
withTreeView = showTreeView;
|
||||||
// activate the splash screen (show later using SwingUtilities)
|
// activate the splash screen (show later using SwingUtilities)
|
||||||
@ -361,6 +358,22 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set UI Font for all controls.
|
||||||
|
*
|
||||||
|
* @param fontResource The FontUIResource for the controls
|
||||||
|
*/
|
||||||
|
private static void setUIFont(javax.swing.plaf.FontUIResource fontResource) {
|
||||||
|
java.util.Enumeration keys = UIManager.getDefaults().keys();
|
||||||
|
while (keys.hasMoreElements()) {
|
||||||
|
Object key = keys.nextElement();
|
||||||
|
Object value = UIManager.get(key);
|
||||||
|
if (value != null && value instanceof javax.swing.plaf.FontUIResource) {
|
||||||
|
UIManager.put(key, fontResource);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets given hostname and tries to load GOParamsters from given file if non
|
* Sets given hostname and tries to load GOParamsters from given file if non
|
||||||
* null.
|
* null.
|
||||||
@ -369,6 +382,8 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
useDefaultModule = EvAInfo.propDefaultModule();
|
useDefaultModule = EvAInfo.propDefaultModule();
|
||||||
this.parentWindow = parent;
|
this.parentWindow = parent;
|
||||||
|
|
||||||
|
setUIFont(new javax.swing.plaf.FontUIResource(Font.SANS_SERIF, 0, 11));
|
||||||
|
|
||||||
if (useDefaultModule != null) {
|
if (useDefaultModule != null) {
|
||||||
useDefaultModule = useDefaultModule.trim();
|
useDefaultModule = useDefaultModule.trim();
|
||||||
if (useDefaultModule.length() < 1) {
|
if (useDefaultModule.length() < 1) {
|
||||||
@ -381,7 +396,8 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
|
|
||||||
/* Set Look and Feel */
|
/* Set Look and Feel */
|
||||||
try {
|
try {
|
||||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
|
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
LOGGER.log(Level.INFO, "Could not set Look&Feel", ex);
|
LOGGER.log(Level.INFO, "Could not set Look&Feel", ex);
|
||||||
}
|
}
|
||||||
@ -465,12 +481,15 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
gbConstraints.gridheight = GridBagConstraints.RELATIVE;
|
gbConstraints.gridheight = GridBagConstraints.RELATIVE;
|
||||||
mainFrame.add(horizontalSplit, gbConstraints);
|
mainFrame.add(horizontalSplit, gbConstraints);
|
||||||
|
|
||||||
|
/* StatusBar of the main frame */
|
||||||
|
statusBar = new JPanel(new FlowLayout(FlowLayout.RIGHT));
|
||||||
|
statusBar.add(new JLabel("Progress"));
|
||||||
|
|
||||||
/* Create ProgressBar and add it to the bottom */
|
/* Create ProgressBar and add it to the status bar */
|
||||||
progressBar = new JProgressBar();
|
progressBar = new JProgressBar();
|
||||||
progressBar.setBorder(new TitledBorder("Progress"));
|
progressBar.setValue(0);
|
||||||
progressBar.setValue(0);
|
progressBar.setStringPainted(true);
|
||||||
progressBar.setStringPainted(true);
|
statusBar.add(progressBar);
|
||||||
|
|
||||||
gbConstraints.gridx = 0;
|
gbConstraints.gridx = 0;
|
||||||
gbConstraints.gridy = 2;
|
gbConstraints.gridy = 2;
|
||||||
@ -478,7 +497,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
gbConstraints.weighty = 0.0;
|
gbConstraints.weighty = 0.0;
|
||||||
gbConstraints.fill = GridBagConstraints.HORIZONTAL;
|
gbConstraints.fill = GridBagConstraints.HORIZONTAL;
|
||||||
gbConstraints.anchor = GridBagConstraints.PAGE_END;
|
gbConstraints.anchor = GridBagConstraints.PAGE_END;
|
||||||
mainFrame.add(progressBar, gbConstraints);
|
mainFrame.add(statusBar, gbConstraints);
|
||||||
|
|
||||||
mainFrame.pack();
|
mainFrame.pack();
|
||||||
mainFrame.setVisible(true);
|
mainFrame.setVisible(true);
|
||||||
@ -498,6 +517,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
buildMenu();
|
buildMenu();
|
||||||
mainFrame.addWindowListener(new WindowAdapter() {
|
mainFrame.addWindowListener(new WindowAdapter() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void windowClosing(final WindowEvent event) {
|
public void windowClosing(final WindowEvent event) {
|
||||||
EvAClient.this.close();
|
EvAClient.this.close();
|
||||||
}
|
}
|
||||||
@ -517,10 +537,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
LOGGER.log(Level.INFO, "Class path is: {0}", System.getProperty("java.class.path", "."));
|
LOGGER.log(Level.INFO, "Class path is: {0}", System.getProperty("java.class.path", "."));
|
||||||
|
|
||||||
if (!(configurationPane.isVisible())) {
|
if (!(configurationPane.isVisible())) {
|
||||||
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
|
||||||
//evaFrame.setLocation((int) ((screenSize.width - evaFrame.getWidth()) / 2), (int) ((screenSize.height - evaFrame.getHeight()) / 2.5));
|
|
||||||
configurationPane.setVisible(true);
|
configurationPane.setVisible(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(mainFrame.isVisible())) {
|
if (!(mainFrame.isVisible())) {
|
||||||
@ -575,22 +592,22 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
/*============================COPIED FROM SYSBIO==============================*/
|
/*============================COPIED FROM SYSBIO==============================*/
|
||||||
// Properties for Mac OS X support.
|
// Properties for Mac OS X support.
|
||||||
if ((System.getProperty("mrj.version") != null)
|
if ((System.getProperty("mrj.version") != null)
|
||||||
|| (System.getProperty("os.name").toLowerCase().indexOf("mac") != -1)) {
|
|| (System.getProperty("os.name").toLowerCase().indexOf("mac") != -1)) {
|
||||||
/*
|
/*
|
||||||
* Note: the xDock name property must be set before parsing
|
* Note: the xDock name property must be set before parsing
|
||||||
* command-line arguments! See above!
|
* command-line arguments! See above!
|
||||||
*/
|
*/
|
||||||
System.setProperty("com.apple.mrj.application.apple.menu.about.name", EvAInfo.productName);
|
System.setProperty("com.apple.mrj.application.apple.menu.about.name", EvAInfo.productName);
|
||||||
|
|
||||||
System.setProperty("apple.awt.graphics.EnableQ2DX", "true");
|
System.setProperty("apple.awt.graphics.EnableQ2DX", "true");
|
||||||
System.setProperty("apple.laf.useScreenMenuBar", "true");
|
System.setProperty("apple.laf.useScreenMenuBar", "true");
|
||||||
System.setProperty("com.apple.macos.smallTabs", "true");
|
System.setProperty("com.apple.macos.smallTabs", "true");
|
||||||
System.setProperty("com.apple.macos.useScreenMenuBar", "true");
|
System.setProperty("com.apple.macos.useScreenMenuBar", "true");
|
||||||
|
|
||||||
System.setProperty("com.apple.mrj.application.growbox.intrudes", "false");
|
System.setProperty("com.apple.mrj.application.growbox.intrudes", "false");
|
||||||
System.setProperty("com.apple.mrj.application.live-resize", "true");
|
System.setProperty("com.apple.mrj.application.live-resize", "true");
|
||||||
}
|
}
|
||||||
/*==========================================================================*/
|
/*==========================================================================*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
*/
|
*/
|
||||||
package eva2.gui;
|
package eva2.gui;
|
||||||
|
|
||||||
import com.sun.javaws.ui.JavawsSysRun;
|
|
||||||
import eva2.EvAInfo;
|
import eva2.EvAInfo;
|
||||||
import eva2.tools.BasicResourceLoader;
|
import eva2.tools.BasicResourceLoader;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
@ -4,29 +4,16 @@ package eva2.gui;
|
|||||||
* Architecture @author Holger Ulmer, Felix Streichert, Hannes Planatscher @version: $Revision: 272
|
* Architecture @author Holger Ulmer, Felix Streichert, Hannes Planatscher @version: $Revision: 272
|
||||||
* $ $Date: 2007-11-21 18:06:36 +0100 (Wed, 21 Nov 2007) $ $Author: mkron $
|
* $ $Date: 2007-11-21 18:06:36 +0100 (Wed, 21 Nov 2007) $ $Author: mkron $
|
||||||
*/
|
*/
|
||||||
/*
|
|
||||||
* ==========================================================================* IMPORTS
|
|
||||||
*==========================================================================
|
|
||||||
*/
|
|
||||||
|
|
||||||
import java.awt.GridBagConstraints;
|
|
||||||
import java.awt.GridBagLayout;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.swing.JComponent;
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import javax.swing.JTabbedPane;
|
|
||||||
|
|
||||||
import eva2.server.go.InterfaceNotifyOnInformers;
|
import eva2.server.go.InterfaceNotifyOnInformers;
|
||||||
import eva2.server.go.problems.InterfaceAdditionalPopulationInformer;
|
import eva2.server.go.problems.InterfaceAdditionalPopulationInformer;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
import java.util.logging.Level;
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.plaf.TabbedPaneUI;
|
|
||||||
import javax.swing.plaf.basic.BasicButtonUI;
|
import javax.swing.plaf.basic.BasicButtonUI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,7 +49,7 @@ public class EvATabbedFrameMaker implements Serializable, PanelMaker, InterfaceN
|
|||||||
|
|
||||||
tabbedPane = new JTabbedPane();
|
tabbedPane = new JTabbedPane();
|
||||||
tabbedPane.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY, 1));
|
tabbedPane.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY, 1));
|
||||||
tabbedPane.setUI(new eva2.gui.utils.CustomTabbedPaneUI());
|
//tabbedPane.setUI(new eva2.gui.utils.CustomTabbedPaneUI());
|
||||||
tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
|
tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ import java.lang.reflect.Method;
|
|||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
import java.lang.reflect.Proxy;
|
import java.lang.reflect.Proxy;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
@ -61,11 +62,12 @@ public class GOEPanel extends JPanel implements ItemListener {
|
|||||||
/**
|
/**
|
||||||
* Creates the GUI editor component
|
* Creates the GUI editor component
|
||||||
*/
|
*/
|
||||||
// private Vector<String> m_ClassesLongName;
|
|
||||||
private GenericObjectEditor genericObjectEditor = null;
|
private GenericObjectEditor genericObjectEditor = null;
|
||||||
private boolean withComboBoxToolTips = true; // should tool tips for the combo box be created?
|
private boolean withComboBoxToolTips = true; // should tool tips for the combo box be created?
|
||||||
private int tipMaxLen = 100; // maximum length of tool tip
|
private int tipMaxLen = 100; // maximum length of tool tip
|
||||||
|
|
||||||
|
private HashMap<String, String> classNameMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -312,15 +314,19 @@ public class GOEPanel extends JPanel implements ItemListener {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected void updateClassType() {
|
protected void updateClassType() {
|
||||||
Vector<String> classesLongNames;
|
List<String> classesLongNames;
|
||||||
ArrayList<Class<?>> instances = new ArrayList<Class<?>>(5);
|
ArrayList<Class<?>> instances = new ArrayList<Class<?>>(5);
|
||||||
if (Proxy.isProxyClass(genericObjectEditor.getClassType())) {
|
if (Proxy.isProxyClass(genericObjectEditor.getClassType())) {
|
||||||
classesLongNames = new Vector<String>(GenericObjectEditor.getClassesFromProperties(((RMIProxyLocal) Proxy.getInvocationHandler(((Proxy) genericObjectEditor.getValue()))).getOriginalClass().getName(), null));
|
classesLongNames = GenericObjectEditor.getClassesFromProperties(((RMIProxyLocal) Proxy.getInvocationHandler(((Proxy) genericObjectEditor.getValue()))).getOriginalClass().getName(), null);
|
||||||
} else {
|
} else {
|
||||||
classesLongNames = new Vector<String>(GenericObjectEditor.getClassesFromProperties(genericObjectEditor.getClassType().getName(), instances));
|
classesLongNames = GenericObjectEditor.getClassesFromProperties(genericObjectEditor.getClassType().getName(), instances);
|
||||||
}
|
}
|
||||||
if (classesLongNames.size() > 1) {
|
if (classesLongNames.size() > 1) {
|
||||||
objectChooser.setModel(new DefaultComboBoxModel(classesLongNames));
|
classNameMap = new HashMap<String, String>();
|
||||||
|
for (String className : classesLongNames) {
|
||||||
|
classNameMap.put(EVAHELP.cutClassName(className), className);
|
||||||
|
}
|
||||||
|
objectChooser.setModel(new DefaultComboBoxModel(classNameMap.keySet().toArray()));
|
||||||
if (withComboBoxToolTips) {
|
if (withComboBoxToolTips) {
|
||||||
objectChooser.setRenderer(new ToolTipComboBoxRenderer(collectComboToolTips(instances, tipMaxLen)));
|
objectChooser.setRenderer(new ToolTipComboBoxRenderer(collectComboToolTips(instances, tipMaxLen)));
|
||||||
}
|
}
|
||||||
@ -364,9 +370,6 @@ public class GOEPanel extends JPanel implements ItemListener {
|
|||||||
*/ (genericObjectEditor.getValue().getClass().getName());
|
*/ (genericObjectEditor.getValue().getClass().getName());
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
for (int i = 0; i < comboBoxModel.getSize(); i++) {
|
for (int i = 0; i < comboBoxModel.getSize(); i++) {
|
||||||
if (TRACE) {
|
|
||||||
System.out.println("in updateChooser: looking at " + (String) comboBoxModel.getElementAt(i));
|
|
||||||
}
|
|
||||||
if (objectName.equals((String) comboBoxModel.getElementAt(i))) {
|
if (objectName.equals((String) comboBoxModel.getElementAt(i))) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
@ -396,11 +399,13 @@ public class GOEPanel extends JPanel implements ItemListener {
|
|||||||
*
|
*
|
||||||
* @param e a value of type 'ItemEvent'
|
* @param e a value of type 'ItemEvent'
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void itemStateChanged(ItemEvent e) {
|
public void itemStateChanged(ItemEvent e) {
|
||||||
String className;
|
String className;
|
||||||
|
|
||||||
if ((e.getSource() == objectChooser) && (e.getStateChange() == ItemEvent.SELECTED)) {
|
if ((e.getSource() == objectChooser) && (e.getStateChange() == ItemEvent.SELECTED)) {
|
||||||
className = (String) objectChooser.getSelectedItem();
|
className = (String) objectChooser.getSelectedItem();
|
||||||
|
className = classNameMap.get(className);
|
||||||
try {
|
try {
|
||||||
Object n = (Object) Class.forName(className).newInstance();
|
Object n = (Object) Class.forName(className).newInstance();
|
||||||
genericObjectEditor.setValue(n);
|
genericObjectEditor.setValue(n);
|
||||||
|
@ -12,6 +12,7 @@ package eva2.gui;
|
|||||||
/*==========================================================================*
|
/*==========================================================================*
|
||||||
* IMPORTS
|
* IMPORTS
|
||||||
*==========================================================================*/
|
*==========================================================================*/
|
||||||
|
import java.awt.Font;
|
||||||
import javax.swing.JMenu;
|
import javax.swing.JMenu;
|
||||||
import javax.swing.JMenuItem;
|
import javax.swing.JMenuItem;
|
||||||
import javax.swing.KeyStroke;
|
import javax.swing.KeyStroke;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user