public class mxRubberband
extends java.lang.Object
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
Modifier and Type | Field and Description |
---|---|
protected java.awt.Color |
borderColor
Defines the border color for drawing the rubberband selection.
|
protected java.awt.Rectangle |
bounds
Holds the current rubberband bounds.
|
protected boolean |
enabled
Specifies if the rubberband is enabled.
|
protected java.awt.Color |
fillColor
Defines the color to be used for filling the rubberband selection.
|
protected java.awt.Point |
first
Holds the point where the selection has started.
|
protected mxGraphComponent |
graphComponent
Reference to the enclosing graph container.
|
Constructor and Description |
---|
mxRubberband(mxGraphComponent graphComponent)
Constructs a new rubberband selection for the given graph component.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getBorderColor()
Returns the border color.
|
java.awt.Color |
getFillColor()
Returns the fill color.
|
boolean |
isEnabled()
Returns the enabled state.
|
boolean |
isRubberbandTrigger(java.awt.event.MouseEvent e)
Returns true if the given event should start the rubberband selection.
|
void |
mouseClicked(java.awt.event.MouseEvent arg0) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mouseEntered(java.awt.event.MouseEvent arg0) |
void |
mouseExited(java.awt.event.MouseEvent arg0) |
void |
mouseMoved(java.awt.event.MouseEvent arg0) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
void |
paintRubberband(java.awt.Graphics g) |
void |
reset()
Resets the rubberband selection without carrying out the selection.
|
java.lang.Object[] |
select(java.awt.Rectangle rect,
java.awt.event.MouseEvent e) |
void |
setBorderColor(java.awt.Color value)
Sets the border color.
|
void |
setEnabled(boolean enabled)
Sets the enabled state.
|
void |
setFillColor(java.awt.Color value)
Sets the fill color.
|
void |
start(java.awt.Point point)
Starts the rubberband selection at the given point.
|
protected java.awt.Color borderColor
protected java.awt.Color fillColor
protected mxGraphComponent graphComponent
protected boolean enabled
protected transient java.awt.Point first
protected transient java.awt.Rectangle bounds
public mxRubberband(mxGraphComponent graphComponent)
graphComponent
- Component that contains the rubberband.public boolean isEnabled()
public void setEnabled(boolean enabled)
public java.awt.Color getBorderColor()
public void setBorderColor(java.awt.Color value)
public java.awt.Color getFillColor()
public void setFillColor(java.awt.Color value)
public boolean isRubberbandTrigger(java.awt.event.MouseEvent e)
public void start(java.awt.Point point)
public void reset()
public java.lang.Object[] select(java.awt.Rectangle rect, java.awt.event.MouseEvent e)
rect
- e
- public void paintRubberband(java.awt.Graphics g)
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseClicked(java.awt.event.MouseEvent arg0)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent arg0)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent arg0)
mouseExited
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent arg0)
mouseMoved
in interface java.awt.event.MouseMotionListener
Copyright (c) 2010 Gaudenz Alder, David Benson. All rights reserved.