public class PrintableComponent extends Object implements PrintableHandler
The individual JComponentWriter-descendants can be accessed by the
getWriter(String) method, if the parameters need to be changed.
getWriters(),
getWriter(String)| Constructor and Description |
|---|
PrintableComponent(JComponent component)
initializes the panel.
|
| Modifier and Type | Method and Description |
|---|---|
JComponent |
getComponent()
returns the GUI component this print dialog is part of.
|
String |
getSaveDialogTitle()
returns the title for the save dialog.
|
static String |
getToolTipText(PrintableComponent component)
Returns a tooltip only if the user wants it.
|
JComponentWriter |
getWriter(String name)
returns the JComponentWriter associated with the given name, is
null if not found. |
Hashtable |
getWriters()
returns a Hashtable with the current available JComponentWriters in the
save dialog.
|
double |
getXScale()
returns the scale factor for the x-axis.
|
double |
getYScale()
returns the scale factor for the y-axis.
|
void |
saveComponent()
displays a save dialog for saving the panel to a file.
|
void |
setSaveDialogTitle(String title)
sets the title for the save dialog.
|
void |
setScale(double x,
double y)
sets the scale factor.
|
public PrintableComponent(JComponent component)
component - the component to enhance with printing functionalitypublic JComponent getComponent()
public static String getToolTipText(PrintableComponent component)
component - the PrintableComponent to ask forpublic Hashtable getWriters()
getWriters in interface PrintableHandlerJComponentWriter.getDescription()public JComponentWriter getWriter(String name)
null if not found.getWriter in interface PrintableHandlername - the name of the writerJComponentWriter.getDescription()public void setSaveDialogTitle(String title)
setSaveDialogTitle in interface PrintableHandlertitle - the title of the save dialogpublic String getSaveDialogTitle()
getSaveDialogTitle in interface PrintableHandlerpublic void setScale(double x,
double y)
setScale in interface PrintableHandlerx - the scale factor for the x-axisy - the scale factor for the y-axispublic double getXScale()
getXScale in interface PrintableHandlerpublic double getYScale()
getYScale in interface PrintableHandlerpublic void saveComponent()
getSelectedFile
method returns null instead of the filename.saveComponent in interface PrintableHandlerCopyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.