|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.event.MouseInputAdapter
net.java.swingfx.rubberband.rubberbands.AbstractRubberBand
public abstract class AbstractRubberBand
An abstract implementation of RubberBand
which handles
the basic drawing/setup of the rubber band.
Field Summary | |
---|---|
protected RubberBandCanvas |
canvas
the canvas where the rubber band will be drawn onto |
protected Rectangle |
rubberband
maintains the size and location of the rubber band |
Constructor Summary | |
---|---|
AbstractRubberBand(RubberBandCanvas canvas)
Creates a new RubberBand and sets the canvas |
Method Summary | |
---|---|
void |
addMouseListeners()
Enforces that the mouse listeners are added to the canvas |
Rectangle |
getBounds()
Returns an integer Rectangle which contains the
size and location of this rubber band |
protected boolean |
isHideOnRelease()
Returns whether or not the rubber band should disappear after the mouse is released |
void |
mouseDragged(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
void |
setCanvas(RubberBandCanvas canvas)
Sets the canvas which the rubber band will be drawn onto |
protected void |
setHideOnRelease(boolean hideOnRelease)
Sets whether the rubber band should disappear when the mouse is released or not |
Methods inherited from class javax.swing.event.MouseInputAdapter |
---|
mouseClicked, mouseEntered, mouseExited, mouseMoved |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.java.swingfx.rubberband.rubberbands.RubberBand |
---|
draw, startRubberBand, stopRubberBand, update, updateRubberBand |
Field Detail |
---|
protected RubberBandCanvas canvas
protected Rectangle rubberband
Constructor Detail |
---|
public AbstractRubberBand(RubberBandCanvas canvas)
RubberBand
and sets the canvas
canvas
- the RubberBandCanvas
on which the rubber band
will be drawnsetCanvas(RubberBandCanvas)
Method Detail |
---|
public void addMouseListeners()
RubberBand
addMouseListeners
in interface RubberBand
public Rectangle getBounds()
RubberBand
Rectangle
which contains the
size and location of this rubber band
getBounds
in interface RubberBand
Rectangle
which contains the size and
location of this rubber bandpublic void setCanvas(RubberBandCanvas canvas)
RubberBand
setCanvas
in interface RubberBand
canvas
- the canvas which the rubber band will be drawn ontopublic void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class MouseInputAdapter
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
mousePressed
in class MouseInputAdapter
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
mouseReleased
in class MouseInputAdapter
protected void setHideOnRelease(boolean hideOnRelease)
hideOnRelease
- if true
the rubber band will
disappear when the mouse is released, if
false
the rubber band will remain
visible until a new rubber band is createdprotected boolean isHideOnRelease()
true
if the rubber band should
disappear when the mouse is released, else if
false
the rubber band should remain
visible until a new rubber band is created
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |