org.graffiti.plugin.tool
Class ToolDummy<T extends InteractiveView<T>>

java.lang.Object
  extended by org.graffiti.plugin.tool.Tool<T>
      extended by org.graffiti.plugin.tool.ToolDummy<T>
All Implemented Interfaces:
Comparable<Tool<?>>

final class ToolDummy<T extends InteractiveView<T>>
extends Tool<T>

Tool dummies represent tools that are present in the preferences tree but have not yet been added by their providing plugins so they are currently unavailable. When the respective tool is added, this dummy will be removed.

Version:
$Revision$ $Date$
Author:
Andreas Gleißner

Field Summary
 
Fields inherited from class org.graffiti.plugin.tool.Tool
id, ID_PATTERN, isDefaultMode, isReadOnly, nextActiveTool, preferences, prevActiveTool, toolButton, viewFamily
 
Constructor Summary
ToolDummy(ViewFamily<T> viewFamily, String id)
          Constructs a tool dummy representing the tool with the specified id.
 
Method Summary
 Tool<T> create(ViewFamily<T> viewFamily, ToolFactory factory)
          Creates the represented tool using the specified factory.
 boolean hasFactoryId(String factoryId)
          Returns if the represented tool will be created by the factory with the specified id.
(package private)  boolean isDummy(int i)
          Returns if this tool is a tool dummy.
 
Methods inherited from class org.graffiti.plugin.tool.Tool
activate, activated, compareTo, deactivated, delete, gesturePerformed, getDescription, getIcon, getIconPath, getId, getName, getPosition, getProvidingPlugin, getToolButton, getViewFamily, getViewFamilyPreferences, isActive, isDefaultMode, isDeleted, isDummy, isHidden, isReadOnly, moveDown, moveUp, reset, reseted, setActive, setDescription, setHidden, setIcon, setIconPath, setName, setPosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolDummy

public ToolDummy(ViewFamily<T> viewFamily,
                 String id)
Constructs a tool dummy representing the tool with the specified id.

Parameters:
viewFamily - the view family supported by the tool to represent.
id - the id of the tool to represent.
Method Detail

hasFactoryId

public boolean hasFactoryId(String factoryId)
Returns if the represented tool will be created by the factory with the specified id.

Parameters:
factoryId - the id of the factory in question.
Returns:
if the represented tool will be created by the factory with the specified id.

create

public Tool<T> create(ViewFamily<T> viewFamily,
                      ToolFactory factory)
Creates the represented tool using the specified factory.

Parameters:
viewFamily - the view family supported by the tool to create.
factory - the factory to create the represented tool
Returns:
the represented tool created using the specified factory.

isDummy

boolean isDummy(int i)
Returns if this tool is a tool dummy. Tool dummies represent tools that are present in the preferences tree but have not yet been added by their providing plugins so they are currently unavailable. When the respective tool is added, this dummy will be removed. This implementation returns true.

Overrides:
isDummy in class Tool<T extends InteractiveView<T>>
Returns:
if this tool is a tool dummy.
See Also:
ToolDummy


Generated at 2012-05-30 11:00:36 PM CEST