public class PrintFileAction extends AbstractViewAction
View
.
This action requires that the view implements the PrintableView
interface.
This action is called when the user selects the Print item in the File menu. The menu item is automatically created by the application.
If you want this behavior in your application, you have to create it
and put it in your ApplicationModel
in method
ApplicationModel.initApplication(org.jhotdraw.app.Application)
.
You should also create a PrintFileAction
when you create this action.
Framework
The interfaces and classes listed below define together the contracts
of a smaller framework inside of the JHotDraw framework for document oriented
applications.
Contract: PrintableView
.
Client: PrintFileAction
.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID |
ENABLED_PROPERTY, VIEW_PROPERTY
Constructor and Description |
---|
PrintFileAction(Application app,
View view)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt) |
boolean |
isEnabled()
Returns true if the action is enabled.
|
void |
printJava2D(PrintableView v) |
void |
printJava2DAlternative(PrintableView v) |
void |
printQuartz(PrintableView v)
On Mac OS X with the Quartz rendering engine, the following code achieves
the best results.
|
getActiveView, getApplication, getPropertyName, installViewListeners, setEnabled, setPropertyName, uninstallViewListeners, updateEnabled, updateView, updateView
public static final java.lang.String ID
public PrintFileAction(Application app, View view)
public void actionPerformed(java.awt.event.ActionEvent evt)
public void printJava2D(PrintableView v)
public void printJava2DAlternative(PrintableView v)
public void printQuartz(PrintableView v)
public boolean isEnabled()
isEnabled
in interface javax.swing.Action
isEnabled
in class AbstractViewAction
Action.isEnabled()