EvAClient accepts a RemoteStateListener which is informed about optimization start/stop etc. (merging MK rev. 222).
This commit is contained in:
parent
eca74db612
commit
cb8af51be6
@ -27,6 +27,7 @@ import java.io.Serializable;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
import javax.swing.ButtonGroup;
|
import javax.swing.ButtonGroup;
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
@ -119,6 +120,19 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
// remember the module in use
|
// remember the module in use
|
||||||
private transient String currentModule = null;
|
private transient String currentModule = null;
|
||||||
|
|
||||||
|
Vector<RemoteStateListener> superListenerList = null;
|
||||||
|
|
||||||
|
public void addRemoteStateListener(RemoteStateListener l) {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getProperty(String key) {
|
public static String getProperty(String key) {
|
||||||
String myVal = EVA_PROPERTIES.getProperty(key);
|
String myVal = EVA_PROPERTIES.getProperty(key);
|
||||||
return myVal;
|
return myVal;
|
||||||
@ -733,16 +747,25 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void performedRestart(String infoString) {
|
public void performedRestart(String infoString) {
|
||||||
|
if (superListenerList != null) for (RemoteStateListener l : superListenerList) {
|
||||||
|
l.performedRestart(infoString);
|
||||||
|
}
|
||||||
logMessage("Restarted processing " + infoString);
|
logMessage("Restarted processing " + infoString);
|
||||||
startTime = System.currentTimeMillis();
|
startTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void performedStart(String infoString) {
|
public void performedStart(String infoString) {
|
||||||
|
if (superListenerList != null) for (RemoteStateListener l : superListenerList) {
|
||||||
|
l.performedStart(infoString);
|
||||||
|
}
|
||||||
logMessage("Started processing " + infoString);
|
logMessage("Started processing " + infoString);
|
||||||
startTime = System.currentTimeMillis();
|
startTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void performedStop() {
|
public void performedStop() {
|
||||||
|
if (superListenerList != null) for (RemoteStateListener l : superListenerList) {
|
||||||
|
l.performedStop();
|
||||||
|
}
|
||||||
long t = (System.currentTimeMillis() - startTime);
|
long t = (System.currentTimeMillis() - startTime);
|
||||||
logMessage(String.format("Stopped after %1$d.%2$tL s", (t / 1000), (t % 1000)));
|
logMessage(String.format("Stopped after %1$d.%2$tL s", (t / 1000), (t % 1000)));
|
||||||
}
|
}
|
||||||
@ -754,6 +777,9 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
* changing the progress bars value.
|
* changing the progress bars value.
|
||||||
*/
|
*/
|
||||||
public void updateProgress(final int percent, String msg) {
|
public void updateProgress(final int percent, String msg) {
|
||||||
|
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) {
|
if (this.m_ProgressBar != null) {
|
||||||
Runnable doSetProgressBarValue = new Runnable() {
|
Runnable doSetProgressBarValue = new Runnable() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user