visad.util
Class PrintActionListener

java.lang.Object
  extended by visad.util.PrintActionListener
All Implemented Interfaces:
ActionListener, EventListener

public class PrintActionListener
extends Object
implements ActionListener

PrintActionListener is an ActionListener which is used to print the contents of the VisAD DisplayImpl. A simple way to use this is:

  DisplayImpl di = new DisplayImpl(...);
  ...
  JButton pb = new JButton("Print Me");
  pb.addActionListener(new PrintActionListener(di));


Constructor Summary
PrintActionListener(DisplayImpl dim)
          ActionListener for printing the contents of the VisAD display
 
Method Summary
 void actionPerformed(ActionEvent e)
          cause the printout of the DisplayImpl; if the dialog is enabled, it will pop up to solicit information from the user.
 DisplayImpl getDisplay()
          Return the display
 boolean getShowDialog()
          get the value of the showDialog state
 void setDisplay(DisplayImpl dim)
          Set the display to which this action will listen
 void setShowDialog(boolean value)
          set whether the PrintDialog should be used or not
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintActionListener

public PrintActionListener(DisplayImpl dim)
ActionListener for printing the contents of the VisAD display

Parameters:
dim - the DisplayImpl to print when the actionPerformed is called
Method Detail

setShowDialog

public void setShowDialog(boolean value)
set whether the PrintDialog should be used or not

Parameters:
value - set to 'true' to use PrintDialog or to 'false' to supress the dialog and just print. The default is 'true'.

getShowDialog

public boolean getShowDialog()
get the value of the showDialog state

Returns:
'true' is PrintDialog will be used; 'false' if supressed.

setDisplay

public void setDisplay(DisplayImpl dim)
Set the display to which this action will listen

Parameters:
dim - DisplayImpl to be printed

getDisplay

public DisplayImpl getDisplay()
Return the display

Returns:
the display associated with this ActionListener

actionPerformed

public void actionPerformed(ActionEvent e)
cause the printout of the DisplayImpl; if the dialog is enabled, it will pop up to solicit information from the user. If the dialog is disabled, just print...

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - the ActionEvent which is ignored...