From c30c9c6e5d278671d7df7321953c72c49bc5df0e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 13 Jun 2008 23:51:24 +0000 Subject: ok, works: change PIDs and TIMEs in the task manager. --- sources/events/VSAbstractEvent.java | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'sources/events/VSAbstractEvent.java') 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,23 +55,40 @@ 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. * -- cgit v1.2.3