org.jhotdraw.contrib
Class DiamondFigure
java.lang.Object
org.jhotdraw.standard.AbstractFigure
org.jhotdraw.figures.AttributeFigure
org.jhotdraw.figures.RectangleFigure
org.jhotdraw.contrib.DiamondFigure
- All Implemented Interfaces:
- java.lang.Cloneable, Figure, java.io.Serializable, Storable
- Direct Known Subclasses:
- DiamondFigureGeometricAdapter
- public class DiamondFigure
- extends RectangleFigure
A diamond with vertices at the midpoints of its enclosing rectangle
- Version:
- <$CURRENT_VERSION$>
- See Also:
- Serialized Form
Method Summary |
java.awt.Point |
chop(java.awt.Point p)
|
java.awt.Insets |
connectionInsets()
Returns the connection inset. |
Connector |
connectorAt(int x,
int y)
Returns the Figures connector for the specified location.
|
boolean |
containsPoint(int x,
int y)
Checks if a point is inside the figure. |
void |
draw(java.awt.Graphics g)
Draws the figure in the given graphics. |
protected java.awt.Polygon |
getPolygon()
|
Methods inherited from class org.jhotdraw.standard.AbstractFigure |
addDependendFigure, addFigureChangeListener, addToContainer, canConnect, center, changed, clone, connectedTextLocator, connectorVisibility, decompose, displayBox, displayBox, figures, findFigureInside, getDecoratedFigure, getDependendFigures, getTextHolder, getZValue, includes, invalidate, invalidateRectangle, isEmpty, listener, moveBy, release, removeDependendFigure, removeFigureChangeListener, removeFromContainer, setZValue, size, visit, willChange |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DiamondFigure
public DiamondFigure()
DiamondFigure
public DiamondFigure(java.awt.Point origin,
java.awt.Point corner)
getPolygon
protected java.awt.Polygon getPolygon()
- Returns:
- the polygon describing the diamond
draw
public void draw(java.awt.Graphics g)
- Description copied from class:
AttributeFigure
- Draws the figure in the given graphics. Draw is a template
method calling drawBackground followed by drawFrame.
- Specified by:
draw
in interface Figure
- Overrides:
draw
in class AttributeFigure
connectionInsets
public java.awt.Insets connectionInsets()
- Description copied from class:
AbstractFigure
- Returns the connection inset. The connection inset
defines the area where the display box of a
figure can't be connected. By default the entire
display box can be connected.
- Specified by:
connectionInsets
in interface Figure
- Overrides:
connectionInsets
in class AbstractFigure
containsPoint
public boolean containsPoint(int x,
int y)
- Description copied from class:
AbstractFigure
- Checks if a point is inside the figure.
- Specified by:
containsPoint
in interface Figure
- Overrides:
containsPoint
in class AbstractFigure
chop
public java.awt.Point chop(java.awt.Point p)
connectorAt
public Connector connectorAt(int x,
int y)
- Description copied from class:
AbstractFigure
- Returns the Figures connector for the specified location.
By default a ChopBoxConnector is returned.
- Specified by:
connectorAt
in interface Figure
- Overrides:
connectorAt
in class AbstractFigure
- See Also:
ChopBoxConnector