Interface Tool


  • public interface Tool
    Tools are functions for interacting with user inputs on the visualization window.

    A tool receive events from visualization window when it is currently the selected tool. The visualization window toolbar presents all available tools implementations.

    Example: A Brush tool colors clicked nodes.

    How-to create a tool implementation

    1. Create a class which implement Tool interface
    2. Add the following annotation to your class to be declared as a new implementation @ServiceProvider(service=Tool.class)
    3. Declare ToolEventListener instances for specifying how the tool is interacting with user input like node click or mouse drag.
    4. Provide a ToolUI instance for giving a name and an icon to your tool.
    Author:
    Mathieu Bastian
    • Method Detail

      • select

        void select()
        Notify when this tool is selected.
      • unselect

        void unselect()
        Notify when this tool is unselected.
      • getListeners

        ToolEventListener[] getListeners()
        Returns the declared tool listeners for this tool. Tool listeners says how the tool is interacting with user input on the visualization window.
        Returns:
        tool listeners declared for this tool implementation
      • getUI

        ToolUI getUI()
        Returns ToolUI instance for this tool.
        Returns:
        the user interface attributes for this tool
      • getSelectionType

        ToolSelectionType getSelectionType()
        Returns the tool type of selection interaction.
        Returns:
        the tool type of selection interaction