public class ToolEvent
extends java.util.EventObject
Observer
State changes of tools can be observed by other objects. Specifically
DrawingEditor
observes area invalidations of tools and repaints
its active drawing view accordingly.
Subject: Tool
; Observer: ToolListener
; Event:
ToolEvent
; Concrete Observer: DrawingEditor
.
Constructor and Description |
---|
ToolEvent(Tool src,
DrawingView view,
java.awt.Rectangle invalidatedArea)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Rectangle |
getInvalidatedArea()
Gets the bounds of the invalidated area on the drawing view.
|
Tool |
getTool()
Gets the tool which is the source of the event.
|
DrawingView |
getView()
Gets the drawing view of the tool.
|
public ToolEvent(Tool src, DrawingView view, java.awt.Rectangle invalidatedArea)
public Tool getTool()
public DrawingView getView()
public java.awt.Rectangle getInvalidatedArea()