|
||||||||||
| 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
diva.canvas.interactor.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 interactor)
Add the selection model of the given selection interactor to the set of selection models selected by this dragger. |
void |
addSelectionModel(SelectionModel model)
Add the given selection model to the set of selection models selected by this dragger. |
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 |
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 |
removeSelectionModel(SelectionModel model)
Remove a selection model from the list of models selected by this dragger. |
java.util.Iterator |
selectionModels()
Get the selection interactors |
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, setEnabled, 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 addSelectionModel(SelectionModel model)
public void addSelectionInteractor(SelectionInteractor interactor)
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 LayerListenermouseDragged in class DragInteractorpublic void mousePressed(LayerEvent event)
mousePressed in interface LayerListenermousePressed in class DragInteractorpublic void mouseReleased(LayerEvent event)
mouseReleased in interface LayerListenermouseReleased in class DragInteractorpublic void removeSelectionModel(SelectionModel model)
public java.util.Iterator selectionModels()
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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||