Some cosmetics. Changed the GUI JPanel to a JToolBar and added Icons to the Buttons.
This commit is contained in:
parent
f1ede54afd
commit
0e2db96402
BIN
resources/images/History24.gif
Normal file
BIN
resources/images/History24.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
resources/images/Server24.gif
Normal file
BIN
resources/images/Server24.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 775 B |
@ -11,62 +11,8 @@ package eva2.client;
|
|||||||
* @version: $Revision: 322 $ $Date: 2007-12-11 17:24:07 +0100 (Tue, 11 Dec 2007)$
|
* @version: $Revision: 322 $ $Date: 2007-12-11 17:24:07 +0100 (Tue, 11 Dec 2007)$
|
||||||
* $Author: mkron $
|
* $Author: mkron $
|
||||||
*/
|
*/
|
||||||
import java.awt.BorderLayout;
|
|
||||||
import java.awt.Dimension;
|
|
||||||
import java.awt.Event;
|
|
||||||
import java.awt.Frame;
|
|
||||||
import java.awt.Graphics;
|
|
||||||
import java.awt.HeadlessException;
|
|
||||||
import java.awt.Toolkit;
|
|
||||||
import java.awt.Window;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.awt.event.KeyEvent;
|
|
||||||
import java.awt.event.WindowAdapter;
|
|
||||||
import java.awt.event.WindowEvent;
|
|
||||||
import java.awt.event.WindowListener;
|
|
||||||
import java.awt.image.BufferedImage;
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.text.MessageFormat;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.Vector;
|
|
||||||
import java.util.logging.*;
|
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
|
||||||
import javax.swing.ImageIcon;
|
|
||||||
import javax.swing.JComponent;
|
|
||||||
import javax.swing.JFrame;
|
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JMenuBar;
|
|
||||||
import javax.swing.JMenuItem;
|
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import javax.swing.JProgressBar;
|
|
||||||
import javax.swing.JScrollPane;
|
|
||||||
import javax.swing.JSeparator;
|
|
||||||
import javax.swing.JTree;
|
|
||||||
import javax.swing.JWindow;
|
|
||||||
import javax.swing.KeyStroke;
|
|
||||||
import javax.swing.SwingUtilities;
|
|
||||||
import javax.swing.event.MenuEvent;
|
|
||||||
import javax.swing.event.MenuListener;
|
|
||||||
|
|
||||||
import eva2.EvAInfo;
|
import eva2.EvAInfo;
|
||||||
import eva2.gui.EvATabbedFrameMaker;
|
import eva2.gui.*;
|
||||||
import eva2.gui.EvATreeNode;
|
|
||||||
import eva2.gui.EvATreeSelectionListener;
|
|
||||||
import eva2.gui.ExtAction;
|
|
||||||
import eva2.gui.HtmlDemo;
|
|
||||||
import eva2.gui.JEFrame;
|
|
||||||
import eva2.gui.JEFrameRegister;
|
|
||||||
import eva2.gui.JExtMenu;
|
|
||||||
import eva2.gui.JParaPanel;
|
|
||||||
import eva2.gui.LogPanel;
|
|
||||||
import eva2.server.EvAServer;
|
import eva2.server.EvAServer;
|
||||||
import eva2.server.go.InterfaceGOParameters;
|
import eva2.server.go.InterfaceGOParameters;
|
||||||
import eva2.server.modules.AbstractModuleAdapter;
|
import eva2.server.modules.AbstractModuleAdapter;
|
||||||
@ -76,12 +22,22 @@ import eva2.server.modules.ModuleAdapter;
|
|||||||
import eva2.server.stat.AbstractStatistics;
|
import eva2.server.stat.AbstractStatistics;
|
||||||
import eva2.server.stat.InterfaceStatisticsListener;
|
import eva2.server.stat.InterfaceStatisticsListener;
|
||||||
import eva2.server.stat.InterfaceStatisticsParameter;
|
import eva2.server.stat.InterfaceStatisticsParameter;
|
||||||
import eva2.tools.BasicResourceLoader;
|
import eva2.tools.*;
|
||||||
import eva2.tools.EVAERROR;
|
|
||||||
import eva2.tools.ReflectPackage;
|
|
||||||
import eva2.tools.Serializer;
|
|
||||||
import eva2.tools.StringTools;
|
|
||||||
import eva2.tools.jproxy.RemoteStateListener;
|
import eva2.tools.jproxy.RemoteStateListener;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.text.MessageFormat;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.Vector;
|
||||||
|
import java.util.logging.Handler;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.LogRecord;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import javax.swing.*;
|
||||||
|
import javax.swing.event.MenuEvent;
|
||||||
|
import javax.swing.event.MenuListener;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -326,7 +282,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
splashScreen.dispose();
|
splashScreen.dispose();
|
||||||
}
|
}
|
||||||
clientInited = true;
|
clientInited = true;
|
||||||
notify();
|
notifyAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -13,6 +13,7 @@ package eva2.gui;
|
|||||||
/*==========================================================================*
|
/*==========================================================================*
|
||||||
* IMPORTS
|
* IMPORTS
|
||||||
*==========================================================================*/
|
*==========================================================================*/
|
||||||
|
import eva2.EvAInfo;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -25,163 +26,146 @@ import javax.swing.JPanel;
|
|||||||
|
|
||||||
import eva2.server.modules.ModuleAdapter;
|
import eva2.server.modules.ModuleAdapter;
|
||||||
import eva2.server.stat.EvAJob;
|
import eva2.server.stat.EvAJob;
|
||||||
|
import eva2.tools.BasicResourceLoader;
|
||||||
import eva2.tools.jproxy.RMIProxyLocal;
|
import eva2.tools.jproxy.RMIProxyLocal;
|
||||||
import eva2.tools.jproxy.RemoteStateListener;
|
import eva2.tools.jproxy.RemoteStateListener;
|
||||||
|
import java.awt.Toolkit;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import javax.swing.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains the GUI elements of start and stop buttons and optionally a help button.
|
* Contains the GUI elements of start and stop buttons and optionally a help button.
|
||||||
*/
|
*/
|
||||||
public class EvAModuleButtonPanelMaker implements RemoteStateListener, Serializable, PanelMaker {
|
public class EvAModuleButtonPanelMaker implements RemoteStateListener, Serializable, PanelMaker {
|
||||||
public static boolean TRACE = false;
|
private static final Logger logger = Logger.getLogger(EvAInfo.defaultLogger);
|
||||||
private String m_Name ="undefined";
|
private String m_Name = "undefined";
|
||||||
private ModuleAdapter m_Adapter;
|
private ModuleAdapter moduleAdapter;
|
||||||
private boolean m_StateRunning;
|
private boolean runningState;
|
||||||
private JButton m_RunButton;
|
private JButton runButton;
|
||||||
private JButton m_PPButton;
|
private JButton postProcessButton;
|
||||||
private JButton m_StopButton;
|
private JButton stopButton;
|
||||||
private JButton m_ScheduleButton;
|
private JButton scheduleButton;
|
||||||
// private JButton m_actExitMod;
|
// private JButton m_actExitMod;
|
||||||
private JButton m_JHelpButton;
|
private JButton helpButton;
|
||||||
// private JButton m_ShowSolButton;
|
// private JButton m_ShowSolButton;
|
||||||
private JPanel m_Panel;
|
private JToolBar toolBar;
|
||||||
private String m_HelperFileName;
|
private String helpFileName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public EvAModuleButtonPanelMaker(ModuleAdapter adapter, boolean state) {
|
public EvAModuleButtonPanelMaker(ModuleAdapter adapter, boolean state) {
|
||||||
m_Name = "GENERAL";
|
m_Name = "GENERAL";
|
||||||
m_StateRunning = state;
|
runningState = state;
|
||||||
if (TRACE) System.out.println("Constructor EvAModuleButtonPanelMaker:");
|
moduleAdapter = adapter;
|
||||||
m_Adapter = adapter;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public JComponent makePanel() {
|
public JToolBar makePanel() {
|
||||||
String myhostname = null;
|
String myhostname = null;
|
||||||
|
|
||||||
m_Panel= new JPanel();
|
toolBar = new JToolBar();
|
||||||
if(TRACE) System.out.println("JModuleGeneral.installAction()");
|
toolBar.setFloatable(false);
|
||||||
if (m_Adapter.hasConnection()) { // we might be in rmi mode
|
|
||||||
|
if (moduleAdapter.hasConnection()) { // we might be in rmi mode
|
||||||
try {
|
try {
|
||||||
myhostname = InetAddress.getLocalHost().getHostName();
|
myhostname = InetAddress.getLocalHost().getHostName();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.err.println("ERROR getting myhostname "+e.getMessage());
|
logger.log(Level.WARNING, "Could not get hostname", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!m_Adapter.hasConnection()) {
|
if (!moduleAdapter.hasConnection()) {
|
||||||
m_Adapter.addRemoteStateListener((RemoteStateListener)(this));
|
moduleAdapter.addRemoteStateListener((RemoteStateListener)(this));
|
||||||
} else {// there is a network RMI connection
|
} else {// there is a network RMI connection
|
||||||
m_Adapter.addRemoteStateListener((RemoteStateListener)RMIProxyLocal.newInstance(this));
|
moduleAdapter.addRemoteStateListener((RemoteStateListener)RMIProxyLocal.newInstance(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
m_RunButton= new JButton("Start");
|
runButton = makeIconButton("resources/images/Play24.gif", "Start");
|
||||||
m_RunButton.setToolTipText("Start the current optimization run.");
|
runButton.setToolTipText("Start the current optimization run.");
|
||||||
//System.out.println("Start tm_RunButton.addActionListener Run Opt pressed ====================!!!!!!!!!!!!!!!!!!");
|
runButton.addActionListener(new ActionListener() {
|
||||||
m_RunButton.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent e){
|
public void actionPerformed(ActionEvent event) {
|
||||||
//Run Opt pressed !
|
//Run Opt pressed !
|
||||||
onUserStart();
|
onUserStart();
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
m_RunButton.setEnabled(!m_StateRunning); // enabled if not running
|
runButton.setEnabled(!runningState); // enabled if not running
|
||||||
|
|
||||||
m_Panel.add(m_RunButton);
|
|
||||||
// m_Panel.setBorder(BorderFactory.createTitledBorder("general action buttons"));
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////
|
toolBar.add(runButton);
|
||||||
m_StopButton= new JButton("Stop");
|
|
||||||
m_StopButton.setToolTipText("Stop the current optimization run.");
|
stopButton = makeIconButton("resources/images/Stop24.gif", "Stop");
|
||||||
m_StopButton.addActionListener(new ActionListener() {
|
stopButton.setToolTipText("Stop the current optimization run.");
|
||||||
public void actionPerformed(ActionEvent e){
|
stopButton.addActionListener(new ActionListener() {
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent event) {
|
||||||
try {
|
try {
|
||||||
m_Adapter.stopOpt(); // this means user break
|
// this means user break
|
||||||
} catch (Exception ee) { System.err.print ("Error in stop: " + ee.getMessage() ); }
|
moduleAdapter.stopOpt();
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
// if (m_State == false )
|
|
||||||
// m_RestartButton.setEnabled(false);
|
|
||||||
// else
|
|
||||||
// m_RestartButton.setEnabled(true);
|
|
||||||
m_StopButton.setEnabled(m_StateRunning);
|
|
||||||
m_Panel.add(m_StopButton);
|
|
||||||
// //////////////////////////////////////////////////////////////
|
|
||||||
m_PPButton= new JButton("Post Process");
|
|
||||||
m_PPButton.setToolTipText("Start post processing according to available parameters.");
|
|
||||||
m_PPButton.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent e){
|
|
||||||
try {
|
|
||||||
if (!m_Adapter.startPostProcessing()) JOptionPane.showMessageDialog(null, "Post processing seems deactivated! Check the settings.", "Warning", JOptionPane.WARNING_MESSAGE);
|
|
||||||
// m_actStop.setEnabled(true);
|
|
||||||
// m_RunButton.setEnabled(false);
|
|
||||||
} catch (Exception ee) {
|
} catch (Exception ee) {
|
||||||
ee.printStackTrace();
|
logger.log(Level.WARNING, "Error while stopping job.", ee);
|
||||||
System.err.println("Error in run: " +ee +" : " + ee.getMessage() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
|
||||||
m_PPButton.setEnabled(m_StateRunning && m_Adapter.hasPostProcessing());
|
stopButton.setEnabled(runningState);
|
||||||
m_Panel.add(m_PPButton);
|
toolBar.add(stopButton);
|
||||||
|
|
||||||
|
postProcessButton = makeIconButton("resources/images/History24.gif", "Post Process");
|
||||||
|
postProcessButton.setToolTipText("Start post processing according to available parameters.");
|
||||||
|
postProcessButton.addActionListener(new ActionListener() {
|
||||||
|
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
try {
|
||||||
|
if (!moduleAdapter.startPostProcessing()) {
|
||||||
|
JOptionPane.showMessageDialog(null, "Post processing seems deactivated! Check the settings.", "Warning", JOptionPane.WARNING_MESSAGE);
|
||||||
|
}
|
||||||
|
} catch (Exception ee) {
|
||||||
|
logger.log(Level.WARNING, "Error in run", ee);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
postProcessButton.setEnabled(runningState && moduleAdapter.hasPostProcessing());
|
||||||
|
toolBar.add(postProcessButton);
|
||||||
// //////////////////////////////////////////////////////////////
|
// //////////////////////////////////////////////////////////////
|
||||||
m_ScheduleButton= new JButton("Schedule");
|
scheduleButton= makeIconButton("resources/images/Server24.gif", "Schedule");
|
||||||
m_ScheduleButton.setToolTipText("Schedule the currently configured optimization as a job.");
|
scheduleButton.setToolTipText("Schedule the currently configured optimization as a job.");
|
||||||
m_ScheduleButton.addActionListener(new ActionListener() {
|
scheduleButton.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e){
|
|
||||||
EvAJob job = m_Adapter.scheduleJob();
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (job==null) {
|
EvAJob job = moduleAdapter.scheduleJob();
|
||||||
System.err.println("Something went wrong on scheduling!");
|
if (job == null) {
|
||||||
|
logger.log(Level.WARNING, "There was an error on scheduling your job");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
scheduleButton.setEnabled(true);
|
||||||
m_ScheduleButton.setEnabled(true);
|
toolBar.add(scheduleButton);
|
||||||
m_Panel.add(m_ScheduleButton);
|
|
||||||
|
|
||||||
makeHelpButton();
|
makeHelpButton();
|
||||||
|
|
||||||
// if (m_Adapter instanceof AbstractModuleAdapter && (m_Adapter != null)) {
|
return toolBar;
|
||||||
// /** This action listener, called by the "show" button will show the
|
}
|
||||||
// * currently best solution in a frame.
|
|
||||||
// */
|
private JButton makeIconButton(final String iconSrc, final String title) {
|
||||||
// m_ShowSolButton = new JButton("Show Solution");
|
JButton newButton;
|
||||||
// m_ShowSolButton.addActionListener(new ActionListener() {
|
byte[] bytes;
|
||||||
// public void actionPerformed(ActionEvent event) {
|
bytes = BasicResourceLoader.instance().getBytesFromResourceLocation(iconSrc, false);
|
||||||
// InterfaceGOParameters goParams = ((AbstractModuleAdapter)m_Adapter).getGOParameters();
|
if (bytes == null) {
|
||||||
// InterfaceOptimizationProblem goProblem = goParams.getProblem();
|
newButton = new JButton(title);
|
||||||
// InterfaceOptimizer opt = goParams.getOptimizer();
|
} else {
|
||||||
// AbstractEAIndividual indy = opt.getPopulation().getBestEAIndividual();
|
newButton = new JButton(title, new ImageIcon(Toolkit.getDefaultToolkit().createImage(bytes)));
|
||||||
// if (indy != null) {
|
}
|
||||||
// JFrame frame = new JFrame();
|
return newButton;
|
||||||
// frame.setTitle("The current best solution for "+goProblem.getName());
|
|
||||||
// frame.setSize(400, 300);
|
|
||||||
// frame.setLocation(450, 250);
|
|
||||||
// Population pop = opt.getPopulation();
|
|
||||||
// frame.getContentPane().add(goProblem.drawIndividual(pop.getGeneration(), pop.getFunctionCalls(), indy));
|
|
||||||
// frame.validate();
|
|
||||||
// frame.setVisible(true);
|
|
||||||
// } else System.out.println("No current solution available.");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
// m_ShowSolButton.setEnabled(false);
|
|
||||||
// m_Panel.add(m_ShowSolButton);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// m_actExitMod = new JButton("Exit Module");
|
|
||||||
// m_actExitMod.setToolTipText("todo !!.");// TODO
|
|
||||||
return m_Panel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUserStart() {
|
public void onUserStart() {
|
||||||
try {
|
try {
|
||||||
m_Adapter.startOpt();
|
moduleAdapter.startOpt();
|
||||||
m_StopButton.setEnabled(true);
|
stopButton.setEnabled(true);
|
||||||
m_RunButton.setEnabled(false);
|
runButton.setEnabled(false);
|
||||||
m_PPButton.setEnabled(false);
|
postProcessButton.setEnabled(false);
|
||||||
// m_RestartButton.setEnabled(false);
|
// m_RestartButton.setEnabled(false);
|
||||||
// m_JHelpButton.setEnabled(true);
|
// m_JHelpButton.setEnabled(true);
|
||||||
} catch (Exception ee) {
|
} catch (Exception ee) {
|
||||||
@ -192,18 +176,18 @@ public class EvAModuleButtonPanelMaker implements RemoteStateListener, Serializa
|
|||||||
|
|
||||||
private void makeHelpButton() {
|
private void makeHelpButton() {
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
if (m_HelperFileName!=null && (!m_HelperFileName.equals(""))) {
|
if (helpFileName!=null && (!helpFileName.equals(""))) {
|
||||||
m_JHelpButton= new JButton("Description");
|
helpButton= new JButton("Description");
|
||||||
m_JHelpButton.setToolTipText("Description of the current optimization algorithm.");
|
helpButton.setToolTipText("Description of the current optimization algorithm.");
|
||||||
m_JHelpButton.addActionListener(new ActionListener() {
|
helpButton.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e){
|
public void actionPerformed(ActionEvent e){
|
||||||
//System.out.println("Run Opt pressed !!!!!!!!!!!!!!!!======================!!");
|
//System.out.println("Run Opt pressed !!!!!!!!!!!!!!!!======================!!");
|
||||||
try {
|
try {
|
||||||
if (m_HelperFileName!=null) {
|
if (helpFileName!=null) {
|
||||||
HtmlDemo temp = new HtmlDemo(m_HelperFileName);
|
HtmlDemo temp = new HtmlDemo(helpFileName);
|
||||||
temp.show();
|
temp.show();
|
||||||
}
|
}
|
||||||
m_JHelpButton.setEnabled(true);
|
helpButton.setEnabled(true);
|
||||||
} catch (Exception ee) {
|
} catch (Exception ee) {
|
||||||
ee.printStackTrace();
|
ee.printStackTrace();
|
||||||
System.out.print ("Error in run: " +ee +" : " + ee.getMessage() );
|
System.out.print ("Error in run: " +ee +" : " + ee.getMessage() );
|
||||||
@ -211,7 +195,7 @@ public class EvAModuleButtonPanelMaker implements RemoteStateListener, Serializa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
m_Panel.add(m_JHelpButton);
|
toolBar.add(helpButton);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,12 +203,11 @@ public class EvAModuleButtonPanelMaker implements RemoteStateListener, Serializa
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void performedStop() {
|
public void performedStop() {
|
||||||
if (TRACE) System.out.println("EvAModuleButtonPanelMaker.stopOptPerformed");
|
runButton.setEnabled(true);
|
||||||
m_RunButton.setEnabled(true);
|
postProcessButton.setEnabled(true);
|
||||||
m_PPButton.setEnabled(true);
|
runButton.repaint();
|
||||||
m_RunButton.repaint();
|
stopButton.setEnabled(false);
|
||||||
m_StopButton.setEnabled(false);
|
toolBar.repaint();
|
||||||
m_Panel.repaint();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void performedStart(String infoString) {
|
public void performedStart(String infoString) {
|
||||||
@ -247,22 +230,25 @@ public class EvAModuleButtonPanelMaker implements RemoteStateListener, Serializa
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setHelperFilename (String s) {
|
public void setHelperFilename(String fileName) {
|
||||||
if ((s==null) && (s==m_HelperFileName)) return; // both are null, do nothing
|
if ((fileName == null) && (fileName == helpFileName)) {
|
||||||
if (s!=null) {
|
return; // both are null, do nothing
|
||||||
if (m_HelperFileName != null) {
|
}
|
||||||
if (!m_HelperFileName.equals(s)) {
|
if (fileName != null) {
|
||||||
m_Panel.remove(m_JHelpButton);
|
if (helpFileName == null) {
|
||||||
m_HelperFileName = s;
|
// only old is null, nothing to be removed
|
||||||
makeHelpButton();
|
helpFileName = fileName;
|
||||||
} //else // both are equal, do nothing
|
|
||||||
} else { // only old is null, nothing to be removed
|
|
||||||
m_HelperFileName = s;
|
|
||||||
makeHelpButton();
|
makeHelpButton();
|
||||||
|
} else {
|
||||||
|
if (!helpFileName.equals(fileName)) {
|
||||||
|
toolBar.remove(helpButton);
|
||||||
|
helpFileName = fileName;
|
||||||
|
makeHelpButton();
|
||||||
|
} //else // both are equal, do nothing
|
||||||
}
|
}
|
||||||
} else { // s is null, so just remove
|
} else { // s is null, so just remove
|
||||||
m_Panel.remove(m_JHelpButton);
|
toolBar.remove(helpButton);
|
||||||
m_HelperFileName=s;
|
helpFileName = fileName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -405,8 +405,8 @@ public class GenericObjectEditor implements PropertyEditor {
|
|||||||
MethodDescriptor[] methods;
|
MethodDescriptor[] methods;
|
||||||
String rep = "";
|
String rep = "";
|
||||||
try {
|
try {
|
||||||
BeanInfo bi = Introspector.getBeanInfo(m_Object.getClass());
|
BeanInfo beanInfo = Introspector.getBeanInfo(m_Object.getClass());
|
||||||
methods = bi.getMethodDescriptors();
|
methods = beanInfo.getMethodDescriptors();
|
||||||
for (int i = 0; i < methods.length; i++) {
|
for (int i = 0; i < methods.length; i++) {
|
||||||
if (methods[i].getName().equalsIgnoreCase("getName")) getNameMethod = i;
|
if (methods[i].getName().equalsIgnoreCase("getName")) getNameMethod = i;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user