Class AbstractMode

java.lang.Object
org.graffiti.plugin.mode.AbstractMode
All Implemented Interfaces:
Mode
Direct Known Subclasses:
DefaultEditMode

public class AbstractMode
extends Object
implements Mode
This class provides a skeletal implementation of the interface Mode.
See Also:
Mode
  • Method Details

    • getConstraints

      public GraphConstraint[] getConstraints()
      Returns an array containing the GraphConstraints of the current Mode.
      Specified by:
      getConstraints in interface Mode
      Returns:
      an array containing the GraphConstraints of the current Mode.
    • getId

      public String getId()
      Returns the name of this mode. Tools can be added to a mode by adding their ToolButtons to the toolbar with the same name as this mode.
      Specified by:
      getId in interface Mode
      Returns:
      the name of this mode.
    • getTools

      public List<Tool> getTools()
      Returns an array containing all the tools belonging Mode.
      Specified by:
      getTools in interface Mode
      Returns:
      an array containing all the tools belonging Mode.
    • addTool

      public void addTool​(Tool t)
      Adds the given tool to the mode.
      Specified by:
      addTool in interface Mode
      Parameters:
      t - tool to add.