Class Picture
java.lang.Object
java.awt.geom.RectangularShape
java.awt.geom.Rectangle2D
java.awt.Rectangle
org.htmlparser.lexerapplications.thumbelina.Picture
- All Implemented Interfaces:
Shape, Serializable, Cloneable
Class to track pictures within the frame.
Maintains an image, an area and the URL for it.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Rectangle2D
Rectangle2D.Double, Rectangle2D.Float -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ImageThe image for the picture.protected PointThe upper left hand corner of the image.protected URLThe URL for the picture.static final PointThe origin for new points from the zero args constructor.Fields inherited from class Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetImage()Getter for property image.Getter for property origin.getURL()Getter for property URL.voidreset()Reset the picture to uncropped size.booleanReturntrueif that picture is the same as this one.voidSetter for property image.voidSetter for property origin.voidSetter for property URL.toString()Create a string representation of the picture.Methods inherited from class Rectangle
add, add, add, contains, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, translate, unionMethods inherited from class Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, unionMethods inherited from class RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonalMethods inherited from interface Shape
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects
-
Field Details
-
ORIGIN
The origin for new points from the zero args constructor. -
mURL
The URL for the picture. -
mImage
The image for the picture. -
mOrigin
The upper left hand corner of the image. This doesn't change, even if the image is cropped. For example, if the left half of the image is obscured by another, theRectanglefieldsx,y,widthandheightwill change, but the origin remains the same.
-
-
Constructor Details
-
Picture
public Picture()Construct a Picture. -
Picture
public Picture(int x, int y, int width, int height) Construct a Picture over the area given.- Parameters:
x- The x coordinate.y- The y coordinate.width- The width of the picture.height- The height of the picture.
-
Picture
Construct a picture over the rectangle given.- Parameters:
r- The coordinates of the area.
-
Picture
Construct a picture from the one given.- Parameters:
picture- The picture to copy.
-
-
Method Details
-
getURL
-
setURL
-
getImage
-
setImage
Setter for property image.- Parameters:
image- New value of property image.
-
getOrigin
-
setOrigin
Setter for property origin.- Parameters:
origin- New value of property origin.
-
same
Returntrueif that picture is the same as this one.- Parameters:
picture- The picture to check.- Returns:
trueif the images match.
-
reset
public void reset()Reset the picture to uncropped size. -
toString
-