dsto.dfc.swing.panels
Class CmdPrintPreviewPanel

java.lang.Object
  extended by dsto.dfc.swing.commands.AbstractCommand
      extended by dsto.dfc.swing.commands.AbstractMutableCommand
          extended by dsto.dfc.swing.panels.CmdPrintPreviewPanel
All Implemented Interfaces:
Command, Iconic, PanelManagerListener, Copyable, PropertyEventSource, ActionListener, Cloneable, EventListener

public class CmdPrintPreviewPanel
extends AbstractMutableCommand
implements PanelManagerListener

A Command that opens up a print preview dialog.

Author:
Luke Marsh

Field Summary
protected  PanelManager manager
           
 
Fields inherited from class dsto.dfc.swing.commands.AbstractMutableCommand
listeners
 
Fields inherited from class dsto.dfc.swing.commands.AbstractCommand
displayName, icon
 
Fields inherited from interface dsto.dfc.swing.icons.Iconic
NULL_ICON
 
Constructor Summary
CmdPrintPreviewPanel(PanelManager manager, CmdPageLayoutPanel pageLayout)
          Initializes variables.
 
Method Summary
 void aboutToRemovePanel(PanelManagerEvent e)
          Not Implemented.
 void execute()
          Opens a print preview dialog.
 String getDescription()
          Returns the description of this command.
 String getGroupInView(String viewName)
          Assigns this command to the print group.
 char getMnemonic()
          Returns the mnemonic for this command.
 String getName()
          Returns the name of this command.
 boolean isInteractive()
          Returns if this command is interactive.
 void panelAdded(PanelManagerEvent e)
          Calls updateEnabled.
 void panelFloated(PanelManagerEvent e)
          Not Implemented.
 void panelRemoved(PanelManagerEvent e)
          Calls updateEnabled.
 void panelUnfloated(PanelManagerEvent e)
          Not Implemented.
protected  void updateEnabled()
          Sets this command to be enabled if the PanelManager contains one or more panels.
 
Methods inherited from class dsto.dfc.swing.commands.AbstractMutableCommand
addPropertyChangeListener, clone, isEnabled, removePropertyChangeListener, setEnabled, setIcon
 
Methods inherited from class dsto.dfc.swing.commands.AbstractCommand
actionPerformed, canReplace, getAccelerator, getDefaultDisplayName, getDisplayName, getIcon, getLargeIcon, getLogString, setDisplayName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

protected PanelManager manager
Constructor Detail

CmdPrintPreviewPanel

public CmdPrintPreviewPanel(PanelManager manager,
                            CmdPageLayoutPanel pageLayout)
Initializes variables.

Parameters:
manager - The PanelManager that manages the panels and views.
pageLayout - This variable is passed to PrintUtility and PrintPreview in the execute () method so those classes can access the current settings of the page layout.
Method Detail

execute

public void execute()
Opens a print preview dialog.

Specified by:
execute in interface Command
Specified by:
execute in class AbstractCommand

getMnemonic

public char getMnemonic()
Returns the mnemonic for this command.

Specified by:
getMnemonic in interface Command
Specified by:
getMnemonic in class AbstractCommand
Returns:
The mnemonic.

updateEnabled

protected void updateEnabled()
Sets this command to be enabled if the PanelManager contains one or more panels.


getName

public String getName()
Returns the name of this command.

Specified by:
getName in interface Command
Specified by:
getName in interface Iconic
Specified by:
getName in class AbstractCommand
Returns:
The name of the command.

getDescription

public String getDescription()
Returns the description of this command.

Specified by:
getDescription in interface Command
Specified by:
getDescription in class AbstractCommand
Returns:
The description of the command.

isInteractive

public boolean isInteractive()
Returns if this command is interactive.

Specified by:
isInteractive in interface Command
Specified by:
isInteractive in class AbstractCommand
Returns:
true.

getGroupInView

public String getGroupInView(String viewName)
Assigns this command to the print group.

Specified by:
getGroupInView in interface Command
Specified by:
getGroupInView in class AbstractCommand
Parameters:
viewName - The name of the view.
Returns:
The group name, or null if no match was found.

panelAdded

public void panelAdded(PanelManagerEvent e)
Calls updateEnabled.

Specified by:
panelAdded in interface PanelManagerListener
Parameters:
e - The PanelManagerEvent.

panelRemoved

public void panelRemoved(PanelManagerEvent e)
Calls updateEnabled.

Specified by:
panelRemoved in interface PanelManagerListener
Parameters:
e - The PanelManagerEvent.

panelFloated

public void panelFloated(PanelManagerEvent e)
Not Implemented.

Specified by:
panelFloated in interface PanelManagerListener
Parameters:
e - The PanelManagerEvent.

panelUnfloated

public void panelUnfloated(PanelManagerEvent e)
Not Implemented.

Specified by:
panelUnfloated in interface PanelManagerListener
Parameters:
e - The PanelManagerEvent.

aboutToRemovePanel

public void aboutToRemovePanel(PanelManagerEvent e)
Not Implemented.

Specified by:
aboutToRemovePanel in interface PanelManagerListener
Parameters:
e - The PanelManagerEvent.


Copyright © 2008 Commonwealth of Australia