|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lizardtech.djvu.DjVuObject
com.lizardtech.djvu.anno.Rect
public class Rect
This class is the base of all annotations by the viewer to display and manage hyperlinks and highlighted areas inside a DjVuPage.
The currently supported areas can be rectangular GMapRect, elliptical GMapOval and polygonal GMapPoly. Every map area besides the definition of its shape contains information about display style and optional URL, which it may refer to. If this URL is not empty then the map area will work like a hyperlink.
The classes also implement some useful functions to ease geometry manipulations
This is the interface for all map areas. This defines some standard interface to access the geometrical properties of the areas and describes the area itself.
target - Defines where the specified URL should be loaded
comment - This is a string displayed in a status line or in a popup window when the mouse pointer moves over the hyperlink area
border_width - describes how the area border should be drawn
area_color - describes how the area should be highlighted.
The map areas can be displayed using two different techniques, which can be combined together:
Visible border - The border of a map area can be drawn in several different ways (like XOR_BORDER or SHADOW_IN_BORDER). It can be made always visible, or appearing only when the mouse pointer moves over the map area.
Highlighted contents - Contents of rectangular map areas can also be highlighted with some given color.
Field Summary | |
---|---|
static java.lang.String |
ARROW_TAG
arrow tag |
static java.lang.String |
BGCOLOR_TAG
text background color tag |
static java.lang.String |
BORDER_AVIS_TAG
border always visible tag |
static java.lang.String |
HILITE_TAG
hilite tag |
static java.lang.String |
LINE_ARROW_TAG
line arrow tag |
static java.lang.String |
LINE_CLR_TAG
line clear tag |
static java.lang.String |
LINE_WIDTH_TAG
line width tag |
static java.lang.String |
LINECOLOR_TAG
line color tag |
static int |
MAP_LINE
line map type |
static int |
MAP_OVAL
oval map type |
static int |
MAP_POLY
poly map type |
static int |
MAP_RECT
rectangle map type |
static int |
MAP_TEXT
text map type |
static java.lang.String |
MAPAREA_TAG
maparea tag |
static int |
NO_BORDER
no border flag |
static java.lang.String |
NO_BORDER_TAG
no border tag |
static int |
NO_HILITE
no hilite color |
static java.lang.String |
OPACITY_TAG
opacity tag |
static java.lang.String |
PUSHPIN_TAG
text pushpin tag |
static java.lang.String |
RECT_TAG
rect tag |
static int |
SHADOW_EIN_BORDER
shadow ein border flag |
static java.lang.String |
SHADOW_EIN_BORDER_TAG
shadow ein tag |
static int |
SHADOW_EOUT_BORDER
shadow ein border flag |
static java.lang.String |
SHADOW_EOUT_BORDER_TAG
shadow eout tag |
static int |
SHADOW_IN_BORDER
shadow in border flag |
static java.lang.String |
SHADOW_IN_BORDER_TAG
shadow in tag |
static int |
SHADOW_OUT_BORDER
shadow out border flag |
static java.lang.String |
SHADOW_OUT_BORDER_TAG
shadow out tag |
static int |
SOLID_BORDER
solid border flag |
static java.lang.String |
SOLID_BORDER_TAG
border tag |
static java.lang.String |
TARGET_SELF
target self tag |
static java.lang.String |
TEXTCOLOR_TAG
text foreground color tag |
static java.lang.String |
URL_TAG
url tag |
static int |
XOR_BORDER
xor border flag |
static java.lang.String |
XOR_BORDER_TAG
xor border tag |
static int |
XOR_HILITE
xor hilite color |
Fields inherited from class com.lizardtech.djvu.DjVuObject |
---|
hasReferences |
Constructor Summary | |
---|---|
Rect()
Creates a new Rect object. |
Method Summary | |
---|---|
int[] |
computeArray(boolean needY)
A method for setting the coordinates |
boolean |
contains(int x,
int y)
Check if the point is inside the hyperlink area |
static Rect |
createRect(DjVuInterface ref)
Creates an instance of Rect with the options interherited from the specified reference. |
java.lang.String |
get_shape_name()
Query the name of this shape. |
int |
getBgColor()
Get the color of text background in the map area. |
int |
getBorderColor()
Get the color the area border should be drawn. |
int |
getBorderType()
Get the border type. |
int |
getBorderWidth()
Get border width in pixels. |
GRect |
getBounds()
Query the bounding rectangle. |
java.lang.String |
getComment()
Comment - displayed in a status line or as a popup hint when the mouse pointer moves over the map area |
int |
getHiliteColor()
Get the specified a color for highlighting the internal area of the map area. |
protected long |
getInfoHeight()
Query the info height. |
protected long |
getInfoWidth()
Query the info width. |
int |
getLineColor()
Get the color of the line across the map area. |
int |
getLineWidth()
Set the specified a thickness of a line. |
int |
getMapType()
Query the map type. |
int |
getOpacity()
Query the opacity. |
java.util.Vector |
getPoints()
Method generating a list of defining coordinates. |
protected long |
getScaledHeight()
Query the scaled height. |
protected long |
getScaledWidth()
Query the scaled width. |
java.lang.String |
getTarget()
Get the target for the URL. |
int |
getTextColor()
Get the color of text in the map area. |
java.lang.String |
getURL()
Get optional URL which this map area can be associated with. |
int[] |
getXCoordinates()
Gets an array of X coordinates, converted from bottom up to dop down if the pageInfoHeight has been set to non-zero. |
int[] |
getYCoordinates()
Gets an array of Y coordinates, converted from bottom up to dop down if the pageInfoHeight has been set to non-zero. |
Rect |
init(GRect rect)
Changes the Rect's geometry |
boolean |
isArrow()
Query if an arrow should be drawn. |
boolean |
isBorderAlwaysVisible()
Query if the border is always visible, or just when the mouse is over the link. |
boolean |
isEmpty()
Query if the area is empty |
boolean |
isPushpin()
Query if a pushpin should be used. |
boolean |
isValid()
Checks if the object is OK. |
boolean |
isVisible()
Query if the border should current by visible. |
void |
map(Mapper mapper)
Method maps rectangle from one area to another using mapper |
void |
move(int dx,
int dy)
Moves the hyperlink along the given vector. |
protected void |
reset()
Resets cached results. |
void |
resize(int width,
int height)
Resize this shape. |
void |
rotateArea(int rot,
int cx,
int cy)
Called to rotate this shape. |
void |
setArrow(boolean value)
Set if a arrow should be drawn. |
void |
setBgColor(java.lang.Number color)
Set the specified a color for text background of the map area. |
void |
setBorderAlwaysVisible(boolean visible)
Set if the border is always visible, or just when the mouse is over the link. |
void |
setBorderColor(java.lang.Number color)
Sets the color the area border should be drawn. |
void |
setBorderType(int borderType)
Set the border type. |
void |
setBorderWidth(int width)
Set border width in pixels. |
void |
setComment(java.lang.String comment)
Comment - displayed in a status line or as a popup hint when the mouse pointer moves over the map area |
void |
setHiliteColor(java.lang.Number color)
Set the specified a color for highlighting the internal area of the map area. |
void |
setLineColor(java.lang.Number color)
Set the specified a color for a line across map area. |
void |
setLineWidth(java.lang.Number weight)
Set the specified a thickness of a line. |
void |
setOpacity(java.lang.Number opacity)
Set the specified a opacity. |
void |
setPageSize(int width,
int height,
int scaledWidth,
int scaledHeight)
Use this method to set the page height and width for translating from bottom up to top down coordinates and scaling. |
void |
setPushpin(boolean value)
Set if a pushpin should be used. |
void |
setTarget(java.lang.String target)
Set the target for the URL. |
void |
setTextColor(java.lang.Number color)
Set the specified a color for text of the map area. |
void |
setURL(java.lang.String url)
Set optional URL which this map area can be associated with. |
void |
setVisible(boolean visible)
Set if the border should current by visible. |
void |
transform(GRect grect)
Move and resize this shape to the new bounding rectangle. |
void |
unmap(Mapper mapper)
Method unmaps rectangle from one area to another using mapper |
Methods inherited from class com.lizardtech.djvu.DjVuObject |
---|
checkLockTime, create, create, createSoftReference, createWeakReference, getDjVuOptions, getFromReference, invoke, setDjVuOptions |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAP_RECT
public static final int MAP_OVAL
public static final int MAP_POLY
public static final int MAP_TEXT
public static final int MAP_LINE
public static final int NO_BORDER
public static final int XOR_BORDER
public static final int SOLID_BORDER
public static final int SHADOW_IN_BORDER
public static final int SHADOW_OUT_BORDER
public static final int SHADOW_EIN_BORDER
public static final int SHADOW_EOUT_BORDER
public static final java.lang.String MAPAREA_TAG
public static final java.lang.String RECT_TAG
public static final java.lang.String NO_BORDER_TAG
public static final java.lang.String XOR_BORDER_TAG
public static final java.lang.String SOLID_BORDER_TAG
public static final java.lang.String SHADOW_IN_BORDER_TAG
public static final java.lang.String SHADOW_OUT_BORDER_TAG
public static final java.lang.String SHADOW_EIN_BORDER_TAG
public static final java.lang.String SHADOW_EOUT_BORDER_TAG
public static final java.lang.String BORDER_AVIS_TAG
public static final java.lang.String HILITE_TAG
public static final java.lang.String ARROW_TAG
public static final java.lang.String URL_TAG
public static final java.lang.String TARGET_SELF
public static final java.lang.String PUSHPIN_TAG
public static final java.lang.String BGCOLOR_TAG
public static final java.lang.String TEXTCOLOR_TAG
public static final java.lang.String LINECOLOR_TAG
public static final java.lang.String LINE_ARROW_TAG
public static final java.lang.String LINE_WIDTH_TAG
public static final java.lang.String LINE_CLR_TAG
public static final java.lang.String OPACITY_TAG
public static final int NO_HILITE
public static final int XOR_HILITE
Constructor Detail |
---|
public Rect()
Method Detail |
---|
public void setBorderAlwaysVisible(boolean visible)
visible
- true if the border should always be visible.public boolean isBorderAlwaysVisible()
public void setPushpin(boolean value)
value
- true if this is a pushpinpublic boolean isPushpin()
public void setArrow(boolean value)
value
- true if this should have an arrowpublic boolean isArrow()
public void setBorderColor(java.lang.Number color)
color
- DOCUMENT ME!public int getBorderColor()
public void setBorderType(int borderType)
borderType
- DOCUMENT ME!public int getBorderType()
public void setBorderWidth(int width)
width
- DOCUMENT ME!public int getBorderWidth()
public void setComment(java.lang.String comment)
comment
- DOCUMENT ME!public java.lang.String getComment()
public void setHiliteColor(java.lang.Number color)
color
- the hilite colorpublic int getHiliteColor()
public void setTextColor(java.lang.Number color)
color
- the text colorpublic int getTextColor()
public void setBgColor(java.lang.Number color)
color
- the text colorpublic int getBgColor()
public void setLineColor(java.lang.Number color)
color
- the line colorpublic void setLineWidth(java.lang.Number weight)
weight
- the line widthpublic int getLineColor()
public int getLineWidth()
public void setOpacity(java.lang.Number opacity)
opacity
- the opacity of this annotationpublic int getOpacity()
public int getMapType()
public void setTarget(java.lang.String target)
target
- DOCUMENT ME!public java.lang.String getTarget()
getTarget
in interface Hyperlink
public void setURL(java.lang.String url)
url
- DOCUMENT ME!public java.lang.String getURL()
getURL
in interface Hyperlink
public void setVisible(boolean visible)
visible
- true if visiblepublic boolean isVisible()
public static Rect createRect(DjVuInterface ref)
ref
- Object to interherit DjVuOptions from.
public GRect getBounds()
public boolean isEmpty()
public final void setPageSize(int width, int height, int scaledWidth, int scaledHeight)
width
- page widthheight
- page heightscaledWidth
- scaled page widthscaledHeight
- scaled page heightpublic java.util.Vector getPoints()
public final int[] getXCoordinates()
public final int[] getYCoordinates()
public final int[] computeArray(boolean needY)
needY
- true if the y coordinates should be returned
public boolean isValid()
public boolean contains(int x, int y)
x
- horizontal coordinatey
- vertical coordinate
public java.lang.String get_shape_name()
public Rect init(GRect rect)
rect
- bounding rectangle
public void map(Mapper mapper)
mapper
- the coordinate mapperpublic void move(int dx, int dy)
dx
- distance to move the x coordinatesdy
- distance to move the y coordinatespublic void resize(int width, int height)
width
- the new widthheight
- the new heightpublic void rotateArea(int rot, int cx, int cy)
rot
- angle to rotate divided by 90cx
- horizontal center of rotationcy
- vertical center of rotationpublic void transform(GRect grect)
grect
- new bounding rectanglepublic void unmap(Mapper mapper)
mapper
- object to map coordinatesprotected final long getInfoHeight()
protected final long getInfoWidth()
protected final long getScaledHeight()
protected final long getScaledWidth()
protected void reset()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |