org.graffiti.plugin.tool
Class DefaultModeFilter

java.lang.Object
  extended by org.graffiti.plugin.tool.DefaultModeFilter
All Implemented Interfaces:
ToolFilter

public class DefaultModeFilter
extends Object
implements ToolFilter

ToolFilter, which lets pass all tools that have their default mode flag set or all tools if the default mode is not active. The default mode is considered to be active if there is no veto against it.

Version:
$Revision$ $Date$
Author:
Andreas Gleißner
See Also:
Tool.isDefaultMode(), ToolRegistry

Constructor Summary
DefaultModeFilter()
          Creates a DefaultModeFilter.
 
Method Summary
 void addVeto(Object veto)
          Adds the specified veto against the default mode.
 boolean isVisible(Tool<?> tool)
          Returns if the specified tool shall be visible.
 void removeVeto(Object veto)
          Removes the specified veto against the default mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultModeFilter

public DefaultModeFilter()
Creates a DefaultModeFilter.

Method Detail

addVeto

public void addVeto(Object veto)
Adds the specified veto against the default mode. The default mode is considered inactive as long as there is at least one veto against it.

Parameters:
veto - the veto to add against the default mode.
See Also:
removeVeto(Object)

removeVeto

public void removeVeto(Object veto)
Removes the specified veto against the default mode.

Parameters:
veto - the veto to remove.
See Also:
addVeto(Object)

isVisible

public boolean isVisible(Tool<?> tool)
Returns if the specified tool shall be visible.

Specified by:
isVisible in interface ToolFilter
Parameters:
tool - the tool in question.
Returns:
true iff the specified tool shall be visible.


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