Class TabbedAddeManager
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
edu.wisc.ssec.mcidasv.servermanager.TabbedAddeManager
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
,RootPaneContainer
,WindowConstants
This class is the GUI frontend to
EntryStore
(the server manager).
It allows users to manipulate their local and remote ADDE data.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private class
class
class
static enum
These are the various "events" that the server manager GUI supports.private static class
private static class
static class
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
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 JPanel
private JButton
private JMenuItem
private JButton
private boolean
Whether or notinitComponents()
has been called.private static final String
Path to the help resources.private JCheckBox
private JTextField
private JButton
private JTextField
private Icon
Icon for invalid datasets.private static final String
ID used to save/restore last directory that contained a MCTABLE.TXT.private static final String
ID used to save/restore the last visible tab between sessions.private static final String
Help target for the local servers.private JTable
private static final org.slf4j.Logger
Pretty typical logger object.private Icon
Icon for datasets that originate from a MCTABLE.TXT.private JButton
private JButton
private JButton
private static final int
Size of the ADDE entry verification thread pool.private static final String
Help target for the remote servers.private JTable
private JButton
private JMenuItem
private JButton
private final List
<LocalAddeEntry> private final List
<RemoteAddeEntry> private final EntryStore
Reference to the actual server manager.private static TabbedAddeManager
Static reference to an instance of this class.private JLabel
private Icon
Icon for datasets that are part of a default McIDAS-V install.private JTabbedPane
private Icon
Icon for datasets that have not been verified.private Icon
Icon for datasets that the user has provided.Fields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabled
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
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
ConstructorsConstructorDescriptionCreates a standalone server manager GUI.TabbedAddeManager
(EntryStore entryStore) Creates a server manager GUI that's linked back to the rest of McIDAS-V. -
Method Summary
Modifier and TypeMethodDescriptioncheckDatasets
(Collection<RemoteAddeEntry> entries) void
Closes and disposes (if needed) the GUI.private void
Handles the user closing the server manager GUI.private String
Returns the directory that contained the most recently imported MCTABLE.TXT.private int
Returns the index of the user's last server manager tab.private List
<LocalAddeEntry> Gets the selected local ADDE entries.private List
<RemoteAddeEntry> Gets the selected remote ADDE entries.private LocalAddeEntry
If there is a single local dataset selected, this method will return that dataset.static TabbedAddeManager
Returns an instance of this class.private void
handleTabStateChanged
(ChangeEvent event) Respond to changes intabbedPane
; primarily switching tabs.void
private boolean
Checks to see ifselectedLocalEntries
contains anyLocalAddeEntry
s.private boolean
Checks to see ifselectedRemoteEntries
contains anyRemoteAddeEntry
s.private boolean
Checks to see if the user has select a single local dataset.private boolean
Checks to see if the user has select a single remote dataset.private static Icon
Create anIcon
from the name of one the server manager icons.private void
void
importMctable
(String path, String username, String project) Extracts datasets from a given MCTABLE.TXT and adds them to the server manager.void
Builds the server manager GUI.private void
Respond to events from the local dataset table.static void
Launch the application.private JPanel
void
Responds to local server events and attempts to update the GUI status message.void
Attempts to refresh the contents of both the local and remote dataset tables.private void
Respond to events.void
removeLocalEntries
(Collection<LocalAddeEntry> entries) Removes the given local ADDE entries from the server manager GUI.void
removeRemoteEntries
(Collection<RemoteAddeEntry> entries) Removes the given remote ADDE entries from the server manager GUI.private void
setLastImportPath
(String path) Saves the directory that contained the most recently imported MCTABLE.TXT.private void
setLastTab
(int index) Saves the index of the last server manager tab the user was looking at.private void
setSelectedLocalEntries
(Collection<LocalAddeEntry> entries) Corresponds to the selected local ADDE entries in the GUI.private void
Corresponds to the selected remote ADDE entries in the GUI.void
Shows a local ADDE entry editor without anything pre-populated (creating a new local ADDE dataset).void
showLocalEditor
(LocalAddeEntry entry) Shows a local ADDE entry editor with the appropriate fields pre-populated, using the values fromentry
.void
If the GUI isn't shown, this method will display things.void
Create and show the GUI the remote ADDE dataset GUI.void
showRemoteEditor
(List<RemoteAddeEntry> entries) Create and show the GUI the remote ADDE dataset GUI.void
Attempts to start the local servers.void
Attempts to stop the local servers.Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
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, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, 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, 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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
logger
Pretty typical logger object. -
HELP_TOP_DIR
Path to the help resources.- See Also:
-
REMOTE_HELP_TARGET
Help target for the remote servers.- See Also:
-
LOCAL_HELP_TARGET
Help target for the local servers.- See Also:
-
LAST_TAB
ID used to save/restore the last visible tab between sessions.- See Also:
-
LAST_IMPORTED
ID used to save/restore last directory that contained a MCTABLE.TXT.- See Also:
-
POOL
Size of the ADDE entry verification thread pool.- See Also:
-
staticTabbedManager
Static reference to an instance of this class. Bad idea! -
serverManager
Reference to the actual server manager. -
selectedRemoteEntries
-
selectedLocalEntries
-
importUser
-
importProject
-
guiInitialized
Whether or notinitComponents()
has been called. -
contentPane
-
remoteTable
-
localTable
-
tabbedPane
-
statusLabel
-
newRemoteButton
-
editRemoteButton
-
removeRemoteButton
-
importRemoteButton
-
newLocalButton
-
editLocalButton
-
removeLocalButton
-
okButton
-
editMenuItem
-
removeMenuItem
-
importAccountBox
-
system
Icon for datasets that are part of a default McIDAS-V install. -
mctable
Icon for datasets that originate from a MCTABLE.TXT. -
user
Icon for datasets that the user has provided. -
invalid
Icon for invalid datasets. -
unverified
Icon for datasets that have not been verified.
-
-
Constructor Details
-
TabbedAddeManager
public TabbedAddeManager()Creates a standalone server manager GUI. -
TabbedAddeManager
Creates a server manager GUI that's linked back to the rest of McIDAS-V.- Parameters:
entryStore
- Server manager reference.- Throws:
NullPointerException
- ifentryStore
isnull
.
-
-
Method Details
-
getTabbedManager
Returns an instance of this class. The instance should correspond to the one being used by the "rest" of McIDAS-V.- Returns:
- Either an instance of this class or
null
.
-
showManager
If the GUI isn't shown, this method will display things. If the GUI is shown, bring it to the front.This method publishes
TabbedAddeManager.Event.SHOWN
. -
closeManager
Closes and disposes (if needed) the GUI. -
refreshDisplay
Attempts to refresh the contents of both the local and remote dataset tables. -
showRemoteEditor
Create and show the GUI the remote ADDE dataset GUI. Since noRemoteAddeEntries
have been provided, none of the fields will be prefilled (user is creating a new dataset). -
showRemoteEditor
Create and show the GUI the remote ADDE dataset GUI. Since someRemoteAddeEntries
have been provided, all of the applicable fields will be filled (user is editing an existing dataset).- Parameters:
entries
- Selection to edit. Should not benull
.
-
removeRemoteEntries
Removes the given remote ADDE entries from the server manager GUI.- Parameters:
entries
- Entries to remove.null
is permissible, but is a "no-op".
-
showLocalEditor
Shows a local ADDE entry editor without anything pre-populated (creating a new local ADDE dataset). -
showLocalEditor
Shows a local ADDE entry editor with the appropriate fields pre-populated, using the values fromentry
. This is intended to handle "editing" a local ADDE dataset.- Parameters:
entry
- Entry to edit; should not benull
.
-
removeLocalEntries
Removes the given local ADDE entries from the server manager GUI.- Parameters:
entries
- Entries to remove.null
is permissible, but is a "no-op".
-
importMctable
Extracts datasets from a given MCTABLE.TXT and adds them to the server manager.- Parameters:
path
- Path to the MCTABLE.TXT. Cannot benull
.username
- ADDE username to use for verifying extracted datasets. Cannot benull
.project
- ADDE project number to use for verifying extracted datasets. Cannot benull
.
-
startLocalServers
Attempts to start the local servers.- See Also:
-
stopLocalServers
Attempts to stop the local servers.- See Also:
-
mcservUpdated
Responds to local server events and attempts to update the GUI status message.- Parameters:
event
- Local server event. Should not benull
.
-
handleUrlImportMenuItem
-
initComponents
Builds the server manager GUI. -
handleTabStateChanged
Respond to changes intabbedPane
; primarily switching tabs.- Parameters:
event
- Event being handled. Ignored for now.
-
remoteSelectionModelChanged
Respond to events.- Parameters:
e
-ListSelectionEvent
that necessitated this call.
-
localSelectionModelChanged
Respond to events from the local dataset table.- Parameters:
e
-ListSelectionEvent
that necessitated this call.
-
hasRemoteSelection
Checks to see ifselectedRemoteEntries
contains anyRemoteAddeEntry
s.- Returns:
- Whether or not any
RemoteAddeEntry
values are selected.
-
hasLocalSelection
Checks to see ifselectedLocalEntries
contains anyLocalAddeEntry
s.- Returns:
- Whether or not any
LocalAddeEntry
values are selected.
-
hasSingleRemoteSelection
Checks to see if the user has select a single remote dataset.- Returns:
true
if there is a single remote dataset selected.false
otherwise.
-
hasSingleLocalSelection
Checks to see if the user has select a single local dataset.- Returns:
true
if there is a single local dataset selected.false
otherwise.
-
getSingleLocalSelection
If there is a single local dataset selected, this method will return that dataset.- Returns:
- Either the single selected local dataset, or
LocalAddeEntry.INVALID_ENTRY
.
-
setSelectedRemoteEntries
Corresponds to the selected remote ADDE entries in the GUI.- Parameters:
entries
- Should not benull
.
-
getSelectedRemoteEntries
Gets the selected remote ADDE entries.- Returns:
- Either an empty list or the remote entries selected in the GUI.
-
setSelectedLocalEntries
Corresponds to the selected local ADDE entries in the GUI.- Parameters:
entries
- Should not benull
.
-
getSelectedLocalEntries
Gets the selected local ADDE entries.- Returns:
- Either an empty list or the local entries selected in the GUI.
-
formWindowClosed
Handles the user closing the server manager GUI.- Parameters:
evt
- Event that triggered this method call. Currently ignored.- See Also:
-
makeFileChooserAccessory
-
importButtonActionPerformed
-
getLastImportPath
Returns the directory that contained the most recently imported MCTABLE.TXT.- Returns:
- Either the path to the most recently imported MCTABLE.TXT file,
or an empty
String
.
-
setLastImportPath
Saves the directory that contained the most recently imported MCTABLE.TXT.- Parameters:
path
- Path to the most recently imported MCTABLE.TXT file.null
values are replaced with an emptyString
.
-
getLastTab
Returns the index of the user's last server manager tab.- Returns:
- Index of the user's most recently viewed server manager tab, or
0
.
-
setLastTab
Saves the index of the last server manager tab the user was looking at.- Parameters:
index
- Index of the user's most recently viewed server manager tab.
-
checkDatasets
-
icon
Create anIcon
from the name of one the server manager icons.Note: this method expects the server manager icons to live in the same directory within the McIDAS-V JAR file. Currently, the directory is
/edu/wisc/ssec/mcidasv/resources/icons/servermanager/
.- Parameters:
icon
- Name of icon within server manager icon directory to use. Should not benull
.- Returns:
Icon
object with the desired image.
-
main
Launch the application. Makes for a simplistic test.- Parameters:
args
- Command line arguments. These are currently ignored.
-