public class mxRubberband extends Object implements MouseListener, MouseMotionListener
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
mxRubberband(mxGraphComponent graphComponent)
Constructs a new rubberband selection for the given graph component.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected Color borderColor
protected Color fillColor
protected mxGraphComponent graphComponent
protected boolean enabled
protected transient Point first
protected transient Rectangle bounds
public mxRubberband(mxGraphComponent graphComponent)
graphComponent
- Component that contains the rubberband.public boolean isEnabled()
public void setEnabled(boolean enabled)
public Color getBorderColor()
public void setBorderColor(Color value)
public Color getFillColor()
public void setFillColor(Color value)
public boolean isRubberbandTrigger(MouseEvent e)
public void start(Point point)
public void reset()
public Object[] select(Rectangle rect, MouseEvent e)
rect
- e
- public void paintRubberband(Graphics g)
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseClicked(MouseEvent arg0)
mouseClicked
in interface MouseListener
public void mouseEntered(MouseEvent arg0)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent arg0)
mouseExited
in interface MouseListener
public void mouseMoved(MouseEvent arg0)
mouseMoved
in interface MouseMotionListener
Copyright (c) 2010-2017 Gaudenz Alder, JGraph Ltd. All rights reserved.