Class ResultHistoryPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
weka.gui.ResultHistoryPanel
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
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: 7059 $
- Author:
- Len Trigg (trigg@cs.waikato.ac.nz)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classExtension of KeyAdapter that implements Serializable.static classExtension of MouseAdapter that implements Serializable.Nested classes/interfaces inherited from class JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class Component
Component.BaselineResizeBehavior -
Field Summary
Fields inherited from class JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an object to the results listvoidaddResult(String name, StringBuffer result) Adds a new result to the result list.voidRemoves all of the result buffers from the history.getList()Gets the JList used by the results listgetNameAtIndex(int index) Gets the name of theitem in the list at the specified indexgetNamedBuffer(String name) Gets the named buffergetNamedObject(String name) Get the named object from the listGets the buffer associated with the currently selected item in the list.Get the name of the currently selected item in the listGets the object associated with the currently selected item in the list.Gets the selection model used by the results list.static voidTests out the result history from the command line.voidOpens the named result in a separate frame.voidremoveResult(String name) Removes one of the result buffers from the history.voidsetHandleRightClicks(boolean tf) Set whether the result history list should handle right clicks or whether the parent object will handle them.voidSets the single-click display to view the named result.voidupdateResult(String name) Tells any component currently displaying the named result that the contents of the result text in the StringBuffer have been updated.Methods inherited from class JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUIMethods inherited from class JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
ResultHistoryPanel
Create the result history object- Parameters:
text- the optional text component for single-click display
-
-
Method Details
-
addResult
Adds a new result to the result list.- Parameters:
name- the name to associate with the resultresult- the StringBuffer that contains the result text
-
removeResult
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.
-
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
-
getNamedObject
-
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
-
getNamedBuffer
Gets the named buffer- Returns:
- the buffer or null if there are no items in the list
-
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
-
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
-
getNameAtIndex
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
-
setSingle
Sets the single-click display to view the named result.- Parameters:
name- the name of the result to display.
-
openFrame
Opens the named result in a separate frame.- Parameters:
name- the name of the result to open.
-
updateResult
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.
-
getSelectionModel
Gets the selection model used by the results list.- Returns:
- a value of type 'ListSelectionModel'
-
getList
-
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
-
main
Tests out the result history from the command line.- Parameters:
args- ignored
-