All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.gui.ResultHistoryPanel

java.lang.Object
    |
    +----java.awt.Component
            |
            +----java.awt.Container
                    |
                    +----javax.swing.JComponent
                            |
                            +----javax.swing.JPanel
                                    |
                                    +----weka.gui.ResultHistoryPanel

public class ResultHistoryPanel
extends javax.swing.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.

Version:
$Revision: 1.15 $
Author:
Len Trigg (trigg@cs.waikato.ac.nz)

Constructor Index

 o ResultHistoryPanel(JTextComponent)
Create the result history object

Method Index

 o addObject(String, Object)
Adds an object to the results list
 o addResult(String, StringBuffer)
Adds a new result to the result list.
 o getList()
Gets the JList used by the results list
 o getNameAtIndex(int)
Gets the name of theitem in the list at the specified index
 o getNamedBuffer(String)
Gets the named buffer
 o getNamedObject(String)
Get the named object from the list
 o getSelectedBuffer()
Gets the buffer associated with the currently selected item in the list.
 o getSelectedName()
Get the name of the currently selected item in the list
 o getSelectedObject()
Gets the object associated with the currently selected item in the list.
 o getSelectionModel()
Gets the selection model used by the results list.
 o main(String[])
Tests out the result history from the command line.
 o openFrame(String)
Opens the named result in a separate frame.
 o removeResult(String)
Removes one of the result buffers from the history.
 o setHandleRightClicks(boolean)
Set whether the result history list should handle right clicks or whether the parent object will handle them.
 o setSingle(String)
Sets the single-click display to view the named result.
 o updateResult(String)
Tells any component currently displaying the named result that the contents of the result text in the StringBuffer have been updated.

Constructor Detail

 o ResultHistoryPanel
public ResultHistoryPanel(javax.swing.text.JTextComponent text)
          Create the result history object
Parameters:
text - the optional text component for single-click display

Method Detail

 o addResult
public void addResult(java.lang.String name,
                      java.lang.StringBuffer result)
          Adds a new result to the result list.
Parameters:
name - the name to associate with the result
result - the StringBuffer that contains the result text
 o removeResult
public void removeResult(java.lang.String name)
          Removes one of the result buffers from the history. Any windows currently displaying the contents of the buffer are not affected.
Parameters:
name - the name of the buffer to remove.
 o addObject
public void addObject(java.lang.String name,
                      java.lang.Object o)
          Adds an object to the results list
Parameters:
name - the name to associate with the object
o - the object
 o getNamedObject
public java.lang.Object getNamedObject(java.lang.String name)
          Get the named object from the list
Parameters:
index - the index of the item to retrieve the stored object for
Returns:
the object or null if there is no object at this index
 o getSelectedObject
public java.lang.Object getSelectedObject()
          Gets the object associated with the currently selected item in the list.
Returns:
the object or null if there is no object corresponding to the current selection in the list
 o getNamedBuffer
public java.lang.StringBuffer getNamedBuffer(java.lang.String name)
          Gets the named buffer
Returns:
the buffer or null if there are no items in the list
 o getSelectedBuffer
public java.lang.StringBuffer getSelectedBuffer()
          Gets the buffer associated with the currently selected item in the list.
Returns:
the buffer or null if there are no items in the list
 o getSelectedName
public java.lang.String getSelectedName()
          Get the name of the currently selected item in the list
Returns:
the name of the currently selected item or null if no item selected
 o getNameAtIndex
public java.lang.String getNameAtIndex(int index)
          Gets the name of theitem in the list at the specified index
Returns:
the name of item or null if there is no item at that index
 o setSingle
public void setSingle(java.lang.String name)
          Sets the single-click display to view the named result.
Parameters:
name - the name of the result to display.
 o openFrame
public void openFrame(java.lang.String name)
          Opens the named result in a separate frame.
Parameters:
name - the name of the result to open.
 o updateResult
public void updateResult(java.lang.String name)
          Tells any component currently displaying the named result that the contents of the result text in the StringBuffer have been updated.
Parameters:
name - the name of the result that has been updated.
 o getSelectionModel
public javax.swing.ListSelectionModel getSelectionModel()
          Gets the selection model used by the results list.
Returns:
a value of type 'ListSelectionModel'
 o getList
public javax.swing.JList getList()
          Gets the JList used by the results list
Returns:
the JList
 o setHandleRightClicks
public void setHandleRightClicks(boolean tf)
          Set whether the result history list should handle right clicks or whether the parent object will handle them.
Parameters:
tf - false if parent object will handle right clicks
 o main
public static void main(java.lang.String args[])
          Tests out the result history from the command line.
Parameters:
args - ignored

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home