|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.vergil.kernel.AnimationRenderer
public class AnimationRenderer
An implementation of a selection renderer that is used for animation. It highlights specified figures by wrapping them 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 that highlights in red.
This class is fashioned after BasicSelectionRenderer, but differs in that it ensures that selection and deselection occurs in the event thread. Also, it highlights objects in red rather than yellow.
Red (johnr) |
Red (eal) |
Field Summary | |
---|---|
private java.util.Hashtable |
_decorators
Mapping from figures to decorators |
protected FigureDecorator |
_prototypeDecorator
The prototype decorator. |
Constructor Summary | |
---|---|
AnimationRenderer()
Create a new selection renderer with the default prototype decorator. |
|
AnimationRenderer(java.awt.Color color)
Create a new selection renderer with the default prototype decorator using the specified color. |
|
AnimationRenderer(java.awt.Color color,
java.awt.Stroke stroke)
Create a new selection renderer with the default prototype decorator using the specified color and stroke. |
|
AnimationRenderer(FigureDecorator decorator)
Create a new renderer with the given prototype decorator. |
Method Summary | |
---|---|
FigureDecorator |
getDecorator()
Get the prototype decorator. |
boolean |
isRenderedSelected(Figure figure)
Test whether the given figure is currently rendered highlighted. |
void |
renderDeselected(Figure figure)
Set the rendering of the figure to not be highlighted. |
void |
renderSelected(Figure figure)
Set the rendering of the figure as highlighted. |
void |
setDecorator(FigureDecorator decorator)
Set the prototype decorator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected FigureDecorator _prototypeDecorator
private java.util.Hashtable _decorators
Constructor Detail |
---|
public AnimationRenderer()
public AnimationRenderer(java.awt.Color color)
color
- The color for the highlight.public AnimationRenderer(java.awt.Color color, java.awt.Stroke stroke)
color
- The color for the highlight.stroke
- The stroke for the highlight.public AnimationRenderer(FigureDecorator decorator)
decorator
- The prototype decorator.Method Detail |
---|
public FigureDecorator getDecorator()
setDecorator(FigureDecorator)
public boolean isRenderedSelected(Figure figure)
isRenderedSelected
in interface SelectionRenderer
figure
- The figure that may be highlighted.
public void renderDeselected(Figure figure)
renderDeselected
in interface SelectionRenderer
figure
- The figure to deselect.public void renderSelected(Figure figure)
renderSelected
in interface SelectionRenderer
figure
- The figure to highlight.public void setDecorator(FigureDecorator decorator)
decorator
- The prototype decorator.getDecorator()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |