public class RemoteEntryEditor extends javax.swing.JDialog
RemoteAddeEntries.| Modifier and Type | Class and Description |
|---|---|
static class |
RemoteEntryEditor.AddeStatus
Possible entry verification states.
|
private static class |
RemoteEntryEditor.StatusWrapper
Associates a
RemoteAddeEntry with one of the states from
RemoteEntryEditor.AddeStatus. |
private class |
RemoteEntryEditor.VerifyEntryTask
Represents an ADDE entry verification task.
|
private class |
RemoteEntryEditor.VerifyHostTask |
javax.swing.JDialog.AccessibleJDialogjava.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityTypejava.awt.Window.AccessibleAWTWindow, java.awt.Window.Type| Modifier and Type | Field and Description |
|---|---|
private javax.swing.JCheckBox |
acctBox |
private javax.swing.JButton |
addServer |
private java.util.Set<javax.swing.JTextField> |
badFields
Contains any
JTextFields that may be in an invalid
(to McIDAS-V) state. |
private javax.swing.JButton |
cancelButton |
private javax.swing.JCheckBox |
capBox |
private java.util.Set<RemoteAddeEntry> |
currentEntries
Current contents of the editor.
|
private McVTextField |
datasetField |
private javax.swing.JLabel |
datasetLabel |
private java.lang.String |
datasetText
Initial contents of
datasetField. |
private AddeEntry.EditorAction |
editorAction
The last dialog action performed by the user.
|
private javax.swing.JPanel |
entryPanel |
private EntryStore |
entryStore
Reference back to the server manager.
|
private static java.awt.Color |
ERROR_FIELD_COLOR
Background
Color of an "invalid"
JTextField. |
private static java.awt.Color |
ERROR_TEXT_COLOR
Text
Color of an "invalid"
JTextField. |
private java.util.concurrent.ExecutorService |
exec
Allows for asynchronous verification of ADDE entries.
|
private javax.swing.JCheckBox |
gridBox |
private javax.swing.JCheckBox |
imageBox |
private boolean |
inErrorState
Whether or not the editor is prompting the user to adjust input.
|
private static org.slf4j.Logger |
logger
Logger object.
|
private TabbedAddeManager |
manager
Server manager GUI.
|
private javax.swing.JCheckBox |
navBox |
private static java.awt.Color |
NORMAL_FIELD_COLOR
Background
Color of a "valid"
JTextField. |
private static java.awt.Color |
NORMAL_TEXT_COLOR
Text
Color of a "valid"
JTextField. |
private javax.swing.JCheckBox |
pointBox |
private static int |
POOL
Number of threads in the thread pool.
|
private static java.lang.String |
PREF_FORCE_CAPS
Whether or not to input in the dataset, username, and project fields
should be uppercased.
|
private javax.swing.JTextField |
projField |
private javax.swing.JLabel |
projLabel |
private javax.swing.JCheckBox |
radarBox |
private javax.swing.JTextField |
serverField |
private javax.swing.JLabel |
serverLabel |
private java.lang.String |
serverText
Initial contents of
serverField. |
private javax.swing.JLabel |
statusLabel |
private javax.swing.JPanel |
statusPanel |
private javax.swing.JCheckBox |
textBox |
private javax.swing.JPanel |
typePanel |
private McVTextField |
userField |
private javax.swing.JLabel |
userLabel |
private javax.swing.JButton |
verifyAddButton |
private javax.swing.JButton |
verifyServer |
accessibleContext, rootPane, rootPaneCheckingEnabledBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor and Description |
|---|
RemoteEntryEditor(EntryStore entryStore,
java.lang.String address,
java.lang.String group)
Populates the server and dataset text fields with given
Strings. |
RemoteEntryEditor(java.awt.Frame parent,
boolean modal,
TabbedAddeManager manager,
EntryStore store) |
RemoteEntryEditor(java.awt.Frame parent,
boolean modal,
TabbedAddeManager manager,
EntryStore store,
java.util.List<RemoteAddeEntry> entries) |
RemoteEntryEditor(java.awt.Frame parent,
boolean modal,
TabbedAddeManager manager,
EntryStore store,
RemoteAddeEntry entry) |
| Modifier and Type | Method and Description |
|---|---|
private void |
acctBoxActionPerformed(java.awt.event.ActionEvent evt) |
private void |
addEntry()
Creates new
RemoteAddeEntrys based upon the contents of the dialog
and adds "them" to the managed servers. |
private void |
addServerActionPerformed(java.awt.event.ActionEvent evt) |
private boolean |
anyBadFields()
Determines whether or not any fields are in an invalid state.
|
private static java.util.Map<RemoteAddeEntry,RemoteEntryEditor.AddeStatus> |
bulkPut(java.util.Collection<RemoteAddeEntry> entries,
RemoteEntryEditor.AddeStatus status) |
private void |
cancelButtonActionPerformed(java.awt.event.ActionEvent evt) |
private void |
capBoxActionPerformed(java.awt.event.ActionEvent evt) |
java.util.Set<RemoteAddeEntry> |
checkGroups(AddeEntry.EditorAction action,
java.util.Set<RemoteAddeEntry> entries) |
java.util.Set<RemoteAddeEntry> |
checkHosts(java.util.Set<RemoteAddeEntry> entries)
Attempt to verify a
Set of RemoteAddeEntrys. |
private void |
disposeDisplayable(boolean refreshManager) |
private void |
editEntry()
Replaces the entries within
currentEntries with new entries
from pollWidgets(boolean). |
private void |
editServerActionPerformed(java.awt.event.ActionEvent evt) |
private void |
formWindowClosed(java.awt.event.WindowEvent evt) |
AddeEntry.EditorAction |
getEditorAction()
Returns the last
AddeEntry.EditorAction that was performed. |
private boolean |
getForceMcxCaps()
Returns the value associated with the
PREF_FORCE_CAPS preference. |
private void |
handleVerifyAdd() |
private void |
handleVerifyEdit() |
private void |
initComponents(java.util.List<RemoteAddeEntry> initEntries)
This method is called from within the constructor to
initialize the form.
|
private java.lang.Thread |
makeCheckThread(AddeEntry.EditorAction action,
java.util.Set<RemoteAddeEntry> entries) |
private java.util.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 |
reactToValueChanges() |
private void |
resetBadFields()
Clear out
badFields and "set" the field's status to
valid. |
private void |
setBadField(javax.swing.JTextField field,
boolean isBad)
Marks a
JTextField as "valid" or "invalid". |
private void |
setCheckBoxes(java.util.Set<RemoteAddeEntry> verified) |
private void |
setEditorAction(AddeEntry.EditorAction editorAction)
Set the
AddeEntry.EditorAction that was performed. |
private void |
setForceMcxCaps(boolean value)
Controls the value associated with the
PREF_FORCE_CAPS preference. |
private void |
setStatus(java.lang.String msg)
Displays a short status message in
statusLabel. |
private void |
verifyAddButtonActionPerformed(java.awt.event.ActionEvent evt) |
private void |
verifyEditButtonActionPerformed(java.awt.event.ActionEvent evt) |
private void |
verifyInput(AddeEntry.EditorAction action)
Attempts to verify that the current contents of the GUI are
"valid".
|
private void |
verifyServerActionPerformed(java.awt.event.ActionEvent evt) |
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, updateaddNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBackaddPropertyChangeListener, 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, toFrontadd, 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, validateTreeaction, 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, getPeer, 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, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprivate static final org.slf4j.Logger logger
private static final int POOL
private static final java.lang.String PREF_FORCE_CAPS
private static final java.awt.Color ERROR_FIELD_COLOR
Color of an "invalid"
JTextField.private static final java.awt.Color ERROR_TEXT_COLOR
Color of an "invalid"
JTextField.private static final java.awt.Color NORMAL_FIELD_COLOR
Color of a "valid"
JTextField.private static final java.awt.Color NORMAL_TEXT_COLOR
Color of a "valid"
JTextField.private final java.util.Set<javax.swing.JTextField> badFields
JTextFields that may be in an invalid
(to McIDAS-V) state.private final TabbedAddeManager manager
null.private final EntryStore entryStore
private java.util.concurrent.ExecutorService exec
null.private final java.util.Set<RemoteAddeEntry> currentEntries
private AddeEntry.EditorAction editorAction
private final java.lang.String serverText
serverField.
Be aware that null is allowed.private final java.lang.String datasetText
datasetField.
Be aware that null is allowed.private boolean inErrorState
private javax.swing.JCheckBox acctBox
private javax.swing.JButton addServer
private javax.swing.JButton cancelButton
private javax.swing.JCheckBox capBox
private McVTextField datasetField
private javax.swing.JLabel datasetLabel
private javax.swing.JPanel entryPanel
private javax.swing.JCheckBox gridBox
private javax.swing.JCheckBox imageBox
private javax.swing.JCheckBox navBox
private javax.swing.JCheckBox pointBox
private javax.swing.JTextField projField
private javax.swing.JLabel projLabel
private javax.swing.JCheckBox radarBox
private javax.swing.JTextField serverField
private javax.swing.JLabel serverLabel
private javax.swing.JLabel statusLabel
private javax.swing.JPanel statusPanel
private javax.swing.JCheckBox textBox
private javax.swing.JPanel typePanel
private McVTextField userField
private javax.swing.JLabel userLabel
private javax.swing.JButton verifyAddButton
private javax.swing.JButton verifyServer
public RemoteEntryEditor(EntryStore entryStore, java.lang.String address, java.lang.String group)
Strings.
This only works if the dialog is not yet visible.
This is mostly useful when adding an entry from a chooser.
entryStore - Reference to the server manager.address - Should be the address of a server, but empty and
null values are allowed.group - Should be the name of a group/dataset on server,
but empty and null values are allowed.public RemoteEntryEditor(java.awt.Frame parent, boolean modal, TabbedAddeManager manager, EntryStore store)
public RemoteEntryEditor(java.awt.Frame parent, boolean modal, TabbedAddeManager manager, EntryStore store, RemoteAddeEntry entry)
public RemoteEntryEditor(java.awt.Frame parent, boolean modal, TabbedAddeManager manager, EntryStore store, java.util.List<RemoteAddeEntry> entries)
private java.util.Set<RemoteAddeEntry> pollWidgets(boolean ignoreCheckboxes)
ignoreCheckboxes - Whether or not the "type" checkboxes
should get ignored. Setting this to true means that all
types are considered valid--which is useful when attempting to verify
the user's input.Set of entries that represent the user's input, or an
empty Set if the input was invalid somehow.private void disposeDisplayable(boolean refreshManager)
private void addEntry()
RemoteAddeEntrys based upon the contents of the dialog
and adds "them" to the managed servers. If the dialog is
displayed, we call Window.dispose() and attempt to refresh the
server manager GUI if it is available.private void editEntry()
currentEntries with new entries
from pollWidgets(boolean). If the dialog is displayed, we call
Window.dispose() and attempt to refresh the server manager GUI if it's
available.private void verifyInput(AddeEntry.EditorAction action)
private void setStatus(java.lang.String msg)
statusLabel.msg - Status message. Shouldn't be null.private void setBadField(javax.swing.JTextField field, boolean isBad)
JTextField 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.field - JTextField to mark.isBad - true means that the field is "invalid",
false means that the field is "valid".private boolean anyBadFields()
private void resetBadFields()
badFields and "set" the field's status to
valid.public AddeEntry.EditorAction getEditorAction()
AddeEntry.EditorAction that was performed.editorActionprivate void setEditorAction(AddeEntry.EditorAction editorAction)
AddeEntry.EditorAction that was performed.editorAction - Action that was performed.editorActionprivate void setForceMcxCaps(boolean value)
PREF_FORCE_CAPS preference.value - true causes user input into the dataset, username,
and project fields to be capitalized.getForceMcxCaps()private boolean getForceMcxCaps()
PREF_FORCE_CAPS preference.setForceMcxCaps(boolean)private void initComponents(java.util.List<RemoteAddeEntry> initEntries)
initEntries - Inital remote ADDE entries to edit.private void acctBoxActionPerformed(java.awt.event.ActionEvent evt)
private void capBoxActionPerformed(java.awt.event.ActionEvent evt)
private void verifyAddButtonActionPerformed(java.awt.event.ActionEvent evt)
private void handleVerifyAdd()
private void verifyEditButtonActionPerformed(java.awt.event.ActionEvent evt)
private void handleVerifyEdit()
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt)
private void formWindowClosed(java.awt.event.WindowEvent evt)
private void verifyServerActionPerformed(java.awt.event.ActionEvent evt)
private void addServerActionPerformed(java.awt.event.ActionEvent evt)
private void editServerActionPerformed(java.awt.event.ActionEvent evt)
private void reactToValueChanges()
public java.util.Set<RemoteAddeEntry> checkHosts(java.util.Set<RemoteAddeEntry> entries)
Set of RemoteAddeEntrys. Useful for
checking a "MCTABLE.TXT" after importing.entries - Set of remote ADDE entries to validate. Cannot
be null.Set of RemoteAddeEntrys that McIDAS-V was able
to connect to.java.lang.NullPointerException - if entries is null.private java.lang.Thread makeCheckThread(AddeEntry.EditorAction action, java.util.Set<RemoteAddeEntry> entries)
private void setCheckBoxes(java.util.Set<RemoteAddeEntry> verified)
public java.util.Set<RemoteAddeEntry> checkGroups(AddeEntry.EditorAction action, java.util.Set<RemoteAddeEntry> entries)
private static java.util.Map<RemoteAddeEntry,RemoteEntryEditor.AddeStatus> bulkPut(java.util.Collection<RemoteAddeEntry> entries, RemoteEntryEditor.AddeStatus status)