Interface ToolChest

  • public interface ToolChest
    Interface to define methods to manage tools in a central location.
    • Method Detail

      • getToolTemplate

        ToolTemplate getToolTemplate​(java.lang.String toolName)
        Get the tool template for the given tool name.
        toolName - name of tool
        null if there is no tool template for the given toolName.
      • getToolTemplates

        ToolTemplate[] getToolTemplates()
        Get the tool templates from the tool chest.
        list of tool template
      • addToolChestChangeListener

        void addToolChestChangeListener​(ToolChestChangeListener l)
        Add a listener to be notified when the tool chest is changed.
        l - listener to add
      • removeToolChestChangeListener

        void removeToolChestChangeListener​(ToolChestChangeListener l)
        Remove a listener that is listening to when the tool chest is changed.
        l - to remove
      • addToolTemplate

        boolean addToolTemplate​(ToolTemplate template)
        Add tool template to the tool chest.
        Note: If the given tool template name already exists in the project, then the name will be altered by appending an underscore and a one-up value. The template parameter's name is also updated with then new name.

        To simply replace a tool with without changing its name, call replaceToolTemplate(ToolTemplate)

        template - tool template to add
      • remove

        boolean remove​(java.lang.String toolName)
        Remove entry (toolTemplate or toolSet) from the tool chest.
        toolName - name of toolConfig or toolSet to remove
        true if the toolConfig or toolset was successfully removed from the tool chest.
      • getToolCount

        int getToolCount()
        Get the number of tools in this tool chest.
        tool count.
      • replaceToolTemplate

        boolean replaceToolTemplate​(ToolTemplate template)
        Performs the same action as calling remove(String) and then addToolTemplate(ToolTemplate). However, calling this method prevents state from being lost in the transition, such as position in the tool chest and default tool status.
        template - The template to add to the tool chest, replacing any tools with the same name.
        True if the template was added.