|
|||||||||
| 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[] djvuPages,
boolean favorFast)
Creates a new DjVuImage object. |
|
DjVuImage(DjVuPage[] djvuPages,
boolean favorFast,
int zoom,
java.awt.Dimension size)
Creates a new DjVuImage object. |
|
DjVuImage(DjVuPage[] djvuPages,
boolean favorFast,
int width,
int height)
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(int index)
Query the size and other page information as indicated in the INFO chunk. |
DjVuPage |
getDjVuPage(int index)
Query a DjVuPage being rendered. |
DjVuFilter |
getFilter(java.awt.Component parent,
java.awt.Rectangle bounds,
int index)
Get a segmented image filter. |
java.awt.Rectangle |
getHighlightBounds()
Query the bounding rectangle of the area to highlight. |
double |
getHorizontalScale()
Query the horizontal scale |
java.awt.Image[] |
getImage(java.awt.Component parent,
java.awt.Rectangle bounds)
Get a segmented Image. |
int |
getIndexMax()
Query the size of the DjVuPage array. |
int |
getMaxDPI()
Query the maximum DPI of the pages being displayed. |
java.awt.Rectangle |
getPageBounds(int index)
Query the bounds for a particular page. |
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(int index,
long maxWait)
Query the DjVuText codec for this page. |
double |
getVerticalScale()
Query the vertical scale |
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(int index,
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(int index,
GRect rect,
java.awt.Rectangle scaled)
Transform the specified coordinates. |
void |
transformRectangle(int index,
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[] djvuPages,
boolean favorFast)
djvuPages - the array of pages to draw at full resolution.favorFast - true if fast magnifications should be favored.
public DjVuImage(DjVuPage[] djvuPages,
boolean favorFast,
int zoom,
java.awt.Dimension size)
djvuPages - the array of pages to draw at full resolution.favorFast - true if fast magnifications should be favored.zoom - factor to scale by as a percentagesize - holder for returning the viewing size
public DjVuImage(DjVuPage[] djvuPages,
boolean favorFast,
int width,
int height)
djvuPages - the array of pages to draw at full resolution.favorFast - true if fast magnifications should be favored.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 double getVerticalScale()
public double getHorizontalScale()
public int getMaxDPI()
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 java.awt.Rectangle getPageBounds(int index)
index - page to query
public boolean isDecoding()
public DjVuPage getDjVuPage(int index)
index - page to query
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,
int index)
parent - Parent component to create the Image in.bounds - Segmentation bounds.index - filter to create
public java.awt.Rectangle getHighlightBounds()
public void setHighlightList(int index,
java.util.Vector list)
index - of visible image to highlightlist - 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 int getIndexMax()
public final DjVuInfo getDjVuInfo(int index)
index - of the page to query
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(int index,
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(int index,
java.awt.Rectangle rect,
java.awt.Rectangle scaled)
index - visible image indexrect - rectangle to transform.scaled - the results of the transform.
public void transformRectangle(int index,
GRect rect,
java.awt.Rectangle scaled)
index - visible image to transform fromrect - 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 | ||||||||