ice.ri.common.print.awt
Class PageSetupDialog

java.lang.Object
  extended byice.ri.common.print.awt.PageSetupDialog
All Implemented Interfaces:
EventListener, WindowListener

public class PageSetupDialog
extends Object
implements WindowListener

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 two different layout flavours which can be easily be selected via the default constructor. The first 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 second flavour is list view which displays a list view of the available panels on the left hand side of the dialog. Selecting a list 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 int LIST_LAYOUT
          Set the look and feel of the dialog to a list panel view.
 
Constructor Summary
PageSetupDialog(Frame parent, Viewport viewport, StormPageFormat stormPageFormat)
          Constructs a new PageSetupDialog with a tabbed layout.
PageSetupDialog(Frame parent, Viewport viewport, StormPageFormat stormPageFormat, int view)
          Constructs a new PageSetupDialog with a tabbed layout.
 
Method Summary
static void refreshPageDecoration(Viewport viewport, StormPageFormat stormPageFormat)
          Utility function for printing.
 StormPageFormat showDialog()
          Display the dialog by making it visible.
 void windowActivated(WindowEvent ev)
           
 void windowClosed(WindowEvent ev)
           
 void windowClosing(WindowEvent e)
          Window Closing Event listener
 void windowDeactivated(WindowEvent ev)
           
 void windowDeiconified(WindowEvent ev)
           
 void windowIconified(WindowEvent ev)
           
 void windowOpened(WindowEvent ev)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIST_LAYOUT

public static final int LIST_LAYOUT
Set the look and feel of the dialog to a list 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
Constructor Detail

PageSetupDialog

public PageSetupDialog(Frame 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(Frame parent,
                       Viewport viewport,
                       StormPageFormat stormPageFormat,
                       int view)
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.
view - specify the desired layout with one of the constants, LIST_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.

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 -

windowClosing

public void windowClosing(WindowEvent e)
Window Closing Event listener

Specified by:
windowClosing in interface WindowListener
Parameters:
e -

windowClosed

public void windowClosed(WindowEvent ev)
Specified by:
windowClosed in interface WindowListener

windowOpened

public void windowOpened(WindowEvent ev)
Specified by:
windowOpened in interface WindowListener

windowIconified

public void windowIconified(WindowEvent ev)
Specified by:
windowIconified in interface WindowListener

windowDeiconified

public void windowDeiconified(WindowEvent ev)
Specified by:
windowDeiconified in interface WindowListener

windowActivated

public void windowActivated(WindowEvent ev)
Specified by:
windowActivated in interface WindowListener

windowDeactivated

public void windowDeactivated(WindowEvent ev)
Specified by:
windowDeactivated in interface WindowListener