public class TabbedAddeManager extends 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 |
JFrame.AccessibleJFrame
Frame.AccessibleAWTFrame
Window.AccessibleAWTWindow, Window.Type
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
private JPanel |
contentPane |
private JButton |
editLocalButton |
private JMenuItem |
editMenuItem |
private JButton |
editRemoteButton |
private boolean |
guiInitialized
Whether or not
initComponents() has been called. |
private static String |
HELP_TOP_DIR
Path to the help resources.
|
private JCheckBox |
importAccountBox |
private JTextField |
importProject |
private JButton |
importRemoteButton |
private JTextField |
importUser |
private Icon |
invalid
Icon for invalid datasets.
|
private static String |
LAST_IMPORTED
ID used to save/restore last directory that contained a MCTABLE.TXT.
|
private static String |
LAST_TAB
ID used to save/restore the last visible tab between sessions.
|
private static String |
LOCAL_HELP_TARGET
Help target for the local servers.
|
private JTable |
localTable |
private static org.slf4j.Logger |
logger
Pretty typical logger object.
|
private Icon |
mctable
Icon for datasets that originate from a MCTABLE.TXT.
|
private JButton |
newLocalButton |
private JButton |
newRemoteButton |
private JButton |
okButton |
private static int |
POOL
Size of the ADDE entry verification thread pool.
|
private static String |
REMOTE_HELP_TARGET
Help target for the remote servers.
|
private JTable |
remoteTable |
private JButton |
removeLocalButton |
private JMenuItem |
removeMenuItem |
private JButton |
removeRemoteButton |
private List<LocalAddeEntry> |
selectedLocalEntries |
private 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 JLabel |
statusLabel |
private Icon |
system
Icon for datasets that are part of a default McIDAS-V install.
|
private JTabbedPane |
tabbedPane |
private Icon |
unverified
Icon for datasets that have not been verified.
|
private 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
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
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 |
---|---|
Set<RemoteAddeEntry> |
checkDatasets(Collection<RemoteAddeEntry> entries) |
void |
closeManager()
Closes and disposes (if needed) the GUI.
|
private void |
formWindowClosed(WindowEvent evt)
Handles the user closing the server manager GUI.
|
private 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 List<LocalAddeEntry> |
getSelectedLocalEntries()
Gets the selected local ADDE entries.
|
private 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(ChangeEvent event)
Respond to changes in
tabbedPane ; primarily switching tabs. |
void |
handleUrlImportMenuItem(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 Icon |
icon(String path)
Construct an
Icon object using the image at the specified
path . |
private void |
importButtonActionPerformed(ActionEvent evt) |
void |
importMctable(String path,
String username,
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(ListSelectionEvent e)
Respond to events from the local dataset table.
|
static void |
main(String[] args)
Launch the application.
|
private 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(ListSelectionEvent e)
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 |
setSelectedRemoteEntries(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(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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFont, postEvent
private static final org.slf4j.Logger logger
private static final String HELP_TOP_DIR
private static final String REMOTE_HELP_TARGET
private static final String LOCAL_HELP_TARGET
private static final String LAST_TAB
private static final String LAST_IMPORTED
private static final int POOL
private static TabbedAddeManager staticTabbedManager
private final EntryStore serverManager
private final List<RemoteAddeEntry> selectedRemoteEntries
private final List<LocalAddeEntry> selectedLocalEntries
private JTextField importUser
private JTextField importProject
private boolean guiInitialized
initComponents()
has been called.private JPanel contentPane
private JTable remoteTable
private JTable localTable
private JTabbedPane tabbedPane
private JLabel statusLabel
private JButton newRemoteButton
private JButton editRemoteButton
private JButton removeRemoteButton
private JButton importRemoteButton
private JButton newLocalButton
private JButton editLocalButton
private JButton removeLocalButton
private JMenuItem editMenuItem
private JMenuItem removeMenuItem
private JCheckBox importAccountBox
private Icon unverified
public TabbedAddeManager()
public TabbedAddeManager(EntryStore entryStore)
entryStore
- Server manager reference.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(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(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(Collection<LocalAddeEntry> entries)
entries
- Entries to remove. null
is permissible, but is a
"no-op".public void importMctable(String path, String username, 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(ActionEvent e)
public void initComponents()
private void handleTabStateChanged(ChangeEvent event)
tabbedPane
; primarily switching tabs.event
- Event being handled. Ignored for now.private void remoteSelectionModelChanged(ListSelectionEvent e)
e
- ListSelectionEvent
that necessitated this call.private void localSelectionModelChanged(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(Collection<RemoteAddeEntry> entries)
entries
- Should not be null
.private List<RemoteAddeEntry> getSelectedRemoteEntries()
private void setSelectedLocalEntries(Collection<LocalAddeEntry> entries)
entries
- Should not be null
.private List<LocalAddeEntry> getSelectedLocalEntries()
private void formWindowClosed(WindowEvent evt)
evt
- Event that triggered this method call. Currently ignored.closeManager()
private JPanel makeFileChooserAccessory()
private void importButtonActionPerformed(ActionEvent evt)
private String getLastImportPath()
String
.private void setLastImportPath(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 Set<RemoteAddeEntry> checkDatasets(Collection<RemoteAddeEntry> entries)
private static Icon icon(String path)
Icon
object using the image at the specified
path
.path
- Path to image to use as an icon. Should not be null
.