edu.ou.mlfw.gui
Class LineShadow
java.lang.Object
edu.ou.mlfw.gui.Shadow2D
edu.ou.mlfw.gui.LineShadow
public class LineShadow
- extends Shadow2D
Constructor Summary |
LineShadow(Vector2D linesegment,
Vector2D start)
start should be the starting point of the line, and linesegment should
be a vector pointing from the starting point to the desired end point of
the line segment. |
Method Summary |
void |
cleanUp()
A convenience method that gets called after all the drawings are
complete and the draw position is reset to the real position. |
void |
draw(java.awt.Graphics2D g)
The actual drawing routine. |
boolean |
drawMe()
Tell the Shadow2DCanvas to draw or not draw this shadow. |
Vector2D |
getRealPosition()
JSpacewarComponent uses this method in conjunction with the bounding box
information to determine if the graphic needs to be redrawn to account
for wrapping. |
void |
setColor(java.awt.Color newColor)
|
void |
setDrawMe(boolean b)
|
void |
setWidth(float w)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LineShadow
public LineShadow(Vector2D linesegment,
Vector2D start)
- start should be the starting point of the line, and linesegment should
be a vector pointing from the starting point to the desired end point of
the line segment. We do this instead of just passing in the start and
end points to avoid ambiguity when there is more than one way to draw a
line between two points.
- Parameters:
line
-
setColor
public void setColor(java.awt.Color newColor)
setWidth
public void setWidth(float w)
cleanUp
public void cleanUp()
- Description copied from class:
Shadow2D
- A convenience method that gets called after all the drawings are
complete and the draw position is reset to the real position.
- Specified by:
cleanUp
in class Shadow2D
draw
public void draw(java.awt.Graphics2D g)
- Description copied from class:
Shadow2D
- The actual drawing routine.
- Specified by:
draw
in class Shadow2D
drawMe
public boolean drawMe()
- Description copied from class:
Shadow2D
- Tell the Shadow2DCanvas to draw or not draw this shadow. This does
not remove the shadow, it just keeps it from being drawn.
- Specified by:
drawMe
in class Shadow2D
- Returns:
- Whether the shadow should be drawn or not.
setDrawMe
public void setDrawMe(boolean b)
getRealPosition
public Vector2D getRealPosition()
- Description copied from class:
Shadow2D
- JSpacewarComponent uses this method in conjunction with the bounding box
information to determine if the graphic needs to be redrawn to account
for wrapping. Real position is the position that resetDrawPosition sets
the draw position to.
- Specified by:
getRealPosition
in class Shadow2D
- Returns:
- The current "real" center position of the bounding box.