com.ibm.as400.vaccess
Class SpooledFileViewer
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- com.ibm.as400.vaccess.SpooledFileViewer
-
- All Implemented Interfaces:
- java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Deprecated.Use Java Swing instead, along with the classes in package com.ibm.as400.access
public class SpooledFileViewer extends javax.swing.JComponent implements java.io.Serializable
The SpooledFileViewer class represents a system spooled file viewer. You can create an instance of this class to view an individual AFPDS or SCS spooled file on the system. Viewer functions such as page forward, page back, set current page, and so on, are provided. The following properties can be set directly, but require the invocation of load() to load the information from the system.- paper size
- spooled file
- viewing fidelity
- current page
Most errors are reported as ErrorEvents rather than throwing exceptions. Users should listen for ErrorEvents in order to diagnose and recover from error conditions.
SpooledFileViewer objects generate the following events:
- ErrorEvent
- PropertyChangeEvent
- VetoableChangeEvent
- WorkingEvent
The following example creates a spooled file viewer to display a spooled file previously created on the system.
// Assume splf is the spooled file. // Create the spooled file viewer SpooledFileViewer splfv = new SpooledFileViewer(splf, 1); splfv.load(); // Add the spooled file viewer to a frame JFrame frame = new JFrame("My Window"); frame.getContentPane().add(splfv);
- See Also:
SpooledFile
, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field and Description static int
A3
Deprecated.Represents A3 paper size (297 x 420 mm)static int
A4
Deprecated.Represents A4 paper size (210 x 297 mm)static int
A5
Deprecated.Represents A5 paper size (148 x 210 mm)static int
ABSOLUTE_FIDELITY
Deprecated.Represents *ABSOLUTE viewing fidelitystatic int
B4
Deprecated.Represents B4 paper size (257 x 364 mm)static int
B5
Deprecated.Represents B5 paper size (182 x 257 mm)static int
CONT132
Deprecated.Represents continuous feed 132 paper size (13.2 x 11 inches)static int
CONT80
Deprecated.Represents continuous feed 80 paper size (8 x 11 inches)static int
CONTENT_FIDELITY
Deprecated.Represents *CONTENT viewing fidelitystatic int
EXECUTIVE
Deprecated.Represents executive paper size (7.25 x 10.5 inches)static int
LEDGER
Deprecated.Represents ledger paper size (17 x 11 inches)static int
LEGAL
Deprecated.Represents legal paper size (8.5 x 14 inches)static int
LETTER
Deprecated.Represents letter paper size (8.5 x 11 inches)static int
NONE
Deprecated.Represents no paper size-
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
-
-
Constructor Summary
Constructors Constructor and Description SpooledFileViewer()
Deprecated.Constructs a SpooledFileViewer object.SpooledFileViewer(SpooledFile spooledFile)
Deprecated.Constructs a SpooledFileViewer object.SpooledFileViewer(SpooledFile spooledFile, int page)
Deprecated.Constructs a SpooledFileViewer object.
-
Method Summary
Methods Modifier and Type Method and Description void
actualSize()
Deprecated.Resets the size of the page image to its original size.void
addErrorListener(ErrorListener listener)
Deprecated.Adds a listener to be notified when an error occurs.void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated.Adds a listener to be notified when the value of any bound property changes.void
addStatusBar()
Deprecated.Adds the status bar.void
addToolBar()
Deprecated.Adds the tool bar.void
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Deprecated.Adds a listener to be notified when the value of any constrained property changes.void
addWorkingListener(WorkingListener listener)
Deprecated.Adds a listener to be notified of a working state.void
close()
Deprecated.Closes the viewer.protected void
finalize()
Deprecated.Closes the viewer.void
fitHeight()
Deprecated.Stretches the size of the page image vertically to the edges of the viewing window.void
fitPage()
Deprecated.Stretches the size of the page image horizontally or vertically so the entire view is contained within the edges of the viewing window.void
fitWidth()
Deprecated.Stretches the size of the page image horizontally to the edges of the viewing window.int
getCurrentPage()
Deprecated.Returns the page number of the current page.int
getNumberOfPages()
Deprecated.Returns the number of pages in the spooled file.int
getPaperSize()
Deprecated.Returns the paper size.java.awt.Dimension
getPreferredSize()
Deprecated.Returns the preferred size of the viewer.SpooledFile
getSpooledFile()
Deprecated.Returns the spooled file being viewed.int
getViewingFidelity()
Deprecated.Returns the viewing fidelity.boolean
isNumberOfPagesEstimated()
Deprecated.Indicates if the number of pages associated with the spooled file being viewed is estimated.void
load()
Deprecated.Loads the spooled file for viewing.void
loadFlashPage()
Deprecated.Loads the previously viewed page.void
loadPage()
Deprecated.Loads the current page for viewing.void
pageBack()
Deprecated.Sets the view back one page.void
pageForward()
Deprecated.Sets the view forward one page.void
removeErrorListener(ErrorListener listener)
Deprecated.Removes an ErrorListener.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated.Removes a property change listener.void
removeStatusBar()
Deprecated.Removes the status bar.void
removeToolBar()
Deprecated.Removes the tool bar.void
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Deprecated.Removes a vetoable change listener.void
removeWorkingListener(WorkingListener listener)
Deprecated.Removes a WorkingListener.void
setCurrentPage(int newPage)
Deprecated.Sets the current page.void
setPaperSize(int paperSize)
Deprecated.Sets the papersize.void
setSpooledFile(SpooledFile spooledFile)
Deprecated.Sets the spooled file.void
setViewingFidelity(int viewingFidelity)
Deprecated.Sets the viewing fidelity.-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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, updateUI
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, 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, setLayout, 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, 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
-
-
-
-
Field Detail
-
ABSOLUTE_FIDELITY
public static final int ABSOLUTE_FIDELITY
Deprecated.Represents *ABSOLUTE viewing fidelity- See Also:
- Constant Field Values
-
CONTENT_FIDELITY
public static final int CONTENT_FIDELITY
Deprecated.Represents *CONTENT viewing fidelity- See Also:
- Constant Field Values
-
LETTER
public static final int LETTER
Deprecated.Represents letter paper size (8.5 x 11 inches)- See Also:
- Constant Field Values
-
LEGAL
public static final int LEGAL
Deprecated.Represents legal paper size (8.5 x 14 inches)- See Also:
- Constant Field Values
-
A3
public static final int A3
Deprecated.Represents A3 paper size (297 x 420 mm)- See Also:
- Constant Field Values
-
A4
public static final int A4
Deprecated.Represents A4 paper size (210 x 297 mm)- See Also:
- Constant Field Values
-
A5
public static final int A5
Deprecated.Represents A5 paper size (148 x 210 mm)- See Also:
- Constant Field Values
-
B4
public static final int B4
Deprecated.Represents B4 paper size (257 x 364 mm)- See Also:
- Constant Field Values
-
B5
public static final int B5
Deprecated.Represents B5 paper size (182 x 257 mm)- See Also:
- Constant Field Values
-
EXECUTIVE
public static final int EXECUTIVE
Deprecated.Represents executive paper size (7.25 x 10.5 inches)- See Also:
- Constant Field Values
-
LEDGER
public static final int LEDGER
Deprecated.Represents ledger paper size (17 x 11 inches)- See Also:
- Constant Field Values
-
CONT80
public static final int CONT80
Deprecated.Represents continuous feed 80 paper size (8 x 11 inches)- See Also:
- Constant Field Values
-
CONT132
public static final int CONT132
Deprecated.Represents continuous feed 132 paper size (13.2 x 11 inches)- See Also:
- Constant Field Values
-
NONE
public static final int NONE
Deprecated.Represents no paper size- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SpooledFileViewer
public SpooledFileViewer()
Deprecated.Constructs a SpooledFileViewer object. A call to setSpooledFile() must be done after calling this method in order to set the spooled file to be viewed.
-
SpooledFileViewer
public SpooledFileViewer(SpooledFile spooledFile)
Deprecated.Constructs a SpooledFileViewer object. By default, the current page is set to the first page of the spooled file. A call to load() must be done after calling this method in order to load the spooled file.- Parameters:
spooledFile
- The spooled file to view.
-
SpooledFileViewer
public SpooledFileViewer(SpooledFile spooledFile, int page)
Deprecated.Constructs a SpooledFileViewer object. Page page of the spooled file is loaded as the initial view. If page is less than 1, an error is thrown. A call to load() must be done after calling this method in order to load the spooled file.- Parameters:
spooledFile
- The spooled file to view.page
- The initial page to view.
-
-
Method Detail
-
actualSize
public void actualSize()
Deprecated.Resets the size of the page image to its original size. This method is only valid after a spooled file has been loaded.
-
addErrorListener
public void addErrorListener(ErrorListener listener)
Deprecated.Adds a listener to be notified when an error occurs.- Parameters:
listener
- The listener.
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated.Adds a listener to be notified when the value of any bound property changes.- Overrides:
addPropertyChangeListener
in classjava.awt.Container
- Parameters:
listener
- The listener.
-
addStatusBar
public void addStatusBar()
Deprecated.Adds the status bar.
-
addToolBar
public void addToolBar()
Deprecated.Adds the tool bar.
-
addVetoableChangeListener
public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Deprecated.Adds a listener to be notified when the value of any constrained property changes.- Overrides:
addVetoableChangeListener
in classjavax.swing.JComponent
- Parameters:
listener
- The listener.
-
addWorkingListener
public void addWorkingListener(WorkingListener listener)
Deprecated.Adds a listener to be notified of a working state.- Parameters:
listener
- The listener.
-
close
public void close()
Deprecated.Closes the viewer.
-
finalize
protected void finalize() throws java.lang.Throwable
Deprecated.Closes the viewer.- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
- If an error occurs during cleanup.
-
fitHeight
public void fitHeight()
Deprecated.Stretches the size of the page image vertically to the edges of the viewing window. This method is only valid after a spooled file has been loaded.
-
fitPage
public void fitPage()
Deprecated.Stretches the size of the page image horizontally or vertically so the entire view is contained within the edges of the viewing window. This method is only valid after a spooled file has been loaded.
-
fitWidth
public void fitWidth()
Deprecated.Stretches the size of the page image horizontally to the edges of the viewing window. This method is only valid after a spooled file has been loaded.
-
getCurrentPage
public int getCurrentPage()
Deprecated.Returns the page number of the current page.- Returns:
- The current page number.
-
getNumberOfPages
public int getNumberOfPages()
Deprecated.Returns the number of pages in the spooled file. This value may be estimated, depending on the origin of spooled file. If the spooled file was created natively on a system, the value is valid. If the spooled file was created on another type of system, the value may be estimated.- Returns:
- The number of pages.
- See Also:
isNumberOfPagesEstimated()
-
getPaperSize
public int getPaperSize()
Deprecated.Returns the paper size. The paper size is used to determine how to process pages from the spooled file.- Returns:
- The paper size.
-
getPreferredSize
public java.awt.Dimension getPreferredSize()
Deprecated.Returns the preferred size of the viewer.- Overrides:
getPreferredSize
in classjavax.swing.JComponent
- Returns:
- The preferred size.
-
getSpooledFile
public SpooledFile getSpooledFile()
Deprecated.Returns the spooled file being viewed.- Returns:
- The spooled file.
-
getViewingFidelity
public int getViewingFidelity()
Deprecated.Returns the viewing fidelity. The viewing fidelity is used to determine how to process pages from the spooled file.- Returns:
- The viewing fidelity.
-
isNumberOfPagesEstimated
public boolean isNumberOfPagesEstimated()
Deprecated.Indicates if the number of pages associated with the spooled file being viewed is estimated.- Returns:
- Returns true if the number of pages is estimated; false otherwise.
- See Also:
getNumberOfPages()
-
load
public void load() throws java.io.IOException, java.beans.PropertyVetoException
Deprecated.Loads the spooled file for viewing. A call to this method must be made after the constructor has been invoked or the spooled file has changed in order to load the spooled file and properly initialize the viewer.- Throws:
java.io.IOException
- Thrown if the spooled file cannot be initialized.java.beans.PropertyVetoException
- Thrown if the property change is vetoed.
-
loadFlashPage
public void loadFlashPage() throws java.beans.PropertyVetoException
Deprecated.Loads the previously viewed page. If a different page was not previously viewed (loaded), no action is taken. This method can only be called after a spooled file has been loaded. If a spooled file has not been successfully loaded into the viewer previously, an error event is fired.- Throws:
java.beans.PropertyVetoException
- Thrown if the property change is vetoed.
-
loadPage
public void loadPage() throws java.beans.PropertyVetoException
Deprecated.Loads the current page for viewing. This method can only be called after a spooled file has been successfully loaded. If the current page is not a valid page of the spooled file, the current page is set to the previously viewed page, and an error event is fired. If a spooled file has not been successfully loaded into the viewer previously, an error event is fired.- Throws:
java.beans.PropertyVetoException
- Thrown if the property change is vetoed.
-
pageBack
public void pageBack() throws java.beans.PropertyVetoException
Deprecated.Sets the view back one page.- Throws:
java.beans.PropertyVetoException
- Thrown if the property change is vetoed.
-
pageForward
public void pageForward() throws java.beans.PropertyVetoException
Deprecated.Sets the view forward one page.- Throws:
java.beans.PropertyVetoException
- Thrown if the property change is vetoed.
-
removeErrorListener
public void removeErrorListener(ErrorListener listener)
Deprecated.Removes an ErrorListener.- Parameters:
listener
- The listener.
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Deprecated.Removes a property change listener.- Overrides:
removePropertyChangeListener
in classjava.awt.Component
- Parameters:
listener
- The listener.
-
removeToolBar
public void removeToolBar()
Deprecated.Removes the tool bar.
-
removeStatusBar
public void removeStatusBar()
Deprecated.Removes the status bar.
-
removeVetoableChangeListener
public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Deprecated.Removes a vetoable change listener.- Overrides:
removeVetoableChangeListener
in classjavax.swing.JComponent
- Parameters:
listener
- The listener.
-
removeWorkingListener
public void removeWorkingListener(WorkingListener listener)
Deprecated.Removes a WorkingListener.- Parameters:
listener
- The listener.
-
setCurrentPage
public void setCurrentPage(int newPage) throws java.beans.PropertyVetoException
Deprecated.Sets the current page.- Parameters:
newPage
- The page to view.- Throws:
java.beans.PropertyVetoException
- Thrown if the property change is vetoed.
-
setPaperSize
public void setPaperSize(int paperSize) throws java.beans.PropertyVetoException
Deprecated.Sets the papersize. If paper size specified by paperSize is not valid, no action is taken.- Parameters:
paperSize
- The paper size to be used for processing spooled file pages.May be any of the following values:
- LETTER - Letter (8.5 x 11 inches)
- LEGAL - Legal (8.5 x 14 inches)
- A3 - A3 (297 x 420 mm)
- A4 - A4 (210 x 297 mm)
- A5 - A5 (148 x 210 mm)
- B4 - B4 (257 x 364 mm)
- B5 - B5 (182 x 257 mm)
- EXECUTIVE - Executive (7.25 x 10.5 inches)
- LEDGER - Ledger (17 x 11 inches)
- CONT80 - Continuous feed 80 (8 x 11 inches)
- CONT132 - Continuous feed 132 (13.2 x 11 inches)
- NONE - None
- Throws:
java.beans.PropertyVetoException
- Thrown if the property change is vetoed.
-
setSpooledFile
public void setSpooledFile(SpooledFile spooledFile) throws java.beans.PropertyVetoException
Deprecated.Sets the spooled file.- Parameters:
spooledFile
- The spooled file to view.- Throws:
java.beans.PropertyVetoException
- Thrown if the property change is vetoed.
-
setViewingFidelity
public void setViewingFidelity(int viewingFidelity) throws java.beans.PropertyVetoException
Deprecated.Sets the viewing fidelity.- Parameters:
viewingFidelity
- The viewing fidelity. If viewing fidelity specified by viewingFidelity is not valid, no action is taken.May be any of the following values:
- ABSOLUTE - Absolute. When this is specified, the spooled file data is scanned and all non-raster data is processed up through the current page.
- CONTENT - Content. When this is specified, the spooled file data is
processed according to datastream type:
- SCS - Process open-time commands and current page commands only.
- AFPDS - Process the first page without rasterizing, then the current page.
- Throws:
java.beans.PropertyVetoException
- Thrown if the property change is vetoed.
-
-