apollo.gui
Class FindPanel

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 apollo.gui.ControlledPanel
                      extended by apollo.gui.FindPanel
All Implemented Interfaces:
DataLoadListener, ControlledObjectI, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class FindPanel
extends ControlledPanel
implements java.awt.event.ActionListener, ControlledObjectI, DataLoadListener

A ControlledPanel which displays the find dialog (for name, base position and sequence). 10/2003: David Goodstein added regular expression searching. He mentioned the following: 0) all searches are case insensitive 1) if regular expression is NOT selected: -it is always a prefix match 2) if regular expression IS selected, it a "contains" match, meaning you should prepend "^" to your search string for a prefix match, append "$" to your search string for a suffix match, and sandwich between "^" and "$" for an exact match 3)for NAME searches, even if regular expression is NOT selected, you can use "*" as a wildcard character (i convert it to ".*" internally) 4) avoid nesting parenthesis on regexp SEQUENCE searches...the reverse-complementing of the regexp string will likely get funky. I don't expect anyone will want to do this, however. 5) i)on SEQUENCE searches, avoid like the plague constructs that can match an arbitrary number of times: atcg[atgc]+ggadd OR atcg.+ggadd This will greedily grab for the longest sequence that is flanked by atcg and ggadd, so you'll likely get only 2 or 3 hits (it does not search within a region that has already been matched). You're better off with atcg[atgc]{1,25}ggadd while will pull out all the matches flanked by atcg and ggadd that have at least one and up to 25 flanking characters 6) for Regexp searches, no need to flank with wildcards, as these are "contains" searches. For SEQUENCE searches, flanking with "^" and "$" doesn't really make sense.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static java.awt.Color color
           
protected static org.apache.log4j.Logger logger
           
 
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
FindPanel(GuiCurationState cs)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          Handles all buttons and fields, does name, position, and sequence searching
 void addNotify()
          override Component.addNotify, called when added to parent.
 void componentInit()
           
 void fireBaseFocusEvent(int pos)
           
 void fireBaseFocusEvent(java.lang.String pos)
          Doesnt need to check if its numeric because of NumericKeyFilter.
 Controller getController()
          Gets the Controller for the object
 boolean handleDataLoadEvent(DataLoadEvent evt)
           
 void setController(Controller c)
          Sets the Controller for the object
 
Methods inherited from class apollo.gui.ControlledPanel
getControllerWindow, needsAutoRemoval
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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
 
Methods inherited from interface apollo.gui.ControlledObjectI
getControllerWindow, needsAutoRemoval
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

color

protected static java.awt.Color color
Constructor Detail

FindPanel

public FindPanel(GuiCurationState cs)
Method Detail

setController

public void setController(Controller c)
Description copied from interface: ControlledObjectI
Sets the Controller for the object

Specified by:
setController in interface ControlledObjectI
Specified by:
setController in class ControlledPanel

getController

public Controller getController()
Description copied from interface: ControlledObjectI
Gets the Controller for the object

Specified by:
getController in interface ControlledObjectI
Specified by:
getController in class ControlledPanel

componentInit

public void componentInit()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Handles all buttons and fields, does name, position, and sequence searching

Specified by:
actionPerformed in interface java.awt.event.ActionListener

handleDataLoadEvent

public boolean handleDataLoadEvent(DataLoadEvent evt)
Specified by:
handleDataLoadEvent in interface DataLoadListener

addNotify

public void addNotify()
Description copied from class: ControlledPanel
override Component.addNotify, called when added to parent. For many ControlledObjects this is when they add themselves as listeners to the controller. At add time can find ancestor of self for window control, I assume this is why its done here. Not a big deal to add to same controller twice as Controller checks for that

Overrides:
addNotify in class ControlledPanel

fireBaseFocusEvent

public void fireBaseFocusEvent(java.lang.String pos)
Doesnt need to check if its numeric because of NumericKeyFilter. 6/2005: Actually, that's not always true--the NumericKeyFilter prevents you from typing non-numbers in the box, but if you copy and paste a string from somewhere else into the box, it lets you paste letters and then throws an exception on parseInt.


fireBaseFocusEvent

public void fireBaseFocusEvent(int pos)