javalib.worldimages
Class FreezeImage

java.lang.Object
  extended by javalib.worldimages.AImage
      extended by javalib.worldimages.RasterImage
          extended by javalib.worldimages.FreezeImage
All Implemented Interfaces:
Drawable, WorldImage, tester.ISame<WorldImage>

public class FreezeImage
extends RasterImage

An image with a memoized raster rendering.

Version:
Dec. 26, 2012
Author:
Stephen Bloch

Field Summary
 
Fields inherited from class javalib.worldimages.RasterImage
id, rendering, transparent
 
Fields inherited from interface javalib.worldimages.WorldImage
LOOKS_SAME
 
Method Summary
 void draw(Graphics2D g)
          Draw this image in the provided Graphics2D context.
 boolean equals(Object other)
          Is this the same as another WorldImage, as expression trees? Define this at every level that has instance variables.
 int getBottom()
          Produce the bottom of the bounding box.
 int getRight()
          Produce the bottom of the bounding box.
(package private) static RasterImage make(WorldImage base)
          Pseudo-constructor for a frozen (memoized) image.
protected  void renderIfNecessary()
          make sure rendering isn't null
 
Methods inherited from class javalib.worldimages.RasterImage
build, frozen, getPixelColor, hashCode, make, map, save, setRendering, toIndentedString
 
Methods inherited from class javalib.worldimages.AImage
above, aboveCentered, beside, besideCentered, build, centerMoved, centerMoved, cornerString, cropped, getCenter, getHeight, getLeft, getTop, getWidth, isApplet, makeCenteredCircle, makeCenteredCircle, makeCenteredCircle, makeCenteredCircle, makeCenteredCircle, makeCenteredCircle, makeCircle, makeCircle, makeCircle, makeCircle, makeCircle, makeCircle, makeEllipse, makeEllipse, makeEllipse, makeEllipse, makeEllipse, makeEllipse, makeFromFile, makeFromURL, makeImage, makeLine, makeLine, makeLine, makePolygon, makePolygon, makePolygon, makePolygon, makePolygon, makePolygon, makeRectangle, makeRectangle, makeRectangle, makeRectangle, makeRectangle, makeRectangle, makeText, makeText, makeText, makeText, makeText, makeText, makeText, makeText, makeText, makeText, makeText, makeText, makeTriangle, makeTriangle, makeTriangle, makeTriangle, makeTriangle, makeTriangle, makeTriangle, makeTriangle, makeTriangle, makeTriangle, makeTriangle, makeTriangle, map, moved, moved, normalized, overlay, overlayCentered, overlayImages, overlayXY, place, rotate, rotated, rotated, rotatedAround, rotatedAround, rotatedInPlace, rotatedInPlace, same, sameClass, scaled, scaled, show, toString, xReflected, yReflected
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

draw

public void draw(Graphics2D g)
Description copied from interface: WorldImage
Draw this image in the provided Graphics2D context.

Specified by:
draw in interface WorldImage
Overrides:
draw in class RasterImage
Parameters:
g - the provided Graphics2D context

equals

public boolean equals(Object other)
Description copied from interface: WorldImage
Is this the same as another WorldImage, as expression trees? Define this at every level that has instance variables.

Specified by:
equals in interface WorldImage
Overrides:
equals in class RasterImage
Parameters:
other - the object to compare with this
Returns:
true iff the images are isomorphic expression trees, with equal fields.

getBottom

public int getBottom()
Description copied from interface: WorldImage
Produce the bottom of the bounding box.

Specified by:
getBottom in interface WorldImage
Overrides:
getBottom in class RasterImage
Returns:
the y coordinate of the bottom of the bounding box

getRight

public int getRight()
Description copied from interface: WorldImage
Produce the bottom of the bounding box.

Specified by:
getRight in interface WorldImage
Overrides:
getRight in class RasterImage
Returns:
the x coordinate of the right edge of the bounding box

make

static RasterImage make(WorldImage base)
Pseudo-constructor for a frozen (memoized) image.

Parameters:
base - the existing image to freeze

renderIfNecessary

protected void renderIfNecessary()
Description copied from class: RasterImage
make sure rendering isn't null

Overrides:
renderIfNecessary in class RasterImage