ice.ri.common.print.swing
Class PageSetupDialog

java.lang.Object
  extended byice.ri.common.print.swing.PageSetupDialog

public class PageSetupDialog
extends Object

The purpose of this class is to expose many of the settings available in the StormPageFormat object in a "use anywhere" dialog window. The dialog has support for four types of basic PageDecorations defined by their names, such as Title, URL, Date/Time and Page # of #. If the StormPageObject has other PageDecoration with different names they are ignored by the dialog but will still be printed as expected. The StormPageFormat settings are represented by two panels, settings and advanced respectively. The "Settings" panel has the following settings: orientation - radio boxes to choice either Portrait or Landscape for the paper orientation Scale - text field which accepts whole number that represent the layout scale in percent. A check box is also used to specify if the the layout should be shrunk to fit the paper width. Margins - Specify the paper margins in units defined in the Advanced section. Headers & footers - combo boxes can be used to pick the header and footer font and font size from available system fonts. There are also combo boxes for selecting predefined header and footer page decoration for left, center and right positioning. The "Advanced" Jpanel has the following settings: Options - a check box to turn on or off the printing of background colours and images. The default unit can also be selected via a combo box. When a new unit is selected the margins in the "settings" panel are automatically updated. HTML Paging - a check box to turn on or off HTML smart paging. Smart paging enables special algorithms in the HTML4 pilot which try and find logical horizontal and vertical page breaks. If smart paging is disabled horizontal and vertical page breaks are made on the imageable area dimensions. Frames - only applicable for html4 pages that have a frame set page. If so a radio box is used to select individual frame printing which a combo box to select the desired frame. A second radio box is available to for printing all frames in the frameset. This dialog comes in three different layout flavours which can be easily be selected via the default constructor. The first and default flavour is a tabbed layout where each settings panel is represented by a tabbed panel. The second flavour is button view where the first settings panel is visible on the dialog and the advanced settings are available by a button which makes the panel visible. The third flavour is Tree view which displays a tree view of the available panels on the left hand side of the dialog. Selecting the tree elements make the respective panel visible on the right hand side of the dialog. The print preview dialog takes a StormPageFormat object in the constructor and clones it. On the return of showDialog a new modified version of the StormPageObject is returned.

Since:
6.0
Version:
%I%, %G%
Author:
Patrick Corless

Nested Class Summary
 class PageSetupDialog.AdvancedPageSettingsPanel
          The classes purpose is to provide a panel that represents many of the advanced page settings found in the the StormPageFormat object.
 class PageSetupDialog.PageSettingsPanel
          The classes purpose is to provide a panel that represents many of the default page settings found in the the StormPageFormat object.
 
Field Summary
static int BUTTON_LAYOUT
          Set the look and feel of the dialog to button panel view.
static String DECORATION_BLANK
          Specifies a blank page decoration.
static String DECORATION_DATE_TIME
          Specifies a Date/Time decoration.
static String DECORATION_PAGE_NUMBER
          Specifies a page number decoration.
static String DECORATION_TITLE
          Specifies a title page decoration.
static String DECORATION_URL
          Specifies a URL page decoration.
static int TABBED_LAYOUT
          Set the look and feel of the dialog to a tabbed panel view.
static int TREE_LAYOUT
          Set the look and feel of the dialog to a tree panel view.
 
Constructor Summary
PageSetupDialog(JFrame parent, Viewport viewport, StormPageFormat stormPageFormat)
          Constructs a new PageSetupDialog with a tabbed layout.
PageSetupDialog(JFrame parent, Viewport viewport, StormPageFormat stormPageFormat, int view)
          Constructs a new PageSetupDialog with the desired layout.
 
Method Summary
static String getDecorationTitle(String name)
          Gets the decoration title name.
static void refreshPageDecoration(Viewport viewport, StormPageFormat stormPageFormat)
          Utility function for printing.
 StormPageFormat showDialog()
          Display the dialog by making it visible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TABBED_LAYOUT

public static final int TABBED_LAYOUT
Set the look and feel of the dialog to a tabbed panel view.

See Also:
Constant Field Values

BUTTON_LAYOUT

public static final int BUTTON_LAYOUT
Set the look and feel of the dialog to button panel view.

See Also:
Constant Field Values

TREE_LAYOUT

public static final int TREE_LAYOUT
Set the look and feel of the dialog to a tree panel view.

See Also:
Constant Field Values

DECORATION_BLANK

public static final String DECORATION_BLANK
Specifies a blank page decoration.

See Also:
Constant Field Values

DECORATION_TITLE

public static final String DECORATION_TITLE
Specifies a title page decoration.

See Also:
Constant Field Values

DECORATION_URL

public static final String DECORATION_URL
Specifies a URL page decoration.

See Also:
Constant Field Values

DECORATION_DATE_TIME

public static final String DECORATION_DATE_TIME
Specifies a Date/Time decoration.

See Also:
Constant Field Values

DECORATION_PAGE_NUMBER

public static final String DECORATION_PAGE_NUMBER
Specifies a page number decoration.

See Also:
Constant Field Values
Constructor Detail

PageSetupDialog

public PageSetupDialog(JFrame parent,
                       Viewport viewport,
                       StormPageFormat stormPageFormat)
Constructs a new PageSetupDialog with a tabbed layout. A clone of StormPageFormat is made.

Parameters:
parent - parent frame from which the dialog is displayed
viewport - the viewport that will be used for setup
stormPageFormat - the settings from which the dialog uses as default values.

PageSetupDialog

public PageSetupDialog(JFrame parent,
                       Viewport viewport,
                       StormPageFormat stormPageFormat,
                       int view)
Constructs a new PageSetupDialog with the desired layout.

Parameters:
parent - parent frame from which the dialog is displayed
viewport - the viewport that will be used for setup
stormPageFormat - the settings from which the dialog uses as default values.
view - specify the desired layout with one of the constants, TABBED_LAYOUT, TREE_LAYOUT and BUTTON_LAYOUT
Method Detail

showDialog

public StormPageFormat showDialog()
Display the dialog by making it visible.

Returns:
StormPageFormat object which contains any setting changes made through the dialog user interface. If no changes where made the original StormPageFormat object is returned.

getDecorationTitle

public static String getDecorationTitle(String name)
Gets the decoration title name.

Parameters:
name - decoration name.
Returns:
name of decoration if found, null otherwise.

refreshPageDecoration

public static void refreshPageDecoration(Viewport viewport,
                                         StormPageFormat stormPageFormat)
Utility function for printing. Refresh any PageDecoration that are associated with the stormPageFormat object that needed to be updated for the a given viewport state. Decorations named "Title", "Date/Time", URL and "Page # of #" are updated to reflect the given viewports state.

Parameters:
viewport -
stormPageFormat -