Package com.mxgraph.swing.handler
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 Color
Defines the border color for drawing the rubberband selection.protected Rectangle
Holds the current rubberband bounds.protected boolean
Specifies if the rubberband is enabled.protected Color
Defines the color to be used for filling the rubberband selection.protected Point
Holds the point where the selection has started.protected mxGraphComponent
Reference 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.boolean
Returns the enabled state.boolean
Returns true if the given event should start the rubberband selection.void
mouseClicked
(MouseEvent arg0) void
void
mouseEntered
(MouseEvent arg0) void
mouseExited
(MouseEvent arg0) void
mouseMoved
(MouseEvent arg0) void
void
void
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
Starts 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:
mousePressed
in interfaceMouseListener
-
mouseDragged
- Specified by:
mouseDragged
in interfaceMouseMotionListener
-
mouseReleased
- Specified by:
mouseReleased
in interfaceMouseListener
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
- Specified by:
mouseExited
in interfaceMouseListener
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
-