Module ij
Package ij.plugin

Class MacroInstaller

  • All Implemented Interfaces:
    MacroConstants, PlugIn, java.awt.event.ActionListener, java.util.EventListener

    public class MacroInstaller
    extends java.lang.Object
    implements PlugIn, MacroConstants, java.awt.event.ActionListener
    This plugin implements the Plugins/Macros/Install Macros command. It is also used by the Editor class to install macros in menus and by the ImageJ class to install macros at startup.
    • Constructor Detail

      • MacroInstaller

        public MacroInstaller()
    • Method Detail

      • run

        public void run​(java.lang.String path)
        Description copied from interface: PlugIn
        This method is called when the plugin is loaded. 'arg', which may be blank, is the argument specified for this plugin in IJ_Props.txt.
        Specified by:
        run in interface PlugIn
      • install

        public int install​(java.lang.String text)
      • install

        public int install​(java.lang.String text,
                           java.awt.Menu menu)
      • installFile

        public void installFile​(java.lang.String path)
      • installTool

        public void installTool​(java.lang.String path)
      • installLibrary

        public void installLibrary​(java.lang.String path)
      • installFromJar

        public static void installFromJar​(java.lang.String path)
        Installs a macro set contained in ij.jar.
      • installFromIJJar

        public void installFromIJJar​(java.lang.String path)
        Installs a macro set contained in ij.jar.
      • installSingleTool

        public void installSingleTool​(java.lang.String text)
      • openFromIJJar

        public java.lang.String openFromIJJar​(java.lang.String path)
        Returns a text file contained in ij.jar.
      • runMacroTool

        public boolean runMacroTool​(java.lang.String name)
      • runMenuTool

        public boolean runMenuTool​(java.lang.String name,
                                   java.lang.String command)
      • runMacroCommand

        public static boolean runMacroCommand​(java.lang.String name)
        Runs a command in the Plugins/Macros submenu on the current thread.
      • isMacroCommand

        public static boolean isMacroCommand​(java.lang.String name)
        Returns 'true' if the macro command 'name' exists.
      • runMacroShortcut

        public static void runMacroShortcut​(java.lang.String name)
      • runMacro

        public void runMacro​(java.lang.String name)
      • runMacro

        public void runMacro​(java.lang.String name,
                             Editor editor)
      • getMacroCount

        public int getMacroCount()
      • getProgram

        public Program getProgram()
      • isAutoRunAndHide

        public boolean isAutoRunAndHide()
        Returns true if an "AutoRunAndHide" macro was run/installed.
      • setFileName

        public void setFileName​(java.lang.String fileName)
      • getFileName

        public static java.lang.String getFileName()
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent evt)
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
      • installStartupMacros

        public void installStartupMacros​(java.lang.String path)
        Installs startup macros and runs AutoRun macro on current thread.
      • autoRun

        public static void autoRun()
        Runs the StartupMacros AutoRun macro on the current thread.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object