org.graffiti.plugin.tool
Class ConjunctiveToolFilter

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

public class ConjunctiveToolFilter
extends Object
implements ToolFilter

The ConjunctiveToolFilter combines several filters by a conjunction of their conditions, i.e. a tool passes the filter if all contained filters return true.

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

Constructor Summary
ConjunctiveToolFilter()
          Constructs a ConjunctiveToolFilter containing no tool filters.
ConjunctiveToolFilter(ToolFilter... filters)
          Constructs a ConjunctiveToolFilter initially containing the specified filters.
 
Method Summary
 void addFilter(ToolFilter filter)
          Adds the specified tool filter.
 boolean isVisible(Tool<?> tool)
          Returns if the specified tool shall be visible.
 void removeFilter(ToolFilter filter)
          Removes the specified tool filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConjunctiveToolFilter

public ConjunctiveToolFilter()
Constructs a ConjunctiveToolFilter containing no tool filters.

See Also:
ToolFilter

ConjunctiveToolFilter

public ConjunctiveToolFilter(ToolFilter... filters)
Constructs a ConjunctiveToolFilter initially containing the specified filters.

Parameters:
filters - the filters this conjunctive filter initially contains.
Method Detail

addFilter

public void addFilter(ToolFilter filter)
Adds the specified tool filter.

Parameters:
filter - the filter to add.

removeFilter

public void removeFilter(ToolFilter filter)
Removes the specified tool filter.

Parameters:
filter - the filter to remove.

isVisible

public boolean isVisible(Tool<?> tool)
Returns if the specified tool shall be visible. This implementation returns true, if all contained filters return true, else false. The result is lazily evaluated.

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