Class EEMaster


  • public class EEMaster
    extends java.lang.Object
    Load the EEM file and appropriate EE files.
    Author:
    Christopher Mindus
    • Constructor Detail

      • EEMaster

        public EEMaster​(java.lang.String fn,
                        boolean doLoadScreens)
                 throws java.io.IOException
        Loads an EEM file for the recording editor.
        Throws:
        java.io.IOException
      • EEMaster

        public EEMaster()
        Constructor used when catching an EE file.
    • Method Detail

      • getEEMaster

        public static EEMaster getEEMaster​(java.lang.String fn)
                                    throws java.io.IOException
        Creates a shared instance or uses a previous one, reloading changed files if required, with weak memory references to allow smaller memory footprint.
        Throws:
        java.io.IOException - for file failures.
      • getEEFile

        public static EEFile getEEFile​(java.lang.String fn)
                                throws java.io.IOException
        Gets or loads an EE file.
        Throws:
        java.io.IOException - for file failures.
      • catchScreenAsEE

        public static void catchScreenAsEE​(HostSession hostSession,
                                           java.io.ByteArrayOutputStream bos,
                                           java.lang.String screenName)
                                    throws java.io.IOException
        Catch a screen as EE.

        The screen name must be 1 through 20 characters long using the default ASCII (OEM) character set, otherwise an IOException is thrown.

        Throws:
        java.io.IOException - for file errors.
      • catchScreenAsEE

        public static boolean catchScreenAsEE​(HostSession hostSession,
                                              java.lang.String fileName,
                                              java.lang.String screenName,
                                              boolean doAppend)
                                       throws java.io.IOException
        Catch a screen as EE.

        The screen name must be 1 through 20 characters long using the default ASCII (OEM) character set, otherwise an IOException is thrown.

        The flag "doAppend" indicates if the screen name should be appended to the file name specified. If the file exists prior to calling this method with "doAppend=false", the file is overwritten.

        Returns:
        false if the screen name already exists, true for success.
        Throws:
        java.io.IOException - for file errors.
      • getFileName

        public java.lang.String getFileName()
        Gets the name of the EEM file.
      • setFileName

        public void setFileName​(java.lang.String newName)
        Sets the name of the EEM file.
      • setEEFileNames

        public void setEEFileNames​(java.lang.String[] newNames)
                            throws java.io.IOException
        Sets the EE file names array defined for the EEM file.
        Throws:
        java.io.IOException
      • setInitialScreen

        public void setInitialScreen​(int newScreen)
        Sets the initial screen defined for the EEM file.
      • getFlags

        public int getFlags()
        Gets the flags defined for the EEM file.
      • setFlags

        public void setFlags​(int newFlags)
        Sets the delay defined for the EEM file.
      • getDelay

        public int getDelay()
        Gets the delay defined for the EEM file.
      • setDelay

        public void setDelay​(int newDelay)
        Sets the delay defined for the EEM file.
      • setLogic

        public void setLogic​(EELogic[] newLogic)
        Sets the logic statements for the EEM file.
      • createNewEEMFile

        public static boolean createNewEEMFile​(java.lang.String newFileName)
                                        throws java.io.IOException
        Create a new, empty EEM file.
        Throws:
        java.io.IOException
      • write

        public void write()
                   throws java.io.IOException
        Write the content of the instance to a file.
        Throws:
        java.io.IOException
      • addScreen

        public void addScreen​(EEScreen screen)
        Adds a new EEScreen to the table.
      • getInitialScreen

        public EEScreen getInitialScreen()
        Gets the initial EE screen.
        Returns:
        The initial screen, or null for none.
      • getScreen

        public EEScreen getScreen​(java.lang.String name)
        Gets the EE screen from a name.
        Returns:
        null if not found.
      • getAllScreens

        public java.util.ArrayList<EEScreen> getAllScreens()
        Gets all the screens.
      • getFirstScreen

        public EEScreen getFirstScreen()
        Gets the first screen.
        Returns:
        The first screen, or null if none are present.
      • getLastScreen

        public EEScreen getLastScreen()
        Gets the last screen.
        Returns:
        The last screen, or null if none are present.
      • getPreviousNextScreen

        public EEScreen getPreviousNextScreen​(EEScreen current,
                                              int dir)
        Gets the previous or next screen.
        Parameters:
        dir - direction to move, set to -1 for previous or 1 for next.
        Returns:
        null if not found.
      • getLogic

        public EELogic[] getLogic()
        Gets the logic statements for the EEM file.
        Returns:
        null if no logic statements are found.
      • loadCapture

        public void loadCapture​(java.lang.String fn)
                         throws java.io.IOException
        Loads a captured EE file into the EEM.
        Parameters:
        fn - The file name.
        Throws:
        java.io.IOException - For file errors.
      • canEdit

        public boolean canEdit()
        Checks if this master file can be edited for screen captures, i.e. just one file with one screen.