ptolemy.actor.gui.jnlp
Class MenuApplication

java.lang.Object
  extended by ptolemy.actor.gui.jnlp.MenuApplication
Direct Known Subclasses:
DSPApplication, FullApplication, HyVisualApplication, JNLPApplication, PtinyApplication, PtinySandboxApplication, SpaceApplication, VisualSenseApplication

public class MenuApplication
extends java.lang.Object

A wrapper that starts up Vergil from a menu.

MenuApplication is primarily for use with the Java Network Launching Protocol (JNLP) aka Web Start, but it can be used with any system that invokes applications via a menu choice such as the InstallAnywhere lax tool.

If MenuApplication detects that it was invoked from a menu, then it sets the current directory to the value of user's home directory so that when the user opens a file chooser to safe a file then the initial default directory is the user's home directory instead of the application directory

The security manager is set to null for two reasons:

  1. Get rid of the following message when we open the file browser:
    "There is no disk in the drive. Please insert a disk into drive A" with the standard Abort/Retry/Ignore buttons. See: http://forum.java.sun.com/thread.jsp?forum=38&thread=71610
  2. Speed things up, see http://forums.java.sun.com/thread.jsp?forum=38&thread=134393

Note that in Web Start 1.0.1, it is necessary to sign the application if it is to have access to the local disk etc. The way that this is handled is that the .jnlp file that defines the application is copied to the .jar file that defines the main() method for the application and the .jar file is signed. Unfortunately, this means that two Web Start applications cannot share one jar file, so we create wrappers that call the appropriate main method.

For more information about JNLP, see $PTII/mk/jnlp.in.

Each JNLP Application should extend MenuApplication and simply have its main() call this main(). The makefile will need to be extended to create a jar file that includes

 MenuApplication.class
 FooApplication.class
 

Since:
Ptolemy II 2.0
Version:
$Id: MenuApplication.java 57046 2010-01-27 23:35:53Z cxh $
Author:
Christopher Hylands
See Also:
VergilApplication
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (cxh)

Constructor Summary
MenuApplication()
           
 
Method Summary
private static boolean _invokedFromAMenu()
           
static void main(java.lang.String[] args)
          Main method that sets user.dir as necessary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuApplication

public MenuApplication()
Method Detail

main

public static void main(java.lang.String[] args)
Main method that sets user.dir as necessary.

Parameters:
args - Arguments to be passed on to VergilApplication.main()

_invokedFromAMenu

private static boolean _invokedFromAMenu()