|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.EventObject
com.nwoods.jgo.JGoDocumentEvent
This class defines the event object passed to JGoDocumentListeners when events of interest occur on the JGoDocument.
The nature of the event is determined by the Hint value. Some events will be about changes to a JGoObject in the document; in such cases the JGoObject property will not be null. For other events, an Object may provide useful information; in such cases the Object property will not be null. Some events may need additional descriptive information; the Flags property can provide that.
In particular, a CHANGED event uses the Flags property as a sub-hint to indicate the kind of change that happened to the JGoObject, and a previous value may be available. Depending on the type of the previous value, you will have to use the appropriate method. Typically integer and boolean properties will have the previous value accessible via getPreviousValueInt(); all other data types will be stored as Objects that can be accessed via getPreviousValue().
You may define your own hint values greater than LAST.
JGoDocumentListener
,
JGoDocument
,
JGoViewEvent
,
Serialized FormField Summary | |
static int |
ABORTED_TRANSACTION
Raised by JGoDocument.endTransaction(false) for an outer-level transaction that is aborted |
static int |
ARRANGED
The top-level objects of the document have been moved/rearranged |
static int |
BEFORE_CHANGING
A special hint modifier used before a change occurs when passing all of the previous state information as part of a regular document event would be impractical. |
static int |
CHANGED
An object was modified |
static int |
FINISHED_REDO
|
static int |
FINISHED_TRANSACTION
Raised by JGoDocument.endTransaction after committing an outer-level transaction |
static int |
FINISHED_UNDO
|
static int |
INSERTED
An object was added to the document |
static int |
LAST
The end of the predefined hints |
static int |
LAYER_IDENTIFIER_CHANGED
A layer's identifier property has been changed |
static int |
LAYER_INSERTED
A layer has been added |
static int |
LAYER_MODIFIABLE_CHANGED
A layer's modifiable property has been changed |
static int |
LAYER_MOVED
A layer has been moved in the Z-order |
static int |
LAYER_REMOVED
A layer has been removed |
static int |
LAYER_TRANSPARENCY_CHANGED
A layer's transparency property has been changed |
static int |
LAYER_VISIBLE_CHANGED
A layer's visibility has been changed |
static int |
MAINTAINS_PARTID_CHANGED
Whether the document keeps track of JGoIdentifiableParts has changed |
static int |
MODIFIABLE_CHANGED
The user-modifiable property was changed |
static int |
PAPER_COLOR_CHANGED
The paper color was changed |
static int |
REMOVED
An object was removed from the document |
static int |
SIZE_CHANGED
The size of the document changed |
static int |
STARTED_TRANSACTION
Raised by JGoDocument.startTransaction after starting an outer-level transaction |
static int |
STARTING_REDO
|
static int |
STARTING_UNDO
|
static int |
TOPLEFT_CHANGED
The top-left corner for the document was changed |
static int |
UPDATE_ALL
The document changed a lot; all listeners need to refresh. |
static int |
VALID_CYCLE_CHANGED
Whether the document keeps permits users to draw cycles of links has changed |
Fields inherited from class java.util.EventObject |
source |
Constructor Summary | |
JGoDocumentEvent(JGoDocument source,
int hint,
int flags,
java.lang.Object obj)
Construct a new JGoDocument event without previous value information. |
|
JGoDocumentEvent(JGoDocument source,
int hint,
int flags,
java.lang.Object obj,
int prevInt,
java.lang.Object prevObj)
Construct a new JGoDocument event with previous property value information. |
Method Summary | |
int |
getFlags()
Return the flags assocated with this event. |
int |
getHint()
Return the hint assocated with this event. |
JGoObject |
getJGoObject()
Return the JGoObject assocated with this event or null if there is no particular JGoObject associated with the event. |
java.lang.Object |
getObject()
Return the Object assocated with this event or null if there is no particular object associated with the event. |
java.lang.Object |
getPreviousValue()
For events describing an object that has changed (i.e., the hint is CHANGED), the original value of the property described by the sub-hint/flags may be available as an Object, depending on the sub-hint and property type. |
int |
getPreviousValueInt()
For events describing an object that has changed (i.e., the hint is CHANGED), the original value of the property described by the sub-hint/flags may be available as an integer, depending on the sub-hint and property type. |
boolean |
isBeforeChanging()
This predicate returns true when representing an event that occurs before the described change has happened. |
Methods inherited from class java.util.EventObject |
getSource, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int UPDATE_ALL
public static final int STARTED_TRANSACTION
public static final int FINISHED_TRANSACTION
public static final int ABORTED_TRANSACTION
public static final int STARTING_UNDO
public static final int FINISHED_UNDO
public static final int STARTING_REDO
public static final int FINISHED_REDO
public static final int INSERTED
public static final int CHANGED
public static final int REMOVED
public static final int SIZE_CHANGED
public static final int PAPER_COLOR_CHANGED
public static final int MODIFIABLE_CHANGED
public static final int TOPLEFT_CHANGED
public static final int LAYER_INSERTED
public static final int LAYER_REMOVED
public static final int LAYER_MOVED
public static final int LAYER_VISIBLE_CHANGED
public static final int LAYER_MODIFIABLE_CHANGED
public static final int LAYER_TRANSPARENCY_CHANGED
public static final int LAYER_IDENTIFIER_CHANGED
public static final int ARRANGED
public static final int MAINTAINS_PARTID_CHANGED
public static final int VALID_CYCLE_CHANGED
public static final int BEFORE_CHANGING
This is basically useful for Undo processing, to record the state of the document or layer or object before anything happens. Listeners other than Undo/Redo listeners may choose to ignore all events whose hint has this flag turned on.
public static final int LAST
Constructor Detail |
public JGoDocumentEvent(JGoDocument source, int hint, int flags, java.lang.Object obj)
source
- the JGoDocument that is the source of the event.hint
- identifies the type of event.flags
- additional information about the event.obj
- the Object, sometimes a JGoObject, associated with the event.public JGoDocumentEvent(JGoDocument source, int hint, int flags, java.lang.Object obj, int prevInt, java.lang.Object prevObj)
source
- the JGoDocument that is the source of the event.hint
- identifies the type of event.flags
- additional information about the event.obj
- the Object, sometimes a JGoObject, associated with the event.prevInt
- the previous integer value for an object's property
if specified by the flags sub-hintprevObj
- the previous object value for an object's property
if specified by the flags sub-hintMethod Detail |
public int getHint()
The value will not have the BEFORE_CHANGING flag turned on. Use the isBeforeChanging() predicate to determine if this document event was fired by JGoDocument.fireForedate instead of fireUpdate.
public int getFlags()
public JGoObject getJGoObject()
public java.lang.Object getObject()
public java.lang.Object getPreviousValue()
public int getPreviousValueInt()
public boolean isBeforeChanging()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |