JHotDraw 7.4.1

org.jhotdraw.draw.event
Class FigureEvent

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

public class FigureEvent
extends java.util.EventObject

An EventObject sent to FigureListeners.


Design Patterns

Observer
State changes of figures can be observed by other objects. Specifically CompositeFigure observes area invalidations and remove requests of its child figures. DrawingView also observes area invalidations of its drawing object. Subject: Figure; Observer: FigureListener; Event: FigureEvent; Concrete Observer: CompositeFigure, DrawingView.


Version:
$Id: FigureEvent.java 604 2010-01-09 12:00:29Z rawcoder $
Author:
Werner Randelshofer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
FigureEvent(Figure source, AttributeKey attribute, java.lang.Object oldValue, java.lang.Object newValue)
          Constructs an event for the given source Figure.
FigureEvent(Figure source, java.awt.geom.Rectangle2D.Double invalidatedArea)
          Constructs an event for the given source Figure.
 
Method Summary
 AttributeKey getAttribute()
           
 Figure getFigure()
          Gets the changed figure
 java.awt.geom.Rectangle2D.Double getInvalidatedArea()
          Gets the bounds of the invalidated area on the drawing.
 java.lang.Object getNewValue()
           
 java.lang.Object getOldValue()
           
 
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

FigureEvent

public FigureEvent(Figure source,
                   java.awt.geom.Rectangle2D.Double invalidatedArea)
Constructs an event for the given source Figure.

Parameters:
invalidatedArea - The bounds of the invalidated area on the drawing.

FigureEvent

public FigureEvent(Figure source,
                   AttributeKey attribute,
                   java.lang.Object oldValue,
                   java.lang.Object newValue)
Constructs an event for the given source Figure.

Method Detail

getFigure

public Figure getFigure()
Gets the changed figure


getInvalidatedArea

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


getAttribute

public AttributeKey getAttribute()

getOldValue

public java.lang.Object getOldValue()

getNewValue

public java.lang.Object getNewValue()

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.