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 java.awt.geom.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 java.awt.geom.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 java.awt.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 java.awt.geom.Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, unionMethods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonalMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.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
Getter for property URL.- Returns:
- Value of property URL.
-
setURL
Setter for property URL.- Parameters:
url- New value of property URL.
-
getImage
Getter for property image.- Returns:
- Value of property image.
-
setImage
Setter for property image.- Parameters:
image- New value of property image.
-
getOrigin
Getter for property origin.- Returns:
- Value of property origin.
-
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
Create a string representation of the picture.
-