com.crionics.jpdf.forms
Class ButtonField

java.lang.Object
  extended by PdfObjectContainer
      extended by com.crionics.jpdf.forms.AbstractField
          extended by com.crionics.jpdf.forms.ButtonField

public class ButtonField
extends AbstractField

Form button


Field Summary
static int HIGHLIGHT_INVERT
          When specified, a PDF Viewer will invert the background color of the Form Field whenever the mouse used upon it.
static int HIGHLIGHT_NONE
          When specified, a PDF Viewer will not change the visual appearance of the Form Field whenever the mouse pass over or used upon it.
static int HIGHLIGHT_OUTLINE
          When specified, a PDF Viewer will draw a rectangle on the outer edge of the Form Field whenever the mouse used upon it.
static int HIGHLIGHT_PUSH
          When specified, a PDF Viewer will change the text being displayed on the Form Field based on the following mouse event:
Mouse over it: setRolloverCaption(String) Mouse button pressed: setActivatedCaption(String) default: setNormalCaption(String)
 
Method Summary
static ButtonField createInstance(PdfDocument doc, java.lang.String name, int pageIndex, java.awt.Rectangle rect)
           
 java.lang.String getActivatedCaption()
          Returns the text string which will be visible on the button when is it activated and its highlight mode is set to HIGHLIGHT_PUSH.
 int getHighligthMode()
          Returns the current Highlight mode (one of the ButtonField.HIGHLIGHT_XXX Contants) used by this Form Field for its interaction with a mouse.
 AbstractAction getMousePressedAction()
          Returns the action associated to the Form Field when the mouse button is held pressed while above it.
 AbstractAction getMouseReleasedAction()
          Returns the action associated to the Form Field when the mouse button is released while above it.
 java.lang.String getNormalCaption()
          Returns the text string which will be visible on the button.
 java.lang.String getRolloverCaption()
          Returns the text string which will be visible on the button when the mouse is over it.
 void setActivatedCaption(java.lang.String str)
          Sets the text string which will be visible on the button when is it activated.
 void setHighligthMode(int mode)
          Sets the Highlight mode (one of the ButtonField.HIGHLIGHT_XXX Contants) to be used by this Form Field for its interaction with a mouse.
 void setMousePressedAction(AbstractAction action)
          Sets the action to be associated with the Form Field when the mouse button is held pressed while above it.
 void setNormalCaption(java.lang.String str)
          Sets the text string which will be visible on the button.
 void setRolloverCaption(java.lang.String str)
          Sets thhe text string which will be visible on the button when the mouse is over it.
 
Methods inherited from class com.crionics.jpdf.forms.AbstractField
getAssociatedPageIndex, getBorderColor, getBorderStyle, getBorderWidth, getFillColor, getName, getOrientation, getPosition, getTextColor, getTextFont, getTextSize, getToolTip, isHidden, isPrintable, isReadOnly, setBorderColor, setBorderStyle, setBorderWidth, setFillColor, setHidden, setOrientation, setPosition, setPrintable, setReadOnly, setTextColor, setTextFont, setTextFont, setTextSize, setToolTip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HIGHLIGHT_INVERT

public static final int HIGHLIGHT_INVERT
When specified, a PDF Viewer will invert the background color of the Form Field whenever the mouse used upon it.


HIGHLIGHT_NONE

public static final int HIGHLIGHT_NONE
When specified, a PDF Viewer will not change the visual appearance of the Form Field whenever the mouse pass over or used upon it.


HIGHLIGHT_OUTLINE

public static final int HIGHLIGHT_OUTLINE
When specified, a PDF Viewer will draw a rectangle on the outer edge of the Form Field whenever the mouse used upon it.


HIGHLIGHT_PUSH

public static final int HIGHLIGHT_PUSH
When specified, a PDF Viewer will change the text being displayed on the Form Field based on the following mouse event:

Method Detail

createInstance

public static ButtonField createInstance(PdfDocument doc,
                                         java.lang.String name,
                                         int pageIndex,
                                         java.awt.Rectangle rect)
                                  throws PdfException,
                                         java.io.IOException
Throws:
PdfException
java.io.IOException

getActivatedCaption

public java.lang.String getActivatedCaption()
                                     throws PdfException,
                                            java.io.IOException
Returns the text string which will be visible on the button when is it activated and its highlight mode is set to HIGHLIGHT_PUSH.

Returns:
The text string.
Throws:
PdfException - Raised if a problem occured while parsing the file.
java.io.IOException - Raised if a problem occured while reading the file.

getHighligthMode

public int getHighligthMode()
                     throws PdfException,
                            java.io.IOException
Returns the current Highlight mode (one of the ButtonField.HIGHLIGHT_XXX Contants) used by this Form Field for its interaction with a mouse.

Returns:
The highlight mode.
Throws:
PdfException - Raised if a problem occured while parsing the file.
java.io.IOException - Raised if a problem occured while reading the file.

getMousePressedAction

public AbstractAction getMousePressedAction()
                                     throws PdfException,
                                            java.io.IOException
Returns the action associated to the Form Field when the mouse button is held pressed while above it.

Returns:
The mouse pressed action.
Throws:
PdfException - Raised if a problem occured while parsing the file.
java.io.IOException - Raised if a problem occured while reading the file.

getMouseReleasedAction

public AbstractAction getMouseReleasedAction()
                                      throws PdfException,
                                             java.io.IOException
Returns the action associated to the Form Field when the mouse button is released while above it.

Returns:
The mouse released action.
Throws:
PdfException - Raised if a problem occured while parsing the file.
java.io.IOException - Raised if a problem occured while reading the file.

getNormalCaption

public java.lang.String getNormalCaption()
                                  throws PdfException,
                                         java.io.IOException
Returns the text string which will be visible on the button.

Returns:
The text string.
Throws:
PdfException - Raised if a problem occured while parsing the file.
java.io.IOException - Raised if a problem occured while reading the file.

getRolloverCaption

public java.lang.String getRolloverCaption()
                                    throws PdfException,
                                           java.io.IOException
Returns the text string which will be visible on the button when the mouse is over it.
Note: This Text will only be visible for Form Fields with the highlight mode is set to HIGHLIGHT_PUSH.

Returns:
The text string.
Throws:
PdfException - Raised if a problem occured while parsing the file.
java.io.IOException - Raised if a problem occured while reading the file.

setActivatedCaption

public void setActivatedCaption(java.lang.String str)
                         throws PdfException,
                                java.io.IOException
Sets the text string which will be visible on the button when is it activated.
Note: This Text will only be visible for Form Fields with the highlight mode is set to HIGHLIGHT_PUSH.

Parameters:
str - The text string to set.
Throws:
PdfException - Raised if a problem occured while parsing the file.
java.io.IOException - Raised if a problem occured while reading the file.

setHighligthMode

public void setHighligthMode(int mode)
                      throws PdfException,
                             java.io.IOException
Sets the Highlight mode (one of the ButtonField.HIGHLIGHT_XXX Contants) to be used by this Form Field for its interaction with a mouse.

Parameters:
mode - The highlight mode.
Throws:
PdfException - Raised if a problem occured while parsing the file.
java.io.IOException - Raised if a problem occured while reading the file.

setMousePressedAction

public void setMousePressedAction(AbstractAction action)
                           throws PdfException,
                                  java.io.IOException
Sets the action to be associated with the Form Field when the mouse button is held pressed while above it.

Parameters:
action - The mouse pressed action.
Throws:
PdfException - Raised if a problem occured while parsing the file.
java.io.IOException - Raised if a problem occured while reading the file.

setNormalCaption

public void setNormalCaption(java.lang.String str)
                      throws PdfException,
                             java.io.IOException
Sets the text string which will be visible on the button.

Parameters:
str - The text string to set.
Throws:
PdfException - Raised if a problem occured while parsing the file.
java.io.IOException - Raised if a problem occured while reading the file.

setRolloverCaption

public void setRolloverCaption(java.lang.String str)
                        throws PdfException,
                               java.io.IOException
Sets thhe text string which will be visible on the button when the mouse is over it.
Note: This Text will only be visible for Form Fields with the highlight mode is set to HIGHLIGHT_PUSH.

Parameters:
str - The text string to set.
Throws:
PdfException - Raised if a problem occured while parsing the file.
java.io.IOException - Raised if a problem occured while reading the file.


Copyright © 1999-2007 Crionics. All Rights Reserved.