Side of Software
Print Preview Library 1.8.1

sos.preview
Class BasicPrintPreviewPageUI

java.lang.Object
  |
  +--javax.swing.plaf.ComponentUI
        |
        +--sos.preview.PrintPreviewPageUI
              |
              +--sos.preview.BasicPrintPreviewPageUI

public class BasicPrintPreviewPageUI
extends PrintPreviewPageUI

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

Since:
1.0
See Also:
PrintPreviewPageUI, JPrintPreviewPage

Field Summary
static java.lang.Object ALWAYS_CACHE_VALUE
          A possible value for the look-and-feel key CACHING_POLICY_KEY that always caches the image of the page.
static java.lang.Object BACKGROUND_KEY
          The look-and-feel key for the background color.
static java.lang.Object BORDER_THICKNESS_KEY
          The look-and-feel key for the border thickness.
static java.lang.Object CACHING_POLICY_KEY
          The look-and-feel key for the use of a cache.
static java.lang.Object FOREGROUND_KEY
          The look-and-feel key for the foreground color.
static java.lang.Object MARGIN_COLOR_KEY
          The look-and-feel key for the margin color.
static java.lang.Object MARGIN_STROKE_KEY
          The look-and-feel key for the margin stroke.
static java.lang.Object MEMORY_SENSITIVE_CACHE_VALUE
          A possible value for the look-and-feel key CACHING_POLICY_KEY that caches a soft reference to the image of the page.
static java.lang.Object NEVER_CACHE_VALUE
          A possible value for the look-and-feel key CACHING_POLICY_KEY that never caches the image of the page.
static java.lang.Object SHADOW_COLOR_KEY
          The look-and-feel key for the shadow color.
static java.lang.Object SHADOW_THICKNESS_KEY
          The look-and-feel key for the shadow thickness.
 
Constructor Summary
BasicPrintPreviewPageUI()
          Creates a new instance of BasicPrintPreviewPageUI
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Returns an instance of the UI delegate for the specified component.
 double getFixedHeight(JPrintPreviewPage printPreviewPage)
          Returns the height of the fixed portion of the specified page.
 double getFixedWidth(JPrintPreviewPage printPreviewPage)
          Returns the width of the fixed portion of the specified page.
 java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
          Returns the specified component's preferred size appropriate for the look and feel.
 java.awt.Dimension getScaleablePreferredSize(JPrintPreviewPage printPreviewPage)
          Returns the preferred size of the scaleable portion of the specified page.
protected  void installDefaults()
          Installs the default colors and lines of the print preview page.
 void installUI(javax.swing.JComponent c)
          Configures the specified component appropriate for the look and feel.
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
          Paints the specified component appropriate for the look and feel.
protected  void uninstallDefaults()
          Uninstalls the defaults installed by installDefaults.
 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, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BORDER_THICKNESS_KEY

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


SHADOW_THICKNESS_KEY

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


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 );
 


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 );
 


SHADOW_COLOR_KEY

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


MARGIN_COLOR_KEY

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


MARGIN_STROKE_KEY

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


CACHING_POLICY_KEY

public static final java.lang.Object CACHING_POLICY_KEY
The look-and-feel key for the use of a cache. By default, no cache is used when rendering a print previewed page (NEVER_CACHE_VALUE). Applications may change the default value by invoking at application start-up either
  UIManager.put( BasicPrintPreviewPageUI.CACHING_POLICY_KEY, BasicPrintPreviewPageUI.ALWAYS_CACHE_VALUE );
or
  UIManager.put( BasicPrintPreviewPageUI.CACHING_POLICY_KEY, BasicPrintPreviewPageUI.MEMORY_SENSITIVE_CACHE_VALUE);

Since:
1.8
See Also:
ALWAYS_CACHE_VALUE, MEMORY_SENSITIVE_CACHE_VALUE

ALWAYS_CACHE_VALUE

public static final java.lang.Object ALWAYS_CACHE_VALUE
A possible value for the look-and-feel key CACHING_POLICY_KEY that always caches the image of the page. If the rendering of a page is slow, use of the cached image will speed up successive renderings.

The image is cached for the current zoom level only. If the zoom level changes, the image is redrawn and re-cached.

Since:
1.8

NEVER_CACHE_VALUE

public static final java.lang.Object NEVER_CACHE_VALUE
A possible value for the look-and-feel key CACHING_POLICY_KEY that never caches the image of the page. Each time the image is rendered, print is invoked on the printable object.

Since:
1.8

MEMORY_SENSITIVE_CACHE_VALUE

public static final java.lang.Object MEMORY_SENSITIVE_CACHE_VALUE
A possible value for the look-and-feel key CACHING_POLICY_KEY that caches a soft reference to the image of the page. If the rendering of a page is slow, use of the cached image will speed up successive renderings. If memory is in demand, the soft reference is cleared and the image is re-cached the next time the page is rendered.

The image is cached for the current zoom level only. If the zoom level changes, the image is redrawn and re-cached.

Since:
1.8
Constructor Detail

BasicPrintPreviewPageUI

public BasicPrintPreviewPageUI()
Creates a new instance of BasicPrintPreviewPageUI

Method Detail

createUI

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


getFixedWidth

public double getFixedWidth(JPrintPreviewPage printPreviewPage)
Description copied from class: PrintPreviewPageUI
Returns the width of the fixed portion of the specified page.

Specified by:
getFixedWidth in class PrintPreviewPageUI
Parameters:
printPreviewPage - page to get the fixed width
Returns:
the width of the fixed portion of the specified page

getFixedHeight

public double getFixedHeight(JPrintPreviewPage printPreviewPage)
Description copied from class: PrintPreviewPageUI
Returns the height of the fixed portion of the specified page.

Specified by:
getFixedHeight in class PrintPreviewPageUI
Parameters:
printPreviewPage - page to get the fixed height
Returns:
the height of the fixed portion of the specified page

getPreferredSize

public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
Returns the specified component's preferred size appropriate for the look and feel.

Overrides:
getPreferredSize in class javax.swing.plaf.ComponentUI

getScaleablePreferredSize

public java.awt.Dimension getScaleablePreferredSize(JPrintPreviewPage printPreviewPage)
Description copied from class: PrintPreviewPageUI
Returns the preferred size of the scaleable portion of the specified page.

Specified by:
getScaleablePreferredSize in class PrintPreviewPageUI
Parameters:
printPreviewPage - page to get the preferred size
Returns:
returns the preferred size of the scaleable portion of the specified page

installDefaults

protected void installDefaults()
Installs the default colors and lines of the print preview page.

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)

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)
Paints the specified component appropriate for the look and feel.

Overrides:
paint in class javax.swing.plaf.ComponentUI

uninstallDefaults

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

See Also:
installDefaults()

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.