com.qoppa.pdf.annotations
Class Line

java.lang.Object
  extended bycom.qoppa.pdf.annotations.Annotation
      extended bycom.qoppa.pdf.annotations.ShapeAnnotation
          extended bycom.qoppa.pdf.annotations.Line

public class Line
extends ShapeAnnotation

Class representing a Line annotation in a PDF document. Line annotations are displayed as a line and can be double-clicked to display its content.

Author:
Qoppa Software

Field Summary
static String LINE_ARROW
           
 
Fields inherited from class com.qoppa.pdf.annotations.ShapeAnnotation
LE_CIRCLE, LE_CIRCLE_STR, LE_CLOSEDARROW, LE_CLOSEDARROW_STR, LE_DIAMOND, LE_DIAMOND_STR, LE_NONE, LE_NONE_STR, LE_OPENARROW, LE_OPENARROW_STR, LE_SQUARE, LE_SQUARE_STR
 
Fields inherited from class com.qoppa.pdf.annotations.Annotation
BORDERSTYLE_BEVELED, BORDERSTYLE_DASHED, BORDERSTYLE_INSETS, BORDERSTYLE_SOLID, BORDERSTYLE_UNDERLINE, FLAGS_HIDDEN, FLAGS_INVISIBLE, FLAGS_LOCKED, FLAGS_NOROTATE, FLAGS_NOVIEW, FLAGS_NOZOOM, FLAGS_PRINTABLE, FLAGS_READONLY
 
Constructor Summary
Line(String contents, double x1, double y1, double x2, double y2)
          Constructs a line annotation.
 
Method Summary
 JComponent createComponent(Point2D cropOrigin, IPDFActionHandler actionHandler)
          Creates a JComponent object capable of displaying this annotation.
 String getIntent()
          Returns the description of the intent of the Line Annotation
 int getLineEndStyle()
           
 String getLineEndStyleString()
           
 int getLineStartStyle()
           
 String getLineStartStyleString()
           
 String getSubtype()
          Returns this annotation's subtype: "Line"
 double getX1()
          Returns the x coordinate of the origin of this line.
 double getX2()
          Returns the x coordinate of the endpoint of this line.
 double getY1()
          Returns the y coordinate of the origin of this line.
 double getY2()
          Returns the y coordinate of the endpoint of this line.
 boolean isIntentArrow()
           
 void revalidate()
          Revalidate the shape drawn by this annotation.
 void revalidateRectangle()
           
 void setIntent(String intent)
          Set the description of the intent of the Line Annotation
 void setLineEndStyle(int lineEndStyle)
           
 void setLineEndStyle(String style)
           
 void setLineStartStyle(int lineStartStyle)
           
 void setLineStartStyle(String style)
           
 void setX1(double x1)
           
 void setX2(double x2)
           
 void setY1(double y1)
           
 void setY2(double y2)
           
 void shiftRectangle(double deltaX, double deltaY)
           
 
Methods inherited from class com.qoppa.pdf.annotations.ShapeAnnotation
getBorderWidth, getContents, getInternalColor, getStroke, paintImpl, setBorderWidth, setContents, setInternalColor, setRectangle, setStroke
 
Methods inherited from class com.qoppa.pdf.annotations.Annotation
getActions, getAppearStream, getBorderStyle, getColor, getComponent, getCreationDate, getCreator, getFlags, getLayer, getName, getOpacity, getPopup, getRectangle, getTriggerActions, isHidden, isInvisible, isLocked, isNoRotate, isNoView, isNoZoom, isPrintable, isReadOnly, paint, print, setActions, setAppearStream, setBorderStyle, setColor, setComponent, setComponentVisible, setCreationDate, setCreator, setFlags, setHidden, setInvisible, setLayer, setLocked, setName, setNoRotate, setNoView, setNoZoom, setOpacity, setPopup, setPrintable, setReadOnly, setTriggerActions
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_ARROW

public static final String LINE_ARROW
See Also:
Constant Field Values
Constructor Detail

Line

public Line(String contents,
            double x1,
            double y1,
            double x2,
            double y2)
Constructs a line annotation.

Parameters:
contents - The text contents to display when the annotation is opened.
x1 - The x coordinate of the origin of the line.
y1 - The y coordinate of the origin of the line.
x2 - The x coordinate of the endpoint of the line.
y2 - The y coordinate of the endpoint of the line.
Method Detail

getSubtype

public String getSubtype()
Returns this annotation's subtype: "Line"

Specified by:
getSubtype in class Annotation
Returns:
The annotation subtype.

getX1

public double getX1()
Returns the x coordinate of the origin of this line.

Returns:
The origin's x coordinate.

getX2

public double getX2()
Returns the x coordinate of the endpoint of this line.

Returns:
The endpoint's x coordinate.

getY1

public double getY1()
Returns the y coordinate of the origin of this line.

Returns:
The origin's y coordinate.

getY2

public double getY2()
Returns the y coordinate of the endpoint of this line.

Returns:
The endpoint's y coordinate.

createComponent

public JComponent createComponent(Point2D cropOrigin,
                                  IPDFActionHandler actionHandler)
Creates a JComponent object capable of displaying this annotation.

Specified by:
createComponent in class Annotation
Returns:
JComponent do display this annotation.

setX1

public void setX1(double x1)

setX2

public void setX2(double x2)

setY1

public void setY1(double y1)

setY2

public void setY2(double y2)

getLineEndStyle

public int getLineEndStyle()

setLineEndStyle

public void setLineEndStyle(int lineEndStyle)

getLineStartStyle

public int getLineStartStyle()

setLineStartStyle

public void setLineStartStyle(int lineStartStyle)

setLineEndStyle

public void setLineEndStyle(String style)

setLineStartStyle

public void setLineStartStyle(String style)

getLineEndStyleString

public String getLineEndStyleString()

getLineStartStyleString

public String getLineStartStyleString()

shiftRectangle

public void shiftRectangle(double deltaX,
                           double deltaY)
Overrides:
shiftRectangle in class Annotation

revalidateRectangle

public void revalidateRectangle()

revalidate

public void revalidate()
Description copied from class: ShapeAnnotation
Revalidate the shape drawn by this annotation.

Specified by:
revalidate in class ShapeAnnotation

getIntent

public String getIntent()
Returns the description of the intent of the Line Annotation

Returns:
intent

setIntent

public void setIntent(String intent)
Set the description of the intent of the Line Annotation

Parameters:
intent - the intent to set

isIntentArrow

public boolean isIntentArrow()