From ef5e2356312e8354e1fe0addef6e24636f95ad78 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 20 May 2008 21:45:17 +0000 Subject: A new package events.internal has been introduced. It only contains events which are for internal usage. the events which are in the events.implementations menu are the events which are editable in the task manager. --- sources/events/internal/ProtocolEvent.java | 55 ++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 sources/events/internal/ProtocolEvent.java (limited to 'sources/events/internal/ProtocolEvent.java') diff --git a/sources/events/internal/ProtocolEvent.java b/sources/events/internal/ProtocolEvent.java new file mode 100644 index 0000000..61b5890 --- /dev/null +++ b/sources/events/internal/ProtocolEvent.java @@ -0,0 +1,55 @@ +package events.internal; + +import core.VSProcess; +import events.*; +import protocols.VSProtocol; + +public class ProtocolEvent extends VSEvent { + private String protocolClassname; + private boolean isClientProtocol; /* true = client, false = server */ + private boolean isProtocolActivation; /* true = activate, false = deactivate */ + + protected void onInit() { + setClassname(getClass().toString()); + } + + public void isClientProtocol(boolean isClientProtocol) { + this.isClientProtocol = isClientProtocol; + } + + public boolean isClientProtocol() { + return isClientProtocol; + } + + public void isProtocolActivation(boolean isProtocolActivation) { + this.isProtocolActivation = isProtocolActivation; + } + + public boolean isProtocolActivation() { + return isProtocolActivation; + } + + public void setProtocolClassname(String protocolClassname) { + this.protocolClassname = protocolClassname; + } + + public void onStart() { + VSProtocol protocol = process.getProtocolObject(protocolClassname); + + if (isClientProtocol) + protocol.isClient(isProtocolActivation); + + else + protocol.isServer(isProtocolActivation); + + StringBuffer buffer = new StringBuffer(); + buffer.append(VSRegisteredEvents.getShortname(protocolClassname)); + buffer.append(" "); + buffer.append(isClientProtocol + ? prefs.getString("lang.client") : prefs.getString("lang.server")); + buffer.append(" "); + buffer.append(isProtocolActivation + ? prefs.getString("lang.activated") : prefs.getString("lang.deactivated")); + logg(buffer.toString()); + } +} -- cgit v1.2.3