|
|||||||||
| 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
com.lizardtech.djvu.anno.Poly
public class Poly
Implements polygonal map areas. The only supported types of border are NO_BORDER, XOR_BORDER and SOLID_BORDER. Its contents can not be highlighted either. It's worth mentioning here that despite its name the polygon may be open, which basically makes it a broken line. This very specific mode is used by the hyperlink editor when creating the polygonal hyperlink.
| Field Summary | |
|---|---|
static java.lang.String |
POLY_TAG
The tag name for this shape. |
| Fields inherited from class com.lizardtech.djvu.anno.Rect |
|---|
ARROW_TAG, BGCOLOR_TAG, BORDER_AVIS_TAG, HILITE_TAG, LINE_ARROW_TAG, LINE_CLR_TAG, LINE_WIDTH_TAG, LINECOLOR_TAG, MAP_LINE, MAP_OVAL, MAP_POLY, MAP_RECT, MAP_TEXT, MAPAREA_TAG, NO_BORDER, NO_BORDER_TAG, NO_HILITE, OPACITY_TAG, PUSHPIN_TAG, RECT_TAG, SHADOW_EIN_BORDER, SHADOW_EIN_BORDER_TAG, SHADOW_EOUT_BORDER, SHADOW_EOUT_BORDER_TAG, SHADOW_IN_BORDER, SHADOW_IN_BORDER_TAG, SHADOW_OUT_BORDER, SHADOW_OUT_BORDER_TAG, SOLID_BORDER, SOLID_BORDER_TAG, TARGET_SELF, TEXTCOLOR_TAG, URL_TAG, XOR_BORDER, XOR_BORDER_TAG, XOR_HILITE |
| Fields inherited from class com.lizardtech.djvu.DjVuObject |
|---|
hasReferences |
| Constructor Summary | |
|---|---|
Poly()
Creates a new Poly object. |
|
| Method Summary | |
|---|---|
int |
add_vertex(int x,
int y)
Adds a new vertex and returns number of vertices in the polygon |
boolean |
contains(int xin,
int yin)
Check if the point is inside the hyperlink area |
static Poly |
createPoly(DjVuInterface ref)
Creates an instance of Poly with the options interherited from the specified reference. |
boolean |
does_side_cross_rect(GRect grect,
int side)
Query if side crosses the specified rectangle rect. |
GRect |
getBounds()
Query the bounding rectangle for this shape. |
int |
getMapType()
Query the map type. |
java.util.Vector |
getPoints()
Method generating a list of defining coordinates |
java.lang.String |
getShapeName()
Query the shape tag name |
Poly |
init(int[] xx,
int[] yy,
int points)
Initialize a closed polygon from specified coordinates. |
Poly |
init(int[] xx,
int[] yy,
int points,
boolean open)
Initialize from specified coordinates. |
boolean |
isDataValid()
Checks validity of the polygon |
boolean |
isEmpty()
Query if the poly is closed |
boolean |
isOpen()
Query if this is an open polygon. |
boolean |
isValid()
Checks if the object is OK. |
void |
map(Mapper mapper)
Method maps polygon from one area to another using mapper |
void |
move_vertex(int i,
int x,
int y)
Moves vertex i to position (x, y) |
void |
move(int dx,
int dy)
Move all the points of the polygon. |
void |
optimize_data()
Optimizes the polygon |
void |
reset()
Resets cached results. |
void |
resize(int width,
int height)
Rescale the polygon to the specified bounds size. |
void |
rotateArea(int rot,
int cx,
int cy)
Rotate this area about the specified origin |
void |
setOpen(boolean open)
Closes or open the polygon |
int |
size()
Query the number sides in the polygon |
void |
transform(GRect grect)
Move and scale this polygon to the specified bounding rectangle. |
void |
unmap(Mapper mapper)
Method unmaps polygon from one area to another using mapper |
| Methods inherited from class com.lizardtech.djvu.anno.Rect |
|---|
computeArray, createRect, get_shape_name, getBgColor, getBorderColor, getBorderType, getBorderWidth, getComment, getHiliteColor, getInfoHeight, getInfoWidth, getLineColor, getLineWidth, getOpacity, getScaledHeight, getScaledWidth, getTarget, getTextColor, getURL, getXCoordinates, getYCoordinates, init, isArrow, isBorderAlwaysVisible, isPushpin, isVisible, setArrow, setBgColor, setBorderAlwaysVisible, setBorderColor, setBorderType, setBorderWidth, setComment, setHiliteColor, setLineColor, setLineWidth, setOpacity, setPageSize, setPushpin, setTarget, setTextColor, setURL, setVisible |
| Methods inherited from class com.lizardtech.djvu.DjVuObject |
|---|
checkLockTime, create, create, createSoftReference, createWeakReference, getDjVuOptions, getFromReference, invoke, logError, printStackTrace, setDjVuOptions, verbose |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String POLY_TAG
| Constructor Detail |
|---|
public Poly()
| Method Detail |
|---|
public GRect getBounds()
getBounds in class Rectpublic int getMapType()
getMapType in class Rectpublic static Poly createPoly(DjVuInterface ref)
ref - Object to interherit DjVuOptions from.
public boolean isEmpty()
isEmpty in class Rectpublic boolean isDataValid()
public void setOpen(boolean open)
open - true if this should be an open polygonpublic boolean isOpen()
public java.util.Vector getPoints()
getPoints in class Rectpublic java.lang.String getShapeName()
public boolean isValid()
isValid in class Rect
public int add_vertex(int x,
int y)
x - horizontal positiony - vertical position
public boolean contains(int xin,
int yin)
contains in class Rectxin - horizontal positionyin - vertical position
public boolean does_side_cross_rect(GRect grect,
int side)
grect - the rectangle to checkside - the side number to check
public Poly init(int[] xx,
int[] yy,
int points,
boolean open)
xx - array of horizontal positionsyy - array of vertical positionspoints - number of pointsopen - true if an open polygon
public Poly init(int[] xx,
int[] yy,
int points)
xx - array of horizontal positionsyy - array of vertical positionspoints - number of points
public void map(Mapper mapper)
map in class Rectmapper - used to remap the points
public void move(int dx,
int dy)
move in class Rectdx - Delta x value to add.dy - Delta y value to add.
public void move_vertex(int i,
int x,
int y)
i - point to movex - horizontal positiony - vertical positionpublic void optimize_data()
public void resize(int width,
int height)
resize in class Rectwidth - horizontal length to scale toheight - vertical length to scale to
public void rotateArea(int rot,
int cx,
int cy)
rotateArea in class Rectrot - angle to rotate divided by 90cx - horizontal position of the center of rotationcy - vertical position of the center of rotationpublic int size()
public void transform(GRect grect)
transform in class Rectgrect - the new bounding rectanglepublic void unmap(Mapper mapper)
unmap in class Rectmapper - the mapper to transform the coordinatespublic void reset()
reset in class Rect
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||