public class Triangle extends PolyShape implements Shape
Constructor and Description |
---|
Triangle()
Create a new blue, filled triangle with default position and size.
|
Triangle(int x1,
int y1,
int x2,
int y2,
int x3,
int y3)
Create a new black, unfilled triangle between the given three vertices
|
Triangle(int x1,
int y1,
int x2,
int y2,
int x3,
int y3,
java.awt.Color c,
boolean fill)
Create a new triangle of the given color and filledness between
the given three vertices
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString()
Answer the printed representation of this shape.
|
addTo, currentWindow, getBoundingBox, getCenterX, getCenterY, getColor, getHeight, getWidth, getX, getY, intersects, moveBy, recordWindow, removeFromWindow, setColor
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addTo, currentWindow, getBoundingBox, getCenterX, getCenterY, getColor, getHeight, getWidth, getX, getY, intersects, moveBy, moveTo, paint, recordWindow, removeFromWindow, rotateAround, setColor
public Triangle()
public Triangle(int x1, int y1, int x2, int y2, int x3, int y3)
x1
- the X coordinate of the first vertexy1
- the Y coordinate of the first vertexx2
- the X coordinate of the second vertexy2
- the Y coordinate of the second vertexx3
- the X coordinate of the third vertexy3
- the Y coordinate of the third vertexpublic Triangle(int x1, int y1, int x2, int y2, int x3, int y3, java.awt.Color c, boolean fill)
x1
- the X coordinate of the first vertexy1
- the Y coordinate of the first vertexx2
- the X coordinate of the second vertexy2
- the Y coordinate of the second vertexx3
- the X coordinate of the third vertexy3
- the Y coordinate of the third vertexc
- a color for the trianglefill
- should the triangle be filled with the color?