|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object diva.canvas.AbstractFigure diva.canvas.AbstractFigureContainer diva.canvas.FigureDecorator diva.canvas.toolbox.TypedDecorator
public class TypedDecorator
A FigureDecorator implementation which simply acts as a set of prototypes which can be instantiated according to the type of object the decorator is applied to. Instances of this class will throw an exception if they are actually placed into a figure hierarchy. They can, however, be passed to methods that expect a decorator instance that is to be used as a prototype for other instances.
Red |
Field Summary | |
---|---|
private FigureDecorator |
_defaultDecorator
The default prototype decorator. |
private java.util.Hashtable |
_typedDecorators
The prototypes indexed by type. |
Constructor Summary | |
---|---|
TypedDecorator()
A typed decorator that uses a BasicHighlighter as its default. |
|
TypedDecorator(FigureDecorator defaultDecorator)
A typed decorator with the given decorator as its default. |
Method Summary | |
---|---|
void |
addDecorator(java.lang.Class c,
FigureDecorator d)
Add a decorator which is duplicated when an object of the given class is passed to the newInstance() method. |
FigureDecorator |
newInstance(Figure f)
Return a new decorator, according to the type of the figure. |
void |
removeDecorator(java.lang.Class c)
Remove a decorator. |
void |
setParent(CanvasComponent fc)
Throw an exception. |
Methods inherited from class diva.canvas.FigureDecorator |
---|
add, contains, figures, figuresFromBack, figuresFromFront, getBounds, getChild, getContainer, getDecoratedFigure, getFigureCount, getShape, hit, paint, remove, replaceChild, setChild, transform, translate |
Methods inherited from class diva.canvas.AbstractFigureContainer |
---|
decorate, pick, pick, repaint, undecorate |
Methods inherited from class diva.canvas.AbstractFigure |
---|
contains, getInteractor, getLayer, getOrigin, getParent, getToolTipText, getTransformContext, getUserObject, intersects, isVisible, paint, repaint, setInteractor, setToolTipText, setUserObject, setVisible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface diva.canvas.VisibleComponent |
---|
isVisible, paint, setVisible |
Methods inherited from interface diva.canvas.CanvasComponent |
---|
getParent, getTransformContext, repaint |
Field Detail |
---|
private FigureDecorator _defaultDecorator
private java.util.Hashtable _typedDecorators
Constructor Detail |
---|
public TypedDecorator()
public TypedDecorator(FigureDecorator defaultDecorator)
Method Detail |
---|
public void addDecorator(java.lang.Class c, FigureDecorator d)
public FigureDecorator newInstance(Figure f)
newInstance
in class FigureDecorator
public void removeDecorator(java.lang.Class c)
public void setParent(CanvasComponent fc)
setParent
in interface Figure
setParent
in class AbstractFigure
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |