org.ceryle.ui.search
Class GraphSearchPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.ceryle.ui.search.GraphSearchPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class GraphSearchPanel
extends JPanel

Extends JPanel, creating a panel for graph searching. UI-wise, this just includes the search results, but behind the scenes also the machinery for graph-based queries.

Since:
JDK1.4
Version:
$Id: GraphSearchPanel.java,v 1.15 2007-06-20 01:28:28 altheim Exp $
Author:
Murray Altheim
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static Color COLOR_SELECTED_HIT_BG
          The color used as the background color for selected hits.
protected  JList m_resultList
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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
GraphSearchPanel(FindReplaceDialog dialog)
          Constructor for a GraphSearchPanel provided a MessageWriter.
 
Method Summary
 boolean clearResults()
          Clear the results list, returning true if they are successfully cleared.
 TNode getResult()
          Returns the single result of a search, the selected item in the search result list, or null if empty.
 int getResultCount()
          Returns the number of matching Topics in the last-performed search.
 Set getResults()
          Returns a Set containing the results of the last-performed search, or null if empty.
 void loadTopicMap(TMLayoutPanel tmlpanel)
          Builds the HashMap containing references to all TNodes in the graph found in the provided TMLayoutPanel tmlpanel, crossreferenced with their corresponding Topics, or null when the latter is unavailable.
 boolean search(String searchString, boolean next)
          Searches the graph for the string searchString, starting at the beginning of the iterated results if next is false, or at the end of the last search if true.
 void selectTopics(ActionEvent event)
          Selects in the graph those Topics selected in the results list.
 void setCLUT(ColorLookupTable clut)
          Sets the ColorLookupTable (CLUT) to clut.
protected  void setResultList(StackSet set)
          Sets the displayed list based on the search result StackSet set.
 void writeStatus(String message)
          Sets the content of the status line to the String message.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COLOR_SELECTED_HIT_BG

public static Color COLOR_SELECTED_HIT_BG
The color used as the background color for selected hits.


m_resultList

protected JList m_resultList
Constructor Detail

GraphSearchPanel

public GraphSearchPanel(FindReplaceDialog dialog)
Constructor for a GraphSearchPanel provided a MessageWriter.

Method Detail

setCLUT

public void setCLUT(ColorLookupTable clut)
Sets the ColorLookupTable (CLUT) to clut.


selectTopics

public void selectTopics(ActionEvent event)
Selects in the graph those Topics selected in the results list.


search

public boolean search(String searchString,
                      boolean next)
Searches the graph for the string searchString, starting at the beginning of the iterated results if next is false, or at the end of the last search if true. Returns true if the search was successful, and in the case of "next" searches, true if there are still more results available.


getResultCount

public int getResultCount()
Returns the number of matching Topics in the last-performed search.


getResults

public Set getResults()
Returns a Set containing the results of the last-performed search, or null if empty.


getResult

public TNode getResult()
Returns the single result of a search, the selected item in the search result list, or null if empty. This will throw a RuntimeException if the result list is not in single-selection mode. This is only the case when set for 'return Topic' mode.


setResultList

protected void setResultList(StackSet set)
Sets the displayed list based on the search result StackSet set. If null, clears the list.


clearResults

public boolean clearResults()
Clear the results list, returning true if they are successfully cleared.


loadTopicMap

public void loadTopicMap(TMLayoutPanel tmlpanel)
Builds the HashMap containing references to all TNodes in the graph found in the provided TMLayoutPanel tmlpanel, crossreferenced with their corresponding Topics, or null when the latter is unavailable.

If called with a null parameter after the TMLayoutPanel has been set, re-processes the graph (perhaps with a different set of visible nodes).

Parameters:
tmlpanel - the TMLayoutPanel source of the graph

writeStatus

public void writeStatus(String message)
Sets the content of the status line to the String message. This passes the message off to the parent dialog.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.