public class ChooserPanel
extends javax.swing.JPanel
implements java.awt.event.ActionListener
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
protected javax.swing.JButton |
cancelButton
Cancel button.
|
static java.lang.String |
CMD_LOAD
Text for the load button.
|
protected javax.swing.JComponent |
contents
Panel holding the contents.
|
protected static java.awt.Insets |
GRID_INSETS
Used by derived classes when they do a GuiUtils.doLayout
|
protected static int |
GRID_SPACING
The spacing used in the grid layout.
|
protected static int |
GRID_SPACING_H
The Constant GRID_SPACING_H.
|
protected static int |
GRID_SPACING_V
The Constant GRID_SPACING_V.
|
protected boolean |
haveData
Flag for whether data has been chosen or not.
|
protected java.lang.String |
helpPath
Where can we find help for this panel.
|
protected javax.swing.JButton |
loadButton
Load button.
|
static java.awt.Color |
MAP_COLOR
The color for station maps.
|
protected boolean |
simpleMode
_more_.
|
protected javax.swing.JLabel |
statusLabel
Shows the status.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
ChooserPanel()
Construct an object for selecting a data source from
the current directory and from a default ADDE server.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent ae)
Receive the update,cancel, load commands and call:
doUpdate, doCancel or doLoad.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener.
|
boolean |
canDoUpdate()
Can do update.
|
void |
clearWaitCursor()
Clear any outstanding cursor waits.
|
void |
doCancel()
Gets called when the user presses Cancel in multipleSelect mode
This can get overwritten by a derived class to do something.
|
protected void |
doClose()
Gets called to close the panel.
|
void |
doHelp()
Gets called when the user presses the Help button.
|
void |
doLoad()
Gets called when the user presses
CMD_LOAD button. |
void |
doLoadInThread()
Gets called by doLoad in a thread when the user presses the
load button.
|
protected javax.swing.JComponent |
doMakeContents()
Do make contents.
|
void |
doUpdate()
Gets called when the user presses the Update button.
|
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Fires a PropertyChangeEvent.
|
protected java.lang.String[] |
getButtonLabels()
Get the names for the buttons.
|
javax.swing.JComponent |
getContents()
Hides the fact that this is really a JPanel.
|
javax.swing.JComponent |
getDefaultButtons()
Get the default buttons for this chooser panel.
|
javax.swing.JComponent |
getDefaultButtons(java.awt.event.ActionListener listener)
Gets the default buttons.
|
boolean |
getHaveData()
Gets the have data.
|
protected java.lang.String |
getLoadCommandName()
This allows for derived classes to define their own name for the
"Add source" button.
|
protected java.lang.String |
getLoadToolTip()
Get the tooltip for the load button.
|
protected java.lang.String |
getMessageTemplate()
Gets the message template.
|
boolean |
getSimpleMode()
Gets the simple mode.
|
protected javax.swing.JComponent |
getStatusComponent()
Gets the status component.
|
protected javax.swing.JLabel |
getStatusLabel()
Create (if needed) and return the JLabel that shows the status messages.
|
java.awt.Color |
getStatusLabelBackground()
Gets the status label background.
|
java.awt.Color |
getStatusLabelForeground()
Gets the status label foreground.
|
protected java.lang.String |
getUpdateToolTip()
Get the tooltip for the update button.
|
void |
logException(java.lang.String msg,
java.lang.Exception exc)
Convenience method to
LogUtil.logException(String, Throwable). |
javax.swing.JComponent |
padLabel(java.lang.String s)
Pad label.
|
protected javax.swing.JComponent |
registerStatusComp(java.lang.String name,
javax.swing.JComponent comp)
Register status comp.
|
void |
revalidate() |
void |
setHaveData(boolean have)
Set whether the user has made a selection that contains data.
|
void |
setHelpPath(java.lang.String path)
Set the help path used for this chooser.
|
void |
setMessageTemplate(java.lang.String template)
Sets the message template.
|
void |
setStatus(java.lang.String msg)
Set the status message.
|
void |
setStatus(java.lang.String msg,
java.lang.String compId)
Sets the status.
|
void |
showNormalCursor()
Set the normal cursor over this panel.
|
void |
showNormalCursor(javax.swing.JComponent comp)
Set the normal cursor over this panel.
|
void |
showWaitCursor()
Set the wait cursor over this panel.
|
void |
showWaitCursor(javax.swing.JComponent comp)
Set the wait cursor over this panel.
|
protected void |
updateStatus()
Update status.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, updateadd, 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, validateTreeaction, 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, 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, transferFocusUpCycleprotected static final int GRID_SPACING
protected static final int GRID_SPACING_V
protected static final int GRID_SPACING_H
protected static final java.awt.Insets GRID_INSETS
public static final java.awt.Color MAP_COLOR
public static final java.lang.String CMD_LOAD
protected java.lang.String helpPath
protected javax.swing.JComponent contents
protected javax.swing.JButton loadButton
protected javax.swing.JButton cancelButton
protected boolean haveData
protected javax.swing.JLabel statusLabel
protected boolean simpleMode
public ChooserPanel()
public void setMessageTemplate(java.lang.String template)
template - the new message templateprotected java.lang.String getMessageTemplate()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in class java.awt.Containerlistener - The PropertyChangeListener to add.protected void firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
firePropertyChange in class java.awt.ComponentpropertyName - The name of the property.oldValue - The old value of the property.newValue - The new Value of the property.public void revalidate()
revalidate in class javax.swing.JComponentprotected javax.swing.JComponent registerStatusComp(java.lang.String name,
javax.swing.JComponent comp)
name - the namecomp - the comppublic void setStatus(java.lang.String msg)
msg - The status messagepublic boolean getSimpleMode()
public void setStatus(java.lang.String msg,
java.lang.String compId)
msg - the msgcompId - the comp idprotected javax.swing.JLabel getStatusLabel()
public java.awt.Color getStatusLabelBackground()
public java.awt.Color getStatusLabelForeground()
protected javax.swing.JComponent getStatusComponent()
public void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed in interface java.awt.event.ActionListenerae - ActionEvent to processprotected java.lang.String getLoadCommandName()
public javax.swing.JComponent getDefaultButtons()
public javax.swing.JComponent getDefaultButtons(java.awt.event.ActionListener listener)
listener - the listenerpublic boolean canDoUpdate()
protected java.lang.String[] getButtonLabels()
protected java.lang.String getLoadToolTip()
protected java.lang.String getUpdateToolTip()
public void setHaveData(boolean have)
have - true to set the haveData property. Enables the
loading buttonpublic boolean getHaveData()
public void clearWaitCursor()
public void showWaitCursor()
public void showNormalCursor()
public void showWaitCursor(javax.swing.JComponent comp)
comp - the comppublic void showNormalCursor(javax.swing.JComponent comp)
comp - the comppublic javax.swing.JComponent padLabel(java.lang.String s)
s - the stringpublic javax.swing.JComponent getContents()
protected javax.swing.JComponent doMakeContents()
protected void updateStatus()
public void doLoad()
CMD_LOAD button.
This can get overwritten by a derived class to do something.
By default this calls doLoadDataInThread in a separate threadpublic void doLoadInThread()
public void doUpdate()
public void doHelp()
public void doCancel()
protected void doClose()
public void logException(java.lang.String msg,
java.lang.Exception exc)
LogUtil.logException(String, Throwable).msg - message to logexc - Exception to logpublic void setHelpPath(java.lang.String path)
path - the new help path