Package org.gephi.tools.spi
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
- Create a class which implement
Tool
interface - Add the following annotation to your class to be declared as a new
implementation
@ServiceProvider(service=Tool.class)
- Declare
ToolEventListener
instances for specifying how the tool is interacting with user input like node click or mouse drag. - Provide a
ToolUI
instance 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.ToolSelectionType
getSelectionType()
Returns the tool type of selection interaction.ToolUI
getUI()
ReturnsToolUI
instance for this tool.void
select()
Notify when this tool is selected.void
unselect()
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()
ReturnsToolUI
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
-
-