Class RemoteEntryEditor
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
edu.wisc.ssec.mcidasv.servermanager.RemoteEntryEditor
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
,RootPaneContainer
,WindowConstants
Simple dialog that allows the user to define or modify
RemoteAddeEntries
.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Possible entry verification states.private static class
Associates aRemoteAddeEntry
with one of the states fromRemoteEntryEditor.AddeStatus
.private class
Represents an ADDE entry verification task.private class
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JCheckBox
private JButton
private final Set
<JTextField> Contains anyJTextField
s that may be in an invalid (to McIDAS-V) state.private JButton
private JCheckBox
private final Set
<RemoteAddeEntry> Current contents of the editor.private McVTextField
private JLabel
private final String
Initial contents ofdatasetField
.private AddeEntry.EditorAction
The last dialog action performed by the user.private JPanel
private final EntryStore
Reference back to the server manager.private static final Color
BackgroundColor
of an "invalid"JTextField
.private static final Color
TextColor
of an "invalid"JTextField
.private ExecutorService
Allows for asynchronous verification of ADDE entries.private JCheckBox
private JCheckBox
private boolean
Whether or not the editor is prompting the user to adjust input.private static final org.slf4j.Logger
Logger object.private final TabbedAddeManager
Server manager GUI.private JCheckBox
private static final Color
BackgroundColor
of a "valid"JTextField
.private static final Color
TextColor
of a "valid"JTextField
.private JCheckBox
private static final int
Number of threads in the thread pool.private static final String
Whether or not to input in the dataset, username, and project fields should be uppercased.private JTextField
private JLabel
private JCheckBox
private JTextField
private JLabel
private final String
Initial contents ofserverField
.private JLabel
private JPanel
private JCheckBox
private JPanel
private McVTextField
private JLabel
private JButton
private JButton
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
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
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
Constructor Summary
ConstructorsConstructorDescriptionRemoteEntryEditor
(EntryStore entryStore, String address, String group) Populates the server and dataset text fields with givenString
s.RemoteEntryEditor
(Frame parent, boolean modal, TabbedAddeManager manager, EntryStore store) RemoteEntryEditor
(Frame parent, boolean modal, TabbedAddeManager manager, EntryStore store, RemoteAddeEntry entry) RemoteEntryEditor
(Frame parent, boolean modal, TabbedAddeManager manager, EntryStore store, List<RemoteAddeEntry> entries) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
addEntry()
Creates newRemoteAddeEntry
s based upon the contents of the dialog and adds "them" to the managed servers.private void
private boolean
Determines whether or not any fields are in an invalid state.private static Map
<RemoteAddeEntry, RemoteEntryEditor.AddeStatus> bulkPut
(Collection<RemoteAddeEntry> entries, RemoteEntryEditor.AddeStatus status) private void
private void
checkGroups
(AddeEntry.EditorAction action, Set<RemoteAddeEntry> entries) checkHosts
(Set<RemoteAddeEntry> entries) Attempt to verify aSet
ofRemoteAddeEntry
s.private void
disposeDisplayable
(boolean refreshManager) private void
Replaces the entries withincurrentEntries
with new entries frompollWidgets(boolean)
.private void
private void
Returns the lastAddeEntry.EditorAction
that was performed.private boolean
Returns the value associated with thePREF_FORCE_CAPS
preference.private void
private void
private void
initComponents
(List<RemoteAddeEntry> initEntries) This method is called from within the constructor to initialize the form.private Thread
makeCheckThread
(AddeEntry.EditorAction action, Set<RemoteAddeEntry> entries) private Set
<RemoteAddeEntry> pollWidgets
(boolean ignoreCheckboxes) Poll the various UI components and attempt to construct valid ADDE entries based upon the information provided by the user.private void
private void
Clear outbadFields
and "set" the field's status to valid.private void
setBadField
(JTextField field, boolean isBad) Marks aJTextField
as "valid" or "invalid".private void
setCheckBoxes
(Set<RemoteAddeEntry> verified) private void
setEditorAction
(AddeEntry.EditorAction editorAction) Set theAddeEntry.EditorAction
that was performed.private void
setForceMcxCaps
(boolean value) Controls the value associated with thePREF_FORCE_CAPS
preference.private void
Displays a short status message instatusLabel
.private void
private void
private void
verifyInput
(AddeEntry.EditorAction action) Attempts to verify that the current contents of the GUI are "valid".private void
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
logger
Logger object. -
POOL
Number of threads in the thread pool.- See Also:
-
PREF_FORCE_CAPS
Whether or not to input in the dataset, username, and project fields should be uppercased.- See Also:
-
ERROR_FIELD_COLOR
BackgroundColor
of an "invalid"JTextField
. -
ERROR_TEXT_COLOR
TextColor
of an "invalid"JTextField
. -
NORMAL_FIELD_COLOR
BackgroundColor
of a "valid"JTextField
. -
NORMAL_TEXT_COLOR
TextColor
of a "valid"JTextField
. -
badFields
Contains anyJTextField
s that may be in an invalid (to McIDAS-V) state. -
manager
Server manager GUI. Value may benull
. -
entryStore
Reference back to the server manager. -
exec
Allows for asynchronous verification of ADDE entries. May benull
. -
currentEntries
Current contents of the editor. -
editorAction
The last dialog action performed by the user. -
serverText
Initial contents ofserverField
. Be aware thatnull
is allowed. -
datasetText
Initial contents ofdatasetField
. Be aware thatnull
is allowed. -
inErrorState
Whether or not the editor is prompting the user to adjust input. -
acctBox
-
addServer
-
cancelButton
-
capBox
-
datasetField
-
datasetLabel
-
entryPanel
-
gridBox
-
imageBox
-
pointBox
-
projField
-
projLabel
-
radarBox
-
serverField
-
serverLabel
-
statusLabel
-
statusPanel
-
textBox
-
typePanel
-
userField
-
userLabel
-
verifyAddButton
-
verifyServer
-
-
Constructor Details
-
RemoteEntryEditor
Populates the server and dataset text fields with givenString
s. This only works if the dialog is not yet visible.This is mostly useful when adding an entry from a chooser.
- Parameters:
entryStore
- Reference to the server manager.address
- Should be the address of a server, but empty andnull
values are allowed.group
- Should be the name of a group/dataset onserver
, but empty andnull
values are allowed.
-
RemoteEntryEditor
-
RemoteEntryEditor
public RemoteEntryEditor(Frame parent, boolean modal, TabbedAddeManager manager, EntryStore store, RemoteAddeEntry entry) -
RemoteEntryEditor
public RemoteEntryEditor(Frame parent, boolean modal, TabbedAddeManager manager, EntryStore store, List<RemoteAddeEntry> entries)
-
-
Method Details
-
pollWidgets
Poll the various UI components and attempt to construct valid ADDE entries based upon the information provided by the user.- Parameters:
ignoreCheckboxes
- Whether or not the "type" checkboxes should get ignored. Setting this totrue
means that all types are considered valid--which is useful when attempting to verify the user's input.- Returns:
Set
of entries that represent the user's input, or an emptySet
if the input was invalid somehow.
-
disposeDisplayable
-
addEntry
Creates newRemoteAddeEntry
s based upon the contents of the dialog and adds "them" to the managed servers. If the dialog is displayed, we callWindow.dispose()
and attempt to refresh the server manager GUI if it is available. -
editEntry
Replaces the entries withincurrentEntries
with new entries frompollWidgets(boolean)
. If the dialog is displayed, we callWindow.dispose()
and attempt to refresh the server manager GUI if it's available. -
verifyInput
Attempts to verify that the current contents of the GUI are "valid". -
setStatus
Displays a short status message instatusLabel
.- Parameters:
msg
- Status message. Shouldn't benull
.
-
setBadField
Marks aJTextField
as "valid" or "invalid". Mostly this just means that the field is highlighted in order to provide to the user a sense of "what do I fix" when something goes wrong.- Parameters:
field
-JTextField
to mark.isBad
-true
means that the field is "invalid",false
means that the field is "valid".
-
anyBadFields
Determines whether or not any fields are in an invalid state. Useful for disallowing the user to add invalid entries to the server manager.- Returns:
- Whether or not any fields are invalid.
-
resetBadFields
Clear outbadFields
and "set" the field's status to valid. -
getEditorAction
Returns the lastAddeEntry.EditorAction
that was performed.- Returns:
- Last editor action performed.
- See Also:
-
setEditorAction
Set theAddeEntry.EditorAction
that was performed.- Parameters:
editorAction
- Action that was performed.- See Also:
-
setForceMcxCaps
Controls the value associated with thePREF_FORCE_CAPS
preference.- Parameters:
value
-true
causes user input into the dataset, username, and project fields to be capitalized.- See Also:
-
getForceMcxCaps
Returns the value associated with thePREF_FORCE_CAPS
preference.- Returns:
- Whether or not user input should be automatically capitalized.
- See Also:
-
initComponents
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.- Parameters:
initEntries
- Inital remote ADDE entries to edit.
-
acctBoxActionPerformed
-
capBoxActionPerformed
-
verifyAddButtonActionPerformed
-
handleVerifyAdd
-
verifyEditButtonActionPerformed
-
handleVerifyEdit
-
cancelButtonActionPerformed
-
formWindowClosed
-
verifyServerActionPerformed
-
addServerActionPerformed
-
editServerActionPerformed
-
reactToValueChanges
-
checkHosts
Attempt to verify aSet
ofRemoteAddeEntry
s. Useful for checking a "MCTABLE.TXT" after importing.- Parameters:
entries
-Set
of remote ADDE entries to validate. Cannot benull
.- Returns:
Set
ofRemoteAddeEntry
s that McIDAS-V was able to connect to.- Throws:
NullPointerException
- ifentries
isnull
.
-
makeCheckThread
-
setCheckBoxes
-
checkGroups
public Set<RemoteAddeEntry> checkGroups(AddeEntry.EditorAction action, Set<RemoteAddeEntry> entries) -
bulkPut
private static Map<RemoteAddeEntry,RemoteEntryEditor.AddeStatus> bulkPut(Collection<RemoteAddeEntry> entries, RemoteEntryEditor.AddeStatus status)
-