Class MenuApplication

  • Direct Known Subclasses:
    BCVTBApplication, CapeCodeApplication, CyPhySimApplication, DSPApplication, FullApplication, HyVisualApplication, PtinyApplication, PtinyKeplerApplication, 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$
    Author:
    Christopher Hylands
    See Also:
    VergilApplication
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Constructor Summary

      Constructors 
      Constructor Description
      MenuApplication()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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()