Skip navigation links
WebARTS Design
Java Library

Version 0.10.2
2020-11-11 (Wed), 10:42:54
ca.bc.webarts

Class MDIApplet

    • Field Detail

      • lineSeperator

        String lineSeperator
        Holds the line separator for the system this applet is running on.
      • fileSeperator

        String fileSeperator
        Holds the file separator for the system this applet is running on.
      • toolkit

        Toolkit toolkit
        The Toolkit object that is used to get some basic system information (ie screen size).
      • iconNamePrefix

        String iconNamePrefix
        String added to the iconNames used to auatomatically create the IconsBar
      • iconNames

        String[] iconNames
        String Tokens used to auatomatically create the IconsBar
      • iconToolTips

        String[] iconToolTips
        String Tokens used to auatomatically create the Icon bar tooltips
      • menuName

        String[] menuName
        String Tokens used to auatomatically create the menu bar
      • menuItemName

        String[][] menuItemName
        String Tokens used to automatically create the menu items for each menu on the menubar. It is a 2D array of strings that will be used to create menuitems. If there are 4 menus... there will be 4 lists holding the words/Strings to use for the menu items.
      • menuItemMnemonic

        char[][] menuItemMnemonic
        The Tokens used to automatically assign the Mnemonic for each menu items. It is a 2D array of chars that will be used to assign the Mnemonic. If there are 4 menus... there will be 4 lists holding the chars to use as the Mnemonic for the menu items.
      • menuItemAccel

        int[][] menuItemAccel
        The Tokens used when automatically assigning the accel key for each menu items. It is a 2D array of ints that will be used to assign the accel key constant. If there are 4 menus... there will be 4 lists holding the ints to use as the accel key constant value for the menu items.
      • menuItemAccel2

        int[][] menuItemAccel2
        The Tokens used when automatically assigning the 2nd level of accel key for each menu items. It is a 2D array of ints that will be used to assign the accel key constant. If there are 4 menus... there will be 4 lists holding the ints to use as the accel key constant value for the menu items.
      • menuToolTip

        String[][] menuToolTip
        String Tokens used to automatically create the menu items tooltip for each menu on the menubar. It is a 2D array of strings that will be used to create menuitems tooltips. If there are 4 menus... there will be 4 lists holding the words/Strings to use for the menu items tooltip.
      • menuItemShown

        static boolean[][] menuItemShown
        boolean Tokens used to enable automatic creation of the menu items for each menu on the menubar. It is a 2D array of booleans each one a flag directly refering to the menu item arrays already setup. If there are 4 menus... there will be 4 lists holding the flags to use. If a value of false is specified the menu item will NOT get created.
      • menuItemEnabled

        static boolean[][] menuItemEnabled
        boolean Tokens used to enable the menu items for each menu on the menubar. It is a 2D array of booleans each one a flag directly refering to the menu item arrays already setup. If there are 4 menus... there will be 4 lists holding the flags to use. If a value of false is specified the menu item will be grayed.
      • menuBar

        private JMenuBar menuBar
        The Applets MenuBar. It gets initialized by the method initMenuBar.
        See Also:
        initMenuBar
      • statBar

        private StatusBar statBar
        A status bar object that lives at the bottom of the Internal Window Desktop to provide useful information regarding the applet.
      • statusSizes

        private double[] statusSizes
        Status bar information variable used with the StatusBar object. It provides the sizes for the different sections of the status bar
        See Also:
        StatusBar
      • statusMsg

        private String[] statusMsg
        Status bar information variable used with the StatusBar object. It provides the initial Strings for the different sections of the status bar
        See Also:
        StatusBar
      • mdiPanel

        private JPanel mdiPanel
        The Applets main internal window desktop panel. A JPanel that will hold desktop that is going into this applet EXCEPT the statusbar and menubar; this is so the status bar is at the bottom of the applet, the menubar stays at the top and everything else is in between. See the start method that sets it all up.
      • myMDIDesktop

        private JLayeredPane myMDIDesktop
        myMDIDesktop is the Multiple Document Desktop that gets placed directly inside the MDIViewPanel JPanel. It will hold all the child windows for this app.
      • appX

        private short appX
        The initial X coordinate for this app/let.
      • appY

        private short appY
        The initial Y coordinate for this app/let.
      • isRunningAsAnApplet

        public static boolean isRunningAsAnApplet
        A flag that indicates if this applet is running as an application.
      • debugOutput

        static boolean debugOutput
        Flag to spew debug output to the screen.
      • userDir

        private static String userDir
        A holder for a string representation of the users starting directory.
      • tempPath

        private static String tempPath
        General variables that are used as counters or temps.
      • mediaURL

        private static String mediaURL
        Strings to hold the retrieved applet parameters. They are initialized to their default values.
      • debug

        private static int debug
        A variable to indicate the level of debug output produced. debug = 0 is OFF debug = 1 is Minimal Output debug = 2 is General Outline of Programs Position debug = 3 is Detailed Object creation and method location debug = 4 is verbose
      • debugParam

        private static int debugParam
        A temp variable that holds the APPLET parameter that might or might not have been specified at runtime. This value (if the user specified a value at Init) gets transfered into debug.
    • Method Detail

      • getAppletInfo

        public String getAppletInfo()
        the method that return the programmers customized information about this applet.
        Overrides:
        getAppletInfo in class Applet
        Returns:
        The AppletInfo value
      • getParameterInfo

        public String[][] getParameterInfo()
        The method that returns the information about the possible applet parameters.
        Overrides:
        getParameterInfo in class Applet
        Returns:
        a table of Strings (String[][]) holding the input param name, type and description
      • isApp

        public boolean isApp()
        Tells if this applet was started as an app via its main method
        Returns:
        The App value
      • isApplet

        public boolean isApplet()
        Tells if this applet was started as an applet directly without going through its main method.
        Returns:
        The Applet value
      • init

        public void init()
        Initializes the Applet. Gets all the initial data read in and set up.
        Overrides:
        init in class Applet
      • start

        public void start()
        Starts the operation of the applet. It gets everything running by performing the following functions:
        • adds all the objects to the applet
        • opens up an initial desktopController that is the child window supervisor/B>
        • sets location of the applet on the screen
        • then its SHOWTIME!
        The way things are laid out in the applet are as follows: the media JPanel will hold everything that is going into this applet EXCEPT the statusbar and menubar; This is so the status bar stays at the bottom of the applet and the menubar stays at the top with the menubar able to float around the actual Internal Window desktop.
        Overrides:
        start in class Applet
      • stop

        public void stop()
        The stop method that gets called whne stoping the applet. It does clean up.
        Overrides:
        stop in class Applet
      • initStatusBar

        private StatusBar initStatusBar()
        Initializes the statusbar with the pre- inititialized arrays of data.
      • repaintMenuBar

        public void repaintMenuBar()
        Forces a repaint to this apps menubar.
      • setTheLookAndFeel

        private void setTheLookAndFeel(short i)
        Calls the User Interface Manager and sets the look and feel setting based on the parameter it is passed.
        Parameters:
        i - The new TheLookAndFeel value
      • setScreenLocation

        private void setScreenLocation(int xPosition,
                                       int yPosition,
                                       int xOffset,
                                       int yOffset)
        This method sets the position of this app/applet on the users screen based on the supplied location parameters
        Parameters:
        xPosition - The new ScreenLocation value
        yPosition - The new ScreenLocation value
        xOffset - The new ScreenLocation value
        yOffset - The new ScreenLocation value
      • getAppCodeBase

        private void getAppCodeBase()
        Creates a URL for the location of the applications codebase.
      • getAncestorFrame

        private Frame getAncestorFrame(Component c)
        This method seeks out and returns the Parent Frame for a given component.
        Parameters:
        c - The Component to be used as the basis of the frame search
        Returns:
        Frame The Frame that eventually holds the giuven Component.
      • initMenuBar

        private JMenuBar initMenuBar()
        Creates the JMenuBar and populates the menuitms into it. It uses a set of predefined String arrays that it loops through to create the menus. This way the menus can be easily changed by simply adding or removing entrys in the arrays. You can set the name, Accelerator, Mnemonic, Tooltip, enabled/disabled (clickable/gray), and even if the item gets created at all!

        The fields it uses are:

        • menuItemShown
        • menuName
        • menuItemName
        • menuItemAccel
        • menuItemAccel2
        Returns:
        JMenuBar
        See Also:
        MediaViewer#createMenuItem(int,int)
      • createMenuItem

        private JMenuItem createMenuItem(int menuRef,
                                         int menuItemRef)
        This is the hook through which all menu items are created. The fields it uses are:
        • menuItemMnemonic
        • menuToolTip
        • menuItemEnabled
        Parameters:
        menuRef - Description of Parameter
        menuItemRef - Description of Parameter
        Returns:
        Description of the Returned Value
        See Also:
        MediaViewer#createMenu()
      • indexOf

        private int indexOf(String s)
        Aa simple indexOf helper function to look through the menu items and return an int to represent its HASH position
        Parameters:
        s - Description of Parameter
        Returns:
        int A value that is the HASH in the menuItem array for the menuItem passed in as a param
      • buttonIndexOf

        private int buttonIndexOf(String[] list,
                                  String s)
        Aa simple indexOf helper function to look through the button items and return an int to represent its HASH position
        Parameters:
        list - List of strings to look through
        s - Description of Parameter
        Returns:
        int A value that is the HASH in the menuItem array for the menuItem passed in as a param
      • addListener

        private void addListener(JMenuItem menuItem)
        Adds an ActionListener to the JMenuItem that is supplied in the passed param. This method SHOULD be overriden by the extending class to enable its specific fuctionality.
        Parameters:
        menuItem - The feature to be added to the Listener attribute
      • main

        public static void main(String[] args)
        The main entry for running the MDIApplet as an APP.
        Parameters:
        args - The command line arguments
      • debugOutput

        private static void debugOutput(int l,
                                        String output)
        Handles debug messages by comparing the app debug level to the message level. If the message level is less or == then the message gets outout to System.out.
        Parameters:
        l - Description of Parameter
        output - Description of Parameter

WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses