Package jmri

Class Application


  • public class Application
    extends java.lang.Object
    A lightweight class that provides a methods to retrieve the current JMRI application name and icon.

    The current name is set when a given JMRI application is launched.


    This file is part of JMRI.

    JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

    JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

    • Constructor Summary

      Constructors 
      Constructor Description
      Application()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getApplicationName()
      Return the current JMRI application name.
      static java.lang.String getLogo()
      Return the current JMRI application logo path.
      static java.lang.String getURL()  
      static void setApplicationName​(java.lang.String applicationName)
      Set the current JMRI application name.
      static void setLogo​(java.lang.String logo)
      Set the current JMRI application logo path.
      static void setURL​(java.lang.String URL)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getApplicationName

        public static java.lang.String getApplicationName()
        Return the current JMRI application name.
        Returns:
        String containing JMRI application name or "JMRI" if name has not been set.
      • setApplicationName

        public static void setApplicationName​(java.lang.String applicationName)
                                       throws java.lang.IllegalAccessException,
                                              java.lang.IllegalArgumentException
        Set the current JMRI application name.
        Parameters:
        applicationName - String containing the JMRI application name
        Throws:
        java.lang.IllegalAccessException - if attempting to modify once set
        java.lang.IllegalArgumentException - if a null name passed
      • getLogo

        public static java.lang.String getLogo()
        Return the current JMRI application logo path. This path is relative to the JMRI application installation path. If the application does not have its own icon, return the JMRI default icon.
        Returns:
        String containing the application icon path
      • setLogo

        public static void setLogo​(java.lang.String logo)
        Set the current JMRI application logo path.
        Parameters:
        logo - String with the relative path to the JMRI application icon
      • getURL

        public static java.lang.String getURL()
        Returns:
        the URL
      • setURL

        public static void setURL​(java.lang.String URL)
        Parameters:
        URL - the URL to set