|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.interactor.AbstractInteractor
diva.canvas.interactor.DragInteractor
jsky.image.graphics.SelectionDragger
public class SelectionDragger
A class that implements rubber-banding on a canvas. It contains references to one or more instances of SelectionInteractor, which it notifies whenever dragging on the canvas covers or uncovers items. The SelectionDragger requires three layers: an Event Layer, which it listens to perform drag-selection, an OutlineLayer, on which it draws the drag-selection box, and a FigureLayer, which it selects figures on. It can also accept a GraphicsPane in its constructor, in which case it will use the background event layer, outline layer, and foreground event layer from that pane.
Constructor Summary | |
---|---|
SelectionDragger()
Create a new SelectionDragger |
|
SelectionDragger(GraphicsPane gpane)
Create a new SelectionDragger attached to the given graphics pane. |
Method Summary | |
---|---|
void |
addSelectionInteractor(SelectionInteractor i)
Add a selection interactor to the list of valid interactor. |
void |
clearSelection()
Clear the selection in all the relevant selection interactors. |
void |
contractSelection(SelectionInteractor i,
Figure figure)
Contract the selection by removing an item from it and removing highlight rendering. |
void |
expandSelection(SelectionInteractor i,
Figure figure)
Expand the selection by adding an item to it and adding highlight rendering to it. |
EventLayer |
getEventLayer()
Get the layer that drag events are listened on |
FigureLayer |
getFigureLayer()
Get the layer that figures are selected on |
OverlayLayer |
getOverlayLayer()
Get the layer that drag rectangles are drawn on |
Rectangle2D |
getSelectedArea()
|
MouseFilter |
getSelectionFilter()
Get the mouse filter that controls when this selection filter is activated. |
MouseFilter |
getToggleFilter()
Get the mouse filter that controls the toggling of selections |
void |
mouseDragged(LayerEvent event)
Reshape the rubber-band, swapping coordinates if necessary. |
void |
mousePressed(LayerEvent event)
Clear the selection, and create the rubber-band |
void |
mouseReleased(LayerEvent event)
Delete the rubber-band |
void |
removeSelectionInteractor(SelectionInteractor i)
Remove a selection interactor from the list of valid interactors. |
Iterator |
selectionInteractors()
Get the selection interactors |
void |
setEnabled(boolean enabled)
Enable/disable drag-selecting |
void |
setEventLayer(EventLayer l)
Set the layer that drag events are listened on |
void |
setFigureLayer(FigureLayer l)
Set the layer that figures are selected on |
void |
setOverlayLayer(OverlayLayer l)
Set the layer that drag rectangles are drawn on |
void |
setSelectionFilter(MouseFilter f)
Set the mouse filter that controls when this selection filter is activated. |
void |
setToggleFilter(MouseFilter f)
Set the mouse filter that controls the toggling of selections. |
void |
terminateDragSelection()
Terminate drag-selection operation. |
Methods inherited from class diva.canvas.interactor.DragInteractor |
---|
addLayerListener, appendConstraint, constrainPoint, fireLayerEvent, getSelectiveEnabled, getTargetArray, getX, getY, prependConstraint, removeLayerListener, setSelectiveEnabled, setTargetArray, setup, targets, translate |
Methods inherited from class diva.canvas.interactor.AbstractInteractor |
---|
accept, getMouseFilter, isConsuming, isEnabled, isMotionEnabled, mouseClicked, mouseEntered, mouseExited, mouseMoved, setConsuming, setMotionEnabled, setMouseFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SelectionDragger()
public SelectionDragger(GraphicsPane gpane)
Method Detail |
---|
public void addSelectionInteractor(SelectionInteractor i)
public void clearSelection()
public void contractSelection(SelectionInteractor i, Figure figure)
public void expandSelection(SelectionInteractor i, Figure figure)
public OverlayLayer getOverlayLayer()
public EventLayer getEventLayer()
public FigureLayer getFigureLayer()
public MouseFilter getSelectionFilter()
public MouseFilter getToggleFilter()
public void mouseDragged(LayerEvent event)
mouseDragged
in interface LayerListener
mouseDragged
in class DragInteractor
public void mousePressed(LayerEvent event)
mousePressed
in interface LayerListener
mousePressed
in class DragInteractor
public void mouseReleased(LayerEvent event)
mouseReleased
in interface LayerListener
mouseReleased
in class DragInteractor
public void removeSelectionInteractor(SelectionInteractor i)
public Iterator selectionInteractors()
public void setOverlayLayer(OverlayLayer l)
public void setEventLayer(EventLayer l)
public void setFigureLayer(FigureLayer l)
public void setSelectionFilter(MouseFilter f)
public void setToggleFilter(MouseFilter f)
public void terminateDragSelection()
public Rectangle2D getSelectedArea()
public void setEnabled(boolean enabled)
setEnabled
in interface Interactor
setEnabled
in class AbstractInteractor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |