com.qoppa.pdfViewer
Class InitialViewSettings

java.lang.Object
  extended by com.qoppa.pdfViewer.InitialViewSettings

public class InitialViewSettings
extends Object

This class encapsulates view settings for the page mode, page layout and magnification that the PDFViewerBean uses to display documents when they are loaded. Each PDFViewerBean creates an instance of this class which is accessed with PDFViewerBean.getInitialViewSettings().

The static properties are used to initialize the values when this class is instantiated.

By default, the PDFViewerBean will not override the document's initial view settings. If the document does not contain initial view settings, the PDFViewerBean will use the properties of this class for the page mode, page layout, and magnification. If the override...() flag is true, the document's initial view setting will be ignored, and the InitialViewSettings property will be used.

Note: Not all of the PDF document initial view options are not supported by the PDFViewerBean. Refer to the setPageMode(java.lang.String), setPageLayout(java.lang.String) and setMagnification(java.lang.String) methods for the properties that are supported.

Author:
Qoppa Software

Field Summary
static String XMLKEY_INITIAL_VIEW
          XML Element name used for reading/writing as an XML string
 
Method Summary
static String getDefaultMagnification()
          Returns the default magnification property.
static String getDefaultPageLayout()
          Returns the default pageLayout property.
static String getDefaultPageMode()
          Returns the default pageMode property.
 String getMagnification()
          Returns the magnification property used by the PDFViewerBean when a document is loaded.
 String getPageLayout()
          Returns the pageLayout property used by the PDFViewerBean when a document is loaded.
 String getPageMode()
          Returns the pageMode property used by the PDFViewerBean when a document is loaded.
static boolean isDefaultOverrideMagnification()
          Returns the default overrideMagnification value.
static boolean isDefaultOverridePageLayout()
          Returns the default overridePageLayout value.
static boolean isDefaultOverridePageMode()
          Returns the default overridePageMode value.
 boolean isOverrideMagnification()
          Returns whether or not the PDFViewerBean should ignore a document's magnification and use this class's magnification value instead when a document is loaded.
 boolean isOverridePageLayout()
          Returns whether or not the PDFViewerBean should ignore a document's page layout and use this class's page layout value instead when a document is loaded.
 boolean isOverridePageMode()
          Returns whether or not the PDFViewerBean should ignore a document's page mode and use this class's page mode value instead when a document is loaded.
static void setDefaultMagnification(String defaultMagnification)
          Sets the default magnification property used to initialize new instances of this class.
static void setDefaultOverrideMagnification(boolean override)
          Sets the default overrideMagnification value used to initialize new instances of this class.
static void setDefaultOverridePageLayout(boolean override)
          Sets the default overridePageLayout value used to initialize new instances of this class.
static void setDefaultOverridePageMode(boolean override)
          Sets the default overridePageMode value used to initialize new instances of this class.
static void setDefaultPageLayout(String defaultPageLayout)
          Sets the default pageLayout property used to initialize new instances of this class.
static void setDefaultPageMode(String defaultPageMode)
          Sets the default pageMode property used to initialize new instances of this class.
static void setFromXML(String xmlString)
          This method sets the default InitialViewSettings properties with a properly formatted String xml element.
 void setMagnification(String magnification)
          Sets the magnification property used by the PDFViewerBean when a document is loaded.
 void setOverrideMagnification(boolean override)
          Sets whether or not the PDFViewerBean should ignore a document's magnification and use this class's magnification value instead when a document is loaded.
 void setOverridePageLayout(boolean override)
          Sets whether or not the PDFViewerBean should ignore a document's page layout and use this class's page layout value instead when a document is loaded.
 void setOverridePageMode(boolean override)
          Sets whether or not the PDFViewerBean should ignore a document's page mode and use this class's page mode value instead when a document is loaded.
 void setPageLayout(String pageLayout)
          Sets the pageLayout property used by the PDFViewerBean when a document is loaded.
 void setPageMode(String pageMode)
          Sets the pageMode property used by the PDFViewerBean when a document is loaded.
static String toXMLString()
          This method creates a String that contains an xml element of the default InitialViewSettings properties.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMLKEY_INITIAL_VIEW

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

See Also:
Constant Field Values
Method Detail

getDefaultPageMode

public static String getDefaultPageMode()
Returns the default pageMode property.

Returns:
the default pageMode property
See Also:
setDefaultPageMode(java.lang.String)

setDefaultPageMode

public static void setDefaultPageMode(String defaultPageMode)
Sets the default pageMode property used to initialize new instances of this class.
The options are:

Parameters:
defaultPageMode - one of the four values listed above or empty
Throws:
IllegalArgumentException - if defaultPageMode is not one of the legal values shown above

getDefaultPageLayout

public static String getDefaultPageLayout()
Returns the default pageLayout property.

Returns:
the default pageLayout property
See Also:
setDefaultPageLayout(java.lang.String)

setDefaultPageLayout

public static void setDefaultPageLayout(String defaultPageLayout)
Sets the default pageLayout property used to initialize new instances of this class.
The options are:

Parameters:
defaultPageLayout - one of the four values listed above or empty
Throws:
IllegalArgumentException - if defaultPageLayout is not one of the legal values shown above

getDefaultMagnification

public static String getDefaultMagnification()
Returns the default magnification property.

Returns:
the default magnification property
See Also:
setDefaultMagnification(java.lang.String)

setDefaultMagnification

public static void setDefaultMagnification(String defaultMagnification)
Sets the default magnification property used to initialize new instances of this class.
The options are:

Parameters:
defaultMagnification - one of the four values listed above or empty
Throws:
IllegalArgumentException - if defaultMagnification is not one of the legal values shown above

isDefaultOverridePageMode

public static boolean isDefaultOverridePageMode()
Returns the default overridePageMode value.

Returns:
the default overridePageMode value

setDefaultOverridePageMode

public static void setDefaultOverridePageMode(boolean override)
Sets the default overridePageMode value used to initialize new instances of this class.

Parameters:
override - true if the document's page mode should be overridden, false otherwise

isDefaultOverridePageLayout

public static boolean isDefaultOverridePageLayout()
Returns the default overridePageLayout value.

Returns:
the default overridePageLayout value

setDefaultOverridePageLayout

public static void setDefaultOverridePageLayout(boolean override)
Sets the default overridePageLayout value used to initialize new instances of this class.

Parameters:
override - true if the document's page layout should be overridden, false otherwise

isDefaultOverrideMagnification

public static boolean isDefaultOverrideMagnification()
Returns the default overrideMagnification value.

Returns:
the overrideMagnification value

setDefaultOverrideMagnification

public static void setDefaultOverrideMagnification(boolean override)
Sets the default overrideMagnification value used to initialize new instances of this class.

Parameters:
override - true if the document's magnification should be overridden, false otherwise

getPageMode

public String getPageMode()
Returns the pageMode property used by the PDFViewerBean when a document is loaded.

Returns:
the pageMode property
See Also:
setPageMode(java.lang.String)

setPageMode

public void setPageMode(String pageMode)
Sets the pageMode property used by the PDFViewerBean when a document is loaded.
The options are:

Parameters:
pageMode - one of the four values listed above or empty
Throws:
IllegalArgumentException - if pageMode is not one of the legal values shown above

getPageLayout

public String getPageLayout()
Returns the pageLayout property used by the PDFViewerBean when a document is loaded.

Returns:
the pageLayout property
See Also:
setPageLayout(java.lang.String)

setPageLayout

public void setPageLayout(String pageLayout)
Sets the pageLayout property used by the PDFViewerBean when a document is loaded.
The options are:

Parameters:
pageLayout - one of the four values listed above or empty
Throws:
IllegalArgumentException - if pageLayout is not one of the legal values shown above

getMagnification

public String getMagnification()
Returns the magnification property used by the PDFViewerBean when a document is loaded.

Returns:
the magnification property
See Also:
setMagnification(java.lang.String)

setMagnification

public void setMagnification(String magnification)
Sets the magnification property used by the PDFViewerBean when a document is loaded.
The options are:

Parameters:
magnification - one of the four values listed above or empty
Throws:
IllegalArgumentException - if magnification is not one of the legal values shown above

isOverridePageMode

public boolean isOverridePageMode()
Returns whether or not the PDFViewerBean should ignore a document's page mode and use this class's page mode value instead when a document is loaded.

Returns:
the overridePageMode value

setOverridePageMode

public void setOverridePageMode(boolean override)
Sets whether or not the PDFViewerBean should ignore a document's page mode and use this class's page mode value instead when a document is loaded.

Parameters:
override - true if the document's page mode should be overridden, false otherwise

isOverridePageLayout

public boolean isOverridePageLayout()
Returns whether or not the PDFViewerBean should ignore a document's page layout and use this class's page layout value instead when a document is loaded.

Returns:
the overridePageLayout value

setOverridePageLayout

public void setOverridePageLayout(boolean override)
Sets whether or not the PDFViewerBean should ignore a document's page layout and use this class's page layout value instead when a document is loaded.

Parameters:
override - true if the document's page layout should be overridden, false otherwise

isOverrideMagnification

public boolean isOverrideMagnification()
Returns whether or not the PDFViewerBean should ignore a document's magnification and use this class's magnification value instead when a document is loaded.

Returns:
the overrideMagnification value

setOverrideMagnification

public void setOverrideMagnification(boolean override)
Sets whether or not the PDFViewerBean should ignore a document's magnification and use this class's magnification value instead when a document is loaded.

Parameters:
override - true if the document's magnification should be overridden, false otherwise

toXMLString

public static String toXMLString()
This method creates a String that contains an xml element of the default InitialViewSettings properties. This String can be stored and used to set the default InitialViewSettings.

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

setFromXML

public static void setFromXML(String xmlString)
This method sets the default InitialViewSettings properties with a properly formatted String xml element.

See Also:
toXMLString()