edu.stanford.smi.protege.util
Class AbstractEvent
java.lang.Object
java.util.EventObject
edu.stanford.smi.protege.util.SessionEvent
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
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)
|
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)
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.
Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2007 Stanford University.