类 PrintableComponent

java.lang.Object
weka.gui.visualize.PrintableComponent
所有已实现的接口:
PrintableHandler

public class PrintableComponent extends Object implements PrintableHandler
This class extends the component which is handed over in the constructor by a print dialog. The Print dialog is accessible via Alt+Shift+LeftMouseClick.

The individual JComponentWriter-descendants can be accessed by the getWriter(String) method, if the parameters need to be changed.

版本:
$Revision: 7059 $
作者:
FracPete (fracpete at waikato dot ac dot nz)
另请参阅:
  • 构造器详细资料

    • PrintableComponent

      public PrintableComponent(JComponent component)
      initializes the panel.
      参数:
      component - the component to enhance with printing functionality
  • 方法详细资料

    • getComponent

      public JComponent getComponent()
      returns the GUI component this print dialog is part of.
      返回:
      the GUI component
    • getToolTipText

      public static String getToolTipText(PrintableComponent component)
      Returns a tooltip only if the user wants it. If retrieved for the first, a dialog pops up and asks the user whether the tooltip should always appear or not. The weka/gui/visualize/Visualize.props is then written in the user's home directory.
      参数:
      component - the PrintableComponent to ask for
      返回:
      null if the user doesn't want the tooltip, otherwise the text
    • getWriters

      public Hashtable getWriters()
      returns a Hashtable with the current available JComponentWriters in the save dialog. the key of the Hashtable is the description of the writer.
      指定者:
      getWriters 在接口中 PrintableHandler
      返回:
      all currently available JComponentWriters
      另请参阅:
    • getWriter

      public JComponentWriter getWriter(String name)
      returns the JComponentWriter associated with the given name, is null if not found.
      指定者:
      getWriter 在接口中 PrintableHandler
      参数:
      name - the name of the writer
      返回:
      the writer associated with the given name
      另请参阅:
    • setSaveDialogTitle

      public void setSaveDialogTitle(String title)
      sets the title for the save dialog.
      指定者:
      setSaveDialogTitle 在接口中 PrintableHandler
      参数:
      title - the title of the save dialog
    • getSaveDialogTitle

      public String getSaveDialogTitle()
      returns the title for the save dialog.
      指定者:
      getSaveDialogTitle 在接口中 PrintableHandler
      返回:
      the title of the save dialog
    • setScale

      public void setScale(double x, double y)
      sets the scale factor.
      指定者:
      setScale 在接口中 PrintableHandler
      参数:
      x - the scale factor for the x-axis
      y - the scale factor for the y-axis
    • getXScale

      public double getXScale()
      returns the scale factor for the x-axis.
      指定者:
      getXScale 在接口中 PrintableHandler
      返回:
      the scale factor
    • getYScale

      public double getYScale()
      returns the scale factor for the y-axis.
      指定者:
      getYScale 在接口中 PrintableHandler
      返回:
      the scale factor
    • saveComponent

      public void saveComponent()
      displays a save dialog for saving the panel to a file. Fixes a bug with the Swing JFileChooser: if you entered a new filename in the save dialog and press Enter the getSelectedFile method returns null instead of the filename.
      To solve this annoying behavior we call the save dialog once again s.t. the filename is set. Might look a little bit strange to the user, but no NullPointerException! ;-)
      指定者:
      saveComponent 在接口中 PrintableHandler