javalib.worldimages
Class FromFileImage

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

public class FromFileImage
extends RasterImage

The class to represent an image that came from a .png file and is to be drawn by the world when drawing on its Canvas.

Since:
February 4 2012, then Dec 12 2012
Author:
Viera K. Proulx, slightly modified by 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
 boolean equals(Object other)
          Is this the same as another WorldImage, as expression trees? Define this at every level that has instance variables.
 int hashCode()
          The hashCode to match the equals method
(package private) static WorldImage make(String fileName)
          Pseudo-constructor for objects of class FromFileImage
(package private) static void setIsApplet(boolean flag)
          Record whether we're in an applet.
 String toIndentedString(String indent)
          Produce a String that represents this image, indented by the given indent
 
Methods inherited from class javalib.worldimages.RasterImage
build, draw, frozen, getBottom, getPixelColor, getRight, make, map, renderIfNecessary, save, setRendering
 
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

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.

hashCode

public int hashCode()
The hashCode to match the equals method

Specified by:
hashCode in interface WorldImage
Overrides:
hashCode in class RasterImage

make

static WorldImage make(String fileName)
Pseudo-constructor for objects of class FromFileImage

Parameters:
fileName -

setIsApplet

static void setIsApplet(boolean flag)
Record whether we're in an applet.

Parameters:
flag - true if we're in an applet, false if we're not.

toIndentedString

public String toIndentedString(String indent)
Produce a String that represents this image, indented by the given indent

Specified by:
toIndentedString in interface WorldImage
Overrides:
toIndentedString in class RasterImage
Parameters:
indent - the given prefix representing the desired indentation
Returns:
the String representation of this image