|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lizardtech.djvubean.DjVuImage
public class DjVuImage
This class is used to represent a DjVuPage object as a Vector of buffered images, for displaying in a viewport.
Field Summary | |
---|---|
static java.awt.Color |
BLACK
A constant indicating the color blue. |
static java.awt.Color |
BLUE
A constant indicating the color blue. |
static boolean |
BROKEN_XOR
|
static java.lang.reflect.Constructor |
colorConstructor
Test to determine java version. |
static int |
FIT_PAGE
Magic scale value used to zoom to fit page. |
static int |
FIT_WIDTH
Magic scale value used to zoom to fit width. |
static java.awt.Color |
WHITE
A constant indicating the color white. |
static int |
XOR_HILITE
Special value for XOR HIGHLIGHTING |
Constructor Summary | |
---|---|
DjVuImage(DjVuPage djvuPage,
boolean favorFast)
Creates a new DjVuImage object. |
|
DjVuImage(DjVuPage djvuPage,
int zoom,
java.awt.Dimension size,
boolean favorFast)
Creates a new DjVuImage object. |
|
DjVuImage(DjVuPage djvuPage,
int width,
int height,
boolean favorFast)
Creates a new DjVuImage object. |
Method Summary | |
---|---|
java.awt.Rectangle |
computeScaledBounds(int zoom,
java.awt.Dimension size)
Compute the page size scaled at the appropriate zoom. |
static java.awt.Color |
createColor(int rgb,
int alpha)
Equivalent to new Color(rgb,hasAlpha). |
void |
draw(java.awt.Component parent,
java.awt.Graphics g,
java.awt.image.ImageObserver observer)
Called to create one or more images to draw to. |
void |
drawHighlight(java.awt.Graphics g,
boolean useXOR)
Called to paint the highlight areas onto the image. |
void |
fillRect(java.awt.Graphics g,
int color,
int opacity,
int xmin,
int ymin,
int xmax,
int ymax)
Set the color as specified and then call g.fillRect. |
java.awt.Dimension |
getBorderNW()
Query the north and west border width and height respectively. |
java.awt.Dimension |
getBorderSE()
Query the south and east border width and height respectively. |
java.awt.Rectangle |
getBounds()
Query the scaled size of this image, with an origin at (0,0). |
DjVuInfo |
getDjVuInfo()
Query the size and other page information as indicated in the INFO chunk. |
DjVuPage |
getDjVuPage()
Query the DjVuPage being rendered. |
DjVuFilter |
getFilter(java.awt.Component parent,
java.awt.Rectangle bounds)
Get a segmented Image. |
java.awt.Rectangle |
getHighlightBounds()
Query the bounding rectangle of the area to highlight. |
java.awt.Image[] |
getImage(java.awt.Component parent,
java.awt.Rectangle bounds)
Get a segmented Image. |
DjVuImage |
getScaledInstance(int scale)
Create a new instance of this class, scaled to the specified size. |
DjVuImage |
getScaledInstance(int width,
int height)
Create a new instance of this class, scaled to the specified size. |
java.awt.Dimension |
getSize()
Query the scaled size of the DjVuPage. |
Codec |
getTextCodec(long maxWait)
Query the DjVuText codec for this page. |
boolean |
isDecoding()
Query if decoding is still in progress. |
static boolean |
isDoneDecodingEvent(DjVuImage image,
java.beans.PropertyChangeListener listener,
java.beans.PropertyChangeEvent event)
Check if this is a done decoding event. |
boolean |
isDoneDecodingEvent(java.beans.PropertyChangeListener listener,
java.beans.PropertyChangeEvent event)
Check if this is a done decoding event. |
void |
setBorder(java.awt.Dimension parentSize,
java.awt.Rectangle imageBounds)
Computes the size of the border. |
void |
setBufferBounds(java.awt.Component parent,
java.awt.Rectangle bounds)
Sets the bounds for buffering. |
void |
setBufferBounds(java.awt.Rectangle bounds)
Sets the bounds for buffering. |
void |
setHighlightList(java.util.Vector list)
Take the list of highlighting rectangles and transform it to a list of non-overlapping rectangles covering the same regions. |
void |
transformRectangle(GRect rect,
java.awt.Rectangle scaled)
Transform the specified coordinates. |
void |
transformRectangle(java.awt.Rectangle rect,
java.awt.Rectangle scaled)
Transform the specified coordinates. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean BROKEN_XOR
public static java.awt.Color WHITE
public static java.awt.Color BLUE
public static java.awt.Color BLACK
public static final int FIT_WIDTH
public static final int FIT_PAGE
public static final java.lang.reflect.Constructor colorConstructor
public static final int XOR_HILITE
Constructor Detail |
---|
public DjVuImage(DjVuPage djvuPage, boolean favorFast)
djvuPage
- the page to draw at full resolution.public DjVuImage(DjVuPage djvuPage, int zoom, java.awt.Dimension size, boolean favorFast)
djvuPage
- the page to draw at full resolution.public DjVuImage(DjVuPage djvuPage, int width, int height, boolean favorFast)
djvuPage
- The page to draw.width
- The width to scale the page to.height
- The height to scale the page to.Method Detail |
---|
public static java.awt.Color createColor(int rgb, int alpha)
rgb
- color as an integeralpha
- true if there is an alpha channel
public java.awt.Rectangle computeScaledBounds(int zoom, java.awt.Dimension size)
zoom
- scale factorsize
- target window size
public java.awt.Dimension getBorderNW()
public java.awt.Dimension getBorderSE()
public boolean isDecoding()
public DjVuPage getDjVuPage()
public boolean isDoneDecodingEvent(java.beans.PropertyChangeListener listener, java.beans.PropertyChangeEvent event)
listener
- the listener to checkevent
- the event to check
public static boolean isDoneDecodingEvent(DjVuImage image, java.beans.PropertyChangeListener listener, java.beans.PropertyChangeEvent event)
image
- the image to checklistener
- the listener to checkevent
- the event to check
public void setBorder(java.awt.Dimension parentSize, java.awt.Rectangle imageBounds)
parentSize
- The size of the parent window.imageBounds
- The scaled size of the DjVuPage.public java.awt.Rectangle getBounds()
public void setBufferBounds(java.awt.Component parent, java.awt.Rectangle bounds)
parent
- The containing component.bounds
- The desired boundrary.public void setBufferBounds(java.awt.Rectangle bounds)
bounds
- Desired bounds.public DjVuFilter getFilter(java.awt.Component parent, java.awt.Rectangle bounds)
parent
- Parent component to create the Image in.bounds
- Segmentation bounds.
public java.awt.Rectangle getHighlightBounds()
public void setHighlightList(java.util.Vector list)
list
- of bounds to highlight.public java.awt.Image[] getImage(java.awt.Component parent, java.awt.Rectangle bounds)
parent
- Parent component to create the Image in.bounds
- Segmentation bounds.
public final DjVuInfo getDjVuInfo()
public DjVuImage getScaledInstance(int width, int height)
width
- Scaled width.height
- Scaled height.
public DjVuImage getScaledInstance(int scale)
scale
- Scaling, relative to DPI.
public java.awt.Dimension getSize()
public Codec getTextCodec(long maxWait)
maxWait
- The maximum amount of time to wait. (In milliseconds.)
public void draw(java.awt.Component parent, java.awt.Graphics g, java.awt.image.ImageObserver observer)
parent
- Component being drawn to.g
- Graphics device to draw to.observer
- The ImageObserver monitoring progressive rendering.public void transformRectangle(java.awt.Rectangle rect, java.awt.Rectangle scaled)
rect
- rectangle to transform.scaled
- the results of the transform.public void transformRectangle(GRect rect, java.awt.Rectangle scaled)
rect
- rectangle to transform.scaled
- the results of the transform.public void drawHighlight(java.awt.Graphics g, boolean useXOR)
g
- graphics object to draw.useXOR
- true if XOR highlighting should be used.public void fillRect(java.awt.Graphics g, int color, int opacity, int xmin, int ymin, int xmax, int ymax)
g
- Graphics item to use.color
- RGB color to useopacity
- Level of opacity from 0 to 100.xmin
- left edgeymin
- top edgexmax
- right edgeymax
- bottom edge
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |