org.jhotdraw.draw
Class CompositeFigureEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.jhotdraw.draw.CompositeFigureEvent
All Implemented Interfaces:
java.io.Serializable

public class CompositeFigureEvent
extends java.util.EventObject

An EventObject sent to CompositeFigureListeners.


Design Patterns

Observer
Changes in the composition of a composite figure can be observed.
Subject: CompositeFigure; Observer: CompositeFigureListener; Event: CompositeFigureEvent.


Version:
$Id: CompositeFigureEvent.java 536 2009-06-14 12:10:57Z rawcoder $
Author:
Werner Randelshofer
See Also:
Serialized Form

Field Summary
private  Figure child
           
private  int index
           
private  java.awt.geom.Rectangle2D.Double invalidatedArea
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CompositeFigureEvent(CompositeFigure source, Figure child, java.awt.geom.Rectangle2D.Double invalidatedArea, int zIndex)
          Constructs an event for the provided CompositeFigure.
 
Method Summary
 Figure getChildFigure()
          Gets the changed child figure.
 CompositeFigure getCompositeFigure()
          Gets the changed drawing.
 int getIndex()
          Returns the z-index of the child figure.
 java.awt.geom.Rectangle2D.Double getInvalidatedArea()
          Gets the bounds of the invalidated area on the drawing.
 
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

invalidatedArea

private java.awt.geom.Rectangle2D.Double invalidatedArea

child

private Figure child

index

private int index
Constructor Detail

CompositeFigureEvent

public CompositeFigureEvent(CompositeFigure source,
                            Figure child,
                            java.awt.geom.Rectangle2D.Double invalidatedArea,
                            int zIndex)
Constructs an event for the provided CompositeFigure.

Parameters:
source - The composite figure.
child - The changed figure.
invalidatedArea - The bounds of the invalidated area on the drawing.
Method Detail

getCompositeFigure

public CompositeFigure getCompositeFigure()
Gets the changed drawing.


getChildFigure

public Figure getChildFigure()
Gets the changed child figure.


getInvalidatedArea

public java.awt.geom.Rectangle2D.Double getInvalidatedArea()
Gets the bounds of the invalidated area on the drawing.


getIndex

public int getIndex()
Returns the z-index of the child figure.