JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.page.awt
Class JCAWTPreviewer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--javax.swing.JDialog
                                |
                                +--com.klg.jclass.page.awt.JCAWTPreviewer
All Implemented Interfaces:
Accessible, ActionListener, EventListener, ImageObserver, MenuContainer, RootPaneContainer, Serializable, WindowConstants, WindowListener

public class JCAWTPreviewer
extends JDialog
implements WindowListener, ActionListener

The JCAWTPreviewer is a frame to display print pages. It allows users to flip through the pages and send the current page or all the pages to the printer.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
 
Nested classes inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog
 
Nested classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  JButton closeButton
           
protected  com.klg.jclass.page.JCDocument document
           
protected  JButton firstButton
           
protected  JButton lastButton
           
protected  JButton nextButton
           
protected  JScrollPane pane
           
protected  JButton prevButton
           
protected  JButton printButton
           
protected  com.klg.jclass.page.awt.JCAWTScreenPrinter printer
           
protected  com.klg.jclass.page.awt.JCPrintPage printPage
           
protected  JLabel status
           
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JCAWTPreviewer(String title, JFrame frame, com.klg.jclass.page.JCDocument document)
          Creates a new PrintPreview frame.
JCAWTPreviewer(String title, JFrame frame, com.klg.jclass.page.JCDocument document, com.klg.jclass.page.JCPrinter printer)
          Creates a new PrintPreview frame.
 
Method Summary
 void actionPerformed(ActionEvent e)
          ActionListener method.
 void createPage(Dimension d)
          Creates an image of the page to preview.
 void dispose()
          Disposes of the PageLayout objects that are being held.
protected  int getNumPages()
          Returns the number of pages in this document.
 int getPageHeight()
          Gets the height of a page.
 int getPageWidth()
          Gets the width of a page.
 com.klg.jclass.page.JCPrinter getPrinter()
          Returns the screen printer for this previewer.
 void showPage(int pageIndex)
          Generates a new page image and posts it to the PrintPage component for display.
 void windowActivated(WindowEvent e)
          WindowListener methods.
 void windowClosed(WindowEvent e)
           
 void windowClosing(WindowEvent e)
           
 void windowDeactivated(WindowEvent e)
           
 void windowDeiconified(WindowEvent e)
           
 void windowIconified(WindowEvent e)
           
 void windowOpened(WindowEvent e)
           
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

firstButton

protected JButton firstButton

prevButton

protected JButton prevButton

nextButton

protected JButton nextButton

lastButton

protected JButton lastButton

printButton

protected JButton printButton

closeButton

protected JButton closeButton

pane

protected JScrollPane pane

status

protected JLabel status

printer

protected com.klg.jclass.page.awt.JCAWTScreenPrinter printer

document

protected com.klg.jclass.page.JCDocument document

printPage

protected com.klg.jclass.page.awt.JCPrintPage printPage
Constructor Detail

JCAWTPreviewer

public JCAWTPreviewer(String title,
                      JFrame frame,
                      com.klg.jclass.page.JCDocument document)
Creates a new PrintPreview frame.

Parameters:
title - the title of the frame
frame - the frame in which to show the previewer
document - the laid out document to preview

JCAWTPreviewer

public JCAWTPreviewer(String title,
                      JFrame frame,
                      com.klg.jclass.page.JCDocument document,
                      com.klg.jclass.page.JCPrinter printer)
Creates a new PrintPreview frame.

Parameters:
title - the title of the frame
frame - the frame in which to show the previewer
document - the laid out document to preview
printer - the JCAWTScreenPrinter whose component will be be used to draw on in this previewer
Method Detail

createPage

public void createPage(Dimension d)
Creates an image of the page to preview.

Parameters:
d -

showPage

public void showPage(int pageIndex)
Generates a new page image and posts it to the PrintPage component for display.

Parameters:
pageIndex -

dispose

public void dispose()
Disposes of the PageLayout objects that are being held.

Overrides:
dispose in class Dialog

getNumPages

protected int getNumPages()
Returns the number of pages in this document.

Returns:
the number of pages in this document

actionPerformed

public void actionPerformed(ActionEvent e)
ActionListener method.

Specified by:
actionPerformed in interface ActionListener
Parameters:
e -

getPageWidth

public int getPageWidth()
Gets the width of a page.

Returns:
the page width

getPageHeight

public int getPageHeight()
Gets the height of a page.

Returns:
the page height

getPrinter

public com.klg.jclass.page.JCPrinter getPrinter()
Returns the screen printer for this previewer.

Returns:
screen printer for this previewer

windowActivated

public void windowActivated(WindowEvent e)
WindowListener methods.

Specified by:
windowActivated in interface WindowListener
Parameters:
e -

windowClosed

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

windowClosing

public void windowClosing(WindowEvent e)
Specified by:
windowClosing in interface WindowListener

windowDeactivated

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

windowDeiconified

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

windowIconified

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

windowOpened

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

Copyright © 2004 Quest Software Inc..
All rights reserved.