|
HTML Parser Home Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.geom.RectangularShape java.awt.geom.Rectangle2D java.awt.Rectangle org.htmlparser.lexerapplications.thumbelina.Picture
public class Picture
Class to track pictures within the frame. Maintains an image, an area and the URL for it.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D |
---|
Rectangle2D.Double, Rectangle2D.Float |
Field Summary | |
---|---|
protected Point |
mExtent
The lower right hand corner of the image. |
protected Image |
mImage
The cached image. |
PictureListener |
mListener
The object to notify about picture events; |
protected File |
mLocalFile
The local file containing the picture. |
protected Point |
mOrigin
The upper left hand corner of the image. |
protected URL |
mURL
The URL for the picture. |
protected boolean |
mValid
Flag indicating the image is valid. |
static Point |
ORIGIN
The origin for new points from the zero args constructor. |
protected int |
TRANSFER_SIZE
Copy buffer size. |
Fields inherited from class java.awt.Rectangle |
---|
height, width, x, y |
Fields inherited from class java.awt.geom.Rectangle2D |
---|
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
Picture(URL url,
PictureListener listener,
Rectangle r)
Construct a picture over the rectangle given. |
Method Summary | |
---|---|
Point |
getExtent()
Getter for property extent. |
Object |
getIdentity()
Getter for property identity. |
Image |
getImage()
Getter for property image. |
Point |
getOrigin()
Getter for property origin. |
boolean |
getValid()
|
boolean |
imageUpdate(Image image,
int infoflags,
int x,
int y,
int width,
int height)
This method is called when information about an image which was previously requested using an asynchronous interface becomes available. |
void |
reset()
Reset the picture to uncropped size. |
void |
run()
|
void |
setBounds(int x,
int y,
int width,
int height)
|
void |
setBounds(Rectangle r)
Set the rectangular region for this tile. |
void |
setExtent(Point extent)
Setter for property extent. |
void |
setIdentity(Object object)
Setter for property identity. |
void |
setOrigin(Point origin)
Setter for property origin. |
void |
setValid(boolean valid)
Sets the validity of the picture. |
String |
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, 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 org.htmlparser.lexerapplications.thumbelina.Tile |
---|
clone, getBounds |
Methods inherited from interface java.awt.Shape |
---|
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects |
Field Detail |
---|
protected final int TRANSFER_SIZE
public static final Point ORIGIN
protected URL mURL
public PictureListener mListener
protected boolean mValid
protected Point mOrigin
Rectangle
fields x
, y
,
width
and height
will change, but the
origin remains the same.
protected Point mExtent
Rectangle
fields
width
and height
will change, but the
extent remains the same.
protected Image mImage
protected File mLocalFile
Constructor Detail |
---|
public Picture(URL url, PictureListener listener, Rectangle r)
r
- The coordinates of the area.Method Detail |
---|
public Point getOrigin()
public void setOrigin(Point origin)
origin
- New value of property origin.public Point getExtent()
public void setExtent(Point extent)
extent
- New value of property extent.public Image getImage()
public void run()
run
in interface Runnable
public boolean getValid()
getValid
in interface Tile
public void setValid(boolean valid)
setValid
in interface Tile
valid
- If true
the picture is marked valid,
false otherwise.public Object getIdentity()
getIdentity
in interface Tile
public void setIdentity(Object object)
setIdentity
in interface Tile
object
- New value of property identity.public void reset()
reset
in interface Tile
public void setBounds(Rectangle r)
Tile
setBounds
in interface Tile
setBounds
in class Rectangle
r
- The new boundary.public void setBounds(int x, int y, int width, int height)
setBounds
in class Rectangle
public boolean imageUpdate(Image image, int infoflags, int x, int y, int width, int height)
This method should return true if further updates are needed or false if the required information has been acquired. The image which was being tracked is passed in using the img argument. Various constants are combined to form the infoflags argument which indicates what information about the image is now available. The interpretation of the x, y, width, and height arguments depends on the contents of the infoflags argument.
The infoflags
argument should be the bitwise inclusive
OR of the following flags: WIDTH
,
HEIGHT
, PROPERTIES
, SOMEBITS
,
FRAMEBITS
, ALLBITS
, ERROR
,
ABORT
.
imageUpdate
in interface ImageObserver
image
- the image being observed.infoflags
- the bitwise inclusive OR of the following
flags: WIDTH
, HEIGHT
,
PROPERTIES
, SOMEBITS
,
FRAMEBITS
, ALLBITS
,
ERROR
, ABORT
.x
- the x coordinate.y
- the y coordinate.width
- the width.height
- the height.
false
if the infoflags indicate that the
image is completely loaded; true
otherwise.ImageObserver.WIDTH
,
ImageObserver.HEIGHT
,
ImageObserver.PROPERTIES
,
ImageObserver.SOMEBITS
,
ImageObserver.FRAMEBITS
,
ImageObserver.ALLBITS
,
ImageObserver.ERROR
,
ImageObserver.ABORT
,
Image.getWidth(java.awt.image.ImageObserver)
,
Image.getHeight(java.awt.image.ImageObserver)
,
Graphics.drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver)
public String toString()
toString
in class Rectangle
|
© 2006 Derrick Oswald Sep 17, 2006
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
HTML Parser is an open source library released under Common Public License. |