java.lang.Objectobjectdraw.ObjectDrawObject
objectdraw.ObjectDrawShape
objectdraw.ObjectDrawRectangularShape
objectdraw.FramedRect
fluids.FluidContainer
public abstract class FluidContainer
FluidContainer
is the shared superclass of both Tank
and Pipe
.
It contains method to set the color that that container will appear in if its volume or flow rate
is negative.
Field Summary |
---|
Fields inherited from interface objectdraw.DrawableStrokeInterface |
---|
CLICK_SIZE, DEFAULT_STROKE |
Method Summary | |
---|---|
boolean |
contains(Location point)
Determine whether a point is one of the pixels painted by this fluid container. |
Background |
getBackground()
Return the Background object that this fluid container is placed on. |
Color |
getNegativeColor()
Get the Color that will be used to draw this container when its volume
or flow rate is negative. |
void |
removeFromCanvas()
Removing a fluid container from its canvas also removes it from the background. |
void |
setColor(Color c)
Set the color that will be used to draw this container when its volume or flow rate is positive. |
void |
setNegativeColor(Color c)
Set the color that will be used to draw this container when its volume or flow rate is negative. |
Methods inherited from class objectdraw.FramedRect |
---|
addToCanvas, getCanvas, getColor, getDoubleHeight, getDoubleWidth, getDoubleX, getDoubleY, getHeight, getLineWidth, getLocation, getStroke, getWidth, getX, getY, hide, isHidden, makeShape, move, moveTo, moveTo, overlaps, sendBackward, sendForward, sendToBack, sendToFront, setHeight, setLineWidth, setSize, setStroke, setWidth, show, toString |
Methods inherited from class objectdraw.ObjectDrawRectangularShape |
---|
getBounds |
Methods inherited from class objectdraw.ObjectDrawShape |
---|
clearCanvas, draw, draw, getDrawables, getShape, removeCanvas, setMyShape, update |
Methods inherited from class objectdraw.ObjectDrawObject |
---|
deferUpdates, depend, runUpdates, undepend |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface objectdraw.DrawableInterface |
---|
draw, getShape |
Method Detail |
---|
public boolean contains(Location point)
contains
in interface DrawableInterface
contains
in class FramedRect
point
- Location
to checkpublic Background getBackground()
Background
object that this fluid container is placed on.
Background
public Color getNegativeColor()
Color
that will be used to draw this container when its volume
or flow rate is negative.
public void removeFromCanvas()
removeFromCanvas
in interface DrawableInterface
removeFromCanvas
in class FramedRect
public void setColor(Color c)
setColor
in interface DrawableInterface
setColor
in class FramedRect
c
- Color
to draw withpublic void setNegativeColor(Color c)
c
- Color
to draw with