Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.table.search
Class AbstractSearchPanel

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 com.citra.table.search.AbstractSearchPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
SearchPanel, SearchTablePanel

public abstract class AbstractSearchPanel
extends JPanel

An abstract implementation of a search panel that can be easily extended. The classes that extend AbstractSearchPanel are SearchPanel and SearchTablePanel.

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
protected  JButton closeButton
          the close button
protected  JLabel findLabel
          the find label
protected  Color foundBackgroundColor
          the found background color
protected  Color foundForegroundColor
          the found foreground color
protected  JToggleButton highLight
          the highlight button
protected  JButton nextButton
          the next button
protected  JLabel notFound
          the notFound label
protected  Color notFoundBackgroundColor
          the not found background color
protected  Color notFoundForegroundColor
          the not found foreground color
protected  JButton prevButton
          the previous button
protected  SearchModel searchModel
          the search model of the SearchTablePanel that forwards search model events to the listeners.
 
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
AbstractSearchPanel()
          Constructs an AbstractSearchPanel.
 
Method Summary
 JButton getCloseButton()
          Returns the close button.
 JLabel getFindLabel()
          Returns the find label.
 Color getFoundBackgroundColor()
          Returns the background color of the search text field if the search string is found.
 Color getFoundForegroundColor()
          Returns the foreground color of the search text field if the search string is found.
 JToggleButton getHighLightButton()
          Returns the highlight button.
 JButton getNextButton()
          Returns the next button.
 Color getNotFoundBackgroundColor()
          Returns the background color of the search text field if the search string is not found.
 Color getNotFoundForegroundColor()
          Returns the foreground color of the search text field if the search string is not found.
 JLabel getNotFoundLabel()
          Returns the not found label.
 JButton getPrevButton()
          Returns the prev button.
 SearchModel getSearchModel()
          Returns the search model.
abstract  void highLight()
          Searches the whole table in an arbitrary direction.
protected  void initComponents()
          Initializes the components that will be added to the panel.
protected abstract  void makePanel()
          Initializes the panel.
abstract  void next()
          Searches in the forward direction.
abstract  void previous()
          Searches in the backward direction.
 void register(TableModel model)
          Registers a table model so that changes to the model will initiate a search highlight action to be performed.
protected  void registerListeners()
          Registers listeners for the close, highlight, next and previous buttons.
 void setFoundBackgroundColor(Color foundBackgroundColor)
          Assigns the background color of the search text field if the search string is found.
 void setFoundForegroundColor(Color foundForegroundColor)
          Assigns the foreground color of the search text field if the search string is found.
 void setNotFoundBackgroundColor(Color notFoundBackgroundColor)
          Assigns the background color of the search text field if the search string is not found.
 void setNotFoundForegroundColor(Color notFoundForegroundColor)
          Assigns the foreground color of the search text field if the search string is not found.
 void unregister(TableModel model)
          Unregisters a table model that was previously registered with this search panel.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, 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, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

notFoundBackgroundColor

protected Color notFoundBackgroundColor
the not found background color


notFoundForegroundColor

protected Color notFoundForegroundColor
the not found foreground color


foundBackgroundColor

protected Color foundBackgroundColor
the found background color


foundForegroundColor

protected Color foundForegroundColor
the found foreground color


highLight

protected JToggleButton highLight
the highlight button


closeButton

protected JButton closeButton
the close button


findLabel

protected JLabel findLabel
the find label


nextButton

protected JButton nextButton
the next button


prevButton

protected JButton prevButton
the previous button


notFound

protected JLabel notFound
the notFound label


searchModel

protected SearchModel searchModel
the search model of the SearchTablePanel that forwards search model events to the listeners.

Constructor Detail

AbstractSearchPanel

public AbstractSearchPanel()
Constructs an AbstractSearchPanel.

Method Detail

getCloseButton

public JButton getCloseButton()
Returns the close button.

Returns:
the close button

getFindLabel

public JLabel getFindLabel()
Returns the find label.

Returns:
the find label

getFoundBackgroundColor

public Color getFoundBackgroundColor()
Returns the background color of the search text field if the search string is found.

Returns:
the found background color

getFoundForegroundColor

public Color getFoundForegroundColor()
Returns the foreground color of the search text field if the search string is found.

Returns:
the found foreground color

getHighLightButton

public JToggleButton getHighLightButton()
Returns the highlight button.

Returns:
the highlight button

getNextButton

public JButton getNextButton()
Returns the next button.

Returns:
the next button

getNotFoundBackgroundColor

public Color getNotFoundBackgroundColor()
Returns the background color of the search text field if the search string is not found.

Returns:
the not found background color

getNotFoundForegroundColor

public Color getNotFoundForegroundColor()
Returns the foreground color of the search text field if the search string is not found.

Returns:
the not found foreground color

getNotFoundLabel

public JLabel getNotFoundLabel()
Returns the not found label.

Returns:
the not found label

getPrevButton

public JButton getPrevButton()
Returns the prev button.

Returns:
the prev button

getSearchModel

public SearchModel getSearchModel()
Returns the search model.

Returns:
the search model

highLight

public abstract void highLight()
Searches the whole table in an arbitrary direction.


initComponents

protected void initComponents()
Initializes the components that will be added to the panel.


makePanel

protected abstract void makePanel()
Initializes the panel.


next

public abstract void next()
Searches in the forward direction.


previous

public abstract void previous()
Searches in the backward direction.


register

public void register(TableModel model)
Registers a table model so that changes to the model will initiate a search highlight action to be performed.

Parameters:
model - the table model to register with the search panel

registerListeners

protected void registerListeners()
Registers listeners for the close, highlight, next and previous buttons.


setFoundBackgroundColor

public void setFoundBackgroundColor(Color foundBackgroundColor)
Assigns the background color of the search text field if the search string is found.

Parameters:
foundBackgroundColor - the color to assign

setFoundForegroundColor

public void setFoundForegroundColor(Color foundForegroundColor)
Assigns the foreground color of the search text field if the search string is found.

Parameters:
foundForegroundColor - the color to assign

setNotFoundBackgroundColor

public void setNotFoundBackgroundColor(Color notFoundBackgroundColor)
Assigns the background color of the search text field if the search string is not found.

Parameters:
notFoundBackgroundColor - the color to assign

setNotFoundForegroundColor

public void setNotFoundForegroundColor(Color notFoundForegroundColor)
Assigns the foreground color of the search text field if the search string is not found.

Parameters:
notFoundForegroundColor - the color to assign

unregister

public void unregister(TableModel model)
Unregisters a table model that was previously registered with this search panel. See also register.

Parameters:
model - the table model to unregister

Copyright © 2011 Citra Technologies. All Rights Reserved.