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 enumPossible entry verification states.private static classAssociates aRemoteAddeEntrywith one of the states fromRemoteEntryEditor.AddeStatus.private classRepresents an ADDE entry verification task.private classNested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JCheckBoxprivate JButtonprivate final Set<JTextField> Contains anyJTextFields that may be in an invalid (to McIDAS-V) state.private JButtonprivate JCheckBoxprivate final Set<RemoteAddeEntry> Current contents of the editor.private McVTextFieldprivate JLabelprivate final StringInitial contents ofdatasetField.private AddeEntry.EditorActionThe last dialog action performed by the user.private JPanelprivate final EntryStoreReference back to the server manager.private static final ColorBackgroundColorof an "invalid"JTextField.private static final ColorTextColorof an "invalid"JTextField.private ExecutorServiceAllows for asynchronous verification of ADDE entries.private JCheckBoxprivate JCheckBoxprivate booleanWhether or not the editor is prompting the user to adjust input.private static final org.slf4j.LoggerLogger object.private final TabbedAddeManagerServer manager GUI.private JCheckBoxprivate static final ColorBackgroundColorof a "valid"JTextField.private static final ColorTextColorof a "valid"JTextField.private JCheckBoxprivate static final intNumber of threads in the thread pool.private static final StringWhether or not to input in the dataset, username, and project fields should be uppercased.private JTextFieldprivate JLabelprivate JCheckBoxprivate JTextFieldprivate JLabelprivate final StringInitial contents ofserverField.private JLabelprivate JPanelprivate JCheckBoxprivate JPanelprivate McVTextFieldprivate JLabelprivate JButtonprivate JButtonFields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPEFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields 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 givenStrings.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 voidprivate voidaddEntry()Creates newRemoteAddeEntrys based upon the contents of the dialog and adds "them" to the managed servers.private voidprivate booleanDetermines whether or not any fields are in an invalid state.private static Map<RemoteAddeEntry, RemoteEntryEditor.AddeStatus> bulkPut(Collection<RemoteAddeEntry> entries, RemoteEntryEditor.AddeStatus status) private voidprivate voidcheckGroups(AddeEntry.EditorAction action, Set<RemoteAddeEntry> entries) checkHosts(Set<RemoteAddeEntry> entries) Attempt to verify aSetofRemoteAddeEntrys.private voiddisposeDisplayable(boolean refreshManager) private voidReplaces the entries withincurrentEntrieswith new entries frompollWidgets(boolean).private voidprivate voidReturns the lastAddeEntry.EditorActionthat was performed.private booleanReturns the value associated with thePREF_FORCE_CAPSpreference.private voidprivate voidprivate voidinitComponents(List<RemoteAddeEntry> initEntries) This method is called from within the constructor to initialize the form.private ThreadmakeCheckThread(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 voidprivate voidClear outbadFieldsand "set" the field's status to valid.private voidsetBadField(JTextField field, boolean isBad) Marks aJTextFieldas "valid" or "invalid".private voidsetCheckBoxes(Set<RemoteAddeEntry> verified) private voidsetEditorAction(AddeEntry.EditorAction editorAction) Set theAddeEntry.EditorActionthat was performed.private voidsetForceMcxCaps(boolean value) Controls the value associated with thePREF_FORCE_CAPSpreference.private voidDisplays a short status message instatusLabel.private voidprivate voidprivate voidverifyInput(AddeEntry.EditorAction action) Attempts to verify that the current contents of the GUI are "valid".private voidMethods 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, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBackMethods 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, toFrontMethods 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, validateTreeMethods 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
BackgroundColorof an "invalid"JTextField. -
ERROR_TEXT_COLOR
TextColorof an "invalid"JTextField. -
NORMAL_FIELD_COLOR
BackgroundColorof a "valid"JTextField. -
NORMAL_TEXT_COLOR
TextColorof a "valid"JTextField. -
badFields
Contains anyJTextFields 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 thatnullis allowed. -
datasetText
Initial contents ofdatasetField. Be aware thatnullis 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 givenStrings. 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 andnullvalues are allowed.group- Should be the name of a group/dataset onserver, but empty andnullvalues 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 totruemeans that all types are considered valid--which is useful when attempting to verify the user's input.- Returns:
Setof entries that represent the user's input, or an emptySetif the input was invalid somehow.
-
disposeDisplayable
-
addEntry
Creates newRemoteAddeEntrys 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 withincurrentEntrieswith 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 aJTextFieldas "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-JTextFieldto mark.isBad-truemeans that the field is "invalid",falsemeans 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 outbadFieldsand "set" the field's status to valid. -
getEditorAction
Returns the lastAddeEntry.EditorActionthat was performed.- Returns:
- Last editor action performed.
- See Also:
-
setEditorAction
Set theAddeEntry.EditorActionthat was performed.- Parameters:
editorAction- Action that was performed.- See Also:
-
setForceMcxCaps
Controls the value associated with thePREF_FORCE_CAPSpreference.- Parameters:
value-truecauses user input into the dataset, username, and project fields to be capitalized.- See Also:
-
getForceMcxCaps
Returns the value associated with thePREF_FORCE_CAPSpreference.- 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 aSetofRemoteAddeEntrys. Useful for checking a "MCTABLE.TXT" after importing.- Parameters:
entries-Setof remote ADDE entries to validate. Cannot benull.- Returns:
SetofRemoteAddeEntrys that McIDAS-V was able to connect to.- Throws:
NullPointerException- ifentriesisnull.
-
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)
-