|
|||||||||
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(diva.canvas.GraphicsPane gpane)
Create a new SelectionDragger attached to the given graphics pane. |
Method Summary | |
---|---|
void |
addSelectionInteractor(diva.canvas.interactor.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(diva.canvas.interactor.SelectionInteractor i,
diva.canvas.Figure figure)
Contract the selection by removing an item from it and removing highlight rendering. |
void |
expandSelection(diva.canvas.interactor.SelectionInteractor i,
diva.canvas.Figure figure)
Expand the selection by adding an item to it and adding highlight rendering to it. |
diva.canvas.event.EventLayer |
getEventLayer()
Get the layer that drag events are listened on |
diva.canvas.FigureLayer |
getFigureLayer()
Get the layer that figures are selected on |
diva.canvas.OverlayLayer |
getOverlayLayer()
Get the layer that drag rectangles are drawn on |
java.awt.geom.Rectangle2D |
getSelectedArea()
|
diva.canvas.event.MouseFilter |
getSelectionFilter()
Get the mouse filter that controls when this selection filter is activated. |
diva.canvas.event.MouseFilter |
getToggleFilter()
Get the mouse filter that controls the toggling of selections |
void |
mouseDragged(diva.canvas.event.LayerEvent event)
Reshape the rubber-band, swapping coordinates if necessary. |
void |
mousePressed(diva.canvas.event.LayerEvent event)
Clear the selection, and create the rubber-band |
void |
mouseReleased(diva.canvas.event.LayerEvent event)
Delete the rubber-band |
void |
removeSelectionInteractor(diva.canvas.interactor.SelectionInteractor i)
Remove a selection interactor from the list of valid interactors. |
java.util.Iterator |
selectionInteractors()
Get the selection interactors |
void |
setEnabled(boolean enabled)
Enable/disable drag-selecting |
void |
setEventLayer(diva.canvas.event.EventLayer l)
Set the layer that drag events are listened on |
void |
setFigureLayer(diva.canvas.FigureLayer l)
Set the layer that figures are selected on |
void |
setOverlayLayer(diva.canvas.OverlayLayer l)
Set the layer that drag rectangles are drawn on |
void |
setSelectionFilter(diva.canvas.event.MouseFilter f)
Set the mouse filter that controls when this selection filter is activated. |
void |
setToggleFilter(diva.canvas.event.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(diva.canvas.GraphicsPane gpane)
Method Detail |
---|
public void addSelectionInteractor(diva.canvas.interactor.SelectionInteractor i)
public void clearSelection()
public void contractSelection(diva.canvas.interactor.SelectionInteractor i, diva.canvas.Figure figure)
public void expandSelection(diva.canvas.interactor.SelectionInteractor i, diva.canvas.Figure figure)
public diva.canvas.OverlayLayer getOverlayLayer()
public diva.canvas.event.EventLayer getEventLayer()
public diva.canvas.FigureLayer getFigureLayer()
public diva.canvas.event.MouseFilter getSelectionFilter()
public diva.canvas.event.MouseFilter getToggleFilter()
public void mouseDragged(diva.canvas.event.LayerEvent event)
mouseDragged
in interface diva.canvas.event.LayerListener
mouseDragged
in class diva.canvas.interactor.DragInteractor
public void mousePressed(diva.canvas.event.LayerEvent event)
mousePressed
in interface diva.canvas.event.LayerListener
mousePressed
in class diva.canvas.interactor.DragInteractor
public void mouseReleased(diva.canvas.event.LayerEvent event)
mouseReleased
in interface diva.canvas.event.LayerListener
mouseReleased
in class diva.canvas.interactor.DragInteractor
public void removeSelectionInteractor(diva.canvas.interactor.SelectionInteractor i)
public java.util.Iterator selectionInteractors()
public void setOverlayLayer(diva.canvas.OverlayLayer l)
public void setEventLayer(diva.canvas.event.EventLayer l)
public void setFigureLayer(diva.canvas.FigureLayer l)
public void setSelectionFilter(diva.canvas.event.MouseFilter f)
public void setToggleFilter(diva.canvas.event.MouseFilter f)
public void terminateDragSelection()
public java.awt.geom.Rectangle2D getSelectedArea()
public void setEnabled(boolean enabled)
setEnabled
in interface diva.canvas.interactor.Interactor
setEnabled
in class diva.canvas.interactor.AbstractInteractor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |