|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavalib.worldimages.AImage
javalib.worldimages.ColoredImage
javalib.worldimages.RectangularImage
javalib.worldimages.RectangleImage
class RectangleImage
A filled or outlined rectangle
Field Summary |
---|
Fields inherited from class javalib.worldimages.ColoredImage |
---|
defaultColor |
Fields inherited from interface javalib.worldimages.WorldImage |
---|
LOOKS_SAME |
Constructor Summary | |
---|---|
protected |
RectangleImage(int width,
int height,
Color color,
Mode mode)
The full constructor for a RectangleImage. |
Method Summary | |
---|---|
void |
draw(Graphics2D g)
Draw this image in the provided Graphics2D context. |
(package private) static RectangleImage |
make(int width,
int height)
Pseudo-constructor with a default color and mode. |
(package private) static RectangleImage |
make(int width,
int height,
Color color)
Pseudo-constructor with a Color and a default mode. |
(package private) static RectangleImage |
make(int width,
int height,
Color color,
Mode mode)
The full pseudo-constructor |
(package private) static RectangleImage |
make(int width,
int height,
IColor color)
Pseudo-constructor with an IColor and a default mode. |
(package private) static RectangleImage |
make(int width,
int height,
IColor color,
Mode mode)
Pseudo-constructor with an IColor |
(package private) static RectangleImage |
make(int width,
int height,
Mode mode)
Pseudo-constructor with a default color |
(package private) ColoredImage |
replaceColor(Color newColor)
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 newMode)
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 java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected RectangleImage(int width, int height, Color color, Mode mode)
width
- height
- color
- Method Detail |
---|
public void draw(Graphics2D g)
Graphics2D
context.
g
- the provided Graphics2D
contextstatic RectangleImage make(int width, int height)
width
- height
- static RectangleImage make(int width, int height, Color color)
width
- height
- color
- static RectangleImage make(int width, int height, Color color, Mode mode)
width
- height
- color
- mode
- static RectangleImage make(int width, int height, IColor color)
width
- height
- color
- static RectangleImage make(int width, int height, IColor color, Mode mode)
width
- height
- color
- mode
- static RectangleImage make(int width, int height, Mode mode)
width
- height
- mode
- ColoredImage replaceColor(Color newColor)
ColoredImage
replaceColor
in class ColoredImage
RectangularImage replaceDimensions(int width, int height)
RectangularImage
replaceDimensions
in class RectangularImage
ColoredImage replaceMode(Mode newMode)
ColoredImage
replaceMode
in class ColoredImage
public String toIndentedString(String indent)
WorldImage
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.
indent
- the given prefix representing the desired indentation
String
representation of this image
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |