|
|
|
@@ -1,18 +1,12 @@
|
|
|
|
|
package eva2.client;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Title: EvA2
|
|
|
|
|
* Description: The main client class of the EvA framework.
|
|
|
|
|
* Copyright: Copyright (c) 2008
|
|
|
|
|
* Company: University of Tuebingen, Computer Architecture
|
|
|
|
|
* @author Holger Ulmer, Felix Streichert, Hannes Planatscher
|
|
|
|
|
* @version: $Revision: 322 $
|
|
|
|
|
* $Date: 2007-12-11 17:24:07 +0100 (Tue, 11 Dec 2007) $
|
|
|
|
|
* $Author: mkron $
|
|
|
|
|
* Title: EvA2 Description: The main client class of the EvA framework.
|
|
|
|
|
* Copyright: Copyright (c) 2008 Company: University of Tuebingen, Computer
|
|
|
|
|
* Architecture @author Holger Ulmer, Felix Streichert, Hannes Planatscher
|
|
|
|
|
* @version: $Revision: 322 $ $Date: 2007-12-11 17:24:07 +0100 (Tue, 11 Dec
|
|
|
|
|
* 2007) $ $Author: mkron $
|
|
|
|
|
*/
|
|
|
|
|
/*==========================================================================*
|
|
|
|
|
* IMPORTS
|
|
|
|
|
*==========================================================================*/
|
|
|
|
|
import java.awt.BorderLayout;
|
|
|
|
|
import java.awt.Dimension;
|
|
|
|
|
import java.awt.Event;
|
|
|
|
@@ -82,6 +76,7 @@ import eva2.tools.jproxy.RemoteStateListener;
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Generated serial version identifier.
|
|
|
|
|
*/
|
|
|
|
@@ -89,12 +84,8 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
private final int splashScreenTime = 1500;
|
|
|
|
|
private final int maxWindowMenuLength = 30;
|
|
|
|
|
private boolean clientInited = false;
|
|
|
|
|
|
|
|
|
|
public static boolean TRACE = false;
|
|
|
|
|
|
|
|
|
|
public JEFrame m_Frame;
|
|
|
|
|
Runnable initRnbl = null;
|
|
|
|
|
|
|
|
|
|
private Runnable initRnbl = null;
|
|
|
|
|
private EvAComAdapter m_ComAdapter;
|
|
|
|
|
private transient JMenuBar m_barMenu;
|
|
|
|
|
private transient JExtMenu m_mnuAbout;
|
|
|
|
@@ -103,15 +94,12 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
private transient JExtMenu m_mnuWindow;
|
|
|
|
|
private transient JExtMenu m_mnuOptions;
|
|
|
|
|
private transient JProgressBar m_ProgressBar;
|
|
|
|
|
|
|
|
|
|
// public ArrayList m_ModulGUIContainer = new ArrayList();
|
|
|
|
|
// LogPanel
|
|
|
|
|
private LogPanel m_LogPanel;
|
|
|
|
|
|
|
|
|
|
// Module:
|
|
|
|
|
private ExtAction m_actModuleLoad;
|
|
|
|
|
// GUI:
|
|
|
|
|
|
|
|
|
|
// Hosts:
|
|
|
|
|
private ExtAction m_actHost;
|
|
|
|
|
private ExtAction m_actAvailableHost;
|
|
|
|
@@ -121,11 +109,9 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
// About:
|
|
|
|
|
private ExtAction m_actAbout;
|
|
|
|
|
private ExtAction m_actLicense;
|
|
|
|
|
|
|
|
|
|
// private JPanel m_panelTool;
|
|
|
|
|
// private FrameCloseListener m_frameCloseListener;
|
|
|
|
|
// private JFileChooser m_FileChooser;
|
|
|
|
|
|
|
|
|
|
// if not null, the module is loaded automatically and no other can be selected
|
|
|
|
|
private String useDefaultModule = null;//"Genetic_Optimization";
|
|
|
|
|
private boolean showLoadModules = false;
|
|
|
|
@@ -137,27 +123,29 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
private long startTime = 0;
|
|
|
|
|
// remember the module in use
|
|
|
|
|
private transient String currentModule = null;
|
|
|
|
|
|
|
|
|
|
Vector<RemoteStateListener> superListenerList = null;
|
|
|
|
|
private boolean withGUI = true;
|
|
|
|
|
private boolean withTreeView = false;
|
|
|
|
|
private EvATabbedFrameMaker frmMkr = null;
|
|
|
|
|
private EvATabbedFrameMaker frameMaker = null;
|
|
|
|
|
|
|
|
|
|
public void addRemoteStateListener(RemoteStateListener l) {
|
|
|
|
|
if (superListenerList == null) superListenerList = new Vector<RemoteStateListener>();
|
|
|
|
|
if (superListenerList == null) {
|
|
|
|
|
superListenerList = new Vector<RemoteStateListener>();
|
|
|
|
|
}
|
|
|
|
|
superListenerList.add(l);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean removeRemoteStateListener(RemoteStateListener l) {
|
|
|
|
|
if (superListenerList != null) {
|
|
|
|
|
return superListenerList.remove(l);
|
|
|
|
|
} else return false;
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Constructor of GUI of EvA2.
|
|
|
|
|
* Works as client for the EvA2 server.
|
|
|
|
|
* Note that the EvAClient initialized multi-threaded for efficiency. Use {@link #awaitGuiInitialized()}
|
|
|
|
|
* Constructor of GUI of EvA2. Works as client for the EvA2 server. Note
|
|
|
|
|
* that the EvAClient initialized multi-threaded for efficiency. Use {@link #awaitGuiInitialized()}
|
|
|
|
|
* to await full initialization if necessary.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
@@ -166,9 +154,10 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A constructor. Splash screen is optional, Gui is activated, no parent window.
|
|
|
|
|
* Note that the EvAClient initialized multi-threaded for efficiency. Use {@link #awaitGuiInitialized()}
|
|
|
|
|
* to await full initialization if necessary.
|
|
|
|
|
* A constructor. Splash screen is optional, Gui is activated, no parent
|
|
|
|
|
* window. Note that the EvAClient initialized multi-threaded for
|
|
|
|
|
* efficiency. Use {@link #awaitGuiInitialized()} to await full
|
|
|
|
|
* initialization if necessary.
|
|
|
|
|
*
|
|
|
|
|
* @see #EvAClient(String, Window, String, boolean, boolean, boolean)
|
|
|
|
|
* @param hostName
|
|
|
|
@@ -181,9 +170,10 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A constructor with optional spash screen.
|
|
|
|
|
* Note that the EvAClient initialized multi-threaded for efficiency. Use {@link #awaitGuiInitialized()}
|
|
|
|
|
* A constructor with optional spash screen. Note that the EvAClient is
|
|
|
|
|
* initialized multi-threaded for efficiency. Use {@link #awaitGuiInitialized()}
|
|
|
|
|
* to await full initialization if necessary.
|
|
|
|
|
*
|
|
|
|
|
* @see #EvAClient(String, String, boolean, boolean)
|
|
|
|
|
*
|
|
|
|
|
* @param hostName
|
|
|
|
@@ -195,8 +185,8 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A constructor with optional splash screen.
|
|
|
|
|
* Note that the EvAClient initialized multi-threaded for efficiency. Use {@link #awaitGuiInitialized()}
|
|
|
|
|
* A constructor with optional splash screen. Note that the EvAClient
|
|
|
|
|
* initialized multi-threaded for efficiency. Use {@link #awaitGuiInitialized()}
|
|
|
|
|
* to await full initialization if necessary.
|
|
|
|
|
*
|
|
|
|
|
* @see #EvAClient(String, String, boolean, boolean)
|
|
|
|
@@ -211,8 +201,8 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A constructor with optional splash screen.
|
|
|
|
|
* Note that the EvAClient initialized multi-threaded for efficiency. Use {@link #awaitGuiInitialized()}
|
|
|
|
|
* A constructor with optional splash screen. Note that the EvAClient
|
|
|
|
|
* initialized multi-threaded for efficiency. Use {@link #awaitGuiInitialized()}
|
|
|
|
|
* to await full initialization if necessary.
|
|
|
|
|
*
|
|
|
|
|
* @see #EvAClient(String, String, boolean, boolean)
|
|
|
|
@@ -243,13 +233,13 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Main constructor of the EvA2 client GUI. Works as standalone verson locally or
|
|
|
|
|
* as client for the EvA2 server. GO parameters may be
|
|
|
|
|
* loaded from a file (paramsFile) or given directly as a java instance. Both may be null
|
|
|
|
|
* to start with standard parameters. If both are non null, the java instance has the
|
|
|
|
|
* higher priority.
|
|
|
|
|
* Note that the EvAClient initialized multi-threaded for efficiency. Use {@link #awaitGuiInitialized()}
|
|
|
|
|
* to await full initialization if necessary.
|
|
|
|
|
* Main constructor of the EvA2 client GUI. Works as standalone verson
|
|
|
|
|
* locally or as client for the EvA2 server. GO parameters may be loaded
|
|
|
|
|
* from a file (paramsFile) or given directly as a java instance. Both may
|
|
|
|
|
* be null to start with standard parameters. If both are non null, the java
|
|
|
|
|
* instance has the higher priority. Note that the EvAClient initialized
|
|
|
|
|
* multi-threaded for efficiency. Use {@link #awaitGuiInitialized()} to
|
|
|
|
|
* await full initialization if necessary.
|
|
|
|
|
*
|
|
|
|
|
* @param hostName
|
|
|
|
|
* @param parent
|
|
|
|
@@ -271,9 +261,9 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
if (!noSplash && withGUI) {
|
|
|
|
|
try {
|
|
|
|
|
fSplashScreen.splash();
|
|
|
|
|
} catch(HeadlessException e) {
|
|
|
|
|
} catch (HeadlessException e) {
|
|
|
|
|
System.err.println("Error: no xserver present - deactivating GUI.");
|
|
|
|
|
withGUI=false;
|
|
|
|
|
withGUI = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -281,29 +271,40 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
|
|
|
|
|
m_ComAdapter = EvAComAdapter.getInstance();
|
|
|
|
|
|
|
|
|
|
SwingUtilities.invokeLater( initRnbl = new Runnable() {
|
|
|
|
|
public void run(){
|
|
|
|
|
SwingUtilities.invokeLater(initRnbl = new Runnable() {
|
|
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
synchronized (this) {
|
|
|
|
|
long startTime = System.currentTimeMillis();
|
|
|
|
|
init(hostName, paramsFile, goParams, parent); // this takes a bit
|
|
|
|
|
|
|
|
|
|
long wait = System.currentTimeMillis() - startTime;
|
|
|
|
|
if (!autorun) {
|
|
|
|
|
if (!noSplash) try {
|
|
|
|
|
if (!noSplash) {
|
|
|
|
|
try {
|
|
|
|
|
// if splashScreenTime has not passed, sleep some more
|
|
|
|
|
if (wait < splashScreenTime) Thread.sleep(splashScreenTime - wait);
|
|
|
|
|
} catch (Exception e) {}
|
|
|
|
|
if (wait < splashScreenTime) {
|
|
|
|
|
Thread.sleep(splashScreenTime - wait);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (!withGUI && (currentModuleAdapter instanceof GenericModuleAdapter)) {
|
|
|
|
|
// do not save new parameters for an autorun without GUI - they werent changed manually anyways.
|
|
|
|
|
((GenericModuleAdapter) currentModuleAdapter).getStatistics().setSaveParams(false);
|
|
|
|
|
System.out.println("Autorun without GUI - not saving statistics parameters...");
|
|
|
|
|
}
|
|
|
|
|
if (withGUI) frmMkr.onUserStart();
|
|
|
|
|
else currentModuleAdapter.startOpt();
|
|
|
|
|
if (withGUI) {
|
|
|
|
|
frameMaker.onUserStart();
|
|
|
|
|
} else {
|
|
|
|
|
currentModuleAdapter.startOpt();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// close splash screen
|
|
|
|
|
if (!noSplash && withGUI) fSplashScreen.dispose();
|
|
|
|
|
if (!noSplash && withGUI) {
|
|
|
|
|
fSplashScreen.dispose();
|
|
|
|
|
}
|
|
|
|
|
clientInited = true;
|
|
|
|
|
notify();
|
|
|
|
|
}
|
|
|
|
@@ -312,17 +313,17 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Since the constructor runs multi-threaded for efficiency, this method
|
|
|
|
|
* may be called to await the full initialization of a client instance.
|
|
|
|
|
* As soon as it returns, the EvAClient GUI is fully initialized.
|
|
|
|
|
* Since the constructor runs multi-threaded for efficiency, this method may
|
|
|
|
|
* be called to await the full initialization of a client instance. As soon
|
|
|
|
|
* as it returns, the EvAClient GUI is fully initialized.
|
|
|
|
|
*/
|
|
|
|
|
public void awaitClientInitialized() {
|
|
|
|
|
if (initRnbl!=null) {
|
|
|
|
|
if (initRnbl != null) {
|
|
|
|
|
synchronized (initRnbl) {
|
|
|
|
|
if (!clientInited) {
|
|
|
|
|
try {
|
|
|
|
|
initRnbl.wait();
|
|
|
|
|
initRnbl=null;
|
|
|
|
|
initRnbl = null;
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
@@ -332,13 +333,13 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void preloadClasses() {
|
|
|
|
|
ClassPreloader cp = new ClassPreloader( "eva2.server.go.strategies.InterfaceOptimizer", "eva2.server.go.problems.InterfaceOptimizationProblem", "eva2.server.go.InterfaceTerminator");
|
|
|
|
|
ClassPreloader cp = new ClassPreloader("eva2.server.go.strategies.InterfaceOptimizer", "eva2.server.go.problems.InterfaceOptimizationProblem", "eva2.server.go.InterfaceTerminator");
|
|
|
|
|
new Thread(cp).start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Try to start the optimization with current parameters on the loaded module.
|
|
|
|
|
* Return true on success, otherwise false.
|
|
|
|
|
* Try to start the optimization with current parameters on the loaded
|
|
|
|
|
* module. Return true on success, otherwise false.
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
@@ -346,7 +347,9 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
if (currentModuleAdapter != null) {
|
|
|
|
|
currentModuleAdapter.startOpt();
|
|
|
|
|
return true;
|
|
|
|
|
} else return false;
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@@ -378,7 +381,8 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets given hostname and tries to load GOParamsters from given file if non null.
|
|
|
|
|
* Sets given hostname and tries to load GOParamsters from given file if non
|
|
|
|
|
* null.
|
|
|
|
|
*/
|
|
|
|
|
private void init(String hostName, String paramsFile, InterfaceGOParameters goParams, final Window parent) {
|
|
|
|
|
//EVA_EDITOR_PROPERTIES
|
|
|
|
@@ -386,10 +390,12 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
|
|
|
|
|
if (useDefaultModule != null) {
|
|
|
|
|
useDefaultModule = useDefaultModule.trim();
|
|
|
|
|
if (useDefaultModule.length() < 1) useDefaultModule = null;
|
|
|
|
|
if (useDefaultModule.length() < 1) {
|
|
|
|
|
useDefaultModule = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (withGUI ) {
|
|
|
|
|
if (withGUI) {
|
|
|
|
|
m_Frame = new JEFrame(EvAInfo.productName + " workbench");
|
|
|
|
|
m_Frame.setCloseAllOnClosed(true);
|
|
|
|
|
m_Frame.setName(this.getClass().getSimpleName()); // the name is set to recognize the client window
|
|
|
|
@@ -411,21 +417,26 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
m_ProgressBar = new JProgressBar();
|
|
|
|
|
m_Frame.getContentPane().add(m_ProgressBar, BorderLayout.SOUTH);
|
|
|
|
|
|
|
|
|
|
if (EvAInfo.propShowModules() != null) showLoadModules = true;
|
|
|
|
|
else showLoadModules = false; // may be set to true again if default module couldnt be loaded
|
|
|
|
|
|
|
|
|
|
if (EvAInfo.propShowModules() != null) {
|
|
|
|
|
showLoadModules = true;
|
|
|
|
|
} else {
|
|
|
|
|
showLoadModules = false; // may be set to true again if default module couldnt be loaded
|
|
|
|
|
}
|
|
|
|
|
createActions();
|
|
|
|
|
}
|
|
|
|
|
if (useDefaultModule != null) {
|
|
|
|
|
// if goParams are not defined and a params file is defined
|
|
|
|
|
// try to load parameters from file
|
|
|
|
|
if (goParams==null && (paramsFile!=null && (paramsFile.length()>0))) goParams = GOParameters.getInstance(paramsFile, false);
|
|
|
|
|
if (goParams == null && (paramsFile != null && (paramsFile.length() > 0))) {
|
|
|
|
|
goParams = GOParameters.getInstance(paramsFile, false);
|
|
|
|
|
}
|
|
|
|
|
loadModuleFromServer(useDefaultModule, goParams);//loadSpecificModule
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (withGUI) {
|
|
|
|
|
buildMenu();
|
|
|
|
|
m_Frame.addWindowListener(new WindowAdapter() {
|
|
|
|
|
|
|
|
|
|
public void windowClosing(WindowEvent e) {
|
|
|
|
|
System.out.println("Closing EvA2 Client. Bye!");
|
|
|
|
|
m_Frame.dispose();
|
|
|
|
@@ -433,14 +444,18 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
if (keys.contains("MATLAB")) {
|
|
|
|
|
System.out.println("Seems like Ive been started from Matlab: not killing JVM");
|
|
|
|
|
} else {
|
|
|
|
|
if (parent == null) System.exit(1);
|
|
|
|
|
if (parent == null) {
|
|
|
|
|
System.exit(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_ComAdapter != null) {
|
|
|
|
|
if (hostName != null) selectHost(hostName);
|
|
|
|
|
if (hostName != null) {
|
|
|
|
|
selectHost(hostName);
|
|
|
|
|
}
|
|
|
|
|
m_ComAdapter.setLogPanel(m_LogPanel);
|
|
|
|
|
logMessage("Selected Host: " + m_ComAdapter.getHostName());
|
|
|
|
|
}
|
|
|
|
@@ -449,11 +464,11 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
|
|
|
|
|
if (withGUI) {
|
|
|
|
|
m_LogPanel.logMessage("Working directory is: " + System.getProperty("user.dir"));
|
|
|
|
|
m_LogPanel.logMessage("Class path is: " + System.getProperty("java.class.path","."));
|
|
|
|
|
m_LogPanel.logMessage("Class path is: " + System.getProperty("java.class.path", "."));
|
|
|
|
|
|
|
|
|
|
if (!(m_Frame.isVisible())) {
|
|
|
|
|
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
|
|
|
|
m_Frame.setLocation((int)((screenSize.width-m_Frame.getWidth())/2), (int)((screenSize.height-m_Frame.getHeight())/2.5));
|
|
|
|
|
m_Frame.setLocation((int) ((screenSize.width - m_Frame.getWidth()) / 2), (int) ((screenSize.height - m_Frame.getHeight()) / 2.5));
|
|
|
|
|
m_Frame.pack();
|
|
|
|
|
m_Frame.setVisible(true);
|
|
|
|
|
}
|
|
|
|
@@ -462,65 +477,61 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Refresh the parameter panels (if settings have been changed outside
|
|
|
|
|
* of the GUI which should be updated in the GUI.
|
|
|
|
|
* Refresh the parameter panels (if settings have been changed outside of
|
|
|
|
|
* the GUI which should be updated in the GUI.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public void refreshMainPanels() {
|
|
|
|
|
frmMkr.refreshPanels();
|
|
|
|
|
frameMaker.refreshPanels();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The one and only main of the client program. Possible arguments:
|
|
|
|
|
* --autorun immediately starts the optimization (with parameters loaded from current
|
|
|
|
|
* directory if available.
|
|
|
|
|
* --hostname HOST: sets the hostname for the EvAClient to HOST
|
|
|
|
|
* --nosplash: skip the splash screen.
|
|
|
|
|
* --params PFILE: load the optimization parameter from the serialized file PFILE
|
|
|
|
|
* --autorun immediately starts the optimization (with parameters loaded
|
|
|
|
|
* from current directory if available. --hostname HOST: sets the hostname
|
|
|
|
|
* for the EvAClient to HOST --nosplash: skip the splash screen. --params
|
|
|
|
|
* PFILE: load the optimization parameter from the serialized file PFILE
|
|
|
|
|
*
|
|
|
|
|
* @param args command line parameters
|
|
|
|
|
*/
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
if (TRACE) {
|
|
|
|
|
System.out.println(EVAHELP.getSystemPropertyString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] keys= new String[]{"--help", "--autorun", "--nosplash", "--nogui", "--remotehost", "--params", "--treeView"};
|
|
|
|
|
String[] keys = new String[]{"--help", "--autorun", "--nosplash", "--nogui", "--remotehost", "--params", "--treeView"};
|
|
|
|
|
int[] arities = new int[]{0, 0, 0, 0, 1, 1, 0};
|
|
|
|
|
Object[] values = new Object[keys.length];
|
|
|
|
|
|
|
|
|
|
Integer[] unknownArgs = StringTools.parseArguments(args, keys, arities, values, true);
|
|
|
|
|
|
|
|
|
|
if (unknownArgs.length>0) {
|
|
|
|
|
if (unknownArgs.length > 0) {
|
|
|
|
|
System.err.println("Unrecognized command line options: ");
|
|
|
|
|
for (int i=0; i<unknownArgs.length; i++) System.err.println(" " + args[unknownArgs[i]]);
|
|
|
|
|
if (values[0]==null) System.err.println("Try --help as argument.");
|
|
|
|
|
for (int i = 0; i < unknownArgs.length; i++) {
|
|
|
|
|
System.err.println(" " + args[unknownArgs[i]]);
|
|
|
|
|
}
|
|
|
|
|
if (values[0] == null) {
|
|
|
|
|
System.err.println("Try --help as argument.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (values[0]!=null) {
|
|
|
|
|
if (values[0] != null) {
|
|
|
|
|
System.out.println(usage());
|
|
|
|
|
} else {
|
|
|
|
|
boolean autorun=(values[1]!=null);
|
|
|
|
|
boolean nosplash=(values[2]!=null);
|
|
|
|
|
boolean nogui=(values[3]!=null);
|
|
|
|
|
boolean treeView=(values[6]!=null);
|
|
|
|
|
String hostName=StringTools.checkSingleStringArg(keys[4], values[4], arities[4]-1);
|
|
|
|
|
String paramsFile=StringTools.checkSingleStringArg(keys[5], values[5], arities[5]-1);
|
|
|
|
|
boolean autorun = (values[1] != null);
|
|
|
|
|
boolean nosplash = (values[2] != null);
|
|
|
|
|
boolean nogui = (values[3] != null);
|
|
|
|
|
boolean treeView = (values[6] != null);
|
|
|
|
|
String hostName = StringTools.checkSingleStringArg(keys[4], values[4], arities[4] - 1);
|
|
|
|
|
String paramsFile = StringTools.checkSingleStringArg(keys[5], values[5], arities[5] - 1);
|
|
|
|
|
|
|
|
|
|
if (TRACE) System.out.println("Command line arguments were: ");
|
|
|
|
|
if (TRACE) System.out.println(" " + BeanInspector.toString(keys));
|
|
|
|
|
if (TRACE) System.out.println(" " + BeanInspector.toString(values));
|
|
|
|
|
new EvAClient(hostName, paramsFile, autorun, nosplash, nogui, treeView);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Initialize the client GUI with given parameters and set
|
|
|
|
|
* listeners. This will return as soon as the GUI is visible and ready.
|
|
|
|
|
* Initialize the client GUI with given parameters and set listeners. This
|
|
|
|
|
* will return as soon as the GUI is visible and ready.
|
|
|
|
|
*
|
|
|
|
|
* @param goParams optimization parameters
|
|
|
|
|
* @param statisticsListener statistics listener receiving data during optimization
|
|
|
|
|
* @param statisticsListener statistics listener receiving data during
|
|
|
|
|
* optimization
|
|
|
|
|
* @param windowListener additional window listener for client frame
|
|
|
|
|
*/
|
|
|
|
|
public static EvAClient initClientGUI(GOParameters goParams,
|
|
|
|
@@ -581,6 +592,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
/////////////////////////////////////////////////////////////
|
|
|
|
|
m_actModuleLoad = new ExtAction("&Load", "Load Module",
|
|
|
|
|
KeyStroke.getKeyStroke(KeyEvent.VK_L, Event.CTRL_MASK)) {
|
|
|
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
loadModuleFromServer(null, null);
|
|
|
|
|
}
|
|
|
|
@@ -588,6 +600,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
|
|
|
|
|
m_actAbout = new ExtAction("&About...", "Product Information",
|
|
|
|
|
KeyStroke.getKeyStroke(KeyEvent.VK_A, Event.CTRL_MASK)) {
|
|
|
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
logMessage(e.getActionCommand());
|
|
|
|
|
showAboutDialog();
|
|
|
|
@@ -595,6 +608,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
};
|
|
|
|
|
m_actLicense = new ExtAction("&License...", "View License",
|
|
|
|
|
KeyStroke.getKeyStroke(KeyEvent.VK_L, Event.CTRL_MASK)) {
|
|
|
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
logMessage(e.getActionCommand());
|
|
|
|
|
showLicense();
|
|
|
|
@@ -602,6 +616,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
};
|
|
|
|
|
m_actHost = new ExtAction("&List of all servers", "All servers in list",
|
|
|
|
|
KeyStroke.getKeyStroke(KeyEvent.VK_A, Event.CTRL_MASK)) {
|
|
|
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
logMessage(e.getActionCommand());
|
|
|
|
|
selectAvailableHost(m_ComAdapter.getHostNameList());
|
|
|
|
@@ -609,10 +624,12 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
};
|
|
|
|
|
m_actAvailableHost = new ExtAction("Available &Server", "Available server",
|
|
|
|
|
KeyStroke.getKeyStroke(KeyEvent.VK_H, Event.CTRL_MASK)) {
|
|
|
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
logMessage(e.getActionCommand());
|
|
|
|
|
showPleaseWaitDialog();
|
|
|
|
|
Thread xx = new Thread() {
|
|
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
selectAvailableHost(m_ComAdapter.getAvailableHostNameList());
|
|
|
|
|
}
|
|
|
|
@@ -622,10 +639,12 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
};
|
|
|
|
|
m_actKillHost = new ExtAction("&Kill server", "Kill server process on selected host",
|
|
|
|
|
KeyStroke.getKeyStroke(KeyEvent.VK_K, Event.CTRL_MASK)) {
|
|
|
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
logMessage(e.getActionCommand());
|
|
|
|
|
showPleaseWaitDialog();
|
|
|
|
|
Thread xx = new Thread() {
|
|
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
selectAvailableHostToKill(m_ComAdapter.getAvailableHostNameList());
|
|
|
|
|
}
|
|
|
|
@@ -635,10 +654,12 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
};
|
|
|
|
|
m_actKillAllHosts = new ExtAction("Kill &all servers", "Kill all servers",
|
|
|
|
|
KeyStroke.getKeyStroke(KeyEvent.VK_K, Event.CTRL_MASK)) {
|
|
|
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
logMessage(e.getActionCommand());
|
|
|
|
|
showPleaseWaitDialog();
|
|
|
|
|
Thread xx = new Thread() {
|
|
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
selectAllAvailableHostToKill(m_ComAdapter.getAvailableHostNameList());
|
|
|
|
|
}
|
|
|
|
@@ -646,13 +667,12 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
xx.start();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
/* m_actStartServerManager = new ExtAction("Start &Server Manager", "Start &Server Manager",
|
|
|
|
|
KeyStroke.getKeyStroke(KeyEvent.VK_S, Event.CTRL_MASK)){
|
|
|
|
|
public void actionPerformed(ActionEvent e){
|
|
|
|
|
m_LogPanel.logMessage(e.getActionCommand());
|
|
|
|
|
ServerStartFrame sm = new ServerStartFrame(m_ComAdapter.getHostNameList());
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
/*
|
|
|
|
|
* m_actStartServerManager = new ExtAction("Start &Server Manager",
|
|
|
|
|
* "Start &Server Manager", KeyStroke.getKeyStroke(KeyEvent.VK_S,
|
|
|
|
|
* Event.CTRL_MASK)){ public void actionPerformed(ActionEvent e){
|
|
|
|
|
* m_LogPanel.logMessage(e.getActionCommand()); ServerStartFrame sm =
|
|
|
|
|
* new ServerStartFrame(m_ComAdapter.getHostNameList()); } };
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -666,6 +686,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
|
|
|
|
|
m_mnuWindow = new JExtMenu("&Window");
|
|
|
|
|
m_mnuWindow.addMenuListener(new MenuListener() {
|
|
|
|
|
|
|
|
|
|
public void menuSelected(MenuEvent e) {
|
|
|
|
|
// System.out.println("Selected");
|
|
|
|
|
m_mnuWindow.removeAll();
|
|
|
|
@@ -677,6 +698,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
final JFrame x = ((JEFrame) framelist[i]);
|
|
|
|
|
|
|
|
|
|
act.addActionListener((new ActionListener() {
|
|
|
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
if (!x.isActive()) {
|
|
|
|
|
x.setExtendedState(JFrame.NORMAL);
|
|
|
|
@@ -687,20 +709,23 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}));
|
|
|
|
|
if (curMenu.getItemCount()>=maxWindowMenuLength) {
|
|
|
|
|
if (curMenu.getItemCount() >= maxWindowMenuLength) {
|
|
|
|
|
JExtMenu subMenu = new JExtMenu("&More...");
|
|
|
|
|
curMenu.add(new JSeparator());
|
|
|
|
|
curMenu.add(subMenu);
|
|
|
|
|
curMenu=subMenu;
|
|
|
|
|
curMenu = subMenu;
|
|
|
|
|
}
|
|
|
|
|
curMenu.add(act);
|
|
|
|
|
}
|
|
|
|
|
String[] commonPrefixes = JEFrameRegister.getCommonPrefixes(10);
|
|
|
|
|
if (commonPrefixes.length > 0) m_mnuWindow.add(new JSeparator());
|
|
|
|
|
for (int i=0; i<commonPrefixes.length; i++) {
|
|
|
|
|
if (commonPrefixes.length > 0) {
|
|
|
|
|
m_mnuWindow.add(new JSeparator());
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < commonPrefixes.length; i++) {
|
|
|
|
|
final String prefix = commonPrefixes[i];
|
|
|
|
|
JMenuItem act = new JMenuItem("Close all of " + prefix + "...");
|
|
|
|
|
act.addActionListener((new ActionListener() {
|
|
|
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
JEFrameRegister.closeAllByPrefix(prefix);
|
|
|
|
|
}
|
|
|
|
@@ -709,12 +734,13 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void menuCanceled(MenuEvent e) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void menuDeselected(MenuEvent e) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////
|
|
|
|
|
m_mnuSelHosts = new JExtMenu("&Select Hosts");
|
|
|
|
@@ -752,8 +778,9 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void logMessage(String msg) {
|
|
|
|
|
if (TRACE || m_LogPanel == null) System.out.println(msg);
|
|
|
|
|
if (m_LogPanel != null) m_LogPanel.logMessage(msg);
|
|
|
|
|
if (m_LogPanel != null) {
|
|
|
|
|
m_LogPanel.logMessage(msg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@@ -778,7 +805,6 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
localMode = false;
|
|
|
|
|
if (TRACE) logMessage("Using RMI on m_ComAdapter.getHostName()");
|
|
|
|
|
m_ComAdapter.setRunLocally(false);
|
|
|
|
|
}
|
|
|
|
|
if (selectedModule == null) { // show a dialog and ask for a module
|
|
|
|
@@ -787,7 +813,9 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
JOptionPane.showMessageDialog(m_Frame.getContentPane(), "No modules available on " + m_ComAdapter.getHostName(), EvAInfo.infoTitle, 1);
|
|
|
|
|
} else {
|
|
|
|
|
String LastModuleName = Serializer.loadString("lastmodule.ser");
|
|
|
|
|
if (LastModuleName == null) LastModuleName = ModuleNameList[0];
|
|
|
|
|
if (LastModuleName == null) {
|
|
|
|
|
LastModuleName = ModuleNameList[0];
|
|
|
|
|
}
|
|
|
|
|
selectedModule = (String) JOptionPane.showInputDialog(m_Frame.getContentPane(),
|
|
|
|
|
"Which module do you want \n to load on host: " + m_ComAdapter.getHostName() + " ?", "Load optimization module on host",
|
|
|
|
|
JOptionPane.QUESTION_MESSAGE,
|
|
|
|
@@ -813,7 +841,8 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Retrieve the GOParamters of a loaded module. Return null if no module is loaded.
|
|
|
|
|
* Retrieve the GOParamters of a loaded module. Return null if no module is
|
|
|
|
|
* loaded.
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
@@ -842,7 +871,9 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
public boolean isOptRunning() {
|
|
|
|
|
if ((currentModuleAdapter != null) && (currentModuleAdapter instanceof AbstractModuleAdapter)) {
|
|
|
|
|
return ((AbstractModuleAdapter) currentModuleAdapter).isOptRunning();
|
|
|
|
|
} else return false;
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void loadSpecificModule(String selectedModule, InterfaceGOParameters goParams) {
|
|
|
|
@@ -858,7 +889,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
if (newModuleAdapter == null) {
|
|
|
|
|
// When launching a Java Web Start application, baseDir will always be null!
|
|
|
|
|
URL baseDir = getClass().getClassLoader().getResource("");
|
|
|
|
|
String cp = System.getProperty("java.class.path",".");
|
|
|
|
|
String cp = System.getProperty("java.class.path", ".");
|
|
|
|
|
String dir = (baseDir == null) ? System.getProperty("user.dir") : baseDir.getPath();
|
|
|
|
|
// System.err.println("Working dir: " + dir);
|
|
|
|
|
if (baseDir == null) {
|
|
|
|
@@ -875,19 +906,18 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
showLoadModules = true;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
newModuleAdapter.setConnection(!localMode);
|
|
|
|
|
if (m_ComAdapter.isRunLocally()) {
|
|
|
|
|
// TODO in rmi-mode this doesnt work yet! meaning e.g. that theres no content in the info log
|
|
|
|
|
newModuleAdapter.addRemoteStateListener((RemoteStateListener)this);
|
|
|
|
|
newModuleAdapter.addRemoteStateListener((RemoteStateListener) this);
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
if (withGUI) {
|
|
|
|
|
// this (or rather: EvAModuleButtonPanelMaker) is where the start button etc come from!
|
|
|
|
|
frmMkr = newModuleAdapter.getModuleFrame();
|
|
|
|
|
frameMaker = newModuleAdapter.getModuleFrame();
|
|
|
|
|
// newModuleAdapter.setLogPanel(m_LogPanel);
|
|
|
|
|
JPanel moduleContainer = frmMkr.makePanel(); // MK the main frame is actually painted in here
|
|
|
|
|
JPanel moduleContainer = frameMaker.makePanel(); // MK the main frame is actually painted in here
|
|
|
|
|
|
|
|
|
|
boolean wasVisible = m_Frame.isVisible();
|
|
|
|
|
m_Frame.setVisible(false);
|
|
|
|
@@ -898,13 +928,13 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
infoPanel.setLayout(new BorderLayout());
|
|
|
|
|
infoPanel.add(m_ProgressBar, BorderLayout.SOUTH);
|
|
|
|
|
infoPanel.add(m_LogPanel, BorderLayout.NORTH);
|
|
|
|
|
JComponent tree=null;
|
|
|
|
|
JComponent tree = null;
|
|
|
|
|
|
|
|
|
|
if (withTreeView && (newModuleAdapter instanceof AbstractModuleAdapter)) {
|
|
|
|
|
tree = getEvATreeView(frmMkr.getGOPanel(), "GOParameters", ((AbstractModuleAdapter)newModuleAdapter).getGOParameters());
|
|
|
|
|
tree = getEvATreeView(frameMaker.getGOPanel(), "GOParameters", ((AbstractModuleAdapter) newModuleAdapter).getGOParameters());
|
|
|
|
|
m_Frame.add(tree, BorderLayout.WEST);
|
|
|
|
|
}
|
|
|
|
|
m_Frame.add(frmMkr.getToolBar(), BorderLayout.NORTH);
|
|
|
|
|
m_Frame.add(frameMaker.getToolBar(), BorderLayout.NORTH);
|
|
|
|
|
m_Frame.add(moduleContainer, BorderLayout.CENTER);
|
|
|
|
|
//m_Frame.add(m_ProgressBar, BorderLayout.CENTER);
|
|
|
|
|
//m_Frame.add(m_LogPanel, BorderLayout.SOUTH);
|
|
|
|
@@ -957,18 +987,20 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
// parameters to update the tree
|
|
|
|
|
return treeView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
private void selectAvailableHost(String[] HostNames) {
|
|
|
|
|
if (TRACE) System.out.println("SelectAvailableHost");
|
|
|
|
|
if (HostNames == null || HostNames.length == 0) {
|
|
|
|
|
showNoHostFoundDialog();
|
|
|
|
|
} else {
|
|
|
|
|
String HostName = (String) JOptionPane.showInputDialog(m_Frame.getContentPane(),
|
|
|
|
|
"Which active host do you want to connect to?", "Host", JOptionPane.QUESTION_MESSAGE, null,
|
|
|
|
|
HostNames, m_ComAdapter.getHostName());
|
|
|
|
|
if (HostName != null) selectHost(HostName);
|
|
|
|
|
if (HostName != null) {
|
|
|
|
|
selectHost(HostName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -979,10 +1011,6 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
logMessage("Reloading module from server...");
|
|
|
|
|
loadModuleFromServer(currentModule, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// m_mnuModule.setText("Select module");
|
|
|
|
|
// m_mnuModule.repaint();
|
|
|
|
|
// System.out.println(HostName + " selected");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void showPleaseWaitDialog() {
|
|
|
|
@@ -990,14 +1018,13 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void showAboutDialog() {
|
|
|
|
|
JOptionPane.showMessageDialog
|
|
|
|
|
(m_Frame,
|
|
|
|
|
EvAInfo.productName + " - " + EvAInfo.productLongName +
|
|
|
|
|
"\nUniversity of Tuebingen, T\u00FCbingen, Germany\nChair for Cognitive Systems\n" +
|
|
|
|
|
"Dr. M. Kronfeld, H. Planatscher, M. de Paly, Dr. A. Dr\u00E4ger,\n" +
|
|
|
|
|
"Dr. F. Streichert, Dr. H. Ulmer, and Prof. Dr. A. Zell \nCoypright \u00A9 " +
|
|
|
|
|
EvAInfo.copyrightYear + "\nVersion " + EvAInfo.getVersion()+
|
|
|
|
|
"\nSee: " + EvAInfo.url, EvAInfo.infoTitle, 1);
|
|
|
|
|
JOptionPane.showMessageDialog(m_Frame,
|
|
|
|
|
EvAInfo.productName + " - " + EvAInfo.productLongName
|
|
|
|
|
+ "\nUniversity of Tuebingen, T\u00FCbingen, Germany\nChair for Cognitive Systems\n"
|
|
|
|
|
+ "Dr. M. Kronfeld, H. Planatscher, M. de Paly, Dr. A. Dr\u00E4ger,\n"
|
|
|
|
|
+ "Dr. F. Streichert, Dr. H. Ulmer, and Prof. Dr. A. Zell \nCoypright \u00A9 "
|
|
|
|
|
+ EvAInfo.copyrightYear + "\nVersion " + EvAInfo.getVersion()
|
|
|
|
|
+ "\nSee: " + EvAInfo.url, EvAInfo.infoTitle, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void showLicense() {
|
|
|
|
@@ -1012,7 +1039,6 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void selectAvailableHostToKill(String[] HostNames) {
|
|
|
|
|
if (TRACE) System.out.println("SelectAvailableHostToKill");
|
|
|
|
|
if (HostNames == null || HostNames.length == 0) {
|
|
|
|
|
showNoHostFoundDialog();
|
|
|
|
|
return;
|
|
|
|
@@ -1020,8 +1046,9 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
String HostName = (String) JOptionPane.showInputDialog(m_Frame.getContentPane(),
|
|
|
|
|
"Which server do you want to be killed ?", "Host", JOptionPane.QUESTION_MESSAGE, null,
|
|
|
|
|
HostNames, m_ComAdapter.getHostName());
|
|
|
|
|
if (HostName == null)
|
|
|
|
|
if (HostName == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
logMessage("Kill host process on = " + HostName);
|
|
|
|
|
m_ComAdapter.killServer(HostName);
|
|
|
|
|
// m_LogPanel.statusMessage("");
|
|
|
|
@@ -1037,43 +1064,55 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void performedRestart(String infoString) {
|
|
|
|
|
if (superListenerList != null) for (RemoteStateListener l : superListenerList) {
|
|
|
|
|
if (superListenerList != null) {
|
|
|
|
|
for (RemoteStateListener l : superListenerList) {
|
|
|
|
|
l.performedRestart(infoString);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
logMessage("Restarted processing " + infoString);
|
|
|
|
|
startTime = System.currentTimeMillis();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void performedStart(String infoString) {
|
|
|
|
|
if (superListenerList != null) for (RemoteStateListener l : superListenerList) {
|
|
|
|
|
if (superListenerList != null) {
|
|
|
|
|
for (RemoteStateListener l : superListenerList) {
|
|
|
|
|
l.performedStart(infoString);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
logMessage("Started processing " + infoString);
|
|
|
|
|
startTime = System.currentTimeMillis();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void performedStop() {
|
|
|
|
|
if (superListenerList != null) for (RemoteStateListener l : superListenerList) {
|
|
|
|
|
if (superListenerList != null) {
|
|
|
|
|
for (RemoteStateListener l : superListenerList) {
|
|
|
|
|
l.performedStop();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
long t = (System.currentTimeMillis() - startTime);
|
|
|
|
|
logMessage(String.format("Stopped after %1$d.%2$tL s", (t / 1000), (t % 1000)));
|
|
|
|
|
if (!withGUI) System.exit(0);
|
|
|
|
|
if (!withGUI) {
|
|
|
|
|
System.exit(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* When the worker needs to update the GUI we do so by queuing
|
|
|
|
|
* a Runnable for the event dispatching thread with
|
|
|
|
|
* SwingUtilities.invokeLater(). In this case we're just
|
|
|
|
|
* changing the progress bars value.
|
|
|
|
|
* When the worker needs to update the GUI we do so by queuing a Runnable
|
|
|
|
|
* for the event dispatching thread with SwingUtilities.invokeLater(). In
|
|
|
|
|
* this case we're just changing the progress bars value.
|
|
|
|
|
*/
|
|
|
|
|
public void updateProgress(final int percent, String msg) {
|
|
|
|
|
if (superListenerList != null) for (RemoteStateListener l : superListenerList) {
|
|
|
|
|
if (superListenerList != null) {
|
|
|
|
|
for (RemoteStateListener l : superListenerList) {
|
|
|
|
|
l.updateProgress(percent, msg);
|
|
|
|
|
}
|
|
|
|
|
if (msg != null) logMessage(msg);
|
|
|
|
|
}
|
|
|
|
|
if (msg != null) {
|
|
|
|
|
logMessage(msg);
|
|
|
|
|
}
|
|
|
|
|
if (this.m_ProgressBar != null) {
|
|
|
|
|
Runnable doSetProgressBarValue = new Runnable() {
|
|
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
m_ProgressBar.setValue(percent);
|
|
|
|
|
}
|
|
|
|
@@ -1084,6 +1123,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final class SplashScreenShell {
|
|
|
|
|
|
|
|
|
|
SplashScreen splScr = null;
|
|
|
|
|
String imgLoc = null;
|
|
|
|
|
|
|
|
|
@@ -1097,14 +1137,15 @@ final class SplashScreenShell {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void dispose() {
|
|
|
|
|
if (splScr!=null) {
|
|
|
|
|
if (splScr != null) {
|
|
|
|
|
splScr.dispose();
|
|
|
|
|
splScr=null;
|
|
|
|
|
splScr = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class SplashScreen extends Frame {
|
|
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 1281793825850423095L;
|
|
|
|
|
String imgLocation;
|
|
|
|
|
|
|
|
|
@@ -1116,11 +1157,12 @@ class SplashScreen extends Frame {
|
|
|
|
|
* Show the splash screen to the end user.
|
|
|
|
|
*
|
|
|
|
|
* <P>Once this method returns, the splash screen is realized, which means
|
|
|
|
|
* that almost all work on the splash screen should proceed through the event
|
|
|
|
|
* dispatch thread. In particular, any call to <code>dispose</code> for the
|
|
|
|
|
* splash screen must be performed in the event dispatch thread.
|
|
|
|
|
* that almost all work on the splash screen should proceed through the
|
|
|
|
|
* event dispatch thread. In particular, any call to
|
|
|
|
|
* <code>dispose</code> for the splash screen must be performed in the event
|
|
|
|
|
* dispatch thread.
|
|
|
|
|
*/
|
|
|
|
|
public void splash(){
|
|
|
|
|
public void splash() {
|
|
|
|
|
JWindow splashWindow = new JWindow(this);
|
|
|
|
|
BasicResourceLoader loader = BasicResourceLoader.instance();
|
|
|
|
|
byte[] bytes = loader.getBytesFromResourceLocation(imgLocation, true);
|
|
|
|
@@ -1132,5 +1174,4 @@ class SplashScreen extends Frame {
|
|
|
|
|
splashWindow.setLocation(screenSize.width / 2 - splashWindow.getSize().width / 2, screenSize.height / 2 - splashWindow.getSize().height / 2);
|
|
|
|
|
splashWindow.setVisible(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|