|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavalib.worldimages.AImage
javalib.worldimages.Crop
public class Crop
A rectangular window on an existing image.
Field Summary |
---|
Fields inherited from interface javalib.worldimages.WorldImage |
---|
LOOKS_SAME |
Constructor Summary | |
---|---|
Crop(WorldImage base,
int left,
int right,
int top,
int bottom)
Constructor for objects of class Crop |
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 |
getLeft()
Getter for the left edge of the bounding box. |
int |
getRight()
Produce the bottom of the bounding box. |
int |
getTop()
Getter for the top of the bounding box. |
(package private) static WorldImage |
make(WorldImage base,
int left,
int right,
int top,
int bottom)
Pseudo-constructor for objects of class Crop |
String |
toIndentedString(String indent)
Produce a String that represents this image, indented by the given indent . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javalib.worldimages.WorldImage |
---|
hashCode |
Constructor Detail |
---|
Crop(WorldImage base, int left, int right, int top, int bottom)
base
- the image to cropleft,
- right, top, bottom the borders to crop toMethod Detail |
---|
public void draw(Graphics2D g)
WorldImage
Graphics2D
context.
g
- the provided Graphics2D
contextpublic boolean equals(Object other)
WorldImage
equals
in interface WorldImage
equals
in class AImage
other
- the object to compare with this
public int getBottom()
WorldImage
public int getLeft()
AImage
getLeft
in interface WorldImage
getLeft
in class AImage
public int getRight()
WorldImage
public int getTop()
AImage
getTop
in interface WorldImage
getTop
in class AImage
static WorldImage make(WorldImage base, int left, int right, int top, int bottom)
base
- the image to cropleft,
- right, top, bottom the borders to crop topublic 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 |