org.jhotdraw.draw
Class ToolEvent

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

public class ToolEvent
extends java.util.EventObject

An event sent to ToolListener's.


Design Patterns

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.


Version:
$Id: ToolEvent.java 527 2009-06-07 14:28:19Z rawcoder $
Author:
Werner Randelshofer
See Also:
Serialized Form

Field Summary
private  java.awt.Rectangle invalidatedArea
           
private  DrawingView view
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ToolEvent(Tool src, DrawingView view, java.awt.Rectangle invalidatedArea)
          Creates a new instance.
 
Method Summary
 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.
 
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.Rectangle invalidatedArea

view

private DrawingView view
Constructor Detail

ToolEvent

public ToolEvent(Tool src,
                 DrawingView view,
                 java.awt.Rectangle invalidatedArea)
Creates a new instance.

Method Detail

getTool

public Tool getTool()
Gets the tool which is the source of the event.


getView

public DrawingView getView()
Gets the drawing view of the tool.


getInvalidatedArea

public java.awt.Rectangle getInvalidatedArea()
Gets the bounds of the invalidated area on the drawing view.