org.htmlparser.lexerapplications.thumbelina
Class Picture
Rectangle
org.htmlparser.lexerapplications.thumbelina.Picture
public class Picture
extends Rectangle
Class to track pictures within the frame.
Maintains an image, an area and the URL for it.
static Point | ORIGIN - The origin for new points from the zero args constructor.
|
protected Image | mImage - The image for the picture.
|
protected Point | mOrigin - The upper left hand corner of the image.
|
protected URL | mURL - The URL for the picture.
|
Picture() - Construct a Picture.
|
Picture(Rectangle r) - Construct a picture over the rectangle given.
|
Picture(int x, int y, int width, int height) - Construct a Picture over the area given.
|
Picture(Picture picture) - Construct a picture from the one given.
|
Image | getImage() - Getter for property image.
|
Point | getOrigin() - Getter for property origin.
|
URL | getURL() - Getter for property URL.
|
void | reset() - Reset the picture to uncropped size.
|
boolean | same(Picture picture) - Return
true if that picture is the same as this one.
|
void | setImage(Image image) - Setter for property image.
|
void | setOrigin(Point origin) - Setter for property origin.
|
void | setURL(URL url) - Setter for property URL.
|
String | toString() - Create a string representation of the picture.
|
ORIGIN
public static final Point ORIGIN
The origin for new points from the zero args constructor.
mImage
protected Image mImage
The image for the picture.
mOrigin
protected Point 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,
the Rectangle
fields x
, y
,
width
and height
will change, but the
origin remains the same.
mURL
protected URL mURL
The URL for the picture.
Picture
public Picture()
Construct a Picture.
Picture
public Picture(Rectangle r)
Construct a picture over the rectangle given.
r
- The coordinates of the area.
Picture
public Picture(int x,
int y,
int width,
int height)
Construct a Picture over the area given.
x
- The x coordinate.y
- The y coordinate.width
- The width of the picture.height
- The height of the picture.
Picture
public Picture(Picture picture)
Construct a picture from the one given.
picture
- The picture to copy.
getImage
public Image getImage()
Getter for property image.
getOrigin
public Point getOrigin()
Getter for property origin.
- Value of property origin.
getURL
public URL getURL()
Getter for property URL.
reset
public void reset()
Reset the picture to uncropped size.
same
public boolean same(Picture picture)
Return true
if that picture is the same as this one.
picture
- The picture to check.
true
if the images match.
setImage
public void setImage(Image image)
Setter for property image.
image
- New value of property image.
setOrigin
public void setOrigin(Point origin)
Setter for property origin.
origin
- New value of property origin.
setURL
public void setURL(URL url)
Setter for property URL.
url
- New value of property URL.
toString
public String toString()
Create a string representation of the picture.
- A string that shows this picture URL and size.
| © 2005 Derrick Oswald Mai 08, 2008 |
HTML Parser is an open source library released under LGPL. |  |