|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jhotdraw.draw.AbstractFigure
org.jhotdraw.draw.AttributedFigure
org.jhotdraw.draw.RectangleFigure
org.jhotdraw.draw.TriangleFigure
public class TriangleFigure
A triangle with same dimensions as its enclosing rectangle, and apex at any of 8 places
| Field Summary | |
|---|---|
private int |
fRotation
|
(package private) static double[] |
rotations
|
| Constructor Summary | |
|---|---|
TriangleFigure()
|
|
TriangleFigure(java.awt.Point origin,
java.awt.Point corner)
|
|
| Method Summary | |
|---|---|
java.awt.Point |
center()
Gets the center of a figure. |
java.awt.Point |
chop(java.awt.Point p)
|
java.lang.Object |
clone()
Clones a figure. |
java.awt.Insets |
connectionInsets()
Returns the connection inset. |
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. |
java.awt.Polygon |
getPolygon()
Return the polygon describing the triangle |
double |
getRotationAngle()
|
HandleEnumeration |
handles()
Returns the handles of a Figure that can be used to manipulate some of its attributes. |
void |
read(StorableInput dr)
Reads the Figure from a StorableInput. |
void |
rotate(double angle)
|
void |
write(StorableOutput dw)
Stores the Figure to a StorableOutput. |
| Methods inherited from class org.jhotdraw.draw.RectangleFigure |
|---|
basicDisplayBox, basicMoveBy, displayBox, drawBackground, drawFrame |
| Methods inherited from class org.jhotdraw.draw.AttributedFigure |
|---|
getAttribute, getAttribute, getDefaultAttribute, getDefaultAttribute, getFillColor, getFrameColor, initDefaultAttribute, setAttribute, setAttribute, setDefaultAttribute |
| Methods inherited from class org.jhotdraw.draw.AbstractFigure |
|---|
addDependendFigure, addFigureChangeListener, addToContainer, canConnect, changed, connectedTextLocator, connectorAt, 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 |
| Field Detail |
|---|
static double[] rotations
private int fRotation
| Constructor Detail |
|---|
public TriangleFigure()
public TriangleFigure(java.awt.Point origin,
java.awt.Point corner)
| Method Detail |
|---|
public HandleEnumeration handles()
AbstractFigure
handles in interface Figurehandles in class RectangleFigureHandlepublic void rotate(double angle)
public java.awt.Polygon getPolygon()
public void draw(java.awt.Graphics g)
AttributedFigure
draw in interface Figuredraw in class AttributedFigureg - the Graphics to draw intopublic java.awt.Insets connectionInsets()
AbstractFigure
connectionInsets in interface FigureconnectionInsets in class AbstractFigure
public boolean containsPoint(int x,
int y)
AbstractFigure
containsPoint in interface FigurecontainsPoint in class AbstractFigurepublic java.awt.Point center()
AbstractFigure
center in interface Figurecenter in class AbstractFigurepublic java.awt.Point chop(java.awt.Point p)
public java.lang.Object clone()
AbstractFigure
clone in interface Figureclone in class AbstractFigureFigure.clone()public double getRotationAngle()
public void write(StorableOutput dw)
AttributedFigure
write in interface Storablewrite in class RectangleFigure
public void read(StorableInput dr)
throws java.io.IOException
AttributedFigure
read in interface Storableread in class RectangleFigurejava.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||