Class AbstractCompiler

  • All Implemented Interfaces:
    Compiler, Plugin

    @NotThreadSafe
    public abstract class AbstractCompiler
    extends java.lang.Object
    implements Compiler
    Implements fundamental functionality useful for most of the compiler plugins.
    • Field Detail

      • pluginID

        protected final long pluginID
        Plugin ID assigned by emuStudio
      • applicationApi

        protected final ApplicationApi applicationApi
        emuStudio API.
      • settings

        protected final PluginSettings settings
        Compiler custom settings.
    • Constructor Detail

      • AbstractCompiler

        public AbstractCompiler​(long pluginID,
                                ApplicationApi applicationApi,
                                PluginSettings settings)
        Creates new instance.
        Parameters:
        pluginID - plugin ID
        applicationApi - emuStudio API
        settings - plugin custom settings
    • Method Detail

      • destroy

        public void destroy()
        Does nothing. Should be overridden.
        Specified by:
        destroy in interface Plugin
      • getTitle

        public java.lang.String getTitle()
        Get plugin title
        Specified by:
        getTitle in interface Plugin
        Returns:
        title from the PluginRoot annotation
      • showSettings

        public void showSettings​(javax.swing.JFrame parent)
        Does nothing. Should be overridden.
        Specified by:
        showSettings in interface Plugin
        Parameters:
        parent - emuStudio main window (if plugin wants to show a dialog which has a parent)
      • isShowSettingsSupported

        public boolean isShowSettingsSupported()
        Return false. Should be overridden.
        Specified by:
        isShowSettingsSupported in interface Plugin
        Returns:
        false
      • addCompilerListener

        public void addCompilerListener​(CompilerListener listener)
        Adds a listener onto compilerListeners list
        Specified by:
        addCompilerListener in interface Compiler
        Parameters:
        listener - listener object
      • removeCompilerListener

        public void removeCompilerListener​(CompilerListener listener)
        Removes the listener from compilerListeners list
        Specified by:
        removeCompilerListener in interface Compiler
        Parameters:
        listener - listener object
      • notifyCompileStart

        protected void notifyCompileStart()
        This method notifies all compilerListeners that the compiler is starting the compile process.

        This method should be called whenever the compiler begins to run.

      • notifyCompileFinish

        protected void notifyCompileFinish()
        This method notifies all compilerListeners that the compiler finished the compile process right now.

        This method should be called whenever the compiler ends the execution.

      • notifyOnMessage

        public void notifyOnMessage​(CompilerMessage compilerMessage)
        This method notifies all compilerListeners that the compiler wants to print something out (a message).

        This method should be called when the compiler wants to notify the user about some warning or error during compilation; or wants to inform the user of something else (e.g. copyright information).

        Parameters:
        compilerMessage - The message
      • notifyError

        public void notifyError​(java.lang.String msg)
        Notifies the error message.
        Parameters:
        msg - text of the message
      • notifyInfo

        public void notifyInfo​(java.lang.String msg)
        Notifies information message
        Parameters:
        msg - text of the message
      • notifyWarning

        public void notifyWarning​(java.lang.String msg)
        Fires warning message
        Parameters:
        msg - text of the message
      • reset

        public void reset()
        Does nothing.
        Specified by:
        reset in interface Plugin