Package ucar.unidata.ui
Class ChooserPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
ucar.unidata.ui.ChooserPanel
- All Implemented Interfaces:
- ActionListener,- ImageObserver,- MenuContainer,- Serializable,- EventListener,- Accessible
- Direct Known Subclasses:
- IdvChooser
Common class for the chooser panels.
- Author:
- Unidata Metapps development team
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class javax.swing.JPanelJPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponentJComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.ContainerContainer.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.ComponentComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected JButtonCancel button.static final StringText for the load button.protected JComponentPanel holding the contents.protected static final InsetsUsed by derived classes when they do a GuiUtils.doLayoutprotected static final intThe spacing used in the grid layout.protected static final intThe Constant GRID_SPACING_H.protected static final intThe Constant GRID_SPACING_V.protected booleanFlag for whether data has been chosen or not.protected StringWhere can we find help for this panel.protected JButtonLoad button.static final ColorThe color for station maps.protected boolean_more_.protected JLabelShows the status.Fields inherited from class javax.swing.JComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.ComponentaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserverABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct an object for selecting a data source from the current directory and from a default ADDE server.
- 
Method SummaryModifier and TypeMethodDescriptionvoidReceive the update,cancel, load commands and call: doUpdate, doCancel or doLoad.voidAdds a PropertyChangeListener.booleanCan do update.voidClear any outstanding cursor waits.voiddoCancel()Gets called when the user presses Cancel in multipleSelect mode This can get overwritten by a derived class to do something.protected voiddoClose()Gets called to close the panel.voiddoHelp()Gets called when the user presses the Help button.voiddoLoad()Gets called when the user pressesCMD_LOADbutton.voidGets called by doLoad in a thread when the user presses the load button.protected JComponentDo make contents.voiddoUpdate()Gets called when the user presses the Update button.protected voidfirePropertyChange(String propertyName, Object oldValue, Object newValue) Fires a PropertyChangeEvent.protected String[]Get the names for the buttons.Hides the fact that this is really a JPanel.Get the default buttons for this chooser panel.getDefaultButtons(ActionListener listener) Gets the default buttons.booleanGets the have data.protected StringThis allows for derived classes to define their own name for the "Add source" button.protected StringGet the tooltip for the load button.protected StringGets the message template.booleanGets the simple mode.protected JComponentGets the status component.protected JLabelCreate (if needed) and return the JLabel that shows the status messages.Gets the status label background.Gets the status label foreground.protected StringGet the tooltip for the update button.voidlogException(String msg, Exception exc) Convenience method toLogUtil.logException(String, Throwable).Pad label.protected JComponentregisterStatusComp(String name, JComponent comp) Register status comp.voidvoidsetHaveData(boolean have) Set whether the user has made a selection that contains data.voidsetHelpPath(String path) Set the help path used for this chooser.voidsetMessageTemplate(String template) Sets the message template.voidSet the status message.voidSets the status.voidSet the normal cursor over this panel.voidshowNormalCursor(JComponent comp) Set the normal cursor over this panel.voidSet the wait cursor over this panel.voidshowWaitCursor(JComponent comp) Set the wait cursor over this panel.protected voidUpdate status.Methods inherited from class javax.swing.JPanelgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponentaddAncestorListener, 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, 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, updateMethods inherited from class java.awt.Containeradd, add, add, add, add, addContainerListener, addImpl, 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, validateTreeMethods inherited from class java.awt.Componentaction, 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, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
- 
Field Details- 
GRID_SPACINGprotected static final int GRID_SPACINGThe spacing used in the grid layout.- See Also:
 
- 
GRID_SPACING_Vprotected static final int GRID_SPACING_VThe Constant GRID_SPACING_V.- See Also:
 
- 
GRID_SPACING_Hprotected static final int GRID_SPACING_HThe Constant GRID_SPACING_H.- See Also:
 
- 
GRID_INSETSUsed by derived classes when they do a GuiUtils.doLayout
- 
MAP_COLORThe color for station maps.
- 
CMD_LOADText for the load button.- See Also:
 
- 
helpPathWhere can we find help for this panel.
- 
contentsPanel holding the contents.
- 
loadButtonLoad button.
- 
cancelButtonCancel button.
- 
haveDataprotected boolean haveDataFlag for whether data has been chosen or not.
- 
statusLabelShows the status.
- 
simpleModeprotected boolean simpleMode_more_.
 
- 
- 
Constructor Details- 
ChooserPanelpublic ChooserPanel()Construct an object for selecting a data source from the current directory and from a default ADDE server.
 
- 
- 
Method Details- 
setMessageTemplateSets the message template.- Parameters:
- template- the new message template
 
- 
getMessageTemplateGets the message template.- Returns:
- the message template
 
- 
addPropertyChangeListenerAdds a PropertyChangeListener.- Overrides:
- addPropertyChangeListenerin class- Container
- Parameters:
- listener- The PropertyChangeListener to add.
 
- 
firePropertyChangeFires a PropertyChangeEvent.- Overrides:
- firePropertyChangein class- Component
- Parameters:
- propertyName- The name of the property.
- oldValue- The old value of the property.
- newValue- The new Value of the property.
 
- 
revalidatepublic void revalidate()- Overrides:
- revalidatein class- JComponent
 
- 
registerStatusCompRegister status comp.- Parameters:
- name- the name
- comp- the comp
- Returns:
- the JComponent
 
- 
setStatusSet the status message.- Parameters:
- msg- The status message
 
- 
getSimpleModepublic boolean getSimpleMode()Gets the simple mode.- Returns:
- the simple mode
 
- 
setStatusSets the status.- Parameters:
- msg- the msg
- compId- the comp id
 
- 
getStatusLabelCreate (if needed) and return the JLabel that shows the status messages.- Returns:
- The status label
 
- 
getStatusLabelBackgroundGets the status label background.- Returns:
- the status label background
 
- 
getStatusLabelForegroundGets the status label foreground.- Returns:
- the status label foreground
 
- 
getStatusComponentGets the status component.- Returns:
- the status component
 
- 
actionPerformedReceive the update,cancel, load commands and call: doUpdate, doCancel or doLoad.- Specified by:
- actionPerformedin interface- ActionListener
- Parameters:
- ae- ActionEvent to process
 
- 
getLoadCommandNameThis allows for derived classes to define their own name for the "Add source" button.- Returns:
- custom name
 
- 
getDefaultButtonsGet the default buttons for this chooser panel.- Returns:
- panel of buttons
 
- 
getDefaultButtonsGets the default buttons.- Parameters:
- listener- the listener
- Returns:
- the default buttons
 
- 
canDoUpdatepublic boolean canDoUpdate()Can do update.- Returns:
- true, if successful
 
- 
getButtonLabelsGet the names for the buttons.- Returns:
- array of button names
 
- 
getLoadToolTipGet the tooltip for the load button.- Returns:
- The tooltip for the load button
 
- 
getUpdateToolTipGet the tooltip for the update button.- Returns:
- The tooltip for the update button
 
- 
setHaveDatapublic void setHaveData(boolean have) Set whether the user has made a selection that contains data.- Parameters:
- have- true to set the haveData property. Enables the loading button
 
- 
getHaveDatapublic boolean getHaveData()Gets the have data.- Returns:
- the have data
 
- 
clearWaitCursorpublic void clearWaitCursor()Clear any outstanding cursor waits.
- 
showWaitCursorpublic void showWaitCursor()Set the wait cursor over this panel.
- 
showNormalCursorpublic void showNormalCursor()Set the normal cursor over this panel.
- 
showWaitCursorSet the wait cursor over this panel.- Parameters:
- comp- the comp
 
- 
showNormalCursorSet the normal cursor over this panel.- Parameters:
- comp- the comp
 
- 
padLabelPad label.- Parameters:
- s- the string
- Returns:
- the JComponent
 
- 
getContentsHides the fact that this is really a JPanel.- Returns:
- the contents
 
- 
doMakeContentsDo make contents.- Returns:
- the JComponent
 
- 
updateStatusprotected void updateStatus()Update status.
- 
doLoadpublic void doLoad()Gets called when the user pressesCMD_LOADbutton. This can get overwritten by a derived class to do something. By default this calls doLoadDataInThread in a separate thread
- 
doLoadInThreadpublic void doLoadInThread()Gets called by doLoad in a thread when the user presses the load button. Should be overwritten by a derived class.
- 
doUpdatepublic void doUpdate()Gets called when the user presses the Update button. This can get overwritten by a derived class to do something.
- 
doHelppublic void doHelp()Gets called when the user presses the Help button.
- 
doCancelpublic void doCancel()Gets called when the user presses Cancel in multipleSelect mode This can get overwritten by a derived class to do something.
- 
doCloseprotected void doClose()Gets called to close the panel.
- 
logExceptionConvenience method toLogUtil.logException(String, Throwable).- Parameters:
- msg- message to log
- exc- Exception to log
 
- 
setHelpPathSet the help path used for this chooser.- Parameters:
- path- the new help path
 
 
-