Class HObstacle
java.lang.Object
objectdraw.FilledRect
Obstacle
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 |
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 |
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
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 ofy
- top left cornerw
- width andh
- heightc
- where I will be drawnsep
- half amount by which height will be reduced on calling slimmer()
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