com.miginfocom.beans
Class PrintPreviewBean

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.miginfocom.util.gfx.BackgroundPanel
                      extended by com.miginfocom.beans.PaintPanelBean
                          extended by com.miginfocom.beans.PrintPreviewBean
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public final class PrintPreviewBean
extends PaintPanelBean

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PrintPreviewBean()
           
 
Method Summary
 void doLayout()
           
 DateAreaContainer getDateAreaContainer()
          Property: The DateAreaContainer that is to be previewed.
 boolean getFlowPages()
          Property: If set to true the pages will will flow like FlowLayout and while maintaining the same aspect ratio flow the pages from left to right and then top to bottom.
 float getLayoutAlignmentX()
          Property: How to align the preview panels as a group if there are free space to distribute.
 float getLayoutAlignmentY()
          Property: How to align the preview panels as a group if there are free space to distribute.
 java.awt.print.PageFormat getPageFormat()
          Property: The PageFormat that will be used in the print preview.
 int getPageGapX()
          Property: The number of horizontal pixels between two adjacent pages.
 int getPageGapY()
          Property: The number of vertical pixels between two adjacent pages.
 java.awt.Paint getPaperPaint()
          Property: The paint for the papers.
 java.awt.Dimension getPreferredSize()
           
 javax.swing.border.Border getPreviewPanelsBorder()
          Property: The border that will be set for every preview panel.
 PrintSpecification getPrintSpecification()
          Property: The specifiaction that outlines how this date area container should be printed.
 double getScreenDpi()
          Property: The dots (pixels) per inch that the screen physically have.
 double getZoomMaximum()
          Property: The maximum size of and individual page expressed in percent.
 double getZoomMinimum()
          Property: The minimum size of and individual page expressed in percent.
 double getZoomPreferred()
          Property: The prererred size of and individual page expressed in percent.
 void recreatePreviewPanels()
           
 void setDateAreaContainer(DateAreaContainer container)
          Property: The DateAreaContainer that is to be previewed.
 void setFlowPages(boolean b)
          Property: If set to true the pages will will flow like FlowLayout and while maintaining the same aspect ratio flow the pages from left to right and then top to bottom.
 void setLayout(java.awt.LayoutManager lm)
           
 void setLayoutAlignmentX(float alignX)
          Property: How to align the preview panels as a group if there are free space to distribute.
 void setLayoutAlignmentY(float alignY)
          Property: How to align the preview panels as a group if there are free space to distribute.
 void setPageFormat(java.awt.print.PageFormat pf)
          Property: The PageFormat that will be used in the print preview.
 void setPageGapX(int gap)
          Property: The number of horizontal pixels between two adjacent pages.
 void setPageGapY(int gap)
          Property: The number of vertical pixels between two adjacent pages.
 void setPaperPaint(java.awt.Paint p)
          Property: The paint for the papers.
 void setPreviewPanelsBorder(javax.swing.border.Border border)
          Property: The border that will be set for every preview panel.
 void setPrintSpecification(PrintSpecification printSpec)
          Property: The specifiaction that outlines how this date area container should be printed.
 void setScreenDpi(double dpi)
          Property: The dots (pixels) per inch that the screen physically have.
 void setZoomMaximum(double zoom)
          Property: The maximum size of and individual page expressed in percent.
 void setZoomMinimum(double zoom)
          Property: The minimum size of and individual page expressed in percent.
 void setZoomPreferred(double zoom)
          Property: The prererred size of and individual page expressed in percent.
 
Methods inherited from class com.miginfocom.util.gfx.BackgroundPanel
getBackgroundPaint, paintComponent, setBackgroundPaint
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrintPreviewBean

public PrintPreviewBean()
Method Detail

setLayout

public void setLayout(java.awt.LayoutManager lm)
Overrides:
setLayout in class java.awt.Container

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

doLayout

public void doLayout()
Overrides:
doLayout in class java.awt.Container

getDateAreaContainer

public DateAreaContainer getDateAreaContainer()
Property: The DateAreaContainer that is to be previewed.

Returns:
The container. May be null.

setDateAreaContainer

public void setDateAreaContainer(DateAreaContainer container)
Property: The DateAreaContainer that is to be previewed.

Parameters:
container - The container. May be null to reset. Will be saved in a weak reference so there are no memory leaks. This means that the container need to be held in a normal stong reference or the preview bean will not work.

getPaperPaint

public java.awt.Paint getPaperPaint()
Property: The paint for the papers.

Returns:
The current paint. Never null. Color.WHITE is default.

setPaperPaint

public void setPaperPaint(java.awt.Paint p)
Property: The paint for the papers.

Parameters:
p - The new paint. Not null. Color.WHITE is default.

getPrintSpecification

public PrintSpecification getPrintSpecification()
Property: The specifiaction that outlines how this date area container should be printed.

Returns:
The current specification. Not null.
Since:
6.0

setPrintSpecification

public void setPrintSpecification(PrintSpecification printSpec)
Property: The specifiaction that outlines how this date area container should be printed.

Parameters:
printSpec - The new specification. If null a specification will be retrieved from the DateAreaContainer.
Since:
6.0

getZoomMinimum

public double getZoomMinimum()
Property: The minimum size of and individual page expressed in percent. 1.0 is 100% and 0.0 is 0%. Values above 100% (1.0) is allowed.

100% means the size that the page will get on screen is equal to the size of the paper, so for instance if you meassure the width on the screen with a ruler a paper with the "Letter" size would be 8.5 inces wide.

Returns:
The current zoom level.

setZoomMinimum

public void setZoomMinimum(double zoom)
Property: The minimum size of and individual page expressed in percent. 1.0 is 100% and 0.0 is 0%. Values above 100% (1.0) is allowed.

100% means the size that the page will get on screen is equal to the size of the paper, so for instance if you meassure the width on the screen with a ruler a paper with the "Letter" size would be 8.5 inces wide.

Parameters:
zoom - The new zoom level.

getZoomPreferred

public double getZoomPreferred()
Property: The prererred size of and individual page expressed in percent. 1.0 is 100% and 0.0 is 0%. Values above 100% (1.0) is allowed.

100% means the size that the page will get on screen is equal to the size of the paper, so for instance if you meassure the width on the screen with a ruler a paper with the "Letter" size would be 8.5 inces wide.

Returns:
The current zoom level.

setZoomPreferred

public void setZoomPreferred(double zoom)
Property: The prererred size of and individual page expressed in percent. 1.0 is 100% and 0.0 is 0%. Values above 100% (1.0) is allowed.

100% means the size that the page will get on screen is equal to the size of the paper, so for instance if you meassure the width on the screen with a ruler a paper with the "Letter" size would be 8.5 inces wide.

Parameters:
zoom - The new zoom level.

getZoomMaximum

public double getZoomMaximum()
Property: The maximum size of and individual page expressed in percent. 1.0 is 100% and 0.0 is 0%. Values above 100% (1.0) is allowed.

100% means the size that the page will get on screen is equal to the size of the paper, so for instance if you meassure the width on the screen with a ruler a paper with the "Letter" size would be 8.5 inces wide.

Returns:
The current zoom level.

setZoomMaximum

public void setZoomMaximum(double zoom)
Property: The maximum size of and individual page expressed in percent. 1.0 is 100% and 0.0 is 0%. Values above 100% (1.0) is allowed.

100% means the size that the page will get on screen is equal to the size of the paper, so for instance if you meassure the width on the screen with a ruler a paper with the "Letter" size would be 8.5 inces wide.

Parameters:
zoom - The new zoom level.

getScreenDpi

public double getScreenDpi()
Property: The dots (pixels) per inch that the screen physically have. This value is used to caclulate how long a certain distance (e.g. one inch) is on the screen. Since a few screens have higher DPI than 72 and Java has no standard way to get this value you can set it here so that a page that is a certain width will get that width on the screen as well (when the zoom is 100%).

Returns:
The current value. 96 is default.

setScreenDpi

public void setScreenDpi(double dpi)
Property: The dots (pixels) per inch that the screen physically have. This value is used to caclulate how long a certain distance (e.g. one inch) is on the screen. Since a few screens have higher DPI than 72 and Java has no standard way to get this value you can set it here so that a page that is a certain width will get that width on the screen as well (when the zoom is 100%).

Parameters:
dpi - The new value. 96 is default.

getFlowPages

public boolean getFlowPages()
Property: If set to true the pages will will flow like FlowLayout and while maintaining the same aspect ratio flow the pages from left to right and then top to bottom.

If false the layout manager will arrange the pages in the way that they look, so that the painted picture will be correct. This will mean in a x by y grid.

Returns:
The current value.

setFlowPages

public void setFlowPages(boolean b)
Property: If set to true the pages will will flow like FlowLayout and while maintaining the same aspect ratio flow the pages from left to right and then top to bottom.

If false the layout manager will arrange the pages in the way that they look, so that the painted picture will be correct. This will mean in a x by y grid.

Parameters:
b - the new value.

setLayoutAlignmentX

public void setLayoutAlignmentX(float alignX)
Property: How to align the preview panels as a group if there are free space to distribute.

Parameters:
alignX - The new alignment. 0.0 to 1.0.

getLayoutAlignmentX

public float getLayoutAlignmentX()
Property: How to align the preview panels as a group if there are free space to distribute.

Returns:
The alignment. 0.0 to 1.0.

setLayoutAlignmentY

public void setLayoutAlignmentY(float alignY)
Property: How to align the preview panels as a group if there are free space to distribute.

Parameters:
alignY - The new alignment. 0.0 to 1.0.

getLayoutAlignmentY

public float getLayoutAlignmentY()
Property: How to align the preview panels as a group if there are free space to distribute.

Returns:
The alignment. 0.0 to 1.0.

getPreviewPanelsBorder

public javax.swing.border.Border getPreviewPanelsBorder()
Property: The border that will be set for every preview panel.

Returns:
The current border. May be null.

setPreviewPanelsBorder

public void setPreviewPanelsBorder(javax.swing.border.Border border)
Property: The border that will be set for every preview panel.

Parameters:
border - The new border. May be null.

getPageFormat

public java.awt.print.PageFormat getPageFormat()
Property: The PageFormat that will be used in the print preview.

Returns:
The current value. Never null.

setPageFormat

public void setPageFormat(java.awt.print.PageFormat pf)
Property: The PageFormat that will be used in the print preview.

Parameters:
pf - The new value. Never null.

getPageGapY

public int getPageGapY()
Property: The number of vertical pixels between two adjacent pages.

Returns:
The current gap.

setPageGapY

public void setPageGapY(int gap)
Property: The number of vertical pixels between two adjacent pages.

Parameters:
gap - The new gap.

getPageGapX

public int getPageGapX()
Property: The number of horizontal pixels between two adjacent pages.

Returns:
The current gap.

setPageGapX

public void setPageGapX(int gap)
Property: The number of horizontal pixels between two adjacent pages.

Parameters:
gap - The new gap.

recreatePreviewPanels

public void recreatePreviewPanels()


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.