API/ToolLink
ToolLink
Description
The ToolLink class is a class which contains static methods that can be used for easy reference to all tool related stuff.
The class also allows to register new tools and toolsets.
Important methods
int GetUniqueToolID(String name)
Description
Used to get an integer value (ID) that is unique to a certain tool name.
Parameter
name: The name of the tool.
Return value
returns the ID associated with the given name.
boolean RegisterTool(Tool tool)
Description
Used to register new tools.
Parameter
tool: an instance of the tool to be added.
Return value
returns true if the tool was registered and false otherwise.
boolean RegisterToolSet(ToolSet toolset)
Description
Used to register new toolsets.
Parameter
toolset: an instance of the toolset to be added.
Return value
returns true if the toolset was registered and false otherwise.
Tool getTool(int id)
Description
Used to obtain the tool associated with a certain id.
Parameter
id: the id of the tool.
Return value
returns the tool that has that id or the NoTool if no tool exists with that id.
Tool getTool(String name)
Description
Used to obtain the tool with a certain name.
Parameter
name: the name of the tool.
Return value
returns the tool that has that name or the NoTool if no tool exists with that name.
ToolSet getToolSet(String name)
Description
Used to obtain the toolset with a certain name.
Parameter
name: the name of the toolset.
Return value
returns the toolset that has that name or null if no toolset exists with that name.
ToolSet getToolSet(Tool lefttool, Tool righttool)
Description
Used to obtain the toolset with a certain combination of tools.
Parameter
lefttool: the left tool of the toolset.
righttool: the right tool of the toolset.
Return value
returns the toolset that contains those tools or null if no such toolset exists.
void save()
Description
Used to force a save of the registered tool names and ids.
int getAmountOfTools()
Description
Used to see how many tools are registered at the moment.
Return value
returns the amount of registered tools, excluding the NoTool.
Tool getToolFromList(int i)
Description
Used to obtain a tool from the list with all tools.
Parameter
i: the place of the tool in the list (which corresponds with the order the tools were registered).
Return value
returns the tool at the specified position.
Comments