public class TabbedAddeManager extends javax.swing.JFrame
EntryStore
(the server manager).
It allows users to manipulate their local and remote ADDE data.Modifier and Type | Class and Description |
---|---|
private static class |
TabbedAddeManager.BetterCheckTask |
private class |
TabbedAddeManager.CheckEntryTask |
class |
TabbedAddeManager.EntrySourceRenderer |
class |
TabbedAddeManager.EntryValidityRenderer |
static class |
TabbedAddeManager.Event
These are the various "events" that the server manager GUI
supports.
|
private static class |
TabbedAddeManager.LocalAddeTableModel |
private static class |
TabbedAddeManager.RemoteAddeTableModel |
static class |
TabbedAddeManager.TextRenderer |
javax.swing.JFrame.AccessibleJFrame
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
private javax.swing.JPanel |
contentPane |
private javax.swing.JButton |
editLocalButton |
private javax.swing.JMenuItem |
editMenuItem |
private javax.swing.JButton |
editRemoteButton |
private boolean |
guiInitialized
Whether or not
initComponents() has been called. |
private static java.lang.String |
HELP_TOP_DIR
Path to the help resources.
|
private javax.swing.JCheckBox |
importAccountBox |
private javax.swing.JTextField |
importProject |
private javax.swing.JButton |
importRemoteButton |
private javax.swing.JTextField |
importUser |
private javax.swing.Icon |
invalid
Icon for invalid datasets.
|
private static java.lang.String |
LAST_IMPORTED
ID used to save/restore last directory that contained a MCTABLE.TXT.
|
private static java.lang.String |
LAST_TAB
ID used to save/restore the last visible tab between sessions.
|
private static java.lang.String |
LOCAL_HELP_TARGET
Help target for the local servers.
|
private javax.swing.JTable |
localTable |
private static org.slf4j.Logger |
logger
Pretty typical logger object.
|
private javax.swing.Icon |
mctable
Icon for datasets that originate from a MCTABLE.TXT.
|
private javax.swing.JButton |
newLocalButton |
private javax.swing.JButton |
newRemoteButton |
private javax.swing.JButton |
okButton |
private static int |
POOL
Size of the ADDE entry verification thread pool.
|
private static java.lang.String |
REMOTE_HELP_TARGET
Help target for the remote servers.
|
private javax.swing.JTable |
remoteTable |
private javax.swing.JButton |
removeLocalButton |
private javax.swing.JMenuItem |
removeMenuItem |
private javax.swing.JButton |
removeRemoteButton |
private java.util.List<LocalAddeEntry> |
selectedLocalEntries |
private java.util.List<RemoteAddeEntry> |
selectedRemoteEntries |
private EntryStore |
serverManager
Reference to the actual server manager.
|
private static TabbedAddeManager |
staticTabbedManager
Static reference to an instance of this class.
|
private javax.swing.JLabel |
statusLabel |
private javax.swing.Icon |
system
Icon for datasets that are part of a default McIDAS-V install.
|
private javax.swing.JTabbedPane |
tabbedPane |
private javax.swing.Icon |
unverified
Icon for datasets that have not been verified.
|
private javax.swing.Icon |
user
Icon for datasets that the user has provided.
|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
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
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
TabbedAddeManager()
Creates a standalone server manager GUI.
|
TabbedAddeManager(EntryStore entryStore)
Creates a server manager GUI that's linked back to the rest of McIDAS-V.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<RemoteAddeEntry> |
checkDatasets(java.util.Collection<RemoteAddeEntry> entries) |
void |
closeManager()
Closes and disposes (if needed) the GUI.
|
private void |
formWindowClosed(java.awt.event.WindowEvent evt)
Handles the user closing the server manager GUI.
|
private java.lang.String |
getLastImportPath()
Returns the directory that contained the most recently imported MCTABLE.TXT.
|
private int |
getLastTab()
Returns the index of the user's last server manager tab.
|
private java.util.List<LocalAddeEntry> |
getSelectedLocalEntries()
Gets the selected local ADDE entries.
|
private java.util.List<RemoteAddeEntry> |
getSelectedRemoteEntries()
Gets the selected remote ADDE entries.
|
private LocalAddeEntry |
getSingleLocalSelection()
If there is a single local dataset selected, this method will return that
dataset.
|
static TabbedAddeManager |
getTabbedManager()
Returns an instance of this class.
|
private void |
handleTabStateChanged(javax.swing.event.ChangeEvent event)
Respond to changes in
tabbedPane ; primarily switching tabs. |
void |
handleUrlImportMenuItem(java.awt.event.ActionEvent e) |
private boolean |
hasLocalSelection()
Checks to see if
selectedLocalEntries contains any
LocalAddeEntry s. |
private boolean |
hasRemoteSelection()
Checks to see if
selectedRemoteEntries contains any
RemoteAddeEntry s. |
private boolean |
hasSingleLocalSelection()
Checks to see if the user has select a single local dataset.
|
private boolean |
hasSingleRemoteSelection()
Checks to see if the user has select a single remote dataset.
|
private static javax.swing.Icon |
icon(java.lang.String path)
Construct an
Icon object using the image at the specified
path . |
private void |
importButtonActionPerformed(java.awt.event.ActionEvent evt) |
void |
importMctable(java.lang.String path,
java.lang.String username,
java.lang.String project)
Extracts datasets from a given MCTABLE.TXT and adds them to the server
manager.
|
void |
initComponents()
Builds the server manager GUI.
|
private void |
localSelectionModelChanged(javax.swing.event.ListSelectionEvent e)
Respond to events from the local dataset table.
|
static void |
main(java.lang.String[] args)
Launch the application.
|
private javax.swing.JPanel |
makeFileChooserAccessory() |
void |
mcservUpdated(AddeThread.McservEvent event)
Responds to local server events and attempts to update the GUI status
message.
|
void |
refreshDisplay()
Attempts to refresh the contents of both the local and remote dataset
tables.
|
private void |
remoteSelectionModelChanged(javax.swing.event.ListSelectionEvent e)
Respond to events.
|
void |
removeLocalEntries(java.util.Collection<LocalAddeEntry> entries)
Removes the given local ADDE entries from the server manager GUI.
|
void |
removeRemoteEntries(java.util.Collection<RemoteAddeEntry> entries)
Removes the given remote ADDE entries from the server manager GUI.
|
private void |
setLastImportPath(java.lang.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(java.util.Collection<LocalAddeEntry> entries)
Corresponds to the selected local ADDE entries in the GUI.
|
private void |
setSelectedRemoteEntries(java.util.Collection<RemoteAddeEntry> entries)
Corresponds to the selected remote ADDE entries in the GUI.
|
void |
showLocalEditor()
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 from
entry . |
void |
showManager()
If the GUI isn't shown, this method will display things.
|
void |
showRemoteEditor()
Create and show the GUI the remote ADDE dataset GUI.
|
void |
showRemoteEditor(java.util.List<RemoteAddeEntry> entries)
Create and show the GUI the remote ADDE dataset GUI.
|
void |
startLocalServers()
Attempts to start the local servers.
|
void |
stopLocalServers()
Attempts to stop the local servers.
|
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
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
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
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
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, 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, 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, transferFocusUpCycle
private static final org.slf4j.Logger logger
private static final java.lang.String HELP_TOP_DIR
private static final java.lang.String REMOTE_HELP_TARGET
private static final java.lang.String LOCAL_HELP_TARGET
private static final java.lang.String LAST_TAB
private static final java.lang.String LAST_IMPORTED
private static final int POOL
private static TabbedAddeManager staticTabbedManager
private final EntryStore serverManager
private final java.util.List<RemoteAddeEntry> selectedRemoteEntries
private final java.util.List<LocalAddeEntry> selectedLocalEntries
private javax.swing.JTextField importUser
private javax.swing.JTextField importProject
private boolean guiInitialized
initComponents()
has been called.private javax.swing.JPanel contentPane
private javax.swing.JTable remoteTable
private javax.swing.JTable localTable
private javax.swing.JTabbedPane tabbedPane
private javax.swing.JLabel statusLabel
private javax.swing.JButton newRemoteButton
private javax.swing.JButton editRemoteButton
private javax.swing.JButton removeRemoteButton
private javax.swing.JButton importRemoteButton
private javax.swing.JButton newLocalButton
private javax.swing.JButton editLocalButton
private javax.swing.JButton removeLocalButton
private javax.swing.JButton okButton
private javax.swing.JMenuItem editMenuItem
private javax.swing.JMenuItem removeMenuItem
private javax.swing.JCheckBox importAccountBox
private javax.swing.Icon system
private javax.swing.Icon mctable
private javax.swing.Icon user
private javax.swing.Icon invalid
private javax.swing.Icon unverified
public TabbedAddeManager()
public TabbedAddeManager(EntryStore entryStore)
entryStore
- Server manager reference.java.lang.NullPointerException
- if entryStore
is null
.public static TabbedAddeManager getTabbedManager()
null
.public void showManager()
This method publishes TabbedAddeManager.Event.SHOWN
.
public void closeManager()
public void refreshDisplay()
public void showRemoteEditor()
RemoteAddeEntries
have been provided, none of
the fields will be prefilled (user is creating a new dataset).public void showRemoteEditor(java.util.List<RemoteAddeEntry> entries)
RemoteAddeEntries
have been provided, all of the
applicable fields will be filled (user is editing an existing dataset).entries
- Selection to edit. Should not be null
.public void removeRemoteEntries(java.util.Collection<RemoteAddeEntry> entries)
entries
- Entries to remove. null
is permissible, but is a
"no-op".public void showLocalEditor()
public void showLocalEditor(LocalAddeEntry entry)
entry
. This is intended to
handle "editing" a local ADDE dataset.entry
- Entry to edit; should not be null
.public void removeLocalEntries(java.util.Collection<LocalAddeEntry> entries)
entries
- Entries to remove. null
is permissible, but is a
"no-op".public void importMctable(java.lang.String path, java.lang.String username, java.lang.String project)
path
- Path to the MCTABLE.TXT. Cannot be null
.username
- ADDE username to use for verifying extracted datasets.
Cannot be null
.project
- ADDE project number to use for verifying extracted
datasets. Cannot be null
.public void startLocalServers()
EntryStore.startLocalServer()
public void stopLocalServers()
EntryStore.stopLocalServer()
public void mcservUpdated(AddeThread.McservEvent event)
event
- Local server event. Should not be null
.public void handleUrlImportMenuItem(java.awt.event.ActionEvent e)
public void initComponents()
private void handleTabStateChanged(javax.swing.event.ChangeEvent event)
tabbedPane
; primarily switching tabs.event
- Event being handled. Ignored for now.private void remoteSelectionModelChanged(javax.swing.event.ListSelectionEvent e)
e
- ListSelectionEvent
that necessitated this call.private void localSelectionModelChanged(javax.swing.event.ListSelectionEvent e)
e
- ListSelectionEvent
that necessitated this call.private boolean hasRemoteSelection()
selectedRemoteEntries
contains any
RemoteAddeEntry
s.RemoteAddeEntry
values are selected.private boolean hasLocalSelection()
selectedLocalEntries
contains any
LocalAddeEntry
s.LocalAddeEntry
values are selected.private boolean hasSingleRemoteSelection()
true
if there is a single remote dataset selected.
false
otherwise.private boolean hasSingleLocalSelection()
true
if there is a single local dataset selected. false
otherwise.private LocalAddeEntry getSingleLocalSelection()
LocalAddeEntry.INVALID_ENTRY
.private void setSelectedRemoteEntries(java.util.Collection<RemoteAddeEntry> entries)
entries
- Should not be null
.private java.util.List<RemoteAddeEntry> getSelectedRemoteEntries()
private void setSelectedLocalEntries(java.util.Collection<LocalAddeEntry> entries)
entries
- Should not be null
.private java.util.List<LocalAddeEntry> getSelectedLocalEntries()
private void formWindowClosed(java.awt.event.WindowEvent evt)
evt
- Event that triggered this method call. Currently ignored.closeManager()
private javax.swing.JPanel makeFileChooserAccessory()
private void importButtonActionPerformed(java.awt.event.ActionEvent evt)
private java.lang.String getLastImportPath()
String
.private void setLastImportPath(java.lang.String path)
path
- Path to the most recently imported MCTABLE.TXT file.
null
values are replaced with an empty String
.private int getLastTab()
0
.private void setLastTab(int index)
index
- Index of the user's most recently viewed server manager tab.public java.util.Set<RemoteAddeEntry> checkDatasets(java.util.Collection<RemoteAddeEntry> entries)
private static javax.swing.Icon icon(java.lang.String path)
Icon
object using the image at the specified
path
.path
- Path to image to use as an icon. Should not be null
.public static void main(java.lang.String[] args)
args
- Command line arguments. These are currently ignored.