java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
apollo.dataadapter.ensj.CompositeDataSourceConfigurationPanel
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
- public class CompositeDataSourceConfigurationPanel
- extends javax.swing.JPanel
This is a panel which composes a number of the standard DataSourceConfiguration
panels - one for the results, one for variations, one for sequences.
The point is to allow the user to gracefully enter configuration for all of these
different databases.
Which database the user is configuring is determined by a drop-down at the
top of the panel, which determines which one of the set of configuration
panels is visible.
The set/getProperties reads the properties of ALL the panels, prefacing
the properties of all except the "default" panel with a string, like "sequence:"
or "default:". This should allow these properties to be easily cleaved
off later, when we're trying to configure those databases.
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Fields inherited from class java.awt.Container |
|
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, 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, 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, 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, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, 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, 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, transferFocusBackward, transferFocusUpCycle |
choosers
private java.util.HashMap choosers
chooserDropdown
private javax.swing.JComboBox chooserDropdown
chooserActionListener
private java.awt.event.ActionListener chooserActionListener
previousChooserKey
private java.lang.String previousChooserKey
chooserNames
private java.lang.String[] chooserNames
defaultChooserName
private java.lang.String defaultChooserName
interactionListener
public java.awt.event.ActionListener interactionListener
linkChooserInteractions
private boolean linkChooserInteractions
CompositeDataSourceConfigurationPanel
public CompositeDataSourceConfigurationPanel(java.lang.String[] chooserNames)
- Automatically takes the first chooser name passed in as the default.
This also links the choice of database on the default chooser to the remaining
choosers - if you hit the "find" button on the default chooser, it will also
find the variation databases
CompositeDataSourceConfigurationPanel
public CompositeDataSourceConfigurationPanel(java.lang.String[] chooserNames,
boolean linkChooserInteractions)
CompositeDataSourceConfigurationPanel
public CompositeDataSourceConfigurationPanel()
initialiseChoosers
private void initialiseChoosers(java.lang.String[] chooserNames)
- Create each chooser and load into hashmap
getPrefixedProperties
public java.util.Properties getPrefixedProperties()
- Return properties from all choosers, prefixing each with its key
setProperties
public void setProperties(java.util.Properties properties)
- Set (suitably prefixed) properties onto each chooser.
If it doesn't FIND any properties with the prefix it's looking for -
e.g. "sequence" or "variation" etc, then it will just set the input properties
onto that chooser.
buildGUI
private void buildGUI()
makeConstraintAt
protected java.awt.GridBagConstraints makeConstraintAt(int x,
int y,
int width)
getChooserNames
private java.lang.String[] getChooserNames()
getPreviousChooserKey
private java.lang.String getPreviousChooserKey()
setPreviousChooserKey
private void setPreviousChooserKey(java.lang.String key)
getChooser
public DataSourceConfigurationPanel getChooser(java.lang.String key)
getChoosers
private java.util.HashMap getChoosers()
getChooserDropdown
private javax.swing.JComboBox getChooserDropdown()
getSelectedChooser
public java.lang.String getSelectedChooser()
getChooserActionListener
private java.awt.event.ActionListener getChooserActionListener()
getInteractionListener
public java.awt.event.ActionListener getInteractionListener()
- The default interaction listener will do nothing.
setInteractionListener
public void setInteractionListener(java.awt.event.ActionListener listener)
- Any listener passed in here is actually set as the interaction listener on
on each component configuration panel.
main
public static void main(java.lang.String[] args)
setDefaultChooserName
private void setDefaultChooserName(java.lang.String name)
getDefaultChooserName
private java.lang.String getDefaultChooserName()
populateEnsemblDatabases
public void populateEnsemblDatabases()
- Connect to the mysql instance chosen by the "default" chooser.
- Read all mysql databases on the instance.
- For each mysql database (a "catalog" in jdbc terms):
-
- - if it has an "assembly" table, add it to the list of ensembl "core" dbs.
- - otherwise do similar checks to see if it is a variation db.
- Finally set the lists we obtain this way into the ensembl db dropdowns in
each of the db config panels.
Note - we get the signature tables to look for from the "signature" fields in the
ensj-defaults.conf If we don't find these signature
fields in ensj_defaults.conf, we just load all the mysql databases we see into the dropdowns.
isCore
protected boolean isCore(java.lang.String name)
- Returns true if name has the string "core_X_" in it,
where X is a number, and as a number X>= 9. Before you tell me to use
regexp, just let me remind you (1) At time of writing, we're using jdk1.3
and (2) This is NOT the time to introduce another jar file into the build.
isVariation
protected boolean isVariation(java.lang.String name)
- Returns true if name has the string "snp_X_" in it,
where X is a number, and as a number X>= 9.
databaseHasKeyAndVersion
private boolean databaseHasKeyAndVersion(java.lang.String key,
java.lang.String name)
- Utility for the isCore... methods which does the substringing,
and version checkin.
initialiseDatabaseDriver
protected void initialiseDatabaseDriver(java.util.Properties defaultPanelProperties)
getLinkChooserInteractions
private boolean getLinkChooserInteractions()
- Whether to modify the contents of other choosers when the user
hits "find" on the default chooser