Protege 3.3.1

edu.stanford.smi.protege.util
Class AbstractEvent

java.lang.Object
  extended by java.util.EventObject
      extended by edu.stanford.smi.protege.util.SessionEvent
          extended by edu.stanford.smi.protege.util.AbstractEvent
All Implemented Interfaces:
Localizable, Serializable
Direct Known Subclasses:
ClsEvent, FacetEvent, FrameEvent, InstanceEvent, KnowledgeBaseEvent, ProjectEvent, ProjectViewEvent, SelectionEvent, SlotEvent, TransactionEvent, WidgetEvent

public abstract class AbstractEvent
extends SessionEvent
implements Localizable

Base class for all events.

Author:
Ray Fergerson
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
protected AbstractEvent(Object source, int type)
           
protected AbstractEvent(Object source, int type, Object arg1)
           
protected AbstractEvent(Object source, int type, Object arg1, Object arg2)
           
protected AbstractEvent(Object source, int type, Object arg1, Object arg2, Object arg3)
           
 
Method Summary
 boolean equals(Object o)
           
static boolean equals(Object o1, Object o2)
           
 Object getArgument()
           
 Object getArgument1()
           
 Object getArgument2()
           
 Object getArgument3()
           
 int getEventType()
           
 Object getSource()
           
 long getTimeStamp()
           
 String getUserName()
           
 int hashCode()
           
 void localize(KnowledgeBase kb)
           
protected  void setSource(Object o)
           
 void setTimeStamp(long timeStamp)
           
 String toString()
           
 
Methods inherited from class edu.stanford.smi.protege.util.SessionEvent
getSession
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractEvent

protected AbstractEvent(Object source,
                        int type)

AbstractEvent

protected AbstractEvent(Object source,
                        int type,
                        Object arg1)

AbstractEvent

protected AbstractEvent(Object source,
                        int type,
                        Object arg1,
                        Object arg2)

AbstractEvent

protected AbstractEvent(Object source,
                        int type,
                        Object arg1,
                        Object arg2,
                        Object arg3)
Method Detail

localize

public void localize(KnowledgeBase kb)
Specified by:
localize in interface Localizable

setSource

protected void setSource(Object o)

getArgument

public Object getArgument()

getArgument1

public Object getArgument1()

getArgument2

public Object getArgument2()

getArgument3

public Object getArgument3()

getEventType

public int getEventType()

getSource

public Object getSource()
Overrides:
getSource in class EventObject

toString

public String toString()
Overrides:
toString in class EventObject

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

equals

public static boolean equals(Object o1,
                             Object o2)

setTimeStamp

public void setTimeStamp(long timeStamp)

getTimeStamp

public long getTimeStamp()
Returns:
The current system time in milliseconds as a long. This can be used to generate a java.util.Date object.

getUserName

public String getUserName()
Returns:
The user name of the Protege client that generated the event for any knowledge base event. (For example, create class, slot, instance, change values of slots etc.). For the GUI events (e.g. SelectionEvent and WidgetEvent) it will return the local user name, corresponding to the user.name property, either from the protege.properties, or Protege.lax, or the system properties (in this order). If Protege is in standalone mode, it will return the local user name. If Protege is run as a client in multi-user mode, it will return the user name used to login to the Protege server. (The user names are configured in the metaproject ontology). If none of these properties are found, it will return null.

Protege 3.3.1

Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2007 Stanford University.