public class RemoteEntryEditor extends 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 |
JDialog.AccessibleJDialogDialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeWindow.AccessibleAWTWindow, Window.TypeContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
private JCheckBox |
acctBox |
private JButton |
addServer |
private Set<JTextField> |
badFields
Contains any
JTextFields that may be in an invalid
(to McIDAS-V) state. |
private JButton |
cancelButton |
private JCheckBox |
capBox |
private Set<RemoteAddeEntry> |
currentEntries
Current contents of the editor.
|
private McVTextField |
datasetField |
private JLabel |
datasetLabel |
private String |
datasetText
Initial contents of
datasetField. |
private AddeEntry.EditorAction |
editorAction
The last dialog action performed by the user.
|
private JPanel |
entryPanel |
private EntryStore |
entryStore
Reference back to the server manager.
|
private static Color |
ERROR_FIELD_COLOR
Background
Color of an "invalid"
JTextField. |
private static Color |
ERROR_TEXT_COLOR
Text
Color of an "invalid"
JTextField. |
private ExecutorService |
exec
Allows for asynchronous verification of ADDE entries.
|
private JCheckBox |
gridBox |
private 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 JCheckBox |
navBox |
private static Color |
NORMAL_FIELD_COLOR
Background
Color of a "valid"
JTextField. |
private static Color |
NORMAL_TEXT_COLOR
Text
Color of a "valid"
JTextField. |
private JCheckBox |
pointBox |
private static int |
POOL
Number of threads in the thread pool.
|
private static String |
PREF_FORCE_CAPS
Whether or not to input in the dataset, username, and project fields
should be uppercased.
|
private JTextField |
projField |
private JLabel |
projLabel |
private JCheckBox |
radarBox |
private JTextField |
serverField |
private JLabel |
serverLabel |
private String |
serverText
Initial contents of
serverField. |
private JLabel |
statusLabel |
private JPanel |
statusPanel |
private JCheckBox |
textBox |
private JPanel |
typePanel |
private McVTextField |
userField |
private JLabel |
userLabel |
private JButton |
verifyAddButton |
private JButton |
verifyServer |
accessibleContext, rootPane, rootPaneCheckingEnabledDEFAULT_MODALITY_TYPEBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTDISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSEABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
RemoteEntryEditor(EntryStore entryStore,
String address,
String group)
Populates the server and dataset text fields with given
Strings. |
RemoteEntryEditor(Frame parent,
boolean modal,
TabbedAddeManager manager,
EntryStore store) |
RemoteEntryEditor(Frame parent,
boolean modal,
TabbedAddeManager manager,
EntryStore store,
List<RemoteAddeEntry> entries) |
RemoteEntryEditor(Frame parent,
boolean modal,
TabbedAddeManager manager,
EntryStore store,
RemoteAddeEntry entry) |
| Modifier and Type | Method and Description |
|---|---|
private void |
acctBoxActionPerformed(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(ActionEvent evt) |
private boolean |
anyBadFields()
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 |
cancelButtonActionPerformed(ActionEvent evt) |
private void |
capBoxActionPerformed(ActionEvent evt) |
Set<RemoteAddeEntry> |
checkGroups(AddeEntry.EditorAction action,
Set<RemoteAddeEntry> entries) |
Set<RemoteAddeEntry> |
checkHosts(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(ActionEvent evt) |
private void |
formWindowClosed(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(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 |
reactToValueChanges() |
private void |
resetBadFields()
Clear out
badFields and "set" the field's status to
valid. |
private void |
setBadField(JTextField field,
boolean isBad)
Marks a
JTextField as "valid" or "invalid". |
private void |
setCheckBoxes(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(String msg)
Displays a short status message in
statusLabel. |
private void |
verifyAddButtonActionPerformed(ActionEvent evt) |
private void |
verifyEditButtonActionPerformed(ActionEvent evt) |
private void |
verifyInput(AddeEntry.EditorAction action)
Attempts to verify that the current contents of the GUI are
"valid".
|
private void |
verifyServerActionPerformed(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 String PREF_FORCE_CAPS
private static final Color ERROR_FIELD_COLOR
Color of an "invalid"
JTextField.private static final Color ERROR_TEXT_COLOR
Color of an "invalid"
JTextField.private static final Color NORMAL_FIELD_COLOR
Color of a "valid"
JTextField.private static final Color NORMAL_TEXT_COLOR
Color of a "valid"
JTextField.private final Set<JTextField> badFields
JTextFields that may be in an invalid
(to McIDAS-V) state.private final EntryStore entryStore
private ExecutorService exec
null.private final Set<RemoteAddeEntry> currentEntries
private AddeEntry.EditorAction editorAction
private final String serverText
serverField.
Be aware that null is allowed.private final String datasetText
datasetField.
Be aware that null is allowed.private boolean inErrorState
private JButton cancelButton
private McVTextField datasetField
private JLabel datasetLabel
private JPanel entryPanel
private JTextField projField
private JTextField serverField
private JLabel serverLabel
private JLabel statusLabel
private JPanel statusPanel
private McVTextField userField
private JButton verifyAddButton
private JButton verifyServer
public RemoteEntryEditor(EntryStore entryStore, String address, 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(Frame parent, boolean modal, TabbedAddeManager manager, EntryStore store)
public RemoteEntryEditor(Frame parent, boolean modal, TabbedAddeManager manager, EntryStore store, RemoteAddeEntry entry)
public RemoteEntryEditor(Frame parent, boolean modal, TabbedAddeManager manager, EntryStore store, List<RemoteAddeEntry> entries)
private 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(String msg)
statusLabel.msg - Status message. Shouldn't be null.private void setBadField(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(List<RemoteAddeEntry> initEntries)
initEntries - Inital remote ADDE entries to edit.private void acctBoxActionPerformed(ActionEvent evt)
private void capBoxActionPerformed(ActionEvent evt)
private void verifyAddButtonActionPerformed(ActionEvent evt)
private void handleVerifyAdd()
private void verifyEditButtonActionPerformed(ActionEvent evt)
private void handleVerifyEdit()
private void cancelButtonActionPerformed(ActionEvent evt)
private void formWindowClosed(WindowEvent evt)
private void verifyServerActionPerformed(ActionEvent evt)
private void addServerActionPerformed(ActionEvent evt)
private void editServerActionPerformed(ActionEvent evt)
private void reactToValueChanges()
public Set<RemoteAddeEntry> checkHosts(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.NullPointerException - if entries is null.private Thread makeCheckThread(AddeEntry.EditorAction action, Set<RemoteAddeEntry> entries)
private void setCheckBoxes(Set<RemoteAddeEntry> verified)
public Set<RemoteAddeEntry> checkGroups(AddeEntry.EditorAction action, Set<RemoteAddeEntry> entries)
private static Map<RemoteAddeEntry,RemoteEntryEditor.AddeStatus> bulkPut(Collection<RemoteAddeEntry> entries, RemoteEntryEditor.AddeStatus status)