Package org.gephi.tools.spi
Interface Tool
-
public interface ToolTools 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
- Create a class which implement
Toolinterface - Add the following annotation to your class to be declared as a new
implementation
@ServiceProvider(service=Tool.class) - Declare
ToolEventListenerinstances for specifying how the tool is interacting with user input like node click or mouse drag. - Provide a
ToolUIinstance for giving a name and an icon to your tool.
- Author:
- Mathieu Bastian
- Create a class which implement
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ToolEventListener[]getListeners()Returns the declared tool listeners for this tool.ToolSelectionTypegetSelectionType()Returns the tool type of selection interaction.ToolUIgetUI()ReturnsToolUIinstance for this tool.voidselect()Notify when this tool is selected.voidunselect()Notify when this tool is unselected.
-
-
-
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()
ReturnsToolUIinstance 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
-
-