All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CH.ifa.draw.contrib.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


Variable Index

 o fRotation

Constructor Index

 o TriangleFigure()
 o TriangleFigure(Point, Point)

Method Index

 o center()
Gets the center of a figure.
 o chop(Point)
 o clone()
Clones a figure.
 o connectionInsets()
Returns the connection inset.
 o containsPoint(int, int)
Checks if a point is inside the figure.
 o draw(Graphics)
Draws the figure in the given graphics.
 o handles()
Returns the handles of a Figure that can be used to manipulate some of its attributes.
 o polygon()
Return the polygon describing the triangle
 o read(StorableInput)
Reads the Figure from a StorableInput.
 o rotate(double)
 o write(StorableOutput)
Stores the Figure to a StorableOutput.

Variables

 o fRotation
 protected int fRotation

Constructors

 o TriangleFigure
 public TriangleFigure()
 o TriangleFigure
 public TriangleFigure(Point origin,
                       Point corner)

Methods

 o handles
 public Vector handles()
Returns the handles of a Figure that can be used to manipulate some of its attributes.

Overrides:
handles in class RectangleFigure
 o rotate
 public void rotate(double angle)
 o polygon
 public Polygon polygon()
Return the polygon describing the triangle

 o draw
 public void draw(Graphics g)
Draws the figure in the given graphics.

Overrides:
draw in class AttributeFigure
 o connectionInsets
 public Insets connectionInsets()
Returns the connection inset.

Overrides:
connectionInsets in class AbstractFigure
 o containsPoint
 public boolean containsPoint(int x,
                              int y)
Checks if a point is inside the figure.

Overrides:
containsPoint in class AbstractFigure
 o center
 public Point center()
Gets the center of a figure.

Overrides:
center in class AbstractFigure
 o chop
 public Point chop(Point p)
 o clone
 public Object clone()
Clones a figure.

Overrides:
clone in class AbstractFigure
 o write
 public void write(StorableOutput dw)
Stores the Figure to a StorableOutput.

Overrides:
write in class RectangleFigure
 o read
 public void read(StorableInput dr) throws IOException
Reads the Figure from a StorableInput.

Overrides:
read in class RectangleFigure

All Packages  Class Hierarchy  This Package  Previous  Next  Index