com.mindfusion.diagramming
Class DiagramEvent

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

public class DiagramEvent
extends java.util.EventObject

Contains information passed to the events defined in DiagramListener.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DiagramEvent(java.lang.Object source, java.awt.Graphics2D graphics, java.awt.geom.Rectangle2D visibleRect, java.awt.geom.Rectangle2D clipRect)
           
DiagramEvent(java.lang.Object source, java.awt.geom.Point2D position, int button)
          Initializes a new DiagramEvent instance.
 
Method Summary
 java.awt.geom.Rectangle2D getClipRect()
          Gets the current clipping rectangle.
 java.awt.Graphics2D getGraphics()
          Gets an object implementing the IGraphics interface whose methods should be used to draw the custom graphics.
 int getMouseButton()
          Gets the mouse mouseButton related to the event.
 java.awt.geom.Point2D.Float getMousePosition()
          Gets the mouse position.
 java.awt.geom.Rectangle2D getVisibleRect()
          Gets what part of the diagram is currently visible.
 
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

DiagramEvent

public DiagramEvent(java.lang.Object source,
                    java.awt.geom.Point2D position,
                    int button)
Initializes a new DiagramEvent instance.

Parameters:
source - The sender of this event.
position - Specifies the mouse pointer position.
button - One of the MouseEvent.BUTTON* constants.

DiagramEvent

public DiagramEvent(java.lang.Object source,
                    java.awt.Graphics2D graphics,
                    java.awt.geom.Rectangle2D visibleRect,
                    java.awt.geom.Rectangle2D clipRect)
Method Detail

getMousePosition

public java.awt.geom.Point2D.Float getMousePosition()
Gets the mouse position.

Returns:
A Point2D.Float object representing the mouse position in document coordinates.

getMouseButton

public int getMouseButton()
Gets the mouse mouseButton related to the event.

Returns:
One of the MouseEvent.BUTTON* constants.

getClipRect

public java.awt.geom.Rectangle2D getClipRect()
Gets the current clipping rectangle.

Returns:
A Rectangle2D instance.

getGraphics

public java.awt.Graphics2D getGraphics()
Gets an object implementing the IGraphics interface whose methods should be used to draw the custom graphics.

Returns:
An instance of a class implementing the IGraphics interface.

getVisibleRect

public java.awt.geom.Rectangle2D getVisibleRect()
Gets what part of the diagram is currently visible.

Returns:
A Rectangle2D instance