|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
edu.wisc.ssec.mcidasv.servermanager.RemoteEntryEditor
public class RemoteEntryEditor
Simple dialog that allows the user to define or modify RemoteAddeEntry
s.
Nested Class Summary | |
---|---|
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
|
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 |
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 | |
---|---|
private JCheckBox |
acctBox
|
private JButton |
addServer
|
private Set<JTextField> |
badFields
Contains any JTextField s 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 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
|
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 javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
RemoteEntryEditor(EntryStore entryStore,
String address,
String group)
Populates the server and dataset text fields with given String s. |
|
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)
|
Method Summary | |
---|---|
private void |
acctBoxActionPerformed(ActionEvent evt)
|
private void |
addEntry()
Creates new RemoteAddeEntry s 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(Set<RemoteAddeEntry> entries)
|
Set<RemoteAddeEntry> |
checkHosts(Set<RemoteAddeEntry> entries)
Attempt to verify a Set of RemoteAddeEntry s. |
Set<RemoteAddeEntry> |
checkHosts2(Set<RemoteAddeEntry> entries)
|
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()
|
private boolean |
getForceMcxCaps()
Returns the value associated with the PREF_FORCE_CAPS preference. |
private void |
initComponents(List<RemoteAddeEntry> initEntries)
This method is called from within the constructor to initialize the form. |
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 |
setEditorAction(AddeEntry.EditorAction editorAction)
|
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()
Attempts to verify that the current contents of the GUI are "valid". |
private void |
verifyServerActionPerformed(ActionEvent evt)
|
Methods inherited from class java.awt.Dialog |
---|
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private 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
JTextField
s that may be in an invalid
(to McIDAS-V) state.
private final EntryStore entryStore
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 JCheckBox acctBox
private JButton addServer
private JButton cancelButton
private JCheckBox capBox
private McVTextField datasetField
private JLabel datasetLabel
private JPanel entryPanel
private JCheckBox gridBox
private JCheckBox imageBox
private JCheckBox navBox
private JCheckBox pointBox
private JTextField projField
private JLabel projLabel
private JCheckBox radarBox
private JTextField serverField
private JLabel serverLabel
private JLabel statusLabel
private JPanel statusPanel
private JCheckBox textBox
private JPanel typePanel
private McVTextField userField
private JLabel userLabel
private JButton verifyAddButton
private JButton verifyServer
Constructor Detail |
---|
public RemoteEntryEditor(EntryStore entryStore, String address, String group)
String
s.
This only works if the dialog is not yet visible.
This is mostly useful when adding an entry from a chooser.
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)
Method Detail |
---|
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()
RemoteAddeEntry
s 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()
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()
editorAction
private void setEditorAction(AddeEntry.EditorAction editorAction)
editorAction
private 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)
private void acctBoxActionPerformed(ActionEvent evt)
private void capBoxActionPerformed(ActionEvent evt)
private void verifyAddButtonActionPerformed(ActionEvent evt)
private void verifyEditButtonActionPerformed(ActionEvent evt)
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 RemoteAddeEntry
s. Useful for
checking a "MCTABLE.TXT" after importing.
entries
- Set
of remote ADDE entries to validate. Cannot
be null
.
Set
of RemoteAddeEntry
s that McIDAS-V was able
to connect to.
NullPointerException
- if entries
is null
.public Set<RemoteAddeEntry> checkHosts2(Set<RemoteAddeEntry> entries)
public Set<RemoteAddeEntry> checkGroups(Set<RemoteAddeEntry> entries)
private static Map<RemoteAddeEntry,RemoteEntryEditor.AddeStatus> bulkPut(Collection<RemoteAddeEntry> entries, RemoteEntryEditor.AddeStatus status)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |