|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--weka.gui.ResultHistoryPanel
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.
Nested Class Summary | |
static class |
ResultHistoryPanel.RKeyAdapter
Extension of KeyAdapter that implements Serializable. |
static class |
ResultHistoryPanel.RMouseAdapter
Extension of MouseAdapter that implements Serializable. |
Field Summary |
Fields inherited from class javax.swing.JComponent |
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
ResultHistoryPanel(javax.swing.text.JTextComponent text)
Create the result history object |
Method Summary | |
void |
addObject(java.lang.String name,
java.lang.Object o)
Adds an object to the results list |
void |
addResult(java.lang.String name,
java.lang.StringBuffer result)
Adds a new result to the result list. |
javax.swing.JList |
getList()
Gets the JList used by the results list |
java.lang.String |
getNameAtIndex(int index)
Gets the name of theitem in the list at the specified index |
java.lang.StringBuffer |
getNamedBuffer(java.lang.String name)
Gets the named buffer |
java.lang.Object |
getNamedObject(java.lang.String name)
Get the named object from the list |
java.lang.StringBuffer |
getSelectedBuffer()
Gets the buffer associated with the currently selected item in the list. |
java.lang.String |
getSelectedName()
Get the name of the currently selected item in the list |
java.lang.Object |
getSelectedObject()
Gets the object associated with the currently selected item in the list. |
javax.swing.ListSelectionModel |
getSelectionModel()
Gets the selection model used by the results list. |
static void |
main(java.lang.String[] args)
Tests out the result history from the command line. |
void |
openFrame(java.lang.String name)
Opens the named result in a separate frame. |
void |
removeResult(java.lang.String name)
Removes one of the result buffers from the history. |
void |
setHandleRightClicks(boolean tf)
Set whether the result history list should handle right clicks or whether the parent object will handle them. |
void |
setSingle(java.lang.String name)
Sets the single-click display to view the named result. |
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. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ResultHistoryPanel(javax.swing.text.JTextComponent text)
text
- the optional text component for single-click displayMethod Detail |
public void addResult(java.lang.String name, java.lang.StringBuffer result)
name
- the name to associate with the resultresult
- the StringBuffer that contains the result textpublic void removeResult(java.lang.String name)
name
- the name of the buffer to remove.public void addObject(java.lang.String name, java.lang.Object o)
name
- the name to associate with the objecto
- the objectpublic java.lang.Object getNamedObject(java.lang.String name)
public java.lang.Object getSelectedObject()
public java.lang.StringBuffer getNamedBuffer(java.lang.String name)
public java.lang.StringBuffer getSelectedBuffer()
public java.lang.String getSelectedName()
public java.lang.String getNameAtIndex(int index)
public void setSingle(java.lang.String name)
name
- the name of the result to display.public void openFrame(java.lang.String name)
name
- the name of the result to open.public void updateResult(java.lang.String name)
name
- the name of the result that has been updated.public javax.swing.ListSelectionModel getSelectionModel()
public javax.swing.JList getList()
public void setHandleRightClicks(boolean tf)
tf
- false if parent object will handle right clickspublic static void main(java.lang.String[] args)
args
- ignored
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London