agg.util
Class Change

java.lang.Object
  extended by agg.util.Change
Direct Known Subclasses:
Change_ObservableGone

public class Change
extends java.lang.Object

Encapsulation of change information sent out by observable classes using the method notifyObservers(change) of the class java.util.Observable. Observer objects then receive such information as the second argument to their update() method.

Subclasses may specifiy the detailed semantics.


Field Summary
static int MAPPING_ADDED
          code for the adding of a mapping.
static int MAPPING_REMOVED
          code for the removing of a mapping.
static int MODIFIED
          code for general modifications.
static int NOT_DEFINED
          code for a not specified change object.
static int OBJECT_CREATED
          code for a newly created subobject.
static int OBJECT_DESTROYED
          code for a subobject, which will be destroyed.
static int OBJECT_GLUED
          code for two subobjects, which will be glued.
static int OBJECT_MODIFIED
          code for a modified subobject.
static int OBSERVABLE_GONE
          code for the last message of a observable just before it is marked for deletion.
static int REDO_DONE
           
static int SOURCE_SET
           
static int SOURCE_UNSET
           
static int TARGET_SET
           
static int TARGET_UNSET
           
static int WANT_DESTROY_OBJECT
           
static int WANT_MODIFY_OBJECT
           
 
Constructor Summary
Change(int event)
          Construct myself to be a change information representing the coded event.
Change(int event, java.lang.Object item)
          Construct myself to be a change information with the given item and representing the coded event.
Change(int event, java.lang.Object changed, java.lang.Object changer)
          Construct myself to be a change information with the given item and its changer and representing the coded event.
Change(java.lang.Object item)
          Construct myself to be a change information with the given item.
 
Method Summary
 java.lang.Object getChanger()
          Return the changer of the item.
 int getEvent()
          returns the code for this event.
 java.lang.Object getItem()
          Return my item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT_DEFINED

public static final int NOT_DEFINED
code for a not specified change object. No object of the official packages should create such a change object. But you can use it for your own projects.

See Also:
Constant Field Values

OBSERVABLE_GONE

public static final int OBSERVABLE_GONE
code for the last message of a observable just before it is marked for deletion. All Observes should remove all connections to this object as fast as possible, so the garbage collector can remove the old observable.

See Also:
Constant Field Values

OBJECT_CREATED

public static final int OBJECT_CREATED
code for a newly created subobject. This change will be send from graphs for example. The getItem() method should return the new object.

See Also:
Constant Field Values

OBJECT_MODIFIED

public static final int OBJECT_MODIFIED
code for a modified subobject. This change will be send from graphs if the attributes of graph objects would be changed for example. The getItem() method should return a Pair with the modified object as first element and an Integer code of attribute event ID AttrEvent.getID()

See Also:
Constant Field Values

WANT_MODIFY_OBJECT

public static final int WANT_MODIFY_OBJECT
See Also:
Constant Field Values

OBJECT_DESTROYED

public static final int OBJECT_DESTROYED
code for a subobject, which will be destroyed. This change will be send from graphs for example. The getItem() method should return the object to destroy.

See Also:
Constant Field Values

WANT_DESTROY_OBJECT

public static final int WANT_DESTROY_OBJECT
See Also:
Constant Field Values

OBJECT_GLUED

public static final int OBJECT_GLUED
code for two subobjects, which will be glued. This change will be send from graphs for example. The getItem() method should return a Pair of objects to glue with object to keep as first element and object to glue (and destroy) as second.

See Also:
Constant Field Values

MAPPING_ADDED

public static final int MAPPING_ADDED
code for the adding of a mapping. This change will be send from morphisms for example. The getItem() method should return the object to map.

See Also:
Constant Field Values

MAPPING_REMOVED

public static final int MAPPING_REMOVED
code for the removing of a mapping. This change will be send from morphisms for example. The getItem() method should return the object to remove the mapping.

See Also:
Constant Field Values

MODIFIED

public static final int MODIFIED
code for general modifications. This change will be send from graphs without a certain object. The getItem() method returns null.

See Also:
Constant Field Values

SOURCE_SET

public static final int SOURCE_SET
See Also:
Constant Field Values

SOURCE_UNSET

public static final int SOURCE_UNSET
See Also:
Constant Field Values

TARGET_SET

public static final int TARGET_SET
See Also:
Constant Field Values

TARGET_UNSET

public static final int TARGET_UNSET
See Also:
Constant Field Values

REDO_DONE

public static final int REDO_DONE
See Also:
Constant Field Values
Constructor Detail

Change

public Change(java.lang.Object item)
Construct myself to be a change information with the given item.


Change

public Change(int event,
              java.lang.Object item)
Construct myself to be a change information with the given item and representing the coded event.

Parameters:
event - a number code for the event happened, you can use the here defined event codes or your own
item - the object of the event (for example the newly created arc)

Change

public Change(int event,
              java.lang.Object changed,
              java.lang.Object changer)
Construct myself to be a change information with the given item and its changer and representing the coded event.

Parameters:
event - a number code for the event happened, you can use the here defined event codes or your own
changed - the object of the event (for example the newly created arc)
changer - the object which performed this change

Change

public Change(int event)
Construct myself to be a change information representing the coded event.

Parameters:
event - a number code for the event happened, you can use the here defined event codes or your own
Method Detail

getItem

public final java.lang.Object getItem()
Return my item.


getChanger

public final java.lang.Object getChanger()
Return the changer of the item.


getEvent

public int getEvent()
returns the code for this event.