CH.ifa.draw.contrib
Class TriangleFigure
- java.lang.Object
-
- CH.ifa.draw.standard.AbstractFigure
-
- CH.ifa.draw.figures.AttributeFigure
-
- CH.ifa.draw.figures.RectangleFigure
-
- CH.ifa.draw.contrib.TriangleFigure
-
public class TriangleFigure extends RectangleFigure
A triangle with same dimensions as its enclosing rectangle, and apex at any of 8 places- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface CH.ifa.draw.framework.Figure
POPUP_MENU
-
-
Constructor Summary
Constructors Constructor and Description TriangleFigure()TriangleFigure(java.awt.Point origin, java.awt.Point corner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.Pointcenter()Gets the center of a figure.java.awt.Pointchop(java.awt.Point p)java.lang.Objectclone()Clones a figure.java.awt.InsetsconnectionInsets()Returns the connection inset.booleancontainsPoint(int x, int y)Checks if a point is inside the figure.voiddraw(java.awt.Graphics g)Draws the figure in the given graphics.java.util.Vectorhandles()Returns the handles of a Figure that can be used to manipulate some of its attributes.java.awt.Polygonpolygon()Return the polygon describing the trianglevoidread(StorableInput dr)Reads the Figure from a StorableInput.voidrotate(double angle)voidwrite(StorableOutput dw)Stores the Figure to a StorableOutput.-
Methods inherited from class CH.ifa.draw.figures.RectangleFigure
basicDisplayBox, displayBox, drawBackground, drawFrame
-
Methods inherited from class CH.ifa.draw.figures.AttributeFigure
getAttribute, getDefaultAttribute, getFillColor, getFrameColor, setAttribute
-
Methods inherited from class CH.ifa.draw.standard.AbstractFigure
addFigureChangeListener, addToContainer, canConnect, changed, connectedTextLocator, connectorAt, connectorVisibility, decompose, displayBox, displayBox, figures, findFigureInside, includes, invalidate, isEmpty, listener, moveBy, release, removeFigureChangeListener, removeFromContainer, size, willChange
-
-
-
-
Constructor Detail
-
TriangleFigure
public TriangleFigure()
-
TriangleFigure
public TriangleFigure(java.awt.Point origin, java.awt.Point corner)
-
-
Method Detail
-
handles
public java.util.Vector handles()
Description copied from class:AbstractFigureReturns the handles of a Figure that can be used to manipulate some of its attributes.- Specified by:
handlesin interfaceFigure- Overrides:
handlesin classRectangleFigure- Returns:
- a Vector of handles
- See Also:
Handle
-
rotate
public void rotate(double angle)
-
polygon
public java.awt.Polygon polygon()
Return the polygon describing the triangle
-
draw
public void draw(java.awt.Graphics g)
Description copied from class:AttributeFigureDraws the figure in the given graphics. Draw is a template method calling drawBackground followed by drawFrame.- Specified by:
drawin interfaceFigure- Overrides:
drawin classAttributeFigure- Parameters:
g- the Graphics to draw into
-
connectionInsets
public java.awt.Insets connectionInsets()
Description copied from class:AbstractFigureReturns 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:
connectionInsetsin interfaceFigure- Overrides:
connectionInsetsin classAbstractFigure
-
containsPoint
public boolean containsPoint(int x, int y)Description copied from class:AbstractFigureChecks if a point is inside the figure.- Specified by:
containsPointin interfaceFigure- Overrides:
containsPointin classAbstractFigure
-
center
public java.awt.Point center()
Description copied from class:AbstractFigureGets the center of a figure. A convenice method that is rarely overridden.- Specified by:
centerin interfaceFigure- Overrides:
centerin classAbstractFigure
-
chop
public java.awt.Point chop(java.awt.Point p)
-
clone
public java.lang.Object clone()
Description copied from class:AbstractFigureClones a figure. Creates a clone by using the storable mechanism to flatten the Figure to stream followed by resurrecting it from the same stream.- Specified by:
clonein interfaceFigure- Overrides:
clonein classAbstractFigure- See Also:
Figure.clone()
-
write
public void write(StorableOutput dw)
Description copied from class:AttributeFigureStores the Figure to a StorableOutput.- Specified by:
writein interfaceStorable- Overrides:
writein classRectangleFigure
-
read
public void read(StorableInput dr) throws java.io.IOException
Description copied from class:AttributeFigureReads the Figure from a StorableInput.- Specified by:
readin interfaceStorable- Overrides:
readin classRectangleFigure- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG