CH.ifa.draw.standard
Class DecoratorFigure
- java.lang.Object
-
- CH.ifa.draw.standard.AbstractFigure
-
- CH.ifa.draw.standard.DecoratorFigure
-
- All Implemented Interfaces:
- Figure, FigureChangeListener, Storable, java.io.Serializable, java.lang.Cloneable, java.util.EventListener
- Direct Known Subclasses:
- AnimationDecorator, BorderDecorator
public abstract class DecoratorFigure extends AbstractFigure implements FigureChangeListener
DecoratorFigure can be used to decorate other figures with decorations like borders. Decorator forwards all the methods to their contained figure. Subclasses can selectively override these methods to extend and filter their behavior.
Design Patterns
Decorator
DecoratorFigure is a decorator.- See Also:
Figure, Serialized Form
-
-
Field Summary
-
Fields inherited from interface CH.ifa.draw.framework.Figure
POPUP_MENU
-
-
Constructor Summary
Constructors Constructor and Description DecoratorFigure()DecoratorFigure(Figure figure)Constructs a DecoratorFigure and decorates the passed in figure.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidbasicDisplayBox(java.awt.Point origin, java.awt.Point corner)Forwards basicDisplayBox to its contained figure.booleancanConnect()Forwards the canConnect to its contained figure..LocatorconnectedTextLocator(Figure text)Returns the locator used to located connected text.java.awt.InsetsconnectionInsets()Forwards the connection insets to its contained figure..ConnectorconnectorAt(int x, int y)Returns the Connector for the given location.voidconnectorVisibility(boolean isVisible)Forwards the connector visibility request to its component.booleancontainsPoint(int x, int y)Forwards containsPoint to its contained figure.FigureEnumerationdecompose()Forwards decompose to its contained figure.voiddecorate(Figure figure)Decorates the given figure.java.awt.RectangledisplayBox()Forwards displayBox to its contained figure.voiddraw(java.awt.Graphics g)Forwards draw to its contained figure.voidfigureChanged(FigureChangeEvent e)Sent when a figure changedvoidfigureInvalidated(FigureChangeEvent e)Propagates invalidate up the container chain.voidfigureRemoved(FigureChangeEvent e)Sent when a figure was removedvoidfigureRequestRemove(FigureChangeEvent e)Propagates the removeFromDrawing request up to the container.voidfigureRequestUpdate(FigureChangeEvent e)Propagates figureRequestUpdate up the container chain.FigureEnumerationfigures()Forwards figures to its contained figure.FigurefindFigureInside(int x, int y)Forwards findFigureInside to its contained figure.java.lang.ObjectgetAttribute(java.lang.String name)Forwards getAttribute to its contained figure.java.util.Vectorhandles()Forwards handles to its contained figure.booleanincludes(Figure figure)Forwards includes to its contained figure.voidmoveBy(int x, int y)Forwards moveBy to its contained figure.FigurepeelDecoration()Removes the decoration from the contained figure.voidread(StorableInput dr)Reads itself and the contained figure from the StorableInput.voidrelease()Releases itself and the contained figure.voidsetAttribute(java.lang.String name, java.lang.Object value)Forwards setAttribute to its contained figure.voidwrite(StorableOutput dw)Writes itself and the contained figure to the StorableOutput.-
Methods inherited from class CH.ifa.draw.standard.AbstractFigure
addFigureChangeListener, addToContainer, center, changed, clone, displayBox, displayBox, invalidate, isEmpty, listener, removeFigureChangeListener, removeFromContainer, size, willChange
-
-
-
-
Constructor Detail
-
DecoratorFigure
public DecoratorFigure()
-
DecoratorFigure
public DecoratorFigure(Figure figure)
Constructs a DecoratorFigure and decorates the passed in figure.
-
-
Method Detail
-
connectionInsets
public java.awt.Insets connectionInsets()
Forwards the connection insets to its contained figure..- Specified by:
connectionInsetsin interfaceFigure- Overrides:
connectionInsetsin classAbstractFigure
-
canConnect
public boolean canConnect()
Forwards the canConnect to its contained figure..- Specified by:
canConnectin interfaceFigure- Overrides:
canConnectin classAbstractFigure
-
containsPoint
public boolean containsPoint(int x, int y)Forwards containsPoint to its contained figure.- Specified by:
containsPointin interfaceFigure- Overrides:
containsPointin classAbstractFigure
-
decorate
public void decorate(Figure figure)
Decorates the given figure.
-
peelDecoration
public Figure peelDecoration()
Removes the decoration from the contained figure.
-
displayBox
public java.awt.Rectangle displayBox()
Forwards displayBox to its contained figure.- Specified by:
displayBoxin interfaceFigure- Specified by:
displayBoxin classAbstractFigure- See Also:
Figure.basicDisplayBox(java.awt.Point, java.awt.Point)
-
basicDisplayBox
public void basicDisplayBox(java.awt.Point origin, java.awt.Point corner)Forwards basicDisplayBox to its contained figure.- Specified by:
basicDisplayBoxin interfaceFigure- Specified by:
basicDisplayBoxin classAbstractFigure- Parameters:
origin- the new origincorner- the new corner- See Also:
AbstractFigure.displayBox(java.awt.Point, java.awt.Point)
-
draw
public void draw(java.awt.Graphics g)
Forwards draw to its contained figure.
-
findFigureInside
public Figure findFigureInside(int x, int y)
Forwards findFigureInside to its contained figure.- Specified by:
findFigureInsidein interfaceFigure- Overrides:
findFigureInsidein classAbstractFigure- See Also:
AbstractFigure.containsPoint(int, int)
-
handles
public java.util.Vector handles()
Forwards handles to its contained figure.- Specified by:
handlesin interfaceFigure- Specified by:
handlesin classAbstractFigure- Returns:
- a Vector of handles
- See Also:
Handle
-
includes
public boolean includes(Figure figure)
Forwards includes to its contained figure.- Specified by:
includesin interfaceFigure- Overrides:
includesin classAbstractFigure
-
moveBy
public void moveBy(int x, int y)Forwards moveBy to its contained figure.- Specified by:
moveByin interfaceFigure- Overrides:
moveByin classAbstractFigure
-
release
public void release()
Releases itself and the contained figure.- Specified by:
releasein interfaceFigure- Overrides:
releasein classAbstractFigure- See Also:
Figure.release()
-
figureInvalidated
public void figureInvalidated(FigureChangeEvent e)
Propagates invalidate up the container chain.- Specified by:
figureInvalidatedin interfaceFigureChangeListener- See Also:
FigureChangeListener
-
figureChanged
public void figureChanged(FigureChangeEvent e)
Description copied from interface:FigureChangeListenerSent when a figure changed- Specified by:
figureChangedin interfaceFigureChangeListener
-
figureRemoved
public void figureRemoved(FigureChangeEvent e)
Description copied from interface:FigureChangeListenerSent when a figure was removed- Specified by:
figureRemovedin interfaceFigureChangeListener
-
figureRequestUpdate
public void figureRequestUpdate(FigureChangeEvent e)
Propagates figureRequestUpdate up the container chain.- Specified by:
figureRequestUpdatein interfaceFigureChangeListener- See Also:
FigureChangeListener
-
figureRequestRemove
public void figureRequestRemove(FigureChangeEvent e)
Propagates the removeFromDrawing request up to the container.- Specified by:
figureRequestRemovein interfaceFigureChangeListener- See Also:
FigureChangeListener
-
figures
public FigureEnumeration figures()
Forwards figures to its contained figure.- Specified by:
figuresin interfaceFigure- Overrides:
figuresin classAbstractFigure- See Also:
CompositeFigure
-
decompose
public FigureEnumeration decompose()
Forwards decompose to its contained figure.- Specified by:
decomposein interfaceFigure- Overrides:
decomposein classAbstractFigure- Returns:
- an Enumeration for a Vector with itself as the only element.
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)Forwards setAttribute to its contained figure.- Specified by:
setAttributein interfaceFigure- Overrides:
setAttributein classAbstractFigure
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
Forwards getAttribute to its contained figure.- Specified by:
getAttributein interfaceFigure- Overrides:
getAttributein classAbstractFigure
-
connectedTextLocator
public Locator connectedTextLocator(Figure text)
Returns the locator used to located connected text.- Specified by:
connectedTextLocatorin interfaceFigure- Overrides:
connectedTextLocatorin classAbstractFigure
-
connectorAt
public Connector connectorAt(int x, int y)
Returns the Connector for the given location.- Specified by:
connectorAtin interfaceFigure- Overrides:
connectorAtin classAbstractFigure- See Also:
ChopBoxConnector
-
connectorVisibility
public void connectorVisibility(boolean isVisible)
Forwards the connector visibility request to its component.- Specified by:
connectorVisibilityin interfaceFigure- Overrides:
connectorVisibilityin classAbstractFigure
-
write
public void write(StorableOutput dw)
Writes itself and the contained figure to the StorableOutput.- Specified by:
writein interfaceStorable- Overrides:
writein classAbstractFigure
-
read
public void read(StorableInput dr) throws java.io.IOException
Reads itself and the contained figure from the StorableInput.- Specified by:
readin interfaceStorable- Overrides:
readin classAbstractFigure- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG