|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.EventObject | +--java.beans.PropertyChangeEvent | +--y.view.Graph2DEvent
An event which indicates that a property associated with a Graph2D or associated with one of its elements has changed.
Unlike GraphEvents, instances of Graph2DEvent do not reflect structural changes of a graph. They are more related to events of type PropertyChangeEvent. They carry a source, an oldValue and a newValue. Additionally they carry a subject, which may be different from the source. The source is always of type Graph2D. The subject may be of any type, although most of the times the subject is of type NodeRealizer, EdgeRealizer, NodeLabel or EdgeLabel, depending on the attribute that has changed in the graph.
If, for example, the fill color of a NodeRealizer changes from Color.yellow to Color.red, then the subject of the emitted Graph2DEvent will be of type NodeRealizer, its property name will be "fillColor" and its old and new value will be Color.yellow, and Color.red.
If, on the other hand, the text of one of the labels associated with an edge changes, then the subject of the event emitted will be of type EdgeLabel and the associated property name will be "text", since the text of an edge label gets ultimately changed by calling method "setText" on an instance of EdgeLabel.
Whenever a Graph2DEvent is emitted, then the associated new value will be already set on the subject.
Property values of primitive type will be marshalled by the corresponding primitive data type wrapper classes Boolean, Double, Integer, etc.
Field Summary |
Fields inherited from class java.util.EventObject |
source |
Constructor Summary | |
Graph2DEvent(Graph2D source,
Object subject,
String propertyName,
Object oldValue,
Object newValue)
Creates a new instance of Graph2DEvent. |
Method Summary | |
Graph2D |
getGraph2D()
Returns the source of this event. |
String |
getPropertyName()
Returns the property name of the feature whose value has been changed. |
Object |
getSubject()
Returns the subject of this event. |
Methods inherited from class java.beans.PropertyChangeEvent |
getNewValue, getOldValue, getPropagationId, setPropagationId |
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 |
Constructor Detail |
public Graph2DEvent(Graph2D source, Object subject, String propertyName, Object oldValue, Object newValue)
source
- the Graph2D object that is the
source emitting this event.subject
- the subject of this event.propertyName
- the name of the changed propertyoldValue
- the former value of the named property.newValue
- the new value of the named propertyMethod Detail |
public Graph2D getGraph2D()
public Object getSubject()
public String getPropertyName()
getPropertyName
in class PropertyChangeEvent
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |