com.qoppa.pdfNotes.settings
Class AnnotationTools

java.lang.Object
  extended by com.qoppa.pdfNotes.settings.AnnotationTools

public class AnnotationTools
extends Object

This class manages the default properties and settings for the Annotation Tools.

All of the tool's property values can be retrieved and initialized with the methods toXMLString() and setFromXML().

Author:
Qoppa Software

Field Summary
static String XMLKEY_TOOL_DEFAULTS
          XML Element name used for reading/writing as an XML string
 
Constructor Summary
AnnotationTools()
           
 
Method Summary
static String getDefaultAuthor()
          Returns the default author.
static boolean isAuthorEditable()
          Returns the value of the editable flag for the author field.
static boolean isContextMenuEnabled()
          Returns the value of the flag that controls whether the context menu will be shown when right-clickin on annotations.
static boolean isDeleteEnabled()
          Returns the value of the annotation delete enabled flag.
static boolean isFlatteningEnabled()
          Returns the value of the flattening enabled flag.
static boolean isGroupingEnabled()
          Returns the value of the annotation grouping enabled flag.
static boolean isReviewEnabled()
          Returns the flag that indicates whether the review status cycle is enabled.
static boolean isShiftKeyPressed()
          Returns the value of the flag that controls whether the Shift key should be simulated when creating Lines, Polylines, Polygons, and each of the respective dimension annotations (Distance, Perimeter, Area).
static boolean isShowDimensionDialog()
          Returns the value of the show dimension dialog flag.
static boolean isSnapEnabled()
          Returns the value of the snap to content enabled flag.
static void setAuthorEditable(boolean editable)
          Sets the author field as editable or read only.
static void setContextMenuEnabled(boolean contexrtMenuEnabled)
          Sets a flag to indicate whether the context menu should be displayed when right-clicking on annotations.
static void setDefaultAuthor(String defaultAuthor)
          Sets the default author.
static void setDeleteEnabled(boolean enabled)
          Sets a flag to indicate whether annotation deletion should be enabled.
static void setFlatteningEnabled(boolean enabled)
          Sets a flag to indicate whether annotation flattening should be enabled in the bean.
static void setFromXML(String xmlString)
          This method sets the Tool default properties with properly formatted String xml element.
static void setGroupingEnabled(boolean enabled)
          Sets a flag to indicate whether annotation grouping should be enabled.
static void setReviewEnabled(boolean reviewEnabled)
          Sets a flag to indicate whether annotation review status should be enabled.
static void setShiftKeyPressed(boolean shiftKeyPressed)
          Sets a flag to indicate whether the Shift key should be simulated when creating Lines, Polylines, Polygons, and each of the respective dimension annotations (Distance, Perimeter, Area).
static void setSnapToContent(boolean snap)
          Sets a flag to indicate whether snapping to content should be enabled when drawing dimension annotations.
static void showDimensionDialog(boolean show)
          Sets a flag to indicate whether to show the dimension dialog when creating dimension annotations (distance, perimeter, area).
static String toXMLString()
          This method creates a String that contains an xml element of the Tool default properties.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMLKEY_TOOL_DEFAULTS

public static final String XMLKEY_TOOL_DEFAULTS
XML Element name used for reading/writing as an XML string

See Also:
Constant Field Values
Constructor Detail

AnnotationTools

public AnnotationTools()
Method Detail

getDefaultAuthor

public static String getDefaultAuthor()
Returns the default author. This is the value used in the author field when creating an annotation.

Returns:
the defaultAuthor

setDefaultAuthor

public static void setDefaultAuthor(String defaultAuthor)
Sets the default author. This is the value to use in the author field when a new annotation is created.

Parameters:
defaultAuthor - The defaultAuthor to set

setAuthorEditable

public static void setAuthorEditable(boolean editable)
Sets the author field as editable or read only. If false, the author field in annotations will be initialized to the default author, but then users will not be allowed to edit it.

Parameters:
editable - the new value of the flag.

isAuthorEditable

public static boolean isAuthorEditable()
Returns the value of the editable flag for the author field.

Returns:
The current value of the editable flag.

setFromXML

public static void setFromXML(String xmlString)
This method sets the Tool default properties with properly formatted String xml element. Properties are set for AreaHighlightTool, AreaTool, ArrowTool, BookmarkTool, CalloutTool, CaretTool, CircleTool, CloudTool, DistanceTool, FileAttachmentTool, FreeTextTool, LineTool, LinkTool, PencilTool, PerimeterTool, PolygonTool, PolylineTool, RedactionTool, RubberStampTool, SoundTool, SquareTool, StickyNoteTool, TextMarkupTools, and TypewriterTool.

See Also:
toXMLString()

toXMLString

public static String toXMLString()
This method creates a String that contains an xml element of the Tool default properties. This String can be stored and used to set the Tool default properties. Attributes are set for AreaHighlightTool, AreaTool, ArrowTool, BookmarkTool, CalloutTool, CaretTool, CircleTool, CloudTool, DistanceTool, FileAttachmentTool, FreeTextTool, LineTool, LinkTool, PencilTool, PerimeterTool, PolygonTool, PolylineTool, RedactionTool, RubberStampTool, SoundTool, SquareTool, StickyNoteTool, TextMarkupTools, and TypewriterTool.

Returns:
A String containing an xml element of the Tool default properties.
See Also:
setFromXML(String)

setFlatteningEnabled

public static void setFlatteningEnabled(boolean enabled)
Sets a flag to indicate whether annotation flattening should be enabled in the bean. If set to false, then the flatten option will be removed from right-click context menus on annotations and on the thumbnail pages.

Parameters:
enabled - The new value of the flattening enabled flag

isFlatteningEnabled

public static boolean isFlatteningEnabled()
Returns the value of the flattening enabled flag.

Returns:
The value of the flattening enabled flag.

setDeleteEnabled

public static void setDeleteEnabled(boolean enabled)
Sets a flag to indicate whether annotation deletion should be enabled. This flag is used to determine whether to show the menu entries to delete annotations in the right click context menus for annotations and thumbnail pages and additionally enables / disables the delete key when an annotation is selected.

Parameters:
enabled - The new value of the delete annotations flag

isDeleteEnabled

public static boolean isDeleteEnabled()
Returns the value of the annotation delete enabled flag.

Returns:
The value of the annotation delete enabled flag.

setGroupingEnabled

public static void setGroupingEnabled(boolean enabled)
Sets a flag to indicate whether annotation grouping should be enabled. This flag is used to determine whether to show the menu item to group annotations in the annotation's right click context menus.

Parameters:
enabled - The new value of the grouping annotations flag

isGroupingEnabled

public static boolean isGroupingEnabled()
Returns the value of the annotation grouping enabled flag.

Returns:
The value of the annotation grouping enabled flag.

setSnapToContent

public static void setSnapToContent(boolean snap)
Sets a flag to indicate whether snapping to content should be enabled when drawing dimension annotations.

Parameters:
snap - The new value of the snap to content flag

isSnapEnabled

public static boolean isSnapEnabled()
Returns the value of the snap to content enabled flag.

Returns:
The value of the snap to content enabled flag.

showDimensionDialog

public static void showDimensionDialog(boolean show)
Sets a flag to indicate whether to show the dimension dialog when creating dimension annotations (distance, perimeter, area).

Parameters:
show - The new value of the show dimension dialog flag.

isShowDimensionDialog

public static boolean isShowDimensionDialog()
Returns the value of the show dimension dialog flag.

Returns:
The value of the show dimension dialog flag.

isContextMenuEnabled

public static boolean isContextMenuEnabled()
Returns the value of the flag that controls whether the context menu will be shown when right-clickin on annotations.

Returns:
The value of the

setContextMenuEnabled

public static void setContextMenuEnabled(boolean contexrtMenuEnabled)
Sets a flag to indicate whether the context menu should be displayed when right-clicking on annotations.

Parameters:
contexrtMenuEnabled - The new value of the flag

setReviewEnabled

public static void setReviewEnabled(boolean reviewEnabled)
Sets a flag to indicate whether annotation review status should be enabled.

Parameters:
reviewEnabled - The new value of the flag.

isReviewEnabled

public static boolean isReviewEnabled()
Returns the flag that indicates whether the review status cycle is enabled.

Returns:
Flag indicating whether the review options are enabled.

isShiftKeyPressed

public static boolean isShiftKeyPressed()
Returns the value of the flag that controls whether the Shift key should be simulated when creating Lines, Polylines, Polygons, and each of the respective dimension annotations (Distance, Perimeter, Area).

Returns:
the shiftKeyPressed

setShiftKeyPressed

public static void setShiftKeyPressed(boolean shiftKeyPressed)
Sets a flag to indicate whether the Shift key should be simulated when creating Lines, Polylines, Polygons, and each of the respective dimension annotations (Distance, Perimeter, Area). Pressing the Shift key or setting this flag will force the angles to the horizon to be either 0, 45, or 90 degrees.

Parameters:
shiftKeyPressed - The new value of the flag