|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfunworld.WorldImage
funworld.TriangleImage
public class TriangleImage
The class to represent filled triangle images drawn by the
when drawing on its
World.Canvas
The pinhole for the triangle is in the center of the triangle.
| Field Summary | |
|---|---|
geometry.Posn |
p1
|
geometry.Posn |
p2
|
geometry.Posn |
p3
|
| Fields inherited from class funworld.WorldImage |
|---|
color, pinhole |
| Constructor Summary | |
|---|---|
TriangleImage(geometry.Posn p1,
geometry.Posn p2,
geometry.Posn p3,
java.awt.Color color)
A full constructor for this triangle image. |
|
TriangleImage(geometry.Posn p1,
geometry.Posn p2,
geometry.Posn p3,
colors.IColor color)
A convenience constructor to supply the color in the form of . |
|
| Method Summary | |
|---|---|
int |
getHeight()
Produce the height of this triangle image |
int |
getWidth()
Produce the width of this triangle image |
WorldImage |
movePinhole(int dx,
int dy)
Produce the triangle with the pinhole moved by the given (dx, dy) |
WorldImage |
moveTo(geometry.Posn p)
Produce the triangle with the pinhole moved to the given location |
| Methods inherited from class funworld.WorldImage |
|---|
overlayImages |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public geometry.Posn p1
public geometry.Posn p2
public geometry.Posn p3
| Constructor Detail |
|---|
public TriangleImage(geometry.Posn p1,
geometry.Posn p2,
geometry.Posn p3,
java.awt.Color color)
p1 - the first point of this trianglep2 - the second point of this trianglep3 - the third point of this trianglecolor - the color for this image
public TriangleImage(geometry.Posn p1,
geometry.Posn p2,
geometry.Posn p3,
colors.IColor color)
IColor.
p1 - the first point of this trianglep2 - the second point of this trianglep3 - the third point of this trianglecolor - the color for this image| Method Detail |
|---|
public WorldImage movePinhole(int dx,
int dy)
movePinhole in class WorldImagedx - the horizontal offsetdy - the vertical offsetpublic WorldImage moveTo(geometry.Posn p)
moveTo in class WorldImagep - the given locationpublic int getWidth()
getWidth in class WorldImagepublic int getHeight()
getHeight in class WorldImage
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||