Side of Software
Print Preview Library 1.8.1

sos.preview
Class BasicPrintPreviewPaneUI

java.lang.Object
  |
  +--javax.swing.plaf.ComponentUI
        |
        +--sos.preview.PrintPreviewPaneUI
              |
              +--sos.preview.BasicPrintPreviewPaneUI

public class BasicPrintPreviewPaneUI
extends PrintPreviewPaneUI

A basic implementation of the print preview pane look and feel.

Since:
1.0
See Also:
PrintPreviewPaneUI, JPrintPreviewPane

Field Summary
static java.lang.Object BACKGROUND_KEY
          The look-and-feel key for the background color.
static java.lang.Object BOTTOM_MARGIN
          The look-and-feel key for the bottom margin.
static java.lang.Object FOREGROUND_KEY
          The look-and-feel key for the foreground color.
static java.lang.Object HORIZONTAL_ALIGNMENT
          The look-and-feel key for the horizontal alignment of print preview pages.
static java.lang.Object HORIZONTAL_SPACING
          The look-and-feel key for the horizontal space between print preview pages.
static java.lang.Object LEFT_MARGIN
          The look-and-feel key for the left margin.
protected  JPrintPreviewPane printPreviewPane
          The print preview pane that this look and feel is overseeing.
static java.lang.Object RIGHT_MARGIN
          The look-and-feel key for the right margin.
static java.lang.Object SELECTION_BACKGROUND_KEY
          The look-and-feel key for the selection background color.
static java.lang.Object SELECTION_FOREGROUND_KEY
          The look-and-feel key for the selection foreground color.
static java.lang.Object TOP_MARGIN
          The look-and-feel key for the top margin.
static java.lang.Object VERTICAL_ALIGNMENT
          The look-and-feel key for the vertical alignment of print preview pages.
static java.lang.Object VERTICAL_SPACING
          The look-and-feel key for the vertical space between print preview pages.
 
Constructor Summary
BasicPrintPreviewPaneUI()
          Creates a new instance of BasicPrintPreviewPaneUI
 
Method Summary
 java.awt.LayoutManager createFitAllLayout(JPrintPreviewPane printPreviewPane)
          Creates and returns a layout scheme that scales all pages such that they fit in the specified print preview pane's viewport.
 java.awt.LayoutManager createFitLayout(JPrintPreviewPane printPreviewPane)
          Creates and returns a layout scheme that scales all pages such that one dimension of the largest page fits in the specified print preview pane's viewport.
 java.awt.LayoutManager createMatrixLayout(JPrintPreviewPane printPreviewPane, int numRows, int numColumns)
          Creates and returns a layout scheme that arranges pages into rows and columns that fit the bounds of the specified print preview pane's parent.
protected  java.beans.PropertyChangeListener createPropertyChangeListener()
          Returns a PropertyChangeListener that responds to changes in the print preview pane.
protected  java.awt.Cursor createSelectionCursor()
          Returns a cursor that indicates that the print preview pane is in "selection" mode.
protected  javax.swing.event.ListSelectionListener createSelectionListener()
          Returns an object that listens to page selection changes.
protected  javax.swing.event.MouseInputListener createSelectionMouseInputListener()
          Returns a mouse listener that responds to mouse events when the print preview pane is in "selection" mode.
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Returns an instance of the UI delegate for the specified component.
protected  java.awt.Cursor createZoomCursor()
          Returns a cursor that indicates that the print preview pane is in "zoom" mode.
protected  java.awt.Cursor createZoomInCursor()
          Returns a cursor that indicates that the print preview pane is in "zoom in" mode.
protected  javax.swing.event.MouseInputListener createZoomInMouseInputListener()
          Returns a mouse listener that responds to mouse events when the print preview pane is in "zoom in" mode.
 java.awt.LayoutManager createZoomLayout(JPrintPreviewPane printPreviewPane, double scale)
          Creates and returns a layout scheme (appropriate for the specified print preview pane) that scales pages a fixed amount.
protected  javax.swing.event.MouseInputListener createZoomMouseInputListener()
          Returns a mouse listener that responds to mouse events when the print preview pane is in "zoom" mode.
protected  java.awt.Cursor createZoomOutCursor()
          Returns a cursor that indicates that the print preview pane is in "zoom out" mode.
protected  javax.swing.event.MouseInputListener createZoomOutMouseInputListener()
          Returns a mouse listener that responds to mouse events when the print preview pane is in "zoom out" mode.
protected  void installDefaults()
          Installs the default colors of the print preview pane.
protected  void installListeners()
          Installs the look and feel's listeners into the print preview pane and possibly any of its child pages.
 void installUI(javax.swing.JComponent c)
          Configures the specified component appropriate for the look and feel.
protected  void uninstallDefaults()
          Uninstalls the defaults installed by installDefaults.
protected  void uninstallListeners()
          Uninstalls the listeners installed by this look and feel object.
 void uninstallUI(javax.swing.JComponent c)
          Reverses configuration which was done on the specified component during installUI.
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, paint, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BACKGROUND_KEY

public static final java.lang.Object BACKGROUND_KEY
The look-and-feel key for the background color. Applications may change the default value by invoking at application start-up
  UIManager.put( BasicPrintPreviewPageUI.BACKGROUND_KEY, Color.blue );
 


BOTTOM_MARGIN

public static final java.lang.Object BOTTOM_MARGIN
The look-and-feel key for the bottom margin. Applications may change the default value by invoking at application start-up
  UIManager.put( BasicPrintPreviewPageUI.BOTTOM_MARGIN, new Integer( x ));
 


FOREGROUND_KEY

public static final java.lang.Object FOREGROUND_KEY
The look-and-feel key for the foreground color. Applications may change the default value by invoking at application start-up
  UIManager.put( BasicPrintPreviewPageUI.FOREGROUND_KEY, Color.blue );
 


LEFT_MARGIN

public static final java.lang.Object LEFT_MARGIN
The look-and-feel key for the left margin. Applications may change the default value by invoking at application start-up
  UIManager.put( BasicPrintPreviewPageUI.LEFT_MARGIN, new Integer( x ));
 


HORIZONTAL_ALIGNMENT

public static final java.lang.Object HORIZONTAL_ALIGNMENT
The look-and-feel key for the horizontal alignment of print preview pages. Applications may change the default value by invoking at application start-up
  UIManager.put( BasicPrintPreviewPageUI.HORIZONTAL_ALIGNMENT, new Integer( x ));
 


HORIZONTAL_SPACING

public static final java.lang.Object HORIZONTAL_SPACING
The look-and-feel key for the horizontal space between print preview pages. Applications may change the default value by invoking at application start-up
  UIManager.put( BasicPrintPreviewPageUI.HORIZONTAL_SPACING, new Integer( x ));
 


RIGHT_MARGIN

public static final java.lang.Object RIGHT_MARGIN
The look-and-feel key for the right margin. Applications may change the default value by invoking at application start-up
  UIManager.put( BasicPrintPreviewPageUI.RIGHT_MARGIN, new Integer( x ));
 


SELECTION_BACKGROUND_KEY

public static final java.lang.Object SELECTION_BACKGROUND_KEY
The look-and-feel key for the selection background color. Applications may change the default value by invoking at application start-up
  UIManager.put( BasicPrintPreviewPageUI.SELECTION_BACKGROUND_KEY, Color.blue );
 


SELECTION_FOREGROUND_KEY

public static final java.lang.Object SELECTION_FOREGROUND_KEY
The look-and-feel key for the selection foreground color. Applications may change the default value by invoking at application start-up
  UIManager.put( BasicPrintPreviewPageUI.SELECTION_FOREGROUND_KEY, Color.blue );
 


TOP_MARGIN

public static final java.lang.Object TOP_MARGIN
The look-and-feel key for the top margin. Applications may change the default value by invoking at application start-up
  UIManager.put( BasicPrintPreviewPageUI.TOP_MARGIN, new Integer( x ));
 


VERTICAL_ALIGNMENT

public static final java.lang.Object VERTICAL_ALIGNMENT
The look-and-feel key for the vertical alignment of print preview pages. Applications may change the default value by invoking at application start-up
  UIManager.put( BasicPrintPreviewPageUI.VERTICAL_ALIGNMENT, new Integer( x ));
 


VERTICAL_SPACING

public static final java.lang.Object VERTICAL_SPACING
The look-and-feel key for the vertical space between print preview pages. Applications may change the default value by invoking at application start-up
  UIManager.put( BasicPrintPreviewPageUI.VERTICAL_SPACING, new Integer( x ));
 


printPreviewPane

protected JPrintPreviewPane printPreviewPane
The print preview pane that this look and feel is overseeing.

Constructor Detail

BasicPrintPreviewPaneUI

public BasicPrintPreviewPaneUI()
Creates a new instance of BasicPrintPreviewPaneUI

Method Detail

createFitAllLayout

public java.awt.LayoutManager createFitAllLayout(JPrintPreviewPane printPreviewPane)
Description copied from class: PrintPreviewPaneUI
Creates and returns a layout scheme that scales all pages such that they fit in the specified print preview pane's viewport.

Specified by:
createFitAllLayout in class PrintPreviewPaneUI
Parameters:
printPreviewPane - print preview pane for which the layout manager is to be created
Returns:
a layout manager that fits all pages in the bounds of the print preview pane's viewport

createFitLayout

public java.awt.LayoutManager createFitLayout(JPrintPreviewPane printPreviewPane)
Description copied from class: PrintPreviewPaneUI
Creates and returns a layout scheme that scales all pages such that one dimension of the largest page fits in the specified print preview pane's viewport.

Specified by:
createFitLayout in class PrintPreviewPaneUI
Parameters:
printPreviewPane - print preview pane for which the layout manager is to be created
Returns:
a layout manager that sizes the pages such that one dimension matches the print preview pane's viewport

createMatrixLayout

public java.awt.LayoutManager createMatrixLayout(JPrintPreviewPane printPreviewPane,
                                                 int numRows,
                                                 int numColumns)
Description copied from class: PrintPreviewPaneUI
Creates and returns a layout scheme that arranges pages into rows and columns that fit the bounds of the specified print preview pane's parent.

Specified by:
createMatrixLayout in class PrintPreviewPaneUI
Parameters:
printPreviewPane - print preview pane for which the layout manager is to be created
numRows - number of rows per "screen"
numColumns - number of columns per "screen"
Returns:
a layout manager that arranges the print preview pane's pages into a matrix

createPropertyChangeListener

protected java.beans.PropertyChangeListener createPropertyChangeListener()
Returns a PropertyChangeListener that responds to changes in the print preview pane.

Returns:
a PropertyChangeListener that responds to changes in the print preview pane.

createSelectionCursor

protected java.awt.Cursor createSelectionCursor()
Returns a cursor that indicates that the print preview pane is in "selection" mode.

Returns:
a cursor suitable for selecting pages

createSelectionListener

protected javax.swing.event.ListSelectionListener createSelectionListener()
Returns an object that listens to page selection changes.

Returns:
a ListSelectionListener that responds to changes in page selection

createSelectionMouseInputListener

protected javax.swing.event.MouseInputListener createSelectionMouseInputListener()
Returns a mouse listener that responds to mouse events when the print preview pane is in "selection" mode.

Returns:
a MouseInputListener that handles selection mouse events

createZoomLayout

public java.awt.LayoutManager createZoomLayout(JPrintPreviewPane printPreviewPane,
                                               double scale)
Description copied from class: PrintPreviewPaneUI
Creates and returns a layout scheme (appropriate for the specified print preview pane) that scales pages a fixed amount.

Specified by:
createZoomLayout in class PrintPreviewPaneUI
Parameters:
printPreviewPane - print preview pane for which the layout manager is to be created
scale - about to scale the pages
Returns:
a layout manager that scales print preview pages by scale

createZoomCursor

protected java.awt.Cursor createZoomCursor()
Returns a cursor that indicates that the print preview pane is in "zoom" mode.

Returns:
a cursor suitable for zooming

createZoomInCursor

protected java.awt.Cursor createZoomInCursor()
Returns a cursor that indicates that the print preview pane is in "zoom in" mode.

Returns:
a cursor suitable for zooming in

createZoomOutCursor

protected java.awt.Cursor createZoomOutCursor()
Returns a cursor that indicates that the print preview pane is in "zoom out" mode.

Returns:
a cursor suitable for zooming out

createZoomMouseInputListener

protected javax.swing.event.MouseInputListener createZoomMouseInputListener()
Returns a mouse listener that responds to mouse events when the print preview pane is in "zoom" mode.

Returns:
a MouseInputListener that handles zoom mouse events

createZoomInMouseInputListener

protected javax.swing.event.MouseInputListener createZoomInMouseInputListener()
Returns a mouse listener that responds to mouse events when the print preview pane is in "zoom in" mode.

Returns:
a MouseInputListener that handles zoom-in mouse events

createZoomOutMouseInputListener

protected javax.swing.event.MouseInputListener createZoomOutMouseInputListener()
Returns a mouse listener that responds to mouse events when the print preview pane is in "zoom out" mode.

Returns:
a MouseInputListener that handles zoom-out mouse events

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
Returns an instance of the UI delegate for the specified component.


installDefaults

protected void installDefaults()
Installs the default colors of the print preview pane.

See Also:
uninstallDefaults()

installUI

public void installUI(javax.swing.JComponent c)
Configures the specified component appropriate for the look and feel.

Overrides:
installUI in class javax.swing.plaf.ComponentUI
See Also:
uninstallUI(javax.swing.JComponent)

installListeners

protected void installListeners()
Installs the look and feel's listeners into the print preview pane and possibly any of its child pages.


uninstallDefaults

protected void uninstallDefaults()
Uninstalls the defaults installed by installDefaults.

See Also:
installDefaults()

uninstallListeners

protected void uninstallListeners()
Uninstalls the listeners installed by this look and feel object.

See Also:
installListeners()

uninstallUI

public void uninstallUI(javax.swing.JComponent c)
Reverses configuration which was done on the specified component during installUI.

Overrides:
uninstallUI in class javax.swing.plaf.ComponentUI
See Also:
installUI(javax.swing.JComponent)

Side of Software
Print Preview Library 1.8.1

Copyright 2003-07 Side of Software (SOS). All rights reserved.