|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.qoppa.pdf.annotations.Annotation
com.qoppa.pdf.annotations.FileAttachment
Class representing a File Attachment annotation in a PDF document.
| Field Summary | |
static String |
ICON_DEFAULT
|
static String |
ICON_GRAPH
|
static String |
ICON_PAPERCLIP
|
static String |
ICON_PUSHPIN
|
static String |
ICON_TAG
|
| 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 | |
FileAttachment()
Constructs an empty file attachment object. |
|
FileAttachment(byte[] fileContents,
String fileName,
String popupText)
Constructs a file attachment annotation. |
|
FileAttachment(FileContentProvider contents,
String fileName,
String popupText)
Constructor used when the file contents may not be so easily accessible as a byte array or file. |
|
FileAttachment(File attachFile,
String popupText)
Convenience constructor to create a file attachment from a file system file. |
|
| Method Summary | |
JComponent |
createComponent(Point2D cropOrigin,
IPDFActionHandler actionHandler)
Creates a JComponent object capable of displaying this annotation. |
byte[] |
getCheckSum()
Returns the CRC checksum for the file contents. |
byte[] |
getDeflatedContents()
Returns the file contents in deflated format |
String |
getFileName()
Returns the name of the file. |
int |
getFileSize()
Returns the length of the file, in bytes. |
String |
getIconName()
Returns the name of the icon for this annotation. |
static Vector |
getIconNames()
Returns a vector containing the possible names for the file attachment icon. |
InputStream |
getInputStream()
Returns the file contents as an input stream. |
String |
getPopupText()
Returns the text that is displayed when the mouse hovers over the annotation. |
Rectangle2D |
getRectangle()
Override getRectangle: Bounds are set by the size of the text icon |
String |
getSubtype()
Returns this annotation's subtype: "File-Attachment" |
boolean |
isPrintable()
Sound icon never prints. |
void |
openFile(String tempFileName)
Open the file. |
void |
paintImpl(Graphics g,
boolean hasFocus)
Draws the text icon. |
void |
revalidate()
Revalidates this annotation. |
void |
saveFile(File outFile)
Saves the content of the file to a file. |
void |
setColor(Color c)
Sets the annotation's color. |
void |
setFileContents(byte[] fileContents)
Sets the file contents for the file attachment. |
void |
setFileContents(FileContentProvider provider)
Sets the file contents for the file attachment. |
void |
setFileName(String fileName)
Sets the name of the attached file. |
void |
setIconName(String iconName)
Sets the icon name used when displaying this annotation. |
void |
setPopupText(String popupText)
Sets the text that is displayed when the mouse hovers over the annotation. |
void |
writeContents(OutputStream outStream)
Write the contents of the file attachment to an output stream |
| Methods inherited from class com.qoppa.pdf.annotations.Annotation |
getActions, getAppearStream, getBorderStyle, getBorderWidth, getColor, getComponent, getContents, getCreationDate, getCreator, getFlags, getLayer, getName, getOpacity, getPopup, getTriggerActions, isHidden, isInvisible, isLocked, isNoRotate, isNoView, isNoZoom, isReadOnly, paint, print, setActions, setAppearStream, setBorderStyle, setBorderWidth, setComponent, setComponentVisible, setCreationDate, setCreator, setFlags, setHidden, setInvisible, setLayer, setLocked, setName, setNoRotate, setNoView, setNoZoom, setOpacity, setPopup, setPrintable, setReadOnly, setRectangle, setTriggerActions, shiftRectangle |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String ICON_GRAPH
public static final String ICON_PAPERCLIP
public static final String ICON_PUSHPIN
public static final String ICON_TAG
public static final String ICON_DEFAULT
| Constructor Detail |
public FileAttachment()
public FileAttachment(byte[] fileContents,
String fileName,
String popupText)
throws IOException
fileContents - The binary contents of the file.fileName - The name of the file.popupText - The popup text to display when the mouse hovers over the annotation.
public FileAttachment(File attachFile,
String popupText)
throws IOException
attachFile - The file to attach. The constructor reads the contents of the file into memory.popupText - The popup text to display when the mouse hovers over the annotation.
IOException
public FileAttachment(FileContentProvider contents,
String fileName,
String popupText)
contents - An object that fulfills the FileContentProvider interface.fileName - The name of the file to use in the PDF document.popupText - The popup text to display when the mouse hovers over the annotation.
IOException| Method Detail |
public String getSubtype()
getSubtype in class Annotation
public JComponent createComponent(Point2D cropOrigin,
IPDFActionHandler actionHandler)
createComponent in class Annotation
public void paintImpl(Graphics g,
boolean hasFocus)
g - The graphics object to use when drawing.public void revalidate()
Annotation
revalidate in class Annotationpublic boolean isPrintable()
isPrintable in class Annotationpublic String getIconName()
public String getPopupText()
public void setPopupText(String popupText)
popupText - The new text string.public void setIconName(String iconName)
iconName - The name of the icon to use when displaying the annotation in its
un-opened mode. Please use one of the constants defined in this class (ICON_XXXX)
to set the name of the icon.public void setColor(Color c)
setColor in class Annotationc - The new color.
public void setFileContents(byte[] fileContents)
throws IOException
fileContents - The new file contents.
IOExceptionpublic void setFileContents(FileContentProvider provider)
provider - The provider of the file contentspublic String getFileName()
public void setFileName(String fileName)
fileName - The name of the file.
public int getFileSize()
throws IOException,
PDFException
IOException
PDFException
public byte[] getDeflatedContents()
throws IOException,
PDFException
IOException
PDFException
public InputStream getInputStream()
throws IOException,
PDFException
IOException
PDFException
public byte[] getCheckSum()
throws PDFException,
IOException
PDFException
IOExceptionpublic Rectangle2D getRectangle()
getRectangle in class Annotation
public void writeContents(OutputStream outStream)
throws IOException
IOException
public void saveFile(File outFile)
throws PDFException
outFile - the file to save to.
PDFException
public void openFile(String tempFileName)
throws IOException,
PDFException
tempFileName - the temporary name of the file created for display.
IOException
PDFExceptionpublic static Vector getIconNames()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||