summaryrefslogtreecommitdiff
path: root/sources/events/VSAbstractEvent.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-06-13 23:51:24 +0000
committerPaul Buetow <paul@buetow.org>2008-06-13 23:51:24 +0000
commitc30c9c6e5d278671d7df7321953c72c49bc5df0e (patch)
tree018e41ae84fe5febcc8f2dad83c2318e98a61c70 /sources/events/VSAbstractEvent.java
parent053ecc68889e3b4ed1afd23ec12d6ff0aea593d4 (diff)
ok, works: change PIDs and TIMEs in the task manager.
Diffstat (limited to 'sources/events/VSAbstractEvent.java')
-rw-r--r--sources/events/VSAbstractEvent.java25
1 files changed, 21 insertions, 4 deletions
diff --git a/sources/events/VSAbstractEvent.java b/sources/events/VSAbstractEvent.java
index 263f21f..7f0a4e8 100644
--- a/sources/events/VSAbstractEvent.java
+++ b/sources/events/VSAbstractEvent.java
@@ -55,24 +55,41 @@ abstract public class VSAbstractEvent extends VSPrefs {
private String eventClassname;
/**
- * Creates a copy of the event.
+ * Creates a copy of the event and using a new process.
*
+ * @param newProcess The new process
* @return The copy
*/
- final public VSAbstractEvent getCopy() throws VSEventNotCopyableException {
+ final public VSAbstractEvent getCopy(VSProcess theProcess)
+ throws VSEventNotCopyableException {
+
+ if (theProcess == null)
+ theProcess = process;
+
if (!(this instanceof VSCopyableEvent))
- throw new VSEventNotCopyableException(eventShortname);
+ throw new VSEventNotCopyableException(
+ eventShortname + " (" + eventClassname + ")");
VSAbstractEvent copy =
VSRegisteredEvents.createEventInstanceByClassname(
- eventClassname, process);
+ eventClassname, theProcess);
((VSCopyableEvent) this).initCopy(copy);
+ copy.setShortname(eventShortname);
return copy;
}
/**
+ * Creates a copy of the event.
+ *
+ * @return The copy
+ */
+ final public VSAbstractEvent getCopy() throws VSEventNotCopyableException {
+ return getCopy(null);
+ }
+
+ /**
* Inits the event.
*
* @param process the process