Print handler for JavaHelp. Because JDK1.1 is not supported since JavaHelp
version 2.0 this class contains all printing code.
actionPerformed
public void actionPerformed(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.
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a
PropertyChangeListener
to the listener list.
The listener is registered for all properties.
A
PropertyChangeEvent
will get fired in response to setting
a bound property, e.g.
setFont
,
setBackground
,
or
setForeground
.
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.
listener
- The PropertyChangeListener
to be added
Action.addPropertyChangeListener
firePropertyChange
protected void firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Supports reporting bound property changes. This method can be called
when a bound property has changed and it will send the appropriate
PropertyChangeEvent
to any registered
PropertyChangeListeners
.
getHelpModel
public HelpModel getHelpModel()
Getter for property model.
getPF
public PageFormat getPF()
As of JavaHelp version 2.0,
replaced by getPageFormat()
.
getPageFormat
public PageFormat getPageFormat()
Getter for property pageFormat.
- Value of property pageFormat.
getPrinterJob
public PrinterJob getPrinterJob()
getViewRec
protected static Rectangle getViewRec(View rootview,
float width,
float height)
Setups size of editor and return its optimal width.
handlePageSetup
public void handlePageSetup(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.
isEnabled
public boolean isEnabled()
Returns true if the action is enabled.
- true if the action is enabled, false otherwise
print
public void print(URL url)
print
public void print(URL[] urls)
printSetup
public void printSetup()
processException
protected static void processException(Exception e)
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener
from the listener list.
This removes a PropertyChangeListener
that was registered
for all properties.
listener
- the PropertyChangeListener
to be removed
Action.removePropertyChangeListener
setEnabled
public void setEnabled(boolean newValue)
Enables or disables the action.
newValue
- true to enable the action, false to
disable it
setHelpModel
public void setHelpModel(HelpModel helpModel)
setPF
public void setPF(PageFormat pf)
As of JDK version 2.0,
replaced by setPageFormat(pageFormat)
.
setPageFormat
public void setPageFormat(PageFormat pageFormat)
Setter for property pageFormat.
pageFormat
- New value of property pageFormat.