org.openbp.cockpit.modeler.figures.generic
Class BasicFigure

java.lang.Object
  extended by CH.ifa.draw.standard.AbstractFigure
      extended by org.openbp.cockpit.modeler.figures.generic.BasicFigure
All Implemented Interfaces:
CH.ifa.draw.framework.Figure, CH.ifa.draw.util.Storable, java.io.Serializable, java.lang.Cloneable, ChildFigure, Colorizable
Direct Known Subclasses:
XFigure, XTextFigure

public abstract class BasicFigure
extends CH.ifa.draw.standard.AbstractFigure
implements ChildFigure, Colorizable

Extended figure.

Author:
Heiko Erhardt
See Also:
Serialized Form

Field Summary
static java.lang.String DECO_FILLCOLOR
          Decoration key for the fill color (used with Color objects)
static java.lang.String DECO_OVERLAY
          Decoration key for overlay figures (used with Figure objects)
 
Fields inherited from interface CH.ifa.draw.framework.Figure
POPUP_MENU
 
Constructor Summary
BasicFigure()
          Default constructor.
 
Method Summary
 java.lang.Object clone()
          Creates a clone of this object.
protected  java.lang.Object decorateValue(java.lang.String key, java.lang.Object value)
          Determines the decoration for this figure using the given key.
 void draw(java.awt.Graphics g)
          Draws the figure in the given graphics.
protected  void drawFigure(java.awt.Graphics g)
          Draws the figure.
 java.lang.Object getDecorationOwner()
          Returns the decoration owner.
 java.awt.Color getDefaultFillColor()
          Gets the default fill color.
 java.awt.Color getFillColor()
          Gets the fill color.
 CH.ifa.draw.framework.Figure getParent()
          Gets the parent figure of this figure.
 void setFillColor(java.awt.Color fillColor)
          Sets the fill color.
 void setParent(CH.ifa.draw.framework.Figure parent)
          Sets the parent figure of this figure.
 
Methods inherited from class CH.ifa.draw.standard.AbstractFigure
addFigureChangeListener, addToContainer, basicDisplayBox, basicMoveBy, canConnect, center, changed, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, displayBox, figures, findFigureInside, getAttribute, getZValue, handles, includes, invalidate, isEmpty, listener, moveBy, read, release, removeFigureChangeListener, removeFromContainer, setAttribute, setZValue, size, willChange, write
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface CH.ifa.draw.framework.Figure
addFigureChangeListener, addToContainer, basicDisplayBox, canConnect, center, changed, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, displayBox, figures, findFigureInside, getAttribute, getZValue, handles, includes, invalidate, isEmpty, listener, moveBy, release, removeFigureChangeListener, removeFromContainer, setAttribute, setZValue, size, willChange
 
Methods inherited from interface CH.ifa.draw.util.Storable
read, write
 

Field Detail

DECO_FILLCOLOR

public static final java.lang.String DECO_FILLCOLOR
Decoration key for the fill color (used with Color objects)

See Also:
Constant Field Values

DECO_OVERLAY

public static final java.lang.String DECO_OVERLAY
Decoration key for overlay figures (used with Figure objects)

See Also:
Constant Field Values
Constructor Detail

BasicFigure

public BasicFigure()
Default constructor.

Method Detail

clone

public java.lang.Object clone()
Creates a clone of this object.

Specified by:
clone in interface CH.ifa.draw.framework.Figure
Overrides:
clone in class CH.ifa.draw.standard.AbstractFigure

decorateValue

protected java.lang.Object decorateValue(java.lang.String key,
                                         java.lang.Object value)
Determines the decoration for this figure using the given key. The method will use the getDecorationOwner() method to determine the owner of the figure.

Parameters:
key - Decoration key
value - Value used for the decoration
Returns:
The decorated value

getDecorationOwner

public java.lang.Object getDecorationOwner()
Returns the decoration owner.

Returns:
The parent of this figure (can be null)

draw

public void draw(java.awt.Graphics g)
Draws the figure in the given graphics. Template method calling drawFigure(java.awt.Graphics).

Specified by:
draw in interface CH.ifa.draw.framework.Figure
Specified by:
draw in class CH.ifa.draw.standard.AbstractFigure
Parameters:
g - Graphics to draw to
See Also:
AbstractFigure.draw(Graphics g)

drawFigure

protected void drawFigure(java.awt.Graphics g)
Draws the figure.

Parameters:
g - Graphics to draw to

getParent

public CH.ifa.draw.framework.Figure getParent()
Description copied from interface: ChildFigure
Gets the parent figure of this figure.

Specified by:
getParent in interface ChildFigure
Returns:
The parent or null if the figure does not have a parent
See Also:
ChildFigure.getParent()

setParent

public void setParent(CH.ifa.draw.framework.Figure parent)
Description copied from interface: ChildFigure
Sets the parent figure of this figure.

Specified by:
setParent in interface ChildFigure
Parameters:
parent - The parent or null if the figure does not have a parent
See Also:
ChildFigure.setParent(Figure)

getFillColor

public java.awt.Color getFillColor()
Gets the fill color.

Specified by:
getFillColor in interface Colorizable
Returns:
Fill color or null for no fill color

setFillColor

public void setFillColor(java.awt.Color fillColor)
Sets the fill color.

Specified by:
setFillColor in interface Colorizable
Parameters:
fillColor - Fill color or null for no fill color

getDefaultFillColor

public java.awt.Color getDefaultFillColor()
Gets the default fill color.

Specified by:
getDefaultFillColor in interface Colorizable
Returns:
Default fill color or null for no fill color


Copyright © 2011. All Rights Reserved.