uk.ac.starlink.diva
Class DrawGraphicsPane

java.lang.Object
  extended by diva.canvas.CanvasPane
      extended by diva.canvas.GraphicsPane
          extended by uk.ac.starlink.diva.DrawGraphicsPane
All Implemented Interfaces:
CanvasComponent, EventAcceptor

public class DrawGraphicsPane
extends GraphicsPane

The pane for displaying any interactive graphic Figures associated with a Draw. The graphics will normally be created by an instance of the DrawActions class.

Also provides a listener mechanism for Figure changes (selection, dragging).

Version:
$Id$
Author:
Peter W. Draper
See Also:
Draw, DrawActions

Field Summary
 
Fields inherited from class diva.canvas.GraphicsPane
_backgroundEventLayer, _backgroundLayer, _foregroundEventLayer, _foregroundLayer, _layers, _overlayLayer
 
Constructor Summary
DrawGraphicsPane(FigureDecorator decorator)
          Constructor accepts a FigureDecorator.
 
Method Summary
 void addFigure(Figure figure)
          Add an existing Figure.
 void addFigureDraggerListener(FigureListener l)
          Add a FigureListener to the DragRegion used for interacting with figures.
 void addSelectionListener(SelectionListener l)
          Add a listener for any SelectionEvents.
 void addZoomDraggerListener(FigureListener l)
          Add a FigureListener to the DragRegion used for non-figure selection work.
 void clearSelection()
          Clear the selection.
 void disableFigureDraggerSelection()
          Switch off selection using the drag box interactor.
 void enableFigureDraggerSelection()
          Switch selection using the drag box interactor back on.
 DrawController getController()
          Get the controller.
 FigureLayer getFigureLayer()
          Get the figure layer that we draw into.
 FigureProps getFigureProps(Figure figure)
          Return the current properties of a figure.
 Object[] getSelectionAsArray()
          Get a list of the currently selected Figures.
 SelectionInteractor getSelectionInteractor()
          Get the selection interactor.
 int indexOf(Figure figure)
          Get the index of a Figure in the Figure Layer.
 void lowerFigure(Figure figure)
          Lower a Figure to the bottom of the ZList.
 void raiseFigure(Figure figure)
          Raise a figure to the front of the ZList.
 void removeFigure(Figure figure)
          Remove a Figure.
 void removeFigureDraggerListener(FigureListener l)
          Remove a FigureListener to the DragRegion used for interacting with figures.
 void removeZoomDraggerListener(FigureListener l)
          Remove a FigureListener from the DragRegion used for non-figure selection work.
 void select(Figure figure)
          Select the given figure.
 
Methods inherited from class diva.canvas.GraphicsPane
_rebuildLayerArray, getBackgroundEventLayer, getBackgroundLayer, getForegroundEventLayer, getForegroundLayer, getOverlayLayer, layersFromBack, layersFromFront, setBackgroundEventLayer, setBackgroundLayer, setForegroundEventLayer, setForegroundLayer, setOverlayLayer
 
Methods inherited from class diva.canvas.CanvasPane
_initNewLayer, _nullifyLayer, dispatchEvent, getCanvas, getParent, getSize, getToolTipText, getTransformContext, isAntialiasing, isEnabled, layers, paint, paint, processLayerEvent, repaint, repaint, scale, setAntialiasing, setCanvas, setEnabled, setParent, setSize, setSize, setTransform, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawGraphicsPane

public DrawGraphicsPane(FigureDecorator decorator)
Constructor accepts a FigureDecorator. Normally this will be tuned to interact with all the types of figures that will be offered (see DrawActions and the TypedDecorator it creates).

Method Detail

addFigure

public void addFigure(Figure figure)
Add an existing Figure.


indexOf

public int indexOf(Figure figure)
Get the index of a Figure in the Figure Layer.


lowerFigure

public void lowerFigure(Figure figure)
Lower a Figure to the bottom of the ZList.


raiseFigure

public void raiseFigure(Figure figure)
Raise a figure to the front of the ZList.


getSelectionInteractor

public SelectionInteractor getSelectionInteractor()
Get the selection interactor.


getController

public DrawController getController()
Get the controller.


addSelectionListener

public void addSelectionListener(SelectionListener l)
Add a listener for any SelectionEvents.


getSelectionAsArray

public Object[] getSelectionAsArray()
Get a list of the currently selected Figures.


clearSelection

public void clearSelection()
Clear the selection.


select

public void select(Figure figure)
Select the given figure.


getFigureLayer

public FigureLayer getFigureLayer()
Get the figure layer that we draw into.


addFigureDraggerListener

public void addFigureDraggerListener(FigureListener l)
Add a FigureListener to the DragRegion used for interacting with figures.


removeFigureDraggerListener

public void removeFigureDraggerListener(FigureListener l)
Remove a FigureListener to the DragRegion used for interacting with figures.


addZoomDraggerListener

public void addZoomDraggerListener(FigureListener l)
Add a FigureListener to the DragRegion used for non-figure selection work.


removeZoomDraggerListener

public void removeZoomDraggerListener(FigureListener l)
Remove a FigureListener from the DragRegion used for non-figure selection work.


removeFigure

public void removeFigure(Figure figure)
Remove a Figure.

Parameters:
figure - the figure to remove.

getFigureProps

public FigureProps getFigureProps(Figure figure)
Return the current properties of a figure.


disableFigureDraggerSelection

public void disableFigureDraggerSelection()
Switch off selection using the drag box interactor.


enableFigureDraggerSelection

public void enableFigureDraggerSelection()
Switch selection using the drag box interactor back on.



Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.