|
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.PdfLineAnnot
This class represents a line annotation. A line annotation is represented by a straight line. The line has a starting point and an ending point. A line annotation can have a popup dialog box.
A line annotation can have what are called "leader line" and "leader line extension" at its end points. These lines are perpendicular to the main line that identifies the annotation. If a positive length has been specified for the leader line, then it appears at the below the line anotation. If a negative length has been specified, then it appears above the line annotation.
The leader line extension is also a perpendicular line that appears at the other side of the leader line.
// Create a pdf page PdfPage page = new PdfPage(); // Create a PDF font PdfFont fontHelvetica = PdfFont.create("Helvetica", 15,PdfEncodings.WINANSI); fontHelvetica.setColor(Color.BLUE); // Write text on the page page.writeText("Line Annotations", fontHelvetica, 80, 100); // Create an array of x-y coordinates for the starting and // end points of the line annotation double endPts[] = { 80, 150, 250, 150 }; // Create a line annotation and set its properties PdfLineAnnot lineAnnot1 = new PdfLineAnnot(endPts, Color.BLUE); lineAnnot1.setTitle("Title"); lineAnnot1.setSubject("Line Annotation"); lineAnnot1.setContents("This is a Line Annotation"); lineAnnot1.setInteriorColor(Color.red); lineAnnot1.setLineStartStyle(PdfLineAnnot.LINEENDSTYLE_DIAMOND); lineAnnot1.setLineEndStyle(PdfLineAnnot.LINEENDSTYLE_CLOSED_ARROW); lineAnnot1.setBorderStyle(PdfLineAnnot.BORDERSTYLE_INSET); lineAnnot1.setBorderWidth(3); // Add the line annotation to page page.addAnnotation(lineAnnot1);
Field Summary | |
static int |
LINEENDSTYLE_BUTT
Constant for specifying a sharp perpendicular line at the end of a line. |
static int |
LINEENDSTYLE_CIRCLE
Constant for specifying a circle at the end of a line. |
static int |
LINEENDSTYLE_CLOSED_ARROW
Constant for specifying a triangular arrow at the end of a line. |
static int |
LINEENDSTYLE_DIAMOND
Constant for specifying a diamond shape at the end of a polyline. |
static int |
LINEENDSTYLE_NONE
Constant for specifying an abrupt end of a line. |
static int |
LINEENDSTYLE_OPEN_ARROW
Constant for specifying an open arrow at the end of a line. |
static int |
LINEENDSTYLE_RCLOSED_ARROW
Constant for specifying an closed arrow at the end of a line. |
static int |
LINEENDSTYLE_ROPEN_ARROW
Constant for specifying an open reversed arrow at the end of of a line. |
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 at the end of a polyline. |
Constructor Summary | |
PdfLineAnnot()
Zero-argument default constructor. |
|
PdfLineAnnot(double[] points,
Color c)
Constructs a new line annotation with specified starting and end points, popup subject, contents and title, flags, line color, and line-end style and fill color. |
|
PdfLineAnnot(double[] points,
int flags)
Constructs a new line annotation with specified starting and end points, and flags. |
|
PdfLineAnnot(double[] points,
int flags,
Color c)
Constructs a new line annotation with specified starting and end points, flags, and line color. |
|
PdfLineAnnot(double[] points,
String subject,
String contents,
String title)
Constructs a new line annotation with specified starting and end points, and popup subject, contents and title. |
|
PdfLineAnnot(double[] points,
String subject,
String contents,
String title,
Color c)
Constructs a new line annotation with specified starting and end points, popup subject, contents and title, and line color. |
|
PdfLineAnnot(double[] points,
String subject,
String contents,
String title,
int flags)
Constructs a new line annotation with specified starting and end points, popup subject, contents and title, and flags. |
|
PdfLineAnnot(double[] points,
String subject,
String contents,
String title,
int flags,
Color c)
Constructs a new line annotation with specified starting and end points, popup subject, contents and title, flags, line color, line-end styles, and line-end fill color. |
|
PdfLineAnnot(double[] points,
String subject,
String contents,
String title,
int flags,
Color c,
int lineStartStyle,
int lineEndStyle,
Color interior)
Constructs a new line annotation with specified starting and end points, popup subject, contents and title, flags, line color, and line-end style and fill color. |
|
PdfLineAnnot(PdfRect r,
Color c)
Deprecated. Instead, use PdfLineAnnot(double[], Color) . |
|
PdfLineAnnot(PdfRect r,
int flags)
Deprecated. Instead, use PdfLineAnnot(double[], int) . |
|
PdfLineAnnot(PdfRect r,
int flags,
Color c)
Deprecated. Instead, use PdfLineAnnot(double[], int, Color) . |
|
PdfLineAnnot(PdfRect r,
String subject,
String contents,
String title)
Deprecated. Instead, use PdfLineAnnot(double[], String, String, String) . |
|
PdfLineAnnot(PdfRect r,
String subject,
String contents,
String title,
Color c)
Deprecated. Instead, use PdfLineAnnot(double[], String, String, String, Color) . |
|
PdfLineAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags)
Deprecated. Instead, use PdfLineAnnot(double[], String, String, String, int) . |
|
PdfLineAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c)
Deprecated. Instead, use PdfLineAnnot(double[], String, String, String, int, Color) . |
|
PdfLineAnnot(PdfRect r,
String subject,
String contents,
String title,
int flags,
Color c,
int lineStartStyle,
int lineEndStyle,
Color interior)
Deprecated. Instead, use PdfLineAnnot(double[], String, String, String, int, Color, int, int, Color) . |
Method Summary | |
Object |
clone()
|
String |
getCaption()
|
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 interior of the line endings of the annotation. |
double[] |
getLeaderLineArray()
Returns lengths of the leader line and leaderline extension of the line annotation. |
int |
getLineEndStyle()
Returns line-end style of the end of the line annotation. |
int |
getLineStartStyle()
Return line-end style of the starting point of the line annotation. |
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 |
getX1()
Return x-coodinate of the starting point of the line annotation. |
double |
getX2()
Return x-coordinate of the ending point of the line annotation. |
double |
getY1()
Return y-coodinate of the starting point of the line annotation. |
double |
getY2()
Return y-coordinate of the ending point of the line annotation. |
void |
setCaption(String caption)
|
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 interior of the line endings of the annotation. |
void |
setLeaderLineArray(double[] leaderLineArray)
Specifies lengths of the leader line and leader extension line. |
void |
setLineEndStyle(int lineEndStyle)
Specifies line-end style for the end of the line annotation. |
void |
setLineStartStyle(int lineStartStyle)
Specifies line-end style of the starting point of the line annotation. |
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 |
setPoints(double[] points)
Specifies (x, y) coordinates of the starting and ending points of the line annotation. |
void |
setPoints(double[] points,
int measurementUnit)
Specifies (x, y) coordinates of the starting and ending points of the line annotation in specified measurement units. |
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 |
setX1(double x1)
Specifies x-coodinate of the starting point of the line annotation. |
void |
setX2(double x2)
Specifies x-coordinate of the ending point of the line annotation. |
void |
setY1(double y1)
Specifies y-coodinate of the starting point of the line annotation. |
void |
setY2(double y2)
Specifies y-coordinate of the ending point of the line 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 PdfLineAnnot()
public PdfLineAnnot(PdfRect r, String subject, String contents, String title, int flags, Color c, int lineStartStyle, int lineEndStyle, Color interior) throws IOException, PdfException
PdfLineAnnot(double[], String, String, String, int, Color, int, int, Color)
.
public PdfLineAnnot(double[] points, String subject, String contents, String title, int flags, Color c, int lineStartStyle, int lineEndStyle, Color interior) throws IOException, PdfException
points
- x1, y1, x2, and y2, which are coordinates of
the starting point (x1, y1) and end point (x2, y2)
of the linesubject
- text that needs to be displayed in the title bar of
the annotation's popup windowcontents
- text that needs to be used as the contents of the
annotation's popup windowtitle
- text that needs to be used as the subject of the
annotation's popup windowflags
- flag
or combined
value of flags representing characteristics of the
annotationc
- color of the linelineStartStyle
- constant
specifying
line-end style of the annotation's starting pointlineEndStyle
- constant
specifying
line-end style of the annotation's end pointinterior
- color used to fill the interior of the line endings
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfLineAnnot(PdfRect r, String subject, String contents, String title) throws IOException, PdfException
PdfLineAnnot(double[], String, String, String)
.
public PdfLineAnnot(double[] points, String subject, String contents, String title) throws IOException, PdfException
points
- x1, y1, x2, and y2, which are coordinates of
the starting point (x1, y1) and end point
(x2, y2) of the linesubject
- text that needs to be displayed in the title bar of
the annotation's popup windowcontents
- text that needs to be used as the contents of the
annotation's popup windowtitle
- text that needs to be used as the subject of the
annotation's popup window
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfLineAnnot(PdfRect r, String subject, String contents, String title, Color c) throws IOException, PdfException
PdfLineAnnot(double[], String, String, String, Color)
.
public PdfLineAnnot(double[] points, String subject, String contents, String title, Color c) throws IOException, PdfException
points
- x1, y1, x2, and y2, which are coordinates of
the starting point (x1, y1) and end point
(x2, y2) of the linesubject
- text that needs to be displayed in the title bar of
the annotation's popup windowcontents
- text that needs to be used as the contents of the
annotation's popup windowtitle
- text that needs to be used as the subject of the
annotation's popup windowc
- color of the line
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfLineAnnot(PdfRect r, String subject, String contents, String title, int flags) throws IOException, PdfException
PdfLineAnnot(double[], String, String, String, int)
.
public PdfLineAnnot(double[] points, String subject, String contents, String title, int flags) throws IOException, PdfException
points
- x1, y1, x2, and y2, which are coordinates of
the starting point (x1, y1) and end point
(x2, y2) of the linesubject
- text that needs to be displayed in the title bar of
the annotation's popup windowcontents
- text that needs to be used as the contents of the
annotation's popup windowtitle
- text that needs to be used as the subject of the
annotation's popup windowflags
- flag
or combined
value of flags representing characteristics of the
annotation
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfLineAnnot(PdfRect r, String subject, String contents, String title, int flags, Color c) throws IOException, PdfException
PdfLineAnnot(double[], String, String, String, int, Color)
.
public PdfLineAnnot(double[] points, String subject, String contents, String title, int flags, Color c) throws IOException, PdfException
points
- x1, y1, x2, and y2, which are coordinates of
the starting point (x1, y1) and end point
(x2, y2) of the linesubject
- text that needs to be displayed in the title bar of
the annotation's popup windowcontents
- text that needs to be used as the contents of the
annotation's popup windowtitle
- text that needs to be used as the subject of the
annotation's popup windowflags
- flag
or combined
value of flags representing characteristics of the
annotationc
- color of the line
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfLineAnnot(PdfRect r, int flags) throws IOException, PdfException
PdfLineAnnot(double[], int)
.
public PdfLineAnnot(double[] points, int flags) throws IOException, PdfException
points
- x1, y1, x2, and y2, which are coordinates of
the starting point (x1, y1) and end point
(x2, y2) of the lineflags
- flag
or combined
value of flags representing characteristics of the
annotation
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfLineAnnot(PdfRect r, int flags, Color c) throws IOException, PdfException
PdfLineAnnot(double[], int, Color)
.
public PdfLineAnnot(double[] points, int flags, Color c) throws IOException, PdfException
points
- x1, y1, x2, and y2, which are coordinates of
the starting point (x1, y1) and end point
(x2, y2) of the lineflags
- flag
or combined
value of flags representing characteristics of the
annotationc
- color of the line
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.public PdfLineAnnot(PdfRect r, Color c) throws IOException, PdfException
PdfLineAnnot(double[], Color)
.
public PdfLineAnnot(double[] points, Color c) throws IOException, PdfException
points
- x1, y1, x2, and y2, which are coordinates of
the starting point (x1, y1) and end point
(x2, y2) of the linec
- color of the line
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.Method Detail |
public Object clone()
public void setPoints(double[] points) throws PdfException
points[0], points[1]
) and the ending point
will be (points[2], points[3]
).
points
- (x, y) coordinates of the starting and
ending points
PdfException
- if an illegal argument is supplied.public void setPoints(double[] points, int measurementUnit) throws PdfException
points[0], points[1]
) and the ending point will
be (points[2], points[3]
).
points
- (x, y) coordinates of the starting and
ending pointsmeasurementUnit
- measurement unit with which the coordinates are
specified
PdfException
- if an illegal argument is supplied.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 int getLineStartStyle()
setLineStartStyle(int)
public void setLineStartStyle(int lineStartStyle)
lineStartStyle
- constant specifying line-end stylegetLineStartStyle()
public void setTransparency(float transparecyLevel)
public float getTransparency()
public int getLineEndStyle()
setLineEndStyle(int)
public void setLineEndStyle(int lineEndStyle)
lineEndStyle
- constant specifying line-end stylegetLineEndStyle()
public double getX1()
getY1()
public void setX1(double x1)
x1
- x-coodinate of the starting pointgetX1()
public double getX2()
getX2()
public void setX2(double x2)
x2
- x-coordinate of the ending pointpublic double getY1()
getX1()
public void setY1(double y1)
y1
- y-coodinate of the starting pointpublic double getY2()
getX2()
public void setY2(double y2)
y2
- y-coordinate of the ending pointpublic double[] getLeaderLineArray()
setLeaderLineArray(double[])
public void setLeaderLineArray(double[] leaderLineArray) throws PdfException
leaderLineArray[0]
should specify the length of
the leader line. leaderLineArray[1]
should
specify the length of the leader line extension.
leaderLineArray
- two-member array containing the lengths of the
leader line and leader extension line
PdfException
- if an illegal argument is supplied.public String getCaption()
public void setCaption(String caption)
public Color getInteriorColor()
setInteriorColor(Color)
public void setInteriorColor(Color interiorColor)
interiorColor
- color that needs to be used to fill the interior of
the line endingsgetInteriorColor()
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 |