|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectobjectdraw.Line
objectdraw.AngLine
public class AngLine
AngLine is a variant of Line where the constructor takes a starting point and angle from the horizontal rather than two end points.
| Constructor Summary | |
|---|---|
AngLine(double startX,
double startY,
double length,
double radianAngle,
DrawingCanvas canvas)
Creates a new Line given a starting location, length and direction. |
|
AngLine(Location start,
double length,
double radianAngle,
DrawingCanvas canvas)
Creates a new Line given a starting location, length and direction. |
|
| Method Summary | |
|---|---|
void |
addToCanvas(DrawingCanvas c)
Places an existing object on a specified DrawingCanvas. |
DrawingCanvas |
getCanvas()
Determine which (if any) DrawingCanvas this object is positioned on |
java.awt.Color |
getColor()
Retrieves the color of the object. |
void |
hide()
Temporarily hides an object on a DrawingCanvas from view. |
boolean |
isHidden()
Determine whether an object is currently visible on its canvas |
void |
moveTo(Location point)
Moves the object within the canvas to the specified Location |
void |
removeFromCanvas()
Permanently removes the object from the canvas it is currently on. |
void |
sendBackward()
Sends the object backward. |
void |
sendForward()
Sends the object forward. |
void |
sendToBack()
Sends the object to the back. |
void |
sendToFront()
Sends the object to the front. |
void |
setColor(java.awt.Color c)
Sets the color of the object. |
void |
show()
Shows the object if it has been hidden. |
| Methods inherited from class objectdraw.Line |
|---|
contains, getEnd, getStart, move, moveTo, setEnd, setEnd, setEndPoints, setEndPoints, setStart, setStart, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface objectdraw.DrawableInterface |
|---|
addToCanvas, getCanvas, getColor, hide, isHidden, moveTo, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setColor, show |
| Constructor Detail |
|---|
public AngLine(Location start,
double length,
double radianAngle,
DrawingCanvas canvas)
start - the starting point of the line.length - the length of the line.radianAngle - the angle the line makes with the horizontalcanvas - the canvas in which the line is created.
public AngLine(double startX,
double startY,
double length,
double radianAngle,
DrawingCanvas canvas)
startX - the x coordinate of the starting point of the line.startY - the y coordinate of the starting point of the line.length - the length of the line.radianAngle - the angle the line makes with the horizontalcanvas - the canvas in which the line is created.| Method Detail |
|---|
public void addToCanvas(DrawingCanvas c)
DrawableInterfaceremoveFromCanvas() followed
by addToCanvas. This method can also be invoked to place a Drawable object on a
DrawingCanvas after the object is loaded from a file or other stream.
addToCanvas in interface DrawableInterfacec - the canvas on which the object should be drawnpublic void removeFromCanvas()
DrawableInterfacehide() instead.
removeFromCanvas in interface DrawableInterfacepublic DrawingCanvas getCanvas()
DrawableInterface
getCanvas in interface DrawableInterfacepublic void hide()
DrawableInterfaceshow() method.
If the goal is to remove an object from the display permanently, the
removeFromCanvas() method should be used instead.
hide in interface DrawableInterfacepublic void show()
DrawableInterface
show in interface DrawableInterfacepublic boolean isHidden()
DrawableInterface
isHidden in interface DrawableInterfacepublic void moveTo(Location point)
DrawableInterface
moveTo in interface DrawableInterfacepoint - the destination for moving the object.public void setColor(java.awt.Color c)
DrawableInterface
setColor in interface DrawableInterfacec - the color.public java.awt.Color getColor()
DrawableInterface
getColor in interface DrawableInterfacepublic void sendForward()
DrawableInterface
sendForward in interface DrawableInterfacepublic void sendBackward()
DrawableInterface
sendBackward in interface DrawableInterfacepublic void sendToFront()
DrawableInterface
sendToFront in interface DrawableInterfacepublic void sendToBack()
DrawableInterface
sendToBack in interface DrawableInterface
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||