|
Gnostice PDFOne
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gnostice.pdfone.PdfAnnot
com.gnostice.pdfone.PdfProAnnot
com.gnostice.pdfone.PdfPolylineAnnot
This class represents a polyline annotation. A polyline annotation
represents a set of lines representing an open or closed figure. A
polyline annotation is built around a set of points that form the
starting and ending points of the lines. A
polygon annotation
is derivation of the
polyline annotation where a closed figure is formed. To specify the
locations of the vertices, use the
setVertices()
method. To specify
line-ending styles for an annotation, use methods such as
setLineStartStyle(int)
with constants such as
LINEENDSTYLE_OPEN_ARROW
. Here is a sample code snippet
that illustrates how to create a polyline annotation.
PdfWriter writer1 = PdfWriter.fileWriter( new File("PdfPolylineAnnot_example.pdf")); PdfDocument doc1 = new PdfDocument(writer1); PdfPage p1 = new PdfPage(); doc1.add(p1); // Define x-y coordinates for the lines forming the // polyline double vcs[] = { 100,100,150,150,200,250,300,300 }; // Create a polyline annotation PdfPolylineAnnot pla1 = new PdfPolylineAnnot( vcs, "Subject line", "text content", "title text", PdfAnnot.FLAG_PRINT, Color.YELLOW); // Specify color used to fill the ends of the polyline pla1.setInteriorColor(Color.ORANGE); // Specify line-ending styles for the ends of the polyline pla1.setLineStartStyle(PdfPolylineAnnot.LINEENDSTYLE_CIRCLE); pla1.setLineEndStyle(PdfPolylineAnnot.LINEENDSTYLE_SQUARE); // Add annotation to the document doc1.addAnnotation(pla1, 1); doc1.setOpenAfterSave(true); doc1.write(); writer1.dispose();
Field Summary | |
static int |
LINEENDSTYLE_BUTT
Constant for specifying a perpendicular line at the end of a polyline. |
static int |
LINEENDSTYLE_CIRCLE
Constant for specifying a circle-shaped end of a polyline. |
static int |
LINEENDSTYLE_CLOSED_ARROW
Constant for specifying a triangular arrow-like end of a polyline. |
static int |
LINEENDSTYLE_DIAMOND
Constant for specifying a diamond-shaped end of a polyline. |
static int |
LINEENDSTYLE_NONE
Constant for specifying an abrupt end of a polyline. |
static int |
LINEENDSTYLE_OPEN_ARROW
Constant for specifying an arrow-like end of a polyline. |
static int |
LINEENDSTYLE_RCLOSED_ARROW
Constant for specifying an inverted triangular arrow-like end of a polyline. |
static int |
LINEENDSTYLE_ROPEN_ARROW
Constant for specifying an inverted arrow-like end of a polyline. |
static int |
LINEENDSTYLE_SLASH
Constant for specifying a slanted line at the end of a polyline. |
static int |
LINEENDSTYLE_SQUARE
Constant for specifying a square-shaped end of a polyline. |
Constructor Summary | |
PdfPolylineAnnot()
Zero-argument default constructor. |
|
PdfPolylineAnnot(double[] vertices,
Color c)
|
|
PdfPolylineAnnot(double[] vertices,
int flags)
|
|
PdfPolylineAnnot(double[] vertices,
int flags,
Color c)
|
|
PdfPolylineAnnot(double[] vertices,
String subject,
String contents,
String title)
|
|
PdfPolylineAnnot(double[] vertices,
String subject,
String contents,
String title,
Color c)
|
|
PdfPolylineAnnot(double[] vertices,
String subject,
String contents,
String title,
int flags)
|
|
PdfPolylineAnnot(double[] vertices,
String subject,
String contents,
String title,
int flags,
Color c)
|
|
PdfPolylineAnnot(PdfRect r,
Color c)
Deprecated. Instead, use PdfPolylineAnnot(double[], Color) . |
|
PdfPolylineAnnot(PdfRect r,
int flags)
Deprecated. Instead, use PdfPolylineAnnot(double[], int) . |
|
PdfPolylineAnnot(PdfRect r,
int flags,
Color c)
Deprecated. Instead, use PdfPolylineAnnot(double[], int, Color) . |
|
PdfPolylineAnnot(PdfRect r,
String subject,
String contents,
String title)
Deprecated. |
|
PdfPolylineAnnot(PdfRect r,
String subject,
String contents,
String title,
Color c)
Deprecated. Instead, use PdfPolylineAnnot(double[], String, String, String, Color) . |
|
PdfPolylineAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags)
Deprecated. Instead, use PdfPolylineAnnot(double[], String, String, String, int) . |
|
PdfPolylineAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c)
Deprecated. Instead, use PdfPolylineAnnot(PdfRect, String, String, String, int, Color) . |
|
PdfPolylineAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c,
int lineStartStyle,
int lineEndStyle,
Color interior,
double[] vertices)
Deprecated. |
Method Summary | |
Object |
clone()
|
PdfAppearanceStream |
getDownAppearance()
Returns the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field and holds down the mouse button. |
Color |
getInteriorColor()
Returns color used to fill the ends of the polyline. |
int |
getLineEndStyle()
Returns line-ending style of the end of the polyline. |
int |
getLineStartStyle()
Returns line-ending style of the beginning of the polyline. |
PdfAppearanceStream |
getNormalAppearance()
Returns the default appearance stream that needs to be used by a viewer application to display the annotation/form field (that is, when the user is not interacting with the annotation/form field). |
PdfPopUpAnnot |
getPopup()
Returns a popup annotation that needs to be used by a viewer application to display the popup window for this annotation. |
PdfAppearanceStream |
getRolloverAppearance()
Returns the appearance stream that needs to be used by a viewer application to display the annotation when the user places the mouse pointer over the annotation (and does not hold down the mouse button). |
float |
getTransparency()
|
double[] |
getVertices()
Returns locations that are connected by lines to form the polygon or polyline shape of the annotation. |
void |
setDownAppearance(PdfAppearanceStream downAppearance)
Specifies the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field and holds down the mouse button. |
void |
setInteriorColor(Color interiorColor)
Specifies color that needs to be used to fill the ends of the polyline. |
void |
setLineEndStyle(int lineEndStyle)
Specifies line-ending style for the end of the polyline. |
void |
setLineStartStyle(int lineStartStyle)
Specifies line-ending style for the beginning of the polyline. |
void |
setNormalAppearance(PdfAppearanceStream normalAppearance)
Specifies the default appearance stream that needs to be used by a viewer application to display the annotation/form field (that is, when the user is not interacting with the annotation/form field). |
void |
setPopup(PdfPopUpAnnot popup,
boolean overridePopUpProperties)
Specifies a popup annotation that needs to be used by a viewer application to display the popup window for this annotation. |
void |
setRect(double x,
double y,
double width,
double height)
Specifies annotation rectangle for this annotation at ( x , y )
with specified width and height. |
void |
setRect(double x,
double y,
double width,
double height,
int mu)
Specifies annotation rectangle for this annotation in specified measurement unit. |
void |
setRect(PdfRect r)
Specifies PdfRect object as
annotation rectangle
for this annotation. |
void |
setRect(PdfRect r,
int mu)
Specifies PdfRect object as
annotation rectangle for this annotation in specified
measurement unit. |
void |
setRect(Rectangle r)
Specifies Rectangle object as
annotation rectangle for this annotation. |
void |
setRolloverAppearance(PdfAppearanceStream rolloverAppearance)
Specifies the appearance stream that needs to be used by a viewer application to display the annotation/form field when the user places the mouse pointer over the annotation/form field (and does not hold down the mouse button). |
void |
setTransparency(float transparecyLevel)
|
void |
setVertices(double[] vertices)
Specifies locations that need to be connected by lines to form the polygon or polyline shape of the annotation. |
void |
setVertices(double[] vertices,
int measurementUnit)
Specifies locations in specified measurement units that need to be connected by lines to form the polygon or polyline shape of the annotation. |
Methods inherited from class com.gnostice.pdfone.PdfAnnot |
delete, getAnnotName, getBorderStyle, getBorderWidth, getBottom, getColor, getContents, getDashPattern, getFlags, getLeft, getRect, getRight, getSubject, getTitle, getTop, getType, hashCode, isDeleted, isShowRect, setAnnotName, setBorderStyle, setBorderWidth, setColor, setContents, setDashPattern, setFlags, setShowRect, setSubject, setTitle |
Methods inherited from class java.lang.Object |
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int LINEENDSTYLE_SQUARE
public static final int LINEENDSTYLE_CIRCLE
public static final int LINEENDSTYLE_DIAMOND
public static final int LINEENDSTYLE_OPEN_ARROW
public static final int LINEENDSTYLE_CLOSED_ARROW
public static final int LINEENDSTYLE_NONE
public static final int LINEENDSTYLE_BUTT
public static final int LINEENDSTYLE_ROPEN_ARROW
public static final int LINEENDSTYLE_RCLOSED_ARROW
public static final int LINEENDSTYLE_SLASH
Constructor Detail |
public PdfPolylineAnnot()
public PdfPolylineAnnot(PdfRect r, String subject, String contents, String title, int flags, Color c, int lineStartStyle, int lineEndStyle, Color interior, double[] vertices) throws IOException, PdfException
public PdfPolylineAnnot(PdfRect r, String subject, String contents, String title) throws IOException, PdfException
public PdfPolylineAnnot(PdfRect r, String subject, String contents, String title, Color c) throws IOException, PdfException
PdfPolylineAnnot(double[], String, String, String, Color)
.
public PdfPolylineAnnot(double[] vertices, String subject, String contents, String title, Color c) throws IOException, PdfException
public PdfPolylineAnnot(PdfRect r, String subject, String contents, String title, int flags) throws IOException, PdfException
PdfPolylineAnnot(double[], String, String, String, int)
.
public PdfPolylineAnnot(double[] vertices, String subject, String contents, String title, int flags) throws IOException, PdfException
public PdfPolylineAnnot(PdfRect r, String subject, String contents, String title, int flags, Color c) throws IOException, PdfException
PdfPolylineAnnot(PdfRect, String, String, String, int, Color)
.
public PdfPolylineAnnot(double[] vertices, String subject, String contents, String title, int flags, Color c) throws IOException, PdfException
public PdfPolylineAnnot(PdfRect r, int flags) throws IOException, PdfException
PdfPolylineAnnot(double[], int)
.
public PdfPolylineAnnot(double[] vertices, int flags) throws IOException, PdfException
public PdfPolylineAnnot(PdfRect r, int flags, Color c) throws IOException, PdfException
PdfPolylineAnnot(double[], int, Color)
.
public PdfPolylineAnnot(double[] vertices, int flags, Color c) throws IOException, PdfException
public PdfPolylineAnnot(double[] vertices, String subject, String contents, String title) throws IOException, PdfException
public PdfPolylineAnnot(PdfRect r, Color c) throws IOException, PdfException
PdfPolylineAnnot(double[], Color)
.
public PdfPolylineAnnot(double[] vertices, Color c) throws IOException, PdfException
Method Detail |
public Object clone()
public Color getInteriorColor()
public void setInteriorColor(Color interiorColor)
interiorColor
- color that needs to be used to fill the ends of
the polylinepublic double[] getVertices()
setVertices(double[])
,
setVertices(double[], int)
public void setVertices(double[] vertices)
vertices
- x-y coordinates of the locations in the format (x1,
y1, x2, y2, x3, y3...). In case of a polygon
annotation, the last set of x-y coordinates will be
connected with the first set to form the closed
figure of a polygon.getVertices()
public void setVertices(double[] vertices, int measurementUnit)
vertices
- x-y coordinates of the locations in the format (x1,
y1, x2, y2, x3, y3...). In case of a polygon
annotation, the last set of x-y coordinates will be
connected with the first set to form the closed
figure of a polygon.measurementUnit
- constant specifying the measurement unitgetVertices()
,
PdfMeasurement
public final int getLineStartStyle()
setLineStartStyle(int)
,
getLineEndStyle()
,
setLineEndStyle(int)
public final void setLineStartStyle(int lineStartStyle)
LINEENDSTYLE_SQUARE
.
lineStartStyle
- constant specifying the line-ending stylegetLineStartStyle()
,
setLineEndStyle(int)
,
getLineEndStyle()
public void setTransparency(float transparecyLevel)
public float getTransparency()
public final int getLineEndStyle()
setLineEndStyle(int)
,
setLineStartStyle(int)
,
getLineStartStyle()
public final void setLineEndStyle(int lineEndStyle)
LINEENDSTYLE_SQUARE
.
lineEndStyle
- constant specifying the line-ending stylegetLineEndStyle()
,
getLineStartStyle()
,
setLineStartStyle(int)
public void setRect(double x, double y, double width, double height)
PdfAnnot
x
, y
)
with specified width and height.
The position (x
, y
), and dimensions
width
and height
are applied in the
default measurement unit of the page to which the annotation
is added.
setRect
in class PdfAnnot
x
- x-coordinate of the annotation rectangley
- y-coordinate of the annotation rectanglewidth
- width of the annotation rectangleheight
- height of the annotation rectanglePdfAnnot.getRect()
public void setRect(double x, double y, double width, double height, int mu)
PdfAnnot
setRect
in class PdfAnnot
x
- x-coordinate of the annotation rectangley
- y-coordinate of the annotation rectanglewidth
- width of the annotation rectangleheight
- height of the annotation rectanglemu
- measurement unit with which the annotation rectangle
is specifiedPdfAnnot.getRect()
public void setRect(PdfRect r)
PdfAnnot
PdfRect
object as
annotation rectangle
for this annotation.
The position and size of the rectangle are applied in the default measurement unit of the page to which the annotation is added.
setRect
in class PdfAnnot
r
- annotation rectangle for this annotationPdfAnnot.getRect()
public void setRect(PdfRect r, int mu)
PdfAnnot
PdfRect
object as
annotation rectangle for this annotation in specified
measurement unit.
setRect
in class PdfAnnot
r
- annotation rectangle for this annotationmu
- measurement unit with which the annotation rectangle
is specifiedPdfAnnot.getRect()
public void setRect(Rectangle r)
PdfAnnot
Rectangle
object as
annotation rectangle for this annotation.
setRect
in class PdfAnnot
r
- annotation rectangle for this annotationPdfAnnot.getRect()
public PdfPopUpAnnot getPopup()
public void setPopup(PdfPopUpAnnot popup, boolean overridePopUpProperties)
popup
- popup annotation that needs to be used as the popup
windowoverridePopUpProperties
- whether a viewer application should override the
properties of the popup annotation with those of
this annotationPdfProAnnot.getPopup()
public PdfAppearanceStream getDownAppearance()
PdfProAnnot.getNormalAppearance()
,
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.setNormalAppearance(PdfAppearanceStream)
,
PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)
,
PdfProAnnot.setDownAppearance(PdfAppearanceStream)
public void setDownAppearance(PdfAppearanceStream downAppearance)
PdfProAnnot.getNormalAppearance()
,
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.getRolloverAppearance()
,
PdfProAnnot.setNormalAppearance(PdfAppearanceStream)
,
PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)
public PdfAppearanceStream getNormalAppearance()
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.getRolloverAppearance()
,
PdfProAnnot.setNormalAppearance(PdfAppearanceStream)
,
PdfProAnnot.setDownAppearance(PdfAppearanceStream)
,
PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)
public void setNormalAppearance(PdfAppearanceStream normalAppearance)
normalAppearance
- the specified appearance streamPdfProAnnot.setDownAppearance(PdfAppearanceStream)
,
PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)
,
PdfProAnnot.getNormalAppearance()
,
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.getRolloverAppearance()
public PdfAppearanceStream getRolloverAppearance()
PdfProAnnot.getNormalAppearance()
,
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.setNormalAppearance(PdfAppearanceStream)
,
PdfProAnnot.setDownAppearance(PdfAppearanceStream)
,
PdfProAnnot.setRolloverAppearance(PdfAppearanceStream)
public void setRolloverAppearance(PdfAppearanceStream rolloverAppearance)
rolloverAppearance
- the specified appearance streamPdfProAnnot.setNormalAppearance(PdfAppearanceStream)
,
PdfProAnnot.setDownAppearance(PdfAppearanceStream)
,
PdfProAnnot.getNormalAppearance()
,
PdfProAnnot.getDownAppearance()
,
PdfProAnnot.getRolloverAppearance()
|
Pro. Ed. v5.0.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |