|
||||||||||
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.Frame
javax.swing.JFrame
edu.wisc.ssec.mcidasv.servermanager.TabbedAddeManager
public class TabbedAddeManager
This class is the GUI frontend to EntryStore
(the server manager).
It allows users to manipulate their local and remote ADDE data.
Nested Class Summary | |
---|---|
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
|
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 |
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 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 the 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. |
Fields inherited from class javax.swing.JFrame |
---|
accessibleContext, EXIT_ON_CLOSE, 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 javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
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)
|
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. |
Methods inherited from class java.awt.Frame |
---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
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 Detail |
---|
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 JButton okButton
private JMenuItem editMenuItem
private JMenuItem removeMenuItem
private JCheckBox importAccountBox
private Icon system
private Icon mctable
private Icon user
private Icon invalid
private Icon unverified
Constructor Detail |
---|
public TabbedAddeManager()
public TabbedAddeManager(EntryStore entryStore)
entryStore
- Server manager reference.
NullPointerException
- if entryStore
is null
.Method Detail |
---|
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
handled "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 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.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)
path
-
public static void main(String[] args)
args
- Command line arguments. These are currently ignored.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |