|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Frame | +--javax.swing.JFrame | +--edu.ucsb.nceas.morpho.framework.ClientFramework
The ClientFramework is the main entry point for the Morpho application. It creates the main application frame and sets up the menus and toolbars for the application. The framework also provides a mechanism for "plugins" to add menus, toolbars, and services to the application. These plugins are dynamically loaded at runtime. Plugins are classes that implement the "PluginInterface" interface.
Inner classes inherited from class javax.swing.JFrame |
javax.swing.JFrame.AccessibleJFrame |
Inner classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
Inner classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
static java.lang.String |
SEPARATOR_FOLLOWING
|
static java.lang.String |
SEPARATOR_PRECEDING
Constant to indicate a spearator should precede an action |
static java.lang.String |
VERSION
The version of this release of Morpho |
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, 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 | |
ClientFramework(ConfigXML config)
Creates a new instance of ClientFramework |
|
ClientFramework(java.lang.String sTitle,
ConfigXML config)
Creates a new instance of ClientFramework with the given title. |
Method Summary | |
void |
addConnectionListener(ConnectionListener listener)
This method is called by plugins to register a listener for changes in the Connection status. |
void |
addMenu(java.lang.String menuName,
java.lang.Integer menuPosition)
This method is called by plugins to register a menu that the plugin wants created, but that currently has no items. |
void |
addMenu(java.lang.String menuName,
java.lang.Integer menuPosition,
javax.swing.Action[] menuActions)
This method is called by plugins to register a menu and its associated Actions. |
void |
addNotify()
Notifies this component that it has been added to a container This method should be called by Container.add , and
not by user code directly. |
void |
addService(java.lang.Class serviceInterface,
ServiceProvider provider)
This method is called by plugins to register a particular service that the plugin can perform. |
void |
addToolbarActions(javax.swing.Action[] toolbarActions)
This method is called by plugins to register a toolbar Action. |
void |
addWindow(javax.swing.JFrame window)
This method is called by plugins to register a Window that the plugin has created. |
boolean |
checkForService(java.lang.Class serviceInterface)
This method is called by plugins to determine if a particular service has been registered and is available. |
void |
checkJavaVersion()
|
static void |
debug(int severity,
java.lang.String message)
Print debugging messages based on severity level, where severity level 1 are the most critical and higher numbers are more trivial messages. |
ConfigXML |
getConfiguration()
Get the configuration object associated with the framework. |
boolean |
getJavaVersionFlag()
returns true if the JVM version is 1.3 or greater |
java.io.InputStream |
getMetacatInputStream(java.util.Properties prop)
Send a request to Metacat |
java.io.InputStream |
getMetacatInputStream(java.util.Properties prop,
boolean requiresLogin)
Send a request to Metacat |
java.lang.String |
getMetacatString(java.util.Properties prop)
Send a request to Metacat |
java.lang.String |
getMetacatString(java.util.Properties prop,
boolean requiresLogin)
Send a request to Metacat |
java.lang.String |
getPassword()
get password associated with this framework |
ConfigXML |
getProfile()
Get the profile for the currently logged in user. |
ServiceProvider |
getServiceProvider(java.lang.Class serviceInterface)
This method is called by plugins to get a reference to an object that implements a particular interface |
java.lang.String |
getSessionCookie()
|
java.util.Vector |
getTaxonSynonyms(java.lang.String taxonName)
Look up the synonyms of a taxon from ITIS, and return the list of names |
java.lang.String |
getUserName()
Get the username associated with this framework |
boolean |
isConnected()
Determines if the framework has a valid login |
boolean |
logIn()
Log into metacat |
void |
logOut()
Log out of metacat |
void |
logOutExit()
Log out of metacat when exiting |
static void |
main(java.lang.String[] args)
The entry point for this application. |
void |
removeMenuItem(java.lang.String menuName,
int index)
This method is called by plugins to remove a menu item from a menu based on the index of the menu item. |
void |
removeWindow(javax.swing.JFrame window)
This method is called by plugins to de-register a Window that the plugin has created. |
java.io.InputStream |
sendDataFile(java.lang.String id,
java.io.File file)
sends a data file to the metacat using "multipart/form-data" encoding |
void |
setMainContentPane(java.awt.Component comp)
Set the content pane of the main Morpho window to display the component indicated. |
void |
setPassword(java.lang.String pword)
Set the password associated with this framework |
void |
setProfile(ConfigXML newProfile)
Set the profile for the currently logged in user (on startup, or when switching profiles). |
void |
setProfile(java.lang.String newProfileName)
Set the profile associated with this framework based on its name |
void |
setUserName(java.lang.String uname)
Set the username associated with this framework |
Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, isResizable, remove, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle |
Methods inherited from class java.awt.Window |
addWindowListener, applyResourceBundle, applyResourceBundle, dispose, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isShowing, pack, postEvent, processEvent, removeWindowListener, setCursor, show, toBack, toFront |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFont, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, 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, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Field Detail |
public static java.lang.String VERSION
public static java.lang.String SEPARATOR_PRECEDING
public static java.lang.String SEPARATOR_FOLLOWING
Constructor Detail |
public ClientFramework(java.lang.String sTitle, ConfigXML config)
sTitle
- the title for the new frame.#JFrame1()
public ClientFramework(ConfigXML config)
#JFrame1()
Method Detail |
public void setMainContentPane(java.awt.Component comp)
comp
- the component to displaypublic void addMenu(java.lang.String menuName, java.lang.Integer menuPosition)
menuName
- the name of the menu to be added to the frameworkmenuPosition
- the position of the menu to be added to the frameworkpublic void addMenu(java.lang.String menuName, java.lang.Integer menuPosition, javax.swing.Action[] menuActions)
menuName
- the name of the menu to which to add the actionmenuPosition
- the position of the menu on the menu barmenuActions
- an array of Actions to be added to the menupublic void removeMenuItem(java.lang.String menuName, int index)
menuName
- the name of the menu from which to remove the itemindex
- the position of the menu item to removepublic void addToolbarActions(javax.swing.Action[] toolbarActions)
toolbarActions
- an array of Actions to be added to the toolbarpublic void addWindow(javax.swing.JFrame window)
window
- the window to be added to the frameworkpublic void removeWindow(javax.swing.JFrame window)
window
- the window to be removed from the frameworkpublic void addService(java.lang.Class serviceInterface, ServiceProvider provider) throws ServiceExistsException
serviceInterface
- the interface representing this serviceprovider
- a reference to the object providing the serviceServiceExistsException
- public boolean checkForService(java.lang.Class serviceInterface)
serviceInterface
- the service interface desiredpublic ServiceProvider getServiceProvider(java.lang.Class serviceInterface) throws ServiceNotHandledException
serviceInterface
- the service interface desiredpublic void addNotify()
Container.add
, and
not by user code directly.
Overridden here to adjust the size of the frame if needed.addNotify
in class java.awt.Frame
Container.removeNotify()
public java.io.InputStream getMetacatInputStream(java.util.Properties prop, boolean requiresLogin)
prop
- the properties to be sent to MetacatrequiresLogin
- indicates whether a valid connection is required
for the operationpublic java.io.InputStream sendDataFile(java.lang.String id, java.io.File file)
id
- the id to assign to the file on metacat (e.g., knb.1.1)file
- the file to sendpublic java.lang.String getSessionCookie()
public java.io.InputStream getMetacatInputStream(java.util.Properties prop)
prop
- the properties to be sent to Metacatpublic java.lang.String getMetacatString(java.util.Properties prop, boolean requiresLogin)
prop
- the properties to be sent to MetacatrequiresLogin
- indicates whether a valid connection is required
for the operationpublic java.lang.String getMetacatString(java.util.Properties prop)
prop
- the properties to be sent to Metacatpublic boolean logIn()
public void logOut()
public void logOutExit()
public void setUserName(java.lang.String uname)
the
- new username for the frameworkpublic java.lang.String getUserName()
public void setPassword(java.lang.String pword)
the
- new password for the frameworkpublic java.lang.String getPassword()
public boolean isConnected()
public void addConnectionListener(ConnectionListener listener)
listener
- a reference to the object to be notified of changesServiceExistsException
- public ConfigXML getConfiguration()
public ConfigXML getProfile()
public void setProfile(ConfigXML newProfile)
newProfile
- the profile objectpublic void setProfile(java.lang.String newProfileName)
newProfileName
- the name of the new profile for the frameworkpublic java.util.Vector getTaxonSynonyms(java.lang.String taxonName)
taxonName
- public static void debug(int severity, java.lang.String message)
severity
- the severity of the debug messagemessage
- the message to logpublic static void main(java.lang.String[] args)
public void checkJavaVersion()
public boolean getJavaVersionFlag()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |