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

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
                  extended by org.openbp.cockpit.modeler.figures.generic.XPolygonFigure
                      extended by org.openbp.cockpit.modeler.figures.generic.XDiamondFigure
All Implemented Interfaces:
CH.ifa.draw.framework.Figure, CH.ifa.draw.util.Storable, java.io.Serializable, java.lang.Cloneable, ChildFigure, Colorizable

public class XDiamondFigure
extends XPolygonFigure

Extended diamond figure.

Author:
Erich Lauterbach
See Also:
Serialized Form

Field Summary
static double TOLERANCE
          Angle tolerance for snap points
 
Fields inherited from class org.openbp.cockpit.modeler.figures.generic.XPolygonFigure
polygon
 
Fields inherited from class org.openbp.cockpit.modeler.figures.generic.XRectangleFigure
barHeight, box, frameCount, frameDistance, nBars
 
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
XDiamondFigure()
          Constructor.
 
Method Summary
 double convertToStandardAngle(double angle)
          Normalize the angle to the standard convention
 java.awt.Polygon getPolygon()
          Returns the polygon describing the diamond.
 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.XPolygonFigure
center, changed, connectionInsets, containsPoint, createShape, drawFigure, drawFrame, handles
 
Methods inherited from class org.openbp.cockpit.modeler.figures.generic.XRectangleFigure
basicDisplayBox, basicMoveBy, createRectangularShape, displayBox, drawAppliances, initialize
 
Methods inherited from class org.openbp.cockpit.modeler.figures.generic.XFigure
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, connectedTextLocator, connectorAt, connectorVisibility, 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, connectedTextLocator, connectorAt, connectorVisibility, 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

TOLERANCE

public static final double TOLERANCE
Angle tolerance for snap points

See Also:
Constant Field Values
Constructor Detail

XDiamondFigure

public XDiamondFigure()
Constructor.

Method Detail

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.

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

getPolygon

public java.awt.Polygon getPolygon()
Returns the polygon describing the diamond.

Specified by:
getPolygon in class XPolygonFigure

convertToStandardAngle

public double convertToStandardAngle(double angle)
Normalize the angle to the standard convention

Parameters:
angle - The angle to be normalized
Returns:
The normalized angle


Copyright © 2011. All Rights Reserved.