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

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

public class XRectangleFigure
extends XFigure

Extended rectangle figure.

Author:
Heiko Erhardt
See Also:
Serialized Form

Field Summary
protected  int barHeight
          Bar height
protected  java.awt.Rectangle box
          Display box
protected  int frameCount
          Number of frames
protected  int frameDistance
          Distance between figure and frame
protected  int nBars
          Number of bars to draw
 
Fields inherited from class org.openbp.cockpit.modeler.figures.generic.XFigure
DECO_FILLCOLOR2, DECO_FRAMECOLOR, DECO_FRAMESTROKE, descriptor, needUpdatePaint, paint
 
Fields inherited from class org.openbp.cockpit.modeler.figures.generic.BasicFigure
DECO_FILLCOLOR, DECO_OVERLAY
 
Fields inherited from interface CH.ifa.draw.framework.Figure
POPUP_MENU
 
Constructor Summary
XRectangleFigure()
          Default constructor.
 
Method Summary
 void basicDisplayBox(java.awt.Point origin, java.awt.Point corner)
           
protected  void basicMoveBy(int x, int y)
           
 java.awt.geom.RectangularShape createRectangularShape()
          Creates a rectangular shape object that defines the outline of the figure.
 java.awt.Shape createShape()
          Creates a shape object that defines the outline of the figure.
 java.awt.Rectangle displayBox()
           
protected  void drawAppliances(java.awt.Graphics g)
          Draws additional frame parts.
protected  void drawFigure(java.awt.Graphics g)
          Draws the figure.
protected  void drawFrame(java.awt.Graphics g)
          Draws the frame of the figure.
 java.util.Vector handles()
           
 void initialize()
          Initializes the figure after all information from the figure descriptor has been set.
 java.awt.Rectangle placeAdjacent(java.awt.Rectangle rect, double angle)
          Places the given rectangle so that its center is in the given direction and it exactly touches the node, without crossing any lines.
 
Methods inherited from class org.openbp.cockpit.modeler.figures.generic.XFigure
changed, clone, draw, drawImage, getDefaultFillColor, getDefaultFillColor2, getDefaultFrameColor, getDescriptor, getFillColor2, getFrameColor, getFrameStroke, getImageIcon, getOrientation, requestPaintUpdate, setDescriptor, setFillColor, setFillColor2, setFrameColor, setFrameStroke, setImageIcon, setOrientation, updatePaint
 
Methods inherited from class org.openbp.cockpit.modeler.figures.generic.BasicFigure
decorateValue, getDecorationOwner, getFillColor, getParent, setParent
 
Methods inherited from class CH.ifa.draw.standard.AbstractFigure
addFigureChangeListener, addToContainer, canConnect, center, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, figures, findFigureInside, getAttribute, getZValue, 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, canConnect, center, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, figures, findFigureInside, getAttribute, getZValue, 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

frameDistance

protected int frameDistance
Distance between figure and frame


frameCount

protected int frameCount
Number of frames


barHeight

protected int barHeight
Bar height


nBars

protected int nBars
Number of bars to draw


box

protected java.awt.Rectangle box
Display box

Constructor Detail

XRectangleFigure

public XRectangleFigure()
Default constructor.

Method Detail

basicDisplayBox

public void basicDisplayBox(java.awt.Point origin,
                            java.awt.Point corner)
Specified by:
basicDisplayBox in interface CH.ifa.draw.framework.Figure
Specified by:
basicDisplayBox in class CH.ifa.draw.standard.AbstractFigure
See Also:
AbstractFigure.basicDisplayBox(Point origin, Point corner)

handles

public java.util.Vector handles()
Specified by:
handles in interface CH.ifa.draw.framework.Figure
Specified by:
handles in class CH.ifa.draw.standard.AbstractFigure
See Also:
AbstractFigure.handles()

displayBox

public java.awt.Rectangle displayBox()
Specified by:
displayBox in interface CH.ifa.draw.framework.Figure
Specified by:
displayBox in class CH.ifa.draw.standard.AbstractFigure
See Also:
AbstractFigure.displayBox()

basicMoveBy

protected void basicMoveBy(int x,
                           int y)
Specified by:
basicMoveBy in class CH.ifa.draw.standard.AbstractFigure
See Also:
AbstractFigure.basicMoveBy(int x, int y)

initialize

public void initialize()
Initializes the figure after all information from the figure descriptor has been set. Used to parse tagged values of the figure descriptor:
arc-width
arc-height

Overrides:
initialize in class XFigure

drawFigure

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

Overrides:
drawFigure in class BasicFigure
Parameters:
g - Graphics to draw to

drawFrame

protected void drawFrame(java.awt.Graphics g)
Draws the frame of the figure.

Overrides:
drawFrame in class XFigure
Parameters:
g - Graphics to draw to

drawAppliances

protected void drawAppliances(java.awt.Graphics g)
Draws additional frame parts.

Overrides:
drawAppliances in class XFigure
Parameters:
g - Graphics to draw to

placeAdjacent

public java.awt.Rectangle placeAdjacent(java.awt.Rectangle rect,
                                        double angle)
Places the given rectangle so that its center is in the given direction and it exactly touches the node, without crossing any lines.

Specified by:
placeAdjacent in class XFigure
Parameters:
rect - The rectangle to adjust
angle - The direction in which the rectangle should be placed
Returns:
The translated rectangle

createShape

public java.awt.Shape createShape()
Creates a shape object that defines the outline of the figure.

Overrides:
createShape in class XFigure
Returns:
The shape (a java.awt.geom.Rectangle2D)

createRectangularShape

public java.awt.geom.RectangularShape createRectangularShape()
Creates a rectangular shape object that defines the outline of the figure.

Overrides:
createRectangularShape in class XFigure
Returns:
The shape (a java.awt.geom.Rectangle2D)


Copyright © 2011. All Rights Reserved.