|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
jsky.catalog.gui.CatalogQueryPanel
public class CatalogQueryPanel
Displays a panel containing widgets to use for searching a given catalog. Based on the catalog configuration information, different search fields are presented.
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.Insets |
LABEL_INSETS
Isets used for labels in the GridBagLayout |
protected static java.awt.Dimension |
MIN_COMPONENT_SIZE
Used to keep the combo boxes from getting too wide |
protected java.text.NumberFormat |
nf
Used to format floating point values |
protected static java.awt.Insets |
VALUE_INSETS
Isets used for values in the GridBagLayout |
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 | |
---|---|
|
CatalogQueryPanel(Catalog catalog)
Create a CatalogQueryPanel containing catalog specific labels and components for the search parameters specified in the catalog configuration file. |
|
CatalogQueryPanel(Catalog catalog,
int numCols)
Create a CatalogQueryPanel containing catalog specific labels and components for the search parameters specified in the catalog configuration file. |
protected |
CatalogQueryPanel(Catalog catalog,
int numCols,
boolean doLayout)
This constructor is for use by derived classes. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Called when a query parameter is changed to start the search. |
void |
addActionListener(java.awt.event.ActionListener l)
Register to receive action events from this object whenever a query parameter is changed. |
void |
addChangeListener(javax.swing.event.ChangeListener l)
Register to receive change events from this object whenever an item is selected from a JComboBox. |
protected int |
doGridBagLayout(GridBagUtil layout)
Combine the panel items in the correct layout. |
protected void |
fireActionEvent()
Notify any action listeners. |
protected void |
fireChange(javax.swing.JComponent c)
Notify any listeners that a query parameter (from a JComboBox) has changed. |
Catalog |
getCatalog()
Return the catalog for this object |
javax.swing.JComponent |
getComponentForLabel(java.lang.String s)
Return the display component corresponding to the given label text, or null if not found. |
java.lang.String |
getLabelForComponent(javax.swing.JComponent c)
Return the text of the label corresponding to the given display component, or null if not found. |
protected int |
getNumCols()
Return the number of columns to use for the display (should be an even number) |
QueryArgs |
getQueryArgs()
Return a QueryArgs object based on the current panel settings that can be passed to the Catalog.query() method. |
protected java.lang.Object |
getValue(FieldDesc p,
javax.swing.JComponent c)
Return the value in the given component, or null if there is no value there. |
protected java.lang.Object |
getValue(int i)
Return the value in the ith component, or null if there is no value there. |
void |
initQueryArgs(QueryArgs queryArgs)
Initialize a QueryArgs object based on the current panel settings that can be passed to the Catalog.query() method. |
protected javax.swing.JCheckBox |
makeCheckBox()
Make and return a checkbutton |
protected javax.swing.JComponent |
makeComboBox(FieldDesc p)
Make and return a combo box with the values that the given field may have. |
protected javax.swing.JComponent |
makeComponent(FieldDesc p)
Make and return the component for entering the value of the given query parameter. |
protected javax.swing.JLabel |
makeLabel(java.lang.String s)
Make panel label with the given text |
protected void |
makePanelItems()
Make the display panel items |
protected javax.swing.JTextField |
makeTextField(int width)
Make and return a text field with the given width. |
void |
removeActionListener(java.awt.event.ActionListener l)
Stop receiving action events from this object. |
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Stop receiving change events from this object. |
protected void |
removePanelItems()
Remove the panel items. |
boolean |
restoreSettings(java.lang.Object obj)
Restore the settings previously stored. |
void |
setQueryArgs(QueryArgs queryArgs)
Set the values displayed in the query panel from the given object. |
protected void |
setValue(int i,
java.lang.Object value)
Set the value in the ith component. |
protected void |
setValue(javax.swing.JComponent c,
java.lang.Object value)
Set the value in the given component. |
protected void |
setValue(java.lang.String label,
java.lang.Object value)
Set the value in the named component. |
java.lang.Object |
storeSettings()
Store the current settings in a serializable object and return the object. |
void |
update()
Update the display to reflect any changes in the catalog's query parameters |
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 |
---|
protected static final java.awt.Insets LABEL_INSETS
protected static final java.awt.Insets VALUE_INSETS
protected java.text.NumberFormat nf
protected static final java.awt.Dimension MIN_COMPONENT_SIZE
Constructor Detail |
---|
public CatalogQueryPanel(Catalog catalog, int numCols)
catalog
- the catalog to usenumCols
- the number of columns to use for the display (should be an even number)public CatalogQueryPanel(Catalog catalog)
catalog
- the catalog to useprotected CatalogQueryPanel(Catalog catalog, int numCols, boolean doLayout)
catalog
- the catalog to usenumCols
- the number of columns to use for the display (should be an even number)doLayout
- if true, layout the GUI layout, otherwise the derived class must do itMethod Detail |
---|
protected int getNumCols()
public void update()
public void addActionListener(java.awt.event.ActionListener l)
public void removeActionListener(java.awt.event.ActionListener l)
protected void fireActionEvent()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void addChangeListener(javax.swing.event.ChangeListener l)
public void removeChangeListener(javax.swing.event.ChangeListener l)
protected void fireChange(javax.swing.JComponent c)
protected javax.swing.JLabel makeLabel(java.lang.String s)
public Catalog getCatalog()
protected javax.swing.JComponent makeComponent(FieldDesc p)
protected javax.swing.JTextField makeTextField(int width)
protected javax.swing.JCheckBox makeCheckBox()
protected javax.swing.JComponent makeComboBox(FieldDesc p)
protected void makePanelItems()
protected void removePanelItems()
public java.lang.String getLabelForComponent(javax.swing.JComponent c)
public javax.swing.JComponent getComponentForLabel(java.lang.String s)
protected int doGridBagLayout(GridBagUtil layout)
layout
- utility object used for the layout
public void initQueryArgs(QueryArgs queryArgs)
public QueryArgs getQueryArgs()
public void setQueryArgs(QueryArgs queryArgs)
queryArgs
- QueryArgs object describing the values (null values are ignored)protected java.lang.Object getValue(FieldDesc p, javax.swing.JComponent c)
protected java.lang.Object getValue(int i)
protected void setValue(int i, java.lang.Object value)
protected void setValue(java.lang.String label, java.lang.Object value)
protected void setValue(javax.swing.JComponent c, java.lang.Object value)
public java.lang.Object storeSettings()
storeSettings
in interface Storeable
public boolean restoreSettings(java.lang.Object obj)
restoreSettings
in interface Storeable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |