|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
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.umd.cfar.lamp.apploader.AppLoader
A module loader uses the module rdf format to set up its menus and loads modules as beans in seperate windows. It extends JFrame, providing the main menu. The menu contains all the items specified in the preferences as attached to lal:Core, the uri for the running instance of this bean. See the AppLoader owl schema for more information.
Nested Class Summary |
Nested classes inherited from class javax.swing.JFrame |
javax.swing.JFrame.AccessibleJFrame |
Nested classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
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 | |
AppLoader(PrefsManager prefs)
Create a new application window for the application described in the referenced preferences. |
Method Summary | |
static java.lang.Class |
box(java.lang.Class primitive)
Get the box class for a primitive type. |
static java.lang.Object[] |
checkMethod(java.lang.reflect.Method meth,
java.lang.Object val)
Checks that the method can take the given parameter. |
edu.umd.cfar.lamp.apploader.Actionator |
getActionForResource(com.hp.hpl.jena.rdf.model.Resource r)
Assuming r describes an action, gets the action it
describes. |
java.lang.Object |
getBean(java.lang.String uri)
Gets a non-anonymous application bean by URI. |
java.awt.event.ActionListener |
getExitListener()
Gets a listener for the exit action. |
HotkeyProcessor |
getHotkeyManager()
|
java.awt.Image |
getIconFor(com.hp.hpl.jena.rdf.model.Resource beanR)
If the provided bean/resource has an LAL.icon specified, this finds it, and returns it as a java image. |
java.lang.String |
getLabelFor(com.hp.hpl.jena.rdf.model.Resource beanR)
Gets the localized label for the resource. |
java.lang.Object |
getLoadedBeanForResource(com.hp.hpl.jena.rdf.model.Resource r)
Gets an application bean that has already been loaded. |
java.util.logging.Logger |
getLogger()
Gets the java logger associated with this application's core bean. |
PrefsManager |
getPrefs()
Get the preferences for the application |
com.hp.hpl.jena.rdf.model.Resource |
getResourceForBean(java.lang.Object bean)
Gets the resource for the given application bean, if it has been loaded. |
java.awt.event.ActionListener |
getShowWindowActionListener()
A ShowWindowAction tells the apploader to display a bean (its uri is passed as the command) in a JFrame, or bring it to the front if it already loaded in a JFrame. |
AttemptToPerformAction |
getVetoCloseAction()
Gets the action that is currently invoked when the user tries to close the main frame. |
static boolean |
getWindowModified(javax.swing.JComponent jc)
Gets the 'window modified' property of the given Swing component. |
void |
initializeBeanFromResource(java.lang.Object bean,
java.lang.Object parent,
com.hp.hpl.jena.rdf.model.Resource r)
Initializes bean in parent context. |
void |
initializeBeanFromResource(com.hp.hpl.jena.rdf.model.Resource r)
Initialize the bean specified by the resource. |
static boolean |
isMac()
Determines if the application is running on a Macintosh. |
java.lang.Object |
loadBeanFromResource(com.hp.hpl.jena.rdf.model.Resource r)
Load a bean from its resource. |
static java.lang.Object |
loadObjectFromName(java.lang.String name)
Construct a new instance of the Class referenced by the referenced java name. |
static void |
main(java.lang.String[] args)
Creates a new AppLoader and initializes it. |
static boolean |
ofType(java.lang.Class type,
java.lang.Object val)
Checks to see that the object is assignable from the given type. |
java.lang.Object |
rdfNodeToValue(com.hp.hpl.jena.rdf.model.RDFNode propVal)
Gets the java value represented by the RDFNode. |
java.lang.Object |
rdfNodeToValue(com.hp.hpl.jena.rdf.model.RDFNode propVal,
java.lang.Object parent)
Gets the java value represented by the RDFNode. |
void |
setLoadedBean(com.hp.hpl.jena.rdf.model.Resource r,
java.lang.Object bean)
Adds the given object to the list of loaded beans with the given URI. |
void |
setPrefs(PrefsManager prefs)
Sets the prefs. |
static void |
setProperty(java.lang.Object bean,
java.lang.String prop,
java.lang.Object val)
Set a property on a bean using the javabeans patterns. |
void |
setVetoCloseAction(AttemptToPerformAction vetoCloseAction)
Sets action handler to be invoked when the user tries to close the main window. |
void |
setWindowDocumentTitle(com.hp.hpl.jena.rdf.model.Resource r,
java.lang.String docTitle)
Sets the title of the document window to reflect the name of the document. |
void |
setWindowModified(com.hp.hpl.jena.rdf.model.Resource r,
boolean val)
Sets the windowModified field of the given frame. |
void |
shutdown()
Exit the system, executing the appropriate shut down actions. |
static java.net.URI |
string2uri(java.lang.String fname)
Converts a string to a URI. |
static java.lang.String |
toBeanGet(java.lang.String propName)
Returns the method name for the getter of the given property. |
static java.lang.String |
toBeanIs(java.lang.String propName)
Returns the method name for the getter for boolean properties, aka the 'izzer'. |
static java.lang.String |
toBeanSet(java.lang.String propName)
Returns the method name for the setter of the given property. |
Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront |
Methods 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, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods 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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, 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, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
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 |
Constructor Detail |
public AppLoader(PrefsManager prefs) throws com.hp.hpl.jena.rdf.model.RDFException, PreferenceException
prefs
- Preferences (RDF Triples) that describes an application using
the apploader schemata
com.hp.hpl.jena.rdf.model.RDFException
- Something is wrong with the graph
PreferenceException
- Something is wrong with the graph's semanticsMethod Detail |
public java.lang.Object getBean(java.lang.String uri)
uri
- the identifier of the bean to extract
java.lang.IllegalArgumentException
- if the bean is not
found, the identifier is not valid, or there is some
error while loading the bean from the preference datapublic java.lang.Object rdfNodeToValue(com.hp.hpl.jena.rdf.model.RDFNode propVal) throws PreferenceException
propVal
- An RDFNode to convert
PreferenceException
com.hp.hpl.jena.rdf.model.RDFException
public java.lang.Object rdfNodeToValue(com.hp.hpl.jena.rdf.model.RDFNode propVal, java.lang.Object parent) throws PreferenceException
propVal
- The node to convert/interpret/find.parent
- The context for the node; if it is a property value without a
lal:propertyOf link, it assumes it is a property of this.
PreferenceException
com.hp.hpl.jena.rdf.model.RDFException
public static java.lang.Object loadObjectFromName(java.lang.String name) throws PreferenceException
name
- the name of the object to create
PreferenceException
- When the object couldn't be constructed for one reason or
another, e.g. the named class can't be found or it doesn't
have a no-arg constructorpublic java.lang.Object loadBeanFromResource(com.hp.hpl.jena.rdf.model.Resource r) throws PreferenceException
r
- The model node to reference f or construction.
PreferenceException
public java.lang.Object getLoadedBeanForResource(com.hp.hpl.jena.rdf.model.Resource r)
r
- The resource describing the bean
public void setLoadedBean(com.hp.hpl.jena.rdf.model.Resource r, java.lang.Object bean)
r
- bean
- public com.hp.hpl.jena.rdf.model.Resource getResourceForBean(java.lang.Object bean)
bean
- The bean whose URI to find
null
, otherwisepublic void initializeBeanFromResource(com.hp.hpl.jena.rdf.model.Resource r) throws PreferenceException
r
- The description of the bean to initialize.
PreferenceException
public void initializeBeanFromResource(java.lang.Object bean, java.lang.Object parent, com.hp.hpl.jena.rdf.model.Resource r) throws PreferenceException
bean
- The object described by r that you wish to initializeparent
- The parent for the beanr
- The description of the bean to initialize.
PreferenceException
public java.lang.String getLabelFor(com.hp.hpl.jena.rdf.model.Resource beanR)
beanR
- The first RDFS.label for the resource found in the closest
language to the user'
public java.awt.Image getIconFor(com.hp.hpl.jena.rdf.model.Resource beanR)
beanR
- The bean to check
null
public static java.lang.String toBeanSet(java.lang.String propName)
propName
- The java name of the property
setProp
public static java.lang.String toBeanGet(java.lang.String propName)
getprop
and isprop
.
propName
- The java name of the property
getProp
public static java.lang.String toBeanIs(java.lang.String propName)
getprop
and isprop
.
propName
- The java name of the property
isProp
public java.awt.event.ActionListener getShowWindowActionListener()
public void shutdown()
public java.awt.event.ActionListener getExitListener()
public static void main(java.lang.String[] args) throws java.io.IOException, com.hp.hpl.jena.rdf.model.RDFException, PreferenceException
args
- interpreted as triggers and flags specified in the preferences
java.io.IOException
com.hp.hpl.jena.rdf.model.RDFException
PreferenceException
public PrefsManager getPrefs()
public void setPrefs(PrefsManager prefs)
prefs
- The prefs to setpublic static void setProperty(java.lang.Object bean, java.lang.String prop, java.lang.Object val) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
bean
- The instance to modify.prop
- The name of the property to setval
- The new value of the property
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public static boolean ofType(java.lang.Class type, java.lang.Object val)
Class.isAssignableFrom
, this also works for transfering
between the boxed types and the primatives (e.g. Integer and int).
type
- val
-
public static java.lang.Class box(java.lang.Class primitive)
int
type, this returns Integer.class
primitive
- The primitive type. If not a primitive, this returns
null
public static java.lang.Object[] checkMethod(java.lang.reflect.Method meth, java.lang.Object val)
meth
- The method to check.val
- The value to pass, or list of values for a multi-arg method
null
public static java.net.URI string2uri(java.lang.String fname)
fname
- The String to convert to a URI
public edu.umd.cfar.lamp.apploader.Actionator getActionForResource(com.hp.hpl.jena.rdf.model.Resource r)
r
describes an action, gets the action it
describes.
r
- The description of an action to take
java.lang.IllegalArgumentException
- When the resource doesn't describe an understandable actionpublic AttemptToPerformAction getVetoCloseAction()
public void setVetoCloseAction(AttemptToPerformAction vetoCloseAction)
vetoCloseAction
- The vetoCloseAction to setpublic static boolean isMac()
true
if the application is running on a
mac.public void setWindowDocumentTitle(com.hp.hpl.jena.rdf.model.Resource r, java.lang.String docTitle)
r
- the bean to retitledocTitle
- the title of the edited documentpublic void setWindowModified(com.hp.hpl.jena.rdf.model.Resource r, boolean val)
r
- the bean to mark as modified/unmodifiedval
- true
if the bean's contents have been modified
since the last save pointpublic static boolean getWindowModified(javax.swing.JComponent jc)
jc
- the swing component to check
true
when the windowModified
property is set to true
public java.util.logging.Logger getLogger()
public HotkeyProcessor getHotkeyManager()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |