Package com.sun.java.help.impl
Class JHelpPrintHandler
- java.lang.Object
-
- com.sun.java.help.impl.JHelpPrintHandler
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.util.EventListener
- Direct Known Subclasses:
JHelpPrintHandler1_2
public class JHelpPrintHandler extends java.lang.Object implements java.awt.event.ActionListenerPrint handler for JavaHelp. Because JDK1.1 is not supported since JavaHelp version 2.0 this class contains all printing code.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classJHelpPrintHandler.JHPageable
-
Field Summary
Fields Modifier and Type Field Description protected javax.swing.event.SwingPropertyChangeSupportchangeSupportIf anyPropertyChangeListenershave been registered, thechangeSupportfield describes them.static java.lang.StringPAGE_SETUP_BUTTON_NAMEstatic java.lang.StringPRINT_BUTTON_NAMEstatic java.lang.StringPRINT_LATER_BUTTON_NAME
-
Constructor Summary
Constructors Constructor Description JHelpPrintHandler(JHelp help)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent e)ActionListener to perform printing.voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)Adds aPropertyChangeListenerto the listener list.protected voidfirePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)Supports reporting bound property changes.HelpModelgetHelpModel()Getter for property model.static JHelpPrintHandlergetJHelpPrintHandler(JHelp help)java.awt.print.PageFormatgetPageFormat()Getter for property pageFormat.java.awt.print.PageFormatgetPF()Deprecated.As of JavaHelp version 2.0, replaced bygetPageFormat().java.awt.print.PrinterJobgetPrinterJob()protected static java.awt.RectanglegetViewRec(javax.swing.text.View rootview, float width, float height)Setups size of editor and return its optimal width.voidhandlePageSetup(java.awt.Component psComp)Sets the PrintHandler to handle pageSetup as a separate action from printing.booleanisEnabled()Returns true if the action is enabled.voidprint(java.net.URL url)voidprint(java.net.URL[] urls)voidprintSetup()protected static voidprocessException(java.lang.Exception e)voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)Removes aPropertyChangeListenerfrom the listener list.voidsetEnabled(boolean newValue)Enables or disables the action.voidsetHelpModel(HelpModel helpModel)voidsetPageFormat(java.awt.print.PageFormat pageFormat)Setter for property pageFormat.voidsetPF(java.awt.print.PageFormat pf)Deprecated.As of JDK version 2.0, replaced bysetPageFormat(pageFormat).
-
-
-
Field Detail
-
PRINT_BUTTON_NAME
public static final java.lang.String PRINT_BUTTON_NAME
- See Also:
- Constant Field Values
-
PAGE_SETUP_BUTTON_NAME
public static final java.lang.String PAGE_SETUP_BUTTON_NAME
- See Also:
- Constant Field Values
-
PRINT_LATER_BUTTON_NAME
public static final java.lang.String PRINT_LATER_BUTTON_NAME
- See Also:
- Constant Field Values
-
changeSupport
protected javax.swing.event.SwingPropertyChangeSupport changeSupport
If anyPropertyChangeListenershave been registered, thechangeSupportfield describes them.
-
-
Constructor Detail
-
JHelpPrintHandler
public JHelpPrintHandler(JHelp help)
-
-
Method Detail
-
getJHelpPrintHandler
public static JHelpPrintHandler getJHelpPrintHandler(JHelp help)
-
firePropertyChange
protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)Supports reporting bound property changes. This method can be called when a bound property has changed and it will send the appropriatePropertyChangeEventto any registeredPropertyChangeListeners.
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds aPropertyChangeListenerto the listener list. The listener is registered for all properties.A
PropertyChangeEventwill get fired in response to setting a bound property, e.g.setFont,setBackground, orsetForeground. Note that if the current component is inheriting its foreground, background, or font from its container, then no event will be fired in response to a change in the inherited property.- Parameters:
listener- ThePropertyChangeListenerto be added- See Also:
Action.addPropertyChangeListener(java.beans.PropertyChangeListener)
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes aPropertyChangeListenerfrom the listener list. This removes aPropertyChangeListenerthat was registered for all properties.- Parameters:
listener- thePropertyChangeListenerto be removed- See Also:
Action.removePropertyChangeListener(java.beans.PropertyChangeListener)
-
isEnabled
public boolean isEnabled()
Returns true if the action is enabled.- Returns:
- true if the action is enabled, false otherwise
- See Also:
Action.isEnabled()
-
setEnabled
public void setEnabled(boolean newValue)
Enables or disables the action.- Parameters:
newValue- true to enable the action, false to disable it- See Also:
Action.setEnabled(boolean)
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
ActionListener to perform printing. The current implementation of Swing requires that this go through an ActionListener as it must be in the EventDispatchThread.- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener
-
printSetup
public void printSetup()
-
print
public void print(java.net.URL url)
-
print
public void print(java.net.URL[] urls)
-
getPageFormat
public java.awt.print.PageFormat getPageFormat()
Getter for property pageFormat.- Returns:
- Value of property pageFormat.
-
getPF
public java.awt.print.PageFormat getPF()
Deprecated.As of JavaHelp version 2.0, replaced bygetPageFormat().
-
setPageFormat
public void setPageFormat(java.awt.print.PageFormat pageFormat)
Setter for property pageFormat.- Parameters:
pageFormat- New value of property pageFormat.
-
setPF
public void setPF(java.awt.print.PageFormat pf)
Deprecated.As of JDK version 2.0, replaced bysetPageFormat(pageFormat).
-
getPrinterJob
public java.awt.print.PrinterJob getPrinterJob()
-
handlePageSetup
public void handlePageSetup(java.awt.Component psComp)
Sets the PrintHandler to handle pageSetup as a separate action from printing. PageSetup is only in 1.2 but we put in the 1.1 code to make it easier. On 1.1 this will essential do nothing. On 1.2 this sets up the button so we know if we're printing or just doing a page setup.
-
setHelpModel
public void setHelpModel(HelpModel helpModel)
-
getHelpModel
public HelpModel getHelpModel()
Getter for property model.- Returns:
- Value of property model.
-
getViewRec
protected static java.awt.Rectangle getViewRec(javax.swing.text.View rootview, float width, float height)Setups size of editor and return its optimal width.
-
processException
protected static void processException(java.lang.Exception e)
-
-