mxGraph 1.10.4.0


com.mxgraph.swing.handler
Class mxRubberband

java.lang.Object
  extended by com.mxgraph.swing.handler.mxRubberband
All Implemented Interfaces:
MouseListener, MouseMotionListener, EventListener

public class mxRubberband
extends Object
implements MouseListener, MouseMotionListener

Implements a rubberband selection.


Field Summary
protected  Color borderColor
          Defines the border color for drawing the rubberband selection.
protected  Rectangle bounds
          Holds the current rubberband bounds.
protected  boolean enabled
          Specifies if the rubberband is enabled.
protected  Color fillColor
          Defines the color to be used for filling the rubberband selection.
protected  Point first
          Holds the point where the selection has started.
protected  mxGraphComponent graphComponent
          Reference to the enclosing graph container.
 
Constructor Summary
mxRubberband(mxGraphComponent graphComponent)
          Constructs a new rubberband selection for the given graph component.
 
Method Summary
 Color getBorderColor()
          Returns the border color.
 Color getFillColor()
          Returns the fill color.
 boolean isEnabled()
          Returns the enabled state.
 boolean isRubberbandTrigger(MouseEvent e)
          Returns true if the given event should start the rubberband selection.
 void mouseClicked(MouseEvent arg0)
           
 void mouseDragged(MouseEvent e)
           
 void mouseEntered(MouseEvent arg0)
           
 void mouseExited(MouseEvent arg0)
           
 void mouseMoved(MouseEvent arg0)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void paintRubberband(Graphics g)
           
 void reset()
          Resets the rubberband selection without carrying out the selection.
 Object[] select(Rectangle rect, MouseEvent e)
           
 void setBorderColor(Color value)
          Sets the border color.
 void setEnabled(boolean enabled)
          Sets the enabled state.
 void setFillColor(Color value)
          Sets the fill color.
 void start(Point point)
          Starts the rubberband selection at the given point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

borderColor

protected Color borderColor
Defines the border color for drawing the rubberband selection. Default is mxConstants.RUBBERBAND_BORDERCOLOR.


fillColor

protected Color fillColor
Defines the color to be used for filling the rubberband selection. Default is mxConstants.RUBBERBAND_FILLCOLOR.


graphComponent

protected mxGraphComponent graphComponent
Reference to the enclosing graph container.


enabled

protected boolean enabled
Specifies if the rubberband is enabled.


first

protected transient Point first
Holds the point where the selection has started.


bounds

protected transient Rectangle bounds
Holds the current rubberband bounds.

Constructor Detail

mxRubberband

public mxRubberband(mxGraphComponent graphComponent)
Constructs a new rubberband selection for the given graph component.

Parameters:
graphComponent - Component that contains the rubberband.
Method Detail

isEnabled

public boolean isEnabled()
Returns the enabled state.


setEnabled

public void setEnabled(boolean enabled)
Sets the enabled state.


getBorderColor

public Color getBorderColor()
Returns the border color.


setBorderColor

public void setBorderColor(Color value)
Sets the border color.


getFillColor

public Color getFillColor()
Returns the fill color.


setFillColor

public void setFillColor(Color value)
Sets the fill color.


isRubberbandTrigger

public boolean isRubberbandTrigger(MouseEvent e)
Returns true if the given event should start the rubberband selection.


start

public void start(Point point)
Starts the rubberband selection at the given point.


reset

public void reset()
Resets the rubberband selection without carrying out the selection.


select

public Object[] select(Rectangle rect,
                       MouseEvent e)
Parameters:
rect -
e -

paintRubberband

public void paintRubberband(Graphics g)

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener

mouseDragged

public void mouseDragged(MouseEvent e)
Specified by:
mouseDragged in interface MouseMotionListener

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener

mouseClicked

public void mouseClicked(MouseEvent arg0)
Specified by:
mouseClicked in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent arg0)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent arg0)
Specified by:
mouseExited in interface MouseListener

mouseMoved

public void mouseMoved(MouseEvent arg0)
Specified by:
mouseMoved in interface MouseMotionListener

mxGraph 1.10.4.0


Copyright (c) 2010 Gaudenz Alder, David Benson. All rights reserved.