org.jgraph.graph
Class BasicMarqueeHandler

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

public class BasicMarqueeHandler
extends Object

A simple implementation of a marquee handler for JGraph.

Version:
1.0 1/1/02
Author:
Gaudenz Alder

Field Summary
protected  Point currentPoint
           
protected  Rectangle marqueeBounds
           
protected  Cursor previousCursor
           
protected  Point startPoint
           
 
Constructor Summary
BasicMarqueeHandler()
           
 
Method Summary
 Point getCurrentPoint()
          Returns the currentPoint.
 Rectangle getMarqueeBounds()
          Returns the marqueeBounds.
 Cursor getPreviousCursor()
          Returns the previousCursor.
 Point getStartPoint()
          Returns the startPoint.
 boolean isForceMarqueeEvent(MouseEvent event)
           
 void mouseDragged(MouseEvent e)
          Includes the specified startPoint in the marquee selection.
 void mouseMoved(MouseEvent e)
          Empty.
 void mousePressed(MouseEvent e)
          Start the marquee at the specified startPoint.
 void mouseReleased(MouseEvent e)
          Stops the current marquee selection.
protected  void overlay(Graphics g)
           
 void paint(Graphics g)
          Called after the component was repainted (ie.
 void setCurrentPoint(Point currentPoint)
          Sets the currentPoint.
 void setMarqueeBounds(Rectangle marqueeBounds)
          Sets the marqueeBounds.
 void setPreviousCursor(Cursor previousCursor)
          Sets the previousCursor.
 void setStartPoint(Point 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 Cursor previousCursor

marqueeBounds

protected Rectangle marqueeBounds

startPoint

protected Point startPoint

currentPoint

protected Point currentPoint
Constructor Detail

BasicMarqueeHandler

public BasicMarqueeHandler()
Method Detail

isForceMarqueeEvent

public boolean isForceMarqueeEvent(MouseEvent event)

mouseReleased

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


mouseDragged

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


paint

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


overlay

protected void overlay(Graphics g)

mousePressed

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


mouseMoved

public void mouseMoved(MouseEvent e)
Empty.


getCurrentPoint

public Point getCurrentPoint()
Returns the currentPoint.

Returns:
Point

getMarqueeBounds

public Rectangle getMarqueeBounds()
Returns the marqueeBounds.

Returns:
Rectangle

getPreviousCursor

public Cursor getPreviousCursor()
Returns the previousCursor.

Returns:
Cursor

getStartPoint

public Point getStartPoint()
Returns the startPoint.

Returns:
Point

setCurrentPoint

public void setCurrentPoint(Point currentPoint)
Sets the currentPoint.

Parameters:
currentPoint - The currentPoint to set

setMarqueeBounds

public void setMarqueeBounds(Rectangle marqueeBounds)
Sets the marqueeBounds.

Parameters:
marqueeBounds - The marqueeBounds to set

setPreviousCursor

public void setPreviousCursor(Cursor previousCursor)
Sets the previousCursor.

Parameters:
previousCursor - The previousCursor to set

setStartPoint

public void setStartPoint(Point startPoint)
Sets the startPoint.

Parameters:
startPoint - The startPoint to set