程序包 weka.gui

类 ResultHistoryPanel

所有已实现的接口:
ImageObserver, MenuContainer, Serializable, Accessible

public class ResultHistoryPanel extends JPanel
A component that accepts named stringbuffers and displays the name in a list box. When a name is right-clicked, a frame is popped up that contains the string held by the stringbuffer. Optionally a text component may be provided that will have it's text set to the named result text on a left-click.
版本:
$Revision: 7059 $
作者:
Len Trigg (trigg@cs.waikato.ac.nz)
另请参阅:
  • 构造器详细资料

    • ResultHistoryPanel

      public ResultHistoryPanel(JTextComponent text)
      Create the result history object
      参数:
      text - the optional text component for single-click display
  • 方法详细资料

    • addResult

      public void addResult(String name, StringBuffer result)
      Adds a new result to the result list.
      参数:
      name - the name to associate with the result
      result - the StringBuffer that contains the result text
    • removeResult

      public void removeResult(String name)
      Removes one of the result buffers from the history. Any windows currently displaying the contents of the buffer are not affected.
      参数:
      name - the name of the buffer to remove.
    • clearResults

      public void clearResults()
      Removes all of the result buffers from the history. Any windows currently displaying the contents of the buffer are not affected.
    • addObject

      public void addObject(String name, Object o)
      Adds an object to the results list
      参数:
      name - the name to associate with the object
      o - the object
    • getNamedObject

      public Object getNamedObject(String name)
      Get the named object from the list
      参数:
      name - the name of the item to retrieve the stored object for
      返回:
      the object or null if there is no object at this index
    • getSelectedObject

      public Object getSelectedObject()
      Gets the object associated with the currently selected item in the list.
      返回:
      the object or null if there is no object corresponding to the current selection in the list
    • getNamedBuffer

      public StringBuffer getNamedBuffer(String name)
      Gets the named buffer
      返回:
      the buffer or null if there are no items in the list
    • getSelectedBuffer

      public StringBuffer getSelectedBuffer()
      Gets the buffer associated with the currently selected item in the list.
      返回:
      the buffer or null if there are no items in the list
    • getSelectedName

      public String getSelectedName()
      Get the name of the currently selected item in the list
      返回:
      the name of the currently selected item or null if no item selected
    • getNameAtIndex

      public String getNameAtIndex(int index)
      Gets the name of theitem in the list at the specified index
      返回:
      the name of item or null if there is no item at that index
    • setSingle

      public void setSingle(String name)
      Sets the single-click display to view the named result.
      参数:
      name - the name of the result to display.
    • openFrame

      public void openFrame(String name)
      Opens the named result in a separate frame.
      参数:
      name - the name of the result to open.
    • updateResult

      public void updateResult(String name)
      Tells any component currently displaying the named result that the contents of the result text in the StringBuffer have been updated.
      参数:
      name - the name of the result that has been updated.
    • getSelectionModel

      public ListSelectionModel getSelectionModel()
      Gets the selection model used by the results list.
      返回:
      a value of type 'ListSelectionModel'
    • getList

      public JList getList()
      Gets the JList used by the results list
      返回:
      the JList
    • setHandleRightClicks

      public void setHandleRightClicks(boolean tf)
      Set whether the result history list should handle right clicks or whether the parent object will handle them.
      参数:
      tf - false if parent object will handle right clicks
    • main

      public static void main(String[] args)
      Tests out the result history from the command line.
      参数:
      args - ignored