com.mindfusion.diagramming
Class DrawItemEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.mindfusion.diagramming.DrawItemEvent
All Implemented Interfaces:
java.io.Serializable

public class DrawItemEvent
extends java.util.EventObject

Contains information passed to the custom-draw events defined in DiagramListener.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DrawItemEvent(java.lang.Object source, java.awt.Graphics2D graphics, DiagramItem item, boolean shadow, java.awt.geom.Rectangle2D bounds)
          Initializes a new DrawItemEvent instance.
 
Method Summary
 java.awt.geom.Rectangle2D.Float getBounds()
          Gets the position at which to draw the item.
 java.awt.Graphics2D getGraphics()
          Gets a reference to the destination graphics object.
 DiagramItem getItem()
          Gets a reference to the item related to the event.
 boolean getShadow()
          Gets a value indicating whether the event handle should draw the item's shadow or the item.
 
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

DrawItemEvent

public DrawItemEvent(java.lang.Object source,
                     java.awt.Graphics2D graphics,
                     DiagramItem item,
                     boolean shadow,
                     java.awt.geom.Rectangle2D bounds)
Initializes a new DrawItemEvent instance.

Parameters:
source - The sender of this event.
graphics - The destination graphics.
item - The item that should be drawn.
shadow - true if the item's shadow should be drawn, false if the item itself should be drawn.
bounds - Specifies the bounding rectangle of the item or its shadow.
Method Detail

getGraphics

public java.awt.Graphics2D getGraphics()
Gets a reference to the destination graphics object.

Returns:
A reference to a Graphics2D object through which the custom drawing should be performed.

getItem

public DiagramItem getItem()
Gets a reference to the item related to the event.

Returns:
A reference to an DiagramItem -derived object.

getShadow

public boolean getShadow()
Gets a value indicating whether the event handle should draw the item's shadow or the item.

Returns:
true if the event handler should draw a shadow, otherwise false.

getBounds

public java.awt.geom.Rectangle2D.Float getBounds()
Gets the position at which to draw the item.

Returns:
A Rectangle2D.Float object representing the position of the item or its shadow.