Package diva.canvas.interactor
Class BasicSelectionRenderer
- java.lang.Object
- 
- diva.canvas.interactor.BasicSelectionRenderer
 
- 
- All Implemented Interfaces:
- SelectionRenderer
 
 public class BasicSelectionRenderer extends java.lang.Object implements SelectionRenderer A basic implementation of a selection renderer. This implementation wraps each selected figure in an instance of a FigureDecorator. The figure decorator is obtained by cloning a prototype decorator, accessible through the get/setFigureDecorator() methods. The default prototype is an instance of BasicHighlighter. Often, the prototype decorator will be set to instances of one of the Manipulator classes.- Version:
- $Id$
- Author:
- John Reekie
 
- 
- 
Constructor SummaryConstructors Constructor Description BasicSelectionRenderer()Create a new selection renderer with the default prototype decorator.BasicSelectionRenderer(FigureDecorator d)Create a new renderer with the given prototype decorator.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description FigureDecoratorgetDecorator()Get the prototype decorator.booleanisRenderedSelected(Figure figure)Test if the given figure is currently rendered selected.voidrenderDeselected(Figure figure)Set the rendering of the figure as deselected.voidrenderSelected(Figure figure)Set the rendering of the figure as selected.voidsetDecorator(FigureDecorator d)Set the prototype decorator.
 
- 
- 
- 
Constructor Detail- 
BasicSelectionRendererpublic BasicSelectionRenderer() Create a new selection renderer with the default prototype decorator.
 - 
BasicSelectionRendererpublic BasicSelectionRenderer(FigureDecorator d) Create a new renderer with the given prototype decorator.
 
- 
 - 
Method Detail- 
getDecoratorpublic FigureDecorator getDecorator() Get the prototype decorator.
 - 
isRenderedSelectedpublic boolean isRenderedSelected(Figure figure) Test if the given figure is currently rendered selected.- Specified by:
- isRenderedSelectedin interface- SelectionRenderer
 
 - 
renderDeselectedpublic void renderDeselected(Figure figure) Set the rendering of the figure as deselected. The figure has the decorator unwrapped off it and is inserted back into its parent figure container, if there is one. If the figure is not rendered selected, do nothing.- Specified by:
- renderDeselectedin interface- SelectionRenderer
 
 - 
renderSelectedpublic void renderSelected(Figure figure) Set the rendering of the figure as selected. If the figure is already rendered selected, just repaint. Otherwise create a new BasicHighlighter, and wrap the figure in the decorator, inserting the decorator into the figure's parent.- Specified by:
- renderSelectedin interface- SelectionRenderer
 
 - 
setDecoratorpublic void setDecorator(FigureDecorator d) Set the prototype decorator.
 
- 
 
-