public class FigureEvent
extends java.util.EventObject
EventObject
sent to FigureListener
s.
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
.
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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() |
public FigureEvent(Figure source, java.awt.geom.Rectangle2D.Double invalidatedArea)
invalidatedArea
- The bounds of the invalidated area on the drawing.public FigureEvent(Figure source, AttributeKey attribute, java.lang.Object oldValue, java.lang.Object newValue)
public Figure getFigure()
public java.awt.geom.Rectangle2D.Double getInvalidatedArea()
public AttributeKey getAttribute()
public java.lang.Object getOldValue()
public java.lang.Object getNewValue()