com.qoppa.pdf.annotations
Class WidgetText

java.lang.Object
  extended bycom.qoppa.pdf.annotations.Annotation
      extended bycom.qoppa.pdf.annotations.Widget
          extended bycom.qoppa.pdf.annotations.WidgetText

public class WidgetText
extends Widget


Field Summary
 
Fields inherited from class com.qoppa.pdf.annotations.Widget
HIGH_INVERT, HIGH_NONE, HIGH_OUTLINE, HIGH_PUSH, HIGH_TOGGLE, NUMBER_FORMAT
 
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
WidgetText(QFormField field, PDFDictionary widgetDict, boolean keepDict)
           
 
Method Summary
 JComponent createComponent(Point2D cropOrigin, IPDFActionHandler actionHandler)
          Creates a JComponent object capable of displaying this annotation.
 boolean doNotScroll()
           
 void fieldValueChanged()
           
 double getCombCellWidth()
          This method returns the width of each cell when the text field is a comb field meaning that all characters are spaced out equally according to the maximum number of characters allowed in the field.
 int getMaxLength()
           
 QTextField getTextField()
           
 boolean isCombFormat()
          Indicates whether this text widget is in the comb format.
 boolean isMultiLine()
           
 void paintNonText(Graphics2D g2d)
           
 void paintText(Graphics2D g2d)
           
 void setMaxLength(int maxLength)
           
 double stringWidth(String str)
           
 void updateAppearStreamDict(PDFDictionary widgetDict, PDFObject drObject, String value)
           
 
Methods inherited from class com.qoppa.pdf.annotations.Widget
canEdit, getAppearanceState, getBackground, getBorderColor, getCaption, getDA, getEditingComponent, getField, getFont, getGenNumber, getHighlightMode, getHorzTextAlign, getMarkedContentInfo, getNormalStream, getObjNumber, getPage, getPDFObjectManager, getSubtype, getWidgetDict, isEditable, normalizeRectangle, paintImpl, revalidate, setAppearanceState, setBackground, setBorderColor, setCaption, setDA, setField, setFont, setGenNumber, setHidden, setHighlightMode, setObjNumber, setPage, setPDFObjectManager, setPrintable, setWidgetHighlight
 
Methods inherited from class com.qoppa.pdf.annotations.Annotation
getActions, getAppearStream, getBorderStyle, getBorderWidth, getColor, getComponent, getContents, getCreationDate, getCreator, getFlags, getLayer, getName, getOpacity, getPopup, getRectangle, getTriggerActions, isHidden, isInvisible, isLocked, isNoRotate, isNoView, isNoZoom, isPrintable, isReadOnly, paint, print, setActions, setAppearStream, setBorderStyle, setBorderWidth, setColor, setComponent, setComponentVisible, setCreationDate, setCreator, setFlags, setInvisible, setLayer, setLocked, setName, setNoRotate, setNoView, setNoZoom, setOpacity, setPopup, setReadOnly, setRectangle, setTriggerActions, shiftRectangle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WidgetText

public WidgetText(QFormField field,
                  PDFDictionary widgetDict,
                  boolean keepDict)
Method Detail

getMaxLength

public int getMaxLength()

setMaxLength

public void setMaxLength(int maxLength)

fieldValueChanged

public void fieldValueChanged()
                       throws PDFException
Specified by:
fieldValueChanged in class Widget
Throws:
PDFException

isMultiLine

public boolean isMultiLine()

doNotScroll

public boolean doNotScroll()

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.

isCombFormat

public boolean isCombFormat()
Indicates whether this text widget is in the comb format. Comb format is when all characters in the text field are spaced out equally according to the max number of characters For a field to be in comb format, the comb property must be set, the maximum number of characters bigger than 0 and the text field can not be multi-lines.

Returns:
boolean comb format

updateAppearStreamDict

public void updateAppearStreamDict(PDFDictionary widgetDict,
                                   PDFObject drObject,
                                   String value)
                            throws PDFException
Throws:
PDFException

getCombCellWidth

public double getCombCellWidth()
This method returns the width of each cell when the text field is a comb field meaning that all characters are spaced out equally according to the maximum number of characters allowed in the field.


getTextField

public QTextField getTextField()

stringWidth

public double stringWidth(String str)

paintNonText

public void paintNonText(Graphics2D g2d)

paintText

public void paintText(Graphics2D g2d)