javalib.worldimages
Class EllipseImage

java.lang.Object
  extended by javalib.worldimages.AImage
      extended by javalib.worldimages.ColoredImage
          extended by javalib.worldimages.RectangularImage
              extended by javalib.worldimages.EllipseImage
All Implemented Interfaces:
Drawable, WorldImage, tester.ISame<WorldImage>
Direct Known Subclasses:
CircleImage

 class EllipseImage
extends RectangularImage

An outlined ellipse

Version:
(a version number or a date)
Author:
(your name)

Field Summary
 
Fields inherited from class javalib.worldimages.ColoredImage
defaultColor
 
Fields inherited from interface javalib.worldimages.WorldImage
LOOKS_SAME
 
Constructor Summary
protected EllipseImage(int width, int height, Color color, Mode mode)
          The full constructor for an EllipseImage.
 
Method Summary
 void draw(Graphics2D g)
          Draw this image in the provided Graphics2D context.
(package private) static EllipseImage make(int width, int height)
          Another pseudo-constructor with a default color.
(package private) static EllipseImage make(int width, int height, Color color)
          Pseudo-constructor.
(package private) static EllipseImage make(int width, int height, Color color, Mode mode)
          Pseudo-constructor.
(package private) static EllipseImage make(int width, int height, IColor color)
          Pseudo-constructor.
(package private) static EllipseImage make(int width, int height, IColor color, Mode mode)
          Pseudo-constructor.
(package private) static EllipseImage make(int width, int height, Mode mode)
          Another pseudo-constructor with a default color.
(package private)  ColoredImage replaceColor(Color color)
          Functional setter for the color field Define this in all concrete subclasses.
(package private)  RectangularImage replaceDimensions(int width, int height)
          Functional setter for width and height.
(package private)  ColoredImage replaceMode(Mode mode)
          Functional setter for the mode field Define this in all concrete subclasses.
 String toIndentedString(String indent)
          Produce a String that represents this image, indented by the given indent.
 
Methods inherited from class javalib.worldimages.RectangularImage
equals, getBottom, getRight, hashCode, replaceHeight, replaceWidth
 
Methods inherited from class javalib.worldimages.ColoredImage
getColor, getMode, replaceColor
 
Methods inherited from class javalib.worldimages.AImage
above, aboveCentered, beside, besideCentered, build, build, centerMoved, centerMoved, cornerString, cropped, frozen, getCenter, getHeight, getLeft, getPixelColor, 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, map, moved, moved, normalized, overlay, overlayCentered, overlayImages, overlayXY, place, rotate, rotated, rotated, rotatedAround, rotatedAround, rotatedInPlace, rotatedInPlace, same, sameClass, save, scaled, scaled, show, toString, xReflected, yReflected
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EllipseImage

protected EllipseImage(int width,
                       int height,
                       Color color,
                       Mode mode)
The full constructor for an EllipseImage.

Parameters:
width -
height -
color -
Method Detail

draw

public void draw(Graphics2D g)
Draw this image in the provided Graphics2D context.

Parameters:
g - the provided Graphics2D context

make

static EllipseImage make(int width,
                         int height)
Another pseudo-constructor with a default color.

Parameters:
width -
height -

make

static EllipseImage make(int width,
                         int height,
                         Color color)
Pseudo-constructor.

Parameters:
width -
height -
color -

make

static EllipseImage make(int width,
                         int height,
                         Color color,
                         Mode mode)
Pseudo-constructor.

Parameters:
width -
height -
color -
mode -

make

static EllipseImage make(int width,
                         int height,
                         IColor color)
Pseudo-constructor.

Parameters:
width -
height -
color -

make

static EllipseImage make(int width,
                         int height,
                         IColor color,
                         Mode mode)
Pseudo-constructor.

Parameters:
width -
height -
color -
mode -

make

static EllipseImage make(int width,
                         int height,
                         Mode mode)
Another pseudo-constructor with a default color.

Parameters:
width -
height -
mode -

replaceColor

ColoredImage replaceColor(Color color)
Description copied from class: ColoredImage
Functional setter for the color field Define this in all concrete subclasses. (I HATE this! Every one of these definitions will consist of calling the constructor with exactly the same fields but newColor plugged in as the color. Why do I have to write that over and over in every concrete subclass?)

Specified by:
replaceColor in class ColoredImage
Returns:
a new image just like this one but with a different color

replaceDimensions

RectangularImage replaceDimensions(int width,
                                   int height)
Description copied from class: RectangularImage
Functional setter for width and height.

Specified by:
replaceDimensions in class RectangularImage
Returns:
a new image just like this one but with different dimensions.

replaceMode

ColoredImage replaceMode(Mode mode)
Description copied from class: ColoredImage
Functional setter for the mode field Define this in all concrete subclasses.

Specified by:
replaceMode in class ColoredImage
Returns:
a new image just like this one but with a different mode

toIndentedString

public String toIndentedString(String indent)
Description copied from interface: WorldImage
Produce a String that represents this image, indented by the given indent.

Define this in all concrete subclasses.

Convention: The result of toIndentedString() will neither begin nor end with a newline; the specified indent will immediately follow each internal newline.

Parameters:
indent - the given prefix representing the desired indentation
Returns:
the String representation of this image