Class Obstacle
java.lang.Object
objectdraw.FilledRect
Obstacle
- All Implemented Interfaces:
- Serializable, objectdraw.Drawable2DInterface, objectdraw.DrawableInterface, objectdraw.Resizable2DInterface
- Direct Known Subclasses:
- HObstacle, VObstacle
public abstract class Obstacle
- extends objectdraw.FilledRect
abstract class Obstacle
covers both vertical obstacles VObstacle
and horizontal HObstacle
both of which extends Obstacle
- Version:
- 21x06
- Author:
- RPJ
- See Also:
- Serialized Form
Constructor Summary |
Obstacle(double x,
double y,
double w,
double h,
objectdraw.DrawingCanvas c)
|
Methods inherited from class objectdraw.FilledRect |
toString |
Methods inherited from interface objectdraw.Resizable2DInterface |
setHeight, setSize, setWidth |
Methods inherited from interface objectdraw.Drawable2DInterface |
getHeight, getLocation, getWidth, getX, getY, overlaps |
Methods inherited from interface objectdraw.DrawableInterface |
addToCanvas, contains, getCanvas, getColor, hide, isHidden, move, moveTo, moveTo, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setColor, show |
height
protected double height
width
protected double width
x
protected double x
y
protected double y
canvasContent
protected transient objectdraw.CanvasManager canvasContent
color
protected Color color
shown
protected boolean shown
Obstacle
public Obstacle(double x,
double y,
double w,
double h,
objectdraw.DrawingCanvas c)
isVertical
public abstract boolean isVertical()
slimmer
public abstract Obstacle slimmer()
- slimmer -- to remove the excess thickness used to ensure separation
- Returns:
- the slimmer obstacle
getHeight
public double getHeight()
- Specified by:
getHeight
in interface objectdraw.Drawable2DInterface
getWidth
public double getWidth()
- Specified by:
getWidth
in interface objectdraw.Drawable2DInterface
setHeight
public void setHeight(double arg0)
- Specified by:
setHeight
in interface objectdraw.Resizable2DInterface
setSize
public void setSize(double arg0,
double arg1)
- Specified by:
setSize
in interface objectdraw.Resizable2DInterface
setWidth
public void setWidth(double arg0)
- Specified by:
setWidth
in interface objectdraw.Resizable2DInterface
move
public void move(double arg0,
double arg1)
- Specified by:
move
in interface objectdraw.DrawableInterface
moveTo
public void moveTo(objectdraw.Location arg0)
- Specified by:
moveTo
in interface objectdraw.DrawableInterface
contains
public boolean contains(objectdraw.Location arg0)
- Specified by:
contains
in interface objectdraw.DrawableInterface
getLocation
public objectdraw.Location getLocation()
- Specified by:
getLocation
in interface objectdraw.Drawable2DInterface
getX
public double getX()
- Specified by:
getX
in interface objectdraw.Drawable2DInterface
getY
public double getY()
- Specified by:
getY
in interface objectdraw.Drawable2DInterface
overlaps
public boolean overlaps(objectdraw.Drawable2DInterface arg0)
- Specified by:
overlaps
in interface objectdraw.Drawable2DInterface
addToCanvas
public void addToCanvas(objectdraw.DrawingCanvas arg0)
- Specified by:
addToCanvas
in interface objectdraw.DrawableInterface
clearCanvasContent
protected void clearCanvasContent()
getCanvas
public objectdraw.DrawingCanvas getCanvas()
- Specified by:
getCanvas
in interface objectdraw.DrawableInterface
getColor
public Color getColor()
- Specified by:
getColor
in interface objectdraw.DrawableInterface
hide
public void hide()
- Specified by:
hide
in interface objectdraw.DrawableInterface
isHidden
public boolean isHidden()
- Specified by:
isHidden
in interface objectdraw.DrawableInterface
moveTo
public void moveTo(double arg0,
double arg1)
- Specified by:
moveTo
in interface objectdraw.DrawableInterface
removeFromCanvas
public void removeFromCanvas()
- Specified by:
removeFromCanvas
in interface objectdraw.DrawableInterface
sendBackward
public void sendBackward()
- Specified by:
sendBackward
in interface objectdraw.DrawableInterface
sendForward
public void sendForward()
- Specified by:
sendForward
in interface objectdraw.DrawableInterface
sendToBack
public void sendToBack()
- Specified by:
sendToBack
in interface objectdraw.DrawableInterface
sendToFront
public void sendToFront()
- Specified by:
sendToFront
in interface objectdraw.DrawableInterface
setColor
public void setColor(Color arg0)
- Specified by:
setColor
in interface objectdraw.DrawableInterface
setStateChanged
protected void setStateChanged()
show
public void show()
- Specified by:
show
in interface objectdraw.DrawableInterface