Class Obstacle

java.lang.Object
  extended by objectdraw.FilledRect
      extended by 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

Field Summary
protected  objectdraw.CanvasManager canvasContent
           
protected  Color color
           
protected  double height
           
protected  boolean shown
           
protected  double width
           
protected  double x
           
protected  double y
           
 
Constructor Summary
Obstacle(double x, double y, double w, double h, objectdraw.DrawingCanvas c)
           
 
Method Summary
 void addToCanvas(objectdraw.DrawingCanvas arg0)
           
protected  void clearCanvasContent()
           
 boolean contains(objectdraw.Location arg0)
           
 objectdraw.DrawingCanvas getCanvas()
           
 Color getColor()
           
 double getHeight()
           
 objectdraw.Location getLocation()
           
 double getWidth()
           
 double getX()
           
 double getY()
           
 void hide()
           
 boolean isHidden()
           
abstract  boolean isVertical()
           
 void move(double arg0, double arg1)
           
 void moveTo(double arg0, double arg1)
           
 void moveTo(objectdraw.Location arg0)
           
 boolean overlaps(objectdraw.Drawable2DInterface arg0)
           
 void removeFromCanvas()
           
 void sendBackward()
           
 void sendForward()
           
 void sendToBack()
           
 void sendToFront()
           
 void setColor(Color arg0)
           
 void setHeight(double arg0)
           
 void setSize(double arg0, double arg1)
           
protected  void setStateChanged()
           
 void setWidth(double arg0)
           
 void show()
           
abstract  Obstacle slimmer()
          slimmer -- to remove the excess thickness used to ensure separation
 
Methods inherited from class objectdraw.FilledRect
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
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
 

Field Detail

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
Constructor Detail

Obstacle

public Obstacle(double x,
                double y,
                double w,
                double h,
                objectdraw.DrawingCanvas c)
Method Detail

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