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:
- Event, Localizable, Serializable
- Direct Known Subclasses:
- ClsEvent, FacetEvent, FrameEvent, InstanceEvent, KnowledgeBaseEvent, ProjectEvent, ProjectViewEvent, SelectionEvent, ServerProjectNotificationEvent, ServerProjectSessionClosedEvent, ServerProjectStatusChangeEvent, SlotEvent, TransactionEvent, WidgetEvent
public abstract class AbstractEvent
- extends SessionEvent
- implements Localizable, Event
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()
- Specified by:
getSource
in interface Event
- 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)
- Specified by:
setTimeStamp
in interface Event
getTimeStamp
public long getTimeStamp()
- Specified by:
getTimeStamp
in interface Event
- 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()
- Specified by:
getUserName
in interface Event
- 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.
isReplacementEvent
public boolean isReplacementEvent()
- This call tells whether this event was generated as a result of a replaceFrame operation.
The replaceFrame events are a special case. For the smoothest user interaction
widgets will want to simply replace the frame that they are referencing with the new frame.
But we need to properly support legacy widgets that only know about frames changing name we need to
generate the full set of events. Widgets that work by simply replacing the frame can then filter
out these replace frame events because they have already done the work on the first call.
- Specified by:
isReplacementEvent
in interface Event
- Returns:
- true if and only if the event was generated during a replaceFrame operation.
setReplacementEvent
public void setReplacementEvent(boolean replacementEvent)
- This call allows the caller to indicate that this event was generated during a replaceFrame operation.
This method should only be called in the EventGeneratorFrameStore.
The replaceFrame events are a special case. For the smoothest user interaction
widgets will want to simply replace the frame that they are referencing with the new frame.
But we need to properly support legacy widgets that only know about frames changing name we need to
generate the full set of events. Widgets that work by simply replacing the frame can then filter
out these replace frame events because they have already done the work on the first call.
- Specified by:
setReplacementEvent
in interface Event
Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2011 Stanford University.