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 classprivate classclassclassstatic enumThese are the various "events" that the server manager GUI supports.private static classprivate static classstatic classNested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrameNested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrameNested 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 JPanelprivate JButtonprivate JMenuItemprivate JButtonprivate booleanWhether or notinitComponents()has been called.private static final StringPath to the help resources.private JCheckBoxprivate JTextFieldprivate JButtonprivate JTextFieldprivate IconIcon for invalid datasets.private static final StringID used to save/restore last directory that contained a MCTABLE.TXT.private static final StringID used to save/restore the last visible tab between sessions.private static final StringHelp target for the local servers.private JTableprivate static final org.slf4j.LoggerPretty typical logger object.private IconIcon for datasets that originate from a MCTABLE.TXT.private JButtonprivate JButtonprivate JButtonprivate static final intSize of the ADDE entry verification thread pool.private static final StringHelp target for the remote servers.private JTableprivate JButtonprivate JMenuItemprivate JButtonprivate final List<LocalAddeEntry> private final List<RemoteAddeEntry> private final EntryStoreReference to the actual server manager.private static TabbedAddeManagerStatic reference to an instance of this class.private JLabelprivate IconIcon for datasets that are part of a default McIDAS-V install.private JTabbedPaneprivate IconIcon for datasets that have not been verified.private IconIcon for datasets that the user has provided.Fields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabledFields 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_CURSORFields 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
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) voidCloses and disposes (if needed) the GUI.private voidHandles the user closing the server manager GUI.private StringReturns the directory that contained the most recently imported MCTABLE.TXT.private intReturns 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 LocalAddeEntryIf there is a single local dataset selected, this method will return that dataset.static TabbedAddeManagerReturns an instance of this class.private voidhandleTabStateChanged(ChangeEvent event) Respond to changes intabbedPane; primarily switching tabs.voidprivate booleanChecks to see ifselectedLocalEntriescontains anyLocalAddeEntrys.private booleanChecks to see ifselectedRemoteEntriescontains anyRemoteAddeEntrys.private booleanChecks to see if the user has select a single local dataset.private booleanChecks to see if the user has select a single remote dataset.private static IconCreate anIconfrom the name of one the server manager icons.private voidvoidimportMctable(String path, String username, String project) Extracts datasets from a given MCTABLE.TXT and adds them to the server manager.voidBuilds the server manager GUI.private voidRespond to events from the local dataset table.static voidLaunch the application.private JPanelvoidResponds to local server events and attempts to update the GUI status message.voidAttempts to refresh the contents of both the local and remote dataset tables.private voidRespond to events.voidremoveLocalEntries(Collection<LocalAddeEntry> entries) Removes the given local ADDE entries from the server manager GUI.voidremoveRemoteEntries(Collection<RemoteAddeEntry> entries) Removes the given remote ADDE entries from the server manager GUI.private voidsetLastImportPath(String path) Saves the directory that contained the most recently imported MCTABLE.TXT.private voidsetLastTab(int index) Saves the index of the last server manager tab the user was looking at.private voidsetSelectedLocalEntries(Collection<LocalAddeEntry> entries) Corresponds to the selected local ADDE entries in the GUI.private voidCorresponds to the selected remote ADDE entries in the GUI.voidShows a local ADDE entry editor without anything pre-populated (creating a new local ADDE dataset).voidshowLocalEditor(LocalAddeEntry entry) Shows a local ADDE entry editor with the appropriate fields pre-populated, using the values fromentry.voidIf the GUI isn't shown, this method will display things.voidCreate and show the GUI the remote ADDE dataset GUI.voidshowRemoteEditor(List<RemoteAddeEntry> entries) Create and show the GUI the remote ADDE dataset GUI.voidAttempts to start the local servers.voidAttempts 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, updateMethods 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, setUndecoratedMethods 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, 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, 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, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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- ifentryStoreisnull.
-
-
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 noRemoteAddeEntrieshave 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 someRemoteAddeEntrieshave 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.nullis 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.nullis 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-ListSelectionEventthat necessitated this call.
-
localSelectionModelChanged
Respond to events from the local dataset table.- Parameters:
e-ListSelectionEventthat necessitated this call.
-
hasRemoteSelection
Checks to see ifselectedRemoteEntriescontains anyRemoteAddeEntrys.- Returns:
- Whether or not any
RemoteAddeEntryvalues are selected.
-
hasLocalSelection
Checks to see ifselectedLocalEntriescontains anyLocalAddeEntrys.- Returns:
- Whether or not any
LocalAddeEntryvalues are selected.
-
hasSingleRemoteSelection
Checks to see if the user has select a single remote dataset.- Returns:
trueif there is a single remote dataset selected.falseotherwise.
-
hasSingleLocalSelection
Checks to see if the user has select a single local dataset.- Returns:
trueif there is a single local dataset selected.falseotherwise.
-
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.nullvalues 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 anIconfrom 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:
Iconobject with the desired image.
-
main
Launch the application. Makes for a simplistic test.- Parameters:
args- Command line arguments. These are currently ignored.
-