public class CatalogQueryPanel extends JPanel implements ActionListener
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected static Insets |
LABEL_INSETS
Isets used for labels in the GridBagLayout
|
protected static Insets |
VALUE_INSETS
Isets used for values in the GridBagLayout
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Modifier | Constructor and Description |
---|---|
|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
Called when a query parameter is changed to start the search.
|
void |
addActionListener(ActionListener l)
Register to receive action events from this object whenever
a query parameter is changed.
|
void |
addChangeListener(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(JComboBox cb)
Notify any listeners that a query parameter (from a JComboBox) has changed.
|
Catalog |
getCatalog()
Return the catalog for this object
|
JComponent |
getComponentForLabel(String s)
Return the display component corresponding to the given label text, or null if not found.
|
String |
getLabelForComponent(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 Object |
getValue(FieldDesc p,
JComponent c)
Return the value in the given component, or null if there is no value there.
|
protected 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 JCheckBox |
makeCheckBox()
Make and return a checkbutton
|
protected JComboBox |
makeComboBox(FieldDesc p)
Make and return a combo box with the values that the given field may have.
|
protected JComponent |
makeComponent(FieldDesc p)
Make and return the component for entering the value of the
given query parameter.
|
protected JLabel |
makeLabel(String s)
Make panel label with the given text
|
protected void |
makePanelItems()
Make the display panel items
|
protected JTextField |
makeTextField(int width)
Make and return a text field with the given width.
|
void |
removeActionListener(ActionListener l)
Stop receiving action events from this object.
|
void |
removeChangeListener(ChangeListener l)
Stop receiving change events from this object.
|
protected void |
removePanelItems()
Remove the panel items.
|
void |
setQueryArgs(QueryArgs queryArgs)
Set the values displayed in the query panel from the given object.
|
protected void |
setValue(int i,
Object value)
Set the value in the ith component.
|
void |
update()
Update the display to reflect any changes in the catalog's query parameters
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
protected static final Insets LABEL_INSETS
protected static final Insets VALUE_INSETS
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 itprotected int getNumCols()
public void update()
public void addActionListener(ActionListener l)
public void removeActionListener(ActionListener l)
protected void fireActionEvent()
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void addChangeListener(ChangeListener l)
public void removeChangeListener(ChangeListener l)
protected void fireChange(JComboBox cb)
public Catalog getCatalog()
protected JComponent makeComponent(FieldDesc p)
protected JTextField makeTextField(int width)
protected JCheckBox makeCheckBox()
protected JComboBox makeComboBox(FieldDesc p)
protected void makePanelItems()
protected void removePanelItems()
public String getLabelForComponent(JComponent c)
public JComponent getComponentForLabel(String s)
protected int doGridBagLayout(GridBagUtil layout)
layout
- utility object used for the layoutpublic void initQueryArgs(QueryArgs queryArgs)
public QueryArgs getQueryArgs()
public void setQueryArgs(QueryArgs queryArgs)
a
- QueryArgs object describing the values (null values are ignored)protected Object getValue(FieldDesc p, JComponent c)
protected Object getValue(int i)
protected void setValue(int i, Object value)
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.