fluids
Class Background

java.lang.Object
  extended by objectdraw.ObjectDrawObject
      extended by objectdraw.ObjectDrawShape
          extended by objectdraw.ObjectDrawRectangularShape
              extended by objectdraw.VisibleImage
                  extended by fluids.Background
All Implemented Interfaces:
Dependent, Drawable2DInterface, DrawableInterface, LocatableInterface, Resizable2DInterface

public class Background
extends VisibleImage

The Background class draws the background for a fluid mechanics simulation. All other components of the simulation need to be added to this background in order to be drawn.

Author:
Russell Zahniser (russell@zahniser.net)

Constructor Summary
Background(String modelName, DrawingCanvas canvas)
          Create a new Background.
 
Method Summary
 Tank getTank()
          Get the tank that represents the background.
 
Methods inherited from class objectdraw.VisibleImage
addToCanvas, contains, createBufferedCopy, draw, getCanvas, getColor, getDoubleHeight, getDoubleWidth, getDoubleX, getDoubleY, getHeight, getImage, getImageHeight, getImageWidth, getLocation, getWidth, getX, getY, hide, isHidden, makeShape, move, moveTo, moveTo, overlaps, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setColor, setHeight, setImage, setSize, setWidth, show, toString
 
Methods inherited from class objectdraw.ObjectDrawRectangularShape
getBounds
 
Methods inherited from class objectdraw.ObjectDrawShape
clearCanvas, 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
getShape
 

Constructor Detail

Background

public Background(String modelName,
                  DrawingCanvas canvas)
Create a new Background.

Parameters:
modelName - Name of the model. This should be the name of the directory in which the images for this simulation are. There must be a file background.png in that directory.
canvas - DrawingCanvas to add this Background to
Method Detail

getTank

public Tank getTank()
Get the tank that represents the background. This is where water flows into when it overflows from another tank. This method may return null, if there was no "backgroundWater.png" in the directory for this model.

Returns:
The Tank into which other tanks overflow, or null if there is no such tank.