jdraw.framework
Class DrawModelEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--jdraw.framework.DrawModelEvent
All Implemented Interfaces:
java.io.Serializable

public class DrawModelEvent
extends java.util.EventObject

An event which indicates that a draw model has changed. This event is fired if new figures are added to a model or if figures are removed from a model. The event is also fired if one figure in a draw model changes (e.g. its size or its position).

See Also:
FigureListener, Serialized Form

Field Summary
static int FIGURE_ADDED
          This event indicates that a figure was added to the draw model.
static int FIGURE_CHANGED
          This event indicates that a figure was changed in the draw model.
static int FIGURE_REMOVED
          This event indicates that a figure was removed from the draw model.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DrawModelEvent(jdraw.framework.DrawModel source, jdraw.framework.Figure figure, int type)
          Constructs a DrawModelEvent object with the specified model.
 
Method Summary
 jdraw.framework.Figure getFigure()
          Returns the figure which initiated the event.
 jdraw.framework.DrawModel getModel()
          Returns the draw model which changed.
 int getType()
          Returns the event type.
 
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

FIGURE_ADDED

public static final int FIGURE_ADDED
This event indicates that a figure was added to the draw model.

See Also:
Constant Field Values

FIGURE_REMOVED

public static final int FIGURE_REMOVED
This event indicates that a figure was removed from the draw model.

See Also:
Constant Field Values

FIGURE_CHANGED

public static final int FIGURE_CHANGED
This event indicates that a figure was changed in the draw model.

See Also:
Constant Field Values
Constructor Detail

DrawModelEvent

public DrawModelEvent(jdraw.framework.DrawModel source,
                      jdraw.framework.Figure figure,
                      int type)
Constructs a DrawModelEvent object with the specified model.

Parameters:
source - model which changed
figure - the affected figure
type - an integer indicating the event type
Method Detail

getModel

public jdraw.framework.DrawModel getModel()
Returns the draw model which changed.

Returns:
changed model

getFigure

public jdraw.framework.Figure getFigure()
Returns the figure which initiated the event.

Returns:
added, removed or changed figure (depending on event type)

getType

public int getType()
Returns the event type.

Returns:
type of event