Class HObstacle

java.lang.Object
  extended by objectdraw.FilledRect
      extended by Obstacle
          extended by HObstacle
All Implemented Interfaces:
Serializable, objectdraw.Drawable2DInterface, objectdraw.DrawableInterface, objectdraw.Resizable2DInterface

public class HObstacle
extends Obstacle

HObstacle for vertical obstacles to be placed in the RoboPit

Version:
7x06
Author:
RPJ
See Also:
Serialized Form

Field Summary
(package private)  objectdraw.DrawingCanvas canvas
           
protected  objectdraw.CanvasManager canvasContent
           
protected  Color color
           
protected  double height
           
(package private)  double sep
           
protected  boolean shown
           
protected  double width
           
protected  double x
           
protected  double y
           
 
Constructor Summary
HObstacle(double x, double y, double w, double h, objectdraw.DrawingCanvas c, double sep)
          Constructor for objects of class HObstacle
 
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()
           
 boolean isVertical()
          isVertical() of course not , so
 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()
           
 Obstacle slimmer()
          slimmer()
 
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

canvas

objectdraw.DrawingCanvas canvas

sep

double sep

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

HObstacle

public HObstacle(double x,
                 double y,
                 double w,
                 double h,
                 objectdraw.DrawingCanvas c,
                 double sep)
Constructor for objects of class HObstacle

Parameters:
x - coordinates of
y - top left corner
w - width and
h - height
c - where I will be drawn
sep - half amount by which height will be reduced on calling slimmer()
Method Detail

isVertical

public boolean isVertical()
isVertical() of course not , so

Specified by:
isVertical in class Obstacle
Returns:
false

slimmer

public Obstacle slimmer()
slimmer()

Specified by:
slimmer in class Obstacle
Returns:
a slimmer version of myself by reducing height by 2*sep

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