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 Image
The image for the picture.protected Point
The upper left hand corner of the image.protected URL
The URL for the picture.static final Point
The 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.void
reset()
Reset the picture to uncropped size.boolean
Returntrue
if that picture is the same as this one.void
Setter for property image.void
Setter for property origin.void
Setter 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, union
Methods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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, theRectangle
fieldsx
,y
,width
andheight
will 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
Returntrue
if that picture is the same as this one.- Parameters:
picture
- The picture to check.- Returns:
true
if the images match.
-
reset
public void reset()Reset the picture to uncropped size. -
toString
Create a string representation of the picture.
-