org.graffiti.plugin.tool
Class DisjunctiveToolFilter

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

public class DisjunctiveToolFilter
extends Object
implements ToolFilter

The DisjunctiveToolFilter combines several filters by a disjunction of their conditions, i.e. a tool passes the filter if any of the contained filters returns true.

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

Constructor Summary
DisjunctiveToolFilter()
          Constructs a DisjunctiveToolFilter containing no tool filters.
DisjunctiveToolFilter(ToolFilter... filters)
          Constructs a DisjunctiveToolFilter 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

DisjunctiveToolFilter

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

See Also:
ToolFilter

DisjunctiveToolFilter

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

Parameters:
filters - the filters this disjunctive 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 any of the 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