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

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.XEllipseFigure
All Implemented Interfaces:
CH.ifa.draw.framework.Figure, CH.ifa.draw.util.Storable, java.io.Serializable, java.lang.Cloneable, ChildFigure, Colorizable
Direct Known Subclasses:
XCircleFigure

public class XEllipseFigure
extends XRectangleFigure

Extended ellipse figure.

Author:
Heiko Erhardt
See Also:
Serialized Form

Field Summary
protected  int frameCount
          Number of frames
 
Fields inherited from class org.openbp.cockpit.modeler.figures.generic.XRectangleFigure
barHeight, box, 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
XEllipseFigure()
          Default constructor.
 
Method Summary
 java.awt.Insets connectionInsets()
           
 CH.ifa.draw.framework.Connector connectorAt(int x, int y)
           
 boolean containsPoint(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.
protected  void drawFigure(java.awt.Graphics g)
          Draws the figure.
protected  void drawFrame(java.awt.Graphics g)
          Draws the frame of the figure.
 java.awt.Rectangle ellipseBox()
          Returns the rectangle that determines the ellipse.
 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.XRectangleFigure
basicDisplayBox, basicMoveBy, displayBox, drawAppliances, handles
 
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, 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, center, connectedTextLocator, 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

frameCount

protected int frameCount
Number of frames

Constructor Detail

XEllipseFigure

public XEllipseFigure()
Default constructor.

Method Detail

ellipseBox

public java.awt.Rectangle ellipseBox()
Returns the rectangle that determines the ellipse. Usually, this equals the display box. However, if some subclass wants to constrain the ellipse, this may differ.

Returns:
The ellipse rectangle

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 XRectangleFigure

containsPoint

public boolean containsPoint(int x,
                             int y)
Specified by:
containsPoint in interface CH.ifa.draw.framework.Figure
Overrides:
containsPoint in class CH.ifa.draw.standard.AbstractFigure

connectionInsets

public java.awt.Insets connectionInsets()
Specified by:
connectionInsets in interface CH.ifa.draw.framework.Figure
Overrides:
connectionInsets in class CH.ifa.draw.standard.AbstractFigure

connectorAt

public CH.ifa.draw.framework.Connector connectorAt(int x,
                                                   int y)
Specified by:
connectorAt in interface CH.ifa.draw.framework.Figure
Overrides:
connectorAt in class CH.ifa.draw.standard.AbstractFigure

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

createShape

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

Overrides:
createShape in class XRectangleFigure
Returns:
The shape (a java.awt.geom.Ellipse2D)

createRectangularShape

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

Overrides:
createRectangularShape in class XRectangleFigure
Returns:
The shape (a java.awt.geom.Ellipse2D)

drawFigure

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

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

drawFrame

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

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


Copyright © 2011. All Rights Reserved.