Class mxRubberband
java.lang.Object
com.mxgraph.swing.handler.mxRubberband
- All Implemented Interfaces:
MouseListener, MouseMotionListener, EventListener
Implements a rubberband selection.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ColorDefines the border color for drawing the rubberband selection.protected RectangleHolds the current rubberband bounds.protected booleanSpecifies if the rubberband is enabled.protected ColorDefines the color to be used for filling the rubberband selection.protected PointHolds the point where the selection has started.protected mxGraphComponentReference to the enclosing graph container. -
Constructor Summary
ConstructorsConstructorDescriptionmxRubberband(mxGraphComponent graphComponent) Constructs a new rubberband selection for the given graph component. -
Method Summary
Modifier and TypeMethodDescriptionReturns the border color.Returns the fill color.booleanReturns the enabled state.booleanReturns true if the given event should start the rubberband selection.voidmouseClicked(MouseEvent arg0) voidvoidmouseEntered(MouseEvent arg0) voidmouseExited(MouseEvent arg0) voidmouseMoved(MouseEvent arg0) voidvoidvoidvoidreset()Resets the rubberband selection without carrying out the selection.Object[]select(Rectangle rect, MouseEvent e) voidsetBorderColor(Color value) Sets the border color.voidsetEnabled(boolean enabled) Sets the enabled state.voidsetFillColor(Color value) Sets the fill color.voidStarts the rubberband selection at the given point.
-
Field Details
-
borderColor
Defines the border color for drawing the rubberband selection. Default is mxConstants.RUBBERBAND_BORDERCOLOR. -
fillColor
Defines the color to be used for filling the rubberband selection. Default is mxConstants.RUBBERBAND_FILLCOLOR. -
graphComponent
Reference to the enclosing graph container. -
enabled
protected boolean enabledSpecifies if the rubberband is enabled. -
first
Holds the point where the selection has started. -
bounds
Holds the current rubberband bounds.
-
-
Constructor Details
-
mxRubberband
Constructs a new rubberband selection for the given graph component.- Parameters:
graphComponent- Component that contains the rubberband.
-
-
Method Details
-
isEnabled
public boolean isEnabled()Returns the enabled state. -
setEnabled
public void setEnabled(boolean enabled) Sets the enabled state. -
getBorderColor
Returns the border color. -
setBorderColor
Sets the border color. -
getFillColor
Returns the fill color. -
setFillColor
Sets the fill color. -
isRubberbandTrigger
Returns true if the given event should start the rubberband selection. -
start
Starts the rubberband selection at the given point. -
reset
public void reset()Resets the rubberband selection without carrying out the selection. -
select
- Parameters:
rect-e-
-
paintRubberband
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-