JGraph
v5.0


org.jgraph.graph
Class BasicMarqueeHandler

java.lang.Object
  extended by org.jgraph.graph.BasicMarqueeHandler

public class BasicMarqueeHandler
extends java.lang.Object

A simple implementation of a marquee handler for JGraph.


Field Summary
protected  java.awt.geom.Point2D currentPoint
           
protected  java.awt.geom.Rectangle2D marqueeBounds
           
protected  java.awt.Cursor previousCursor
           
protected  java.awt.geom.Point2D startPoint
           
 
Constructor Summary
BasicMarqueeHandler()
           
 
Method Summary
 java.awt.geom.Point2D getCurrentPoint()
          Returns the currentPoint.
 java.awt.geom.Rectangle2D getMarqueeBounds()
          Returns the marqueeBounds.
 java.awt.Cursor getPreviousCursor()
          Returns the previousCursor.
 java.awt.geom.Point2D getStartPoint()
          Returns the startPoint.
 boolean isForceMarqueeEvent(java.awt.event.MouseEvent event)
           
 void mouseDragged(java.awt.event.MouseEvent e)
          Includes the specified startPoint in the marquee selection.
 void mouseMoved(java.awt.event.MouseEvent e)
          Empty.
 void mousePressed(java.awt.event.MouseEvent e)
          Start the marquee at the specified startPoint.
 void mouseReleased(java.awt.event.MouseEvent e)
          Stops the current marquee selection.
 void overlay(java.awt.Graphics g)
           
 void paint(java.awt.Graphics g)
          Called after the component was repainted (ie.
 void setCurrentPoint(java.awt.geom.Point2D currentPoint)
          Sets the currentPoint.
 void setMarqueeBounds(java.awt.geom.Rectangle2D marqueeBounds)
          Sets the marqueeBounds.
 void setPreviousCursor(java.awt.Cursor previousCursor)
          Sets the previousCursor.
 void setStartPoint(java.awt.geom.Point2D startPoint)
          Sets the startPoint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

previousCursor

protected transient java.awt.Cursor previousCursor

marqueeBounds

protected java.awt.geom.Rectangle2D marqueeBounds

startPoint

protected java.awt.geom.Point2D startPoint

currentPoint

protected java.awt.geom.Point2D currentPoint
Constructor Detail

BasicMarqueeHandler

public BasicMarqueeHandler()
Method Detail

isForceMarqueeEvent

public boolean isForceMarqueeEvent(java.awt.event.MouseEvent event)

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Stops the current marquee selection.


mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Includes the specified startPoint in the marquee selection. Calls overlay.


paint

public void paint(java.awt.Graphics g)
Called after the component was repainted (ie. after autoscroll). This is used to indicate that the graphics is no more dirty.


overlay

public void overlay(java.awt.Graphics g)

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Start the marquee at the specified startPoint. This invokes expandMarqueeToPoint to initialize marquee selection.


mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Empty.


getCurrentPoint

public java.awt.geom.Point2D getCurrentPoint()
Returns the currentPoint.

Returns:
Point

getMarqueeBounds

public java.awt.geom.Rectangle2D getMarqueeBounds()
Returns the marqueeBounds.

Returns:
Rectangle

getPreviousCursor

public java.awt.Cursor getPreviousCursor()
Returns the previousCursor.

Returns:
Cursor

getStartPoint

public java.awt.geom.Point2D getStartPoint()
Returns the startPoint.

Returns:
Point

setCurrentPoint

public void setCurrentPoint(java.awt.geom.Point2D currentPoint)
Sets the currentPoint.

Parameters:
currentPoint - The currentPoint to set

setMarqueeBounds

public void setMarqueeBounds(java.awt.geom.Rectangle2D marqueeBounds)
Sets the marqueeBounds.

Parameters:
marqueeBounds - The marqueeBounds to set

setPreviousCursor

public void setPreviousCursor(java.awt.Cursor previousCursor)
Sets the previousCursor.

Parameters:
previousCursor - The previousCursor to set

setStartPoint

public void setStartPoint(java.awt.geom.Point2D startPoint)
Sets the startPoint.

Parameters:
startPoint - The startPoint to set

JGraph
v5.0


Copyright (C) 2003-2004 Gaudenz Alder. All rights reserved.