Package adams.gui.print
Class PrintMouseListener
- java.lang.Object
-
- java.awt.event.MouseAdapter
-
- adams.gui.print.PrintMouseListener
-
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,MouseWheelListener
,EventListener
public class PrintMouseListener extends MouseAdapter
The listener to wait for Ctrl-Shft-Left Mouse Click.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected JComponent
m_Component
the listener's component.protected static JComponentWriterFileChooser
m_FileChooser
the filechooser for saving the panel.
-
Constructor Summary
Constructors Constructor Description PrintMouseListener(JComponent component)
Initializes the listener.PrintMouseListener(JComponent listener, JComponent printed)
Initializes the listener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
initFileChooser()
initializes the filechooser, i.e. locates all the available writers in the current packagevoid
mouseClicked(MouseEvent e)
Invoked when the mouse has been clicked on a component.void
saveComponent()
displays a save dialog for saving the panel to a file.-
Methods inherited from class java.awt.event.MouseAdapter
mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved
-
-
-
-
Field Detail
-
m_Component
protected JComponent m_Component
the listener's component.
-
m_FileChooser
protected static JComponentWriterFileChooser m_FileChooser
the filechooser for saving the panel.
-
-
Constructor Detail
-
PrintMouseListener
public PrintMouseListener(JComponent component)
Initializes the listener. Listening component is the same as the one being printed.- Parameters:
component
- the component for which to create the listener and which to print then
-
PrintMouseListener
public PrintMouseListener(JComponent listener, JComponent printed)
Initializes the listener. Listening component can be different from one being printed.- Parameters:
listener
- the component for which to create the listenerprinted
- the component that is being printed
-
-
Method Detail
-
initFileChooser
protected void initFileChooser()
initializes the filechooser, i.e. locates all the available writers in the current package
-
mouseClicked
public void mouseClicked(MouseEvent e)
Invoked when the mouse has been clicked on a component.- Specified by:
mouseClicked
in interfaceMouseListener
- Overrides:
mouseClicked
in classMouseAdapter
- Parameters:
e
- the event
-
saveComponent
public void saveComponent()
displays a save dialog for saving the panel to a file.
-
-