hep.wired.cut
Class CutSet

java.lang.Object
  extended by hep.wired.cut.CutSet
All Implemented Interfaces:
EventListener, ChangeListener

public class CutSet
extends Object
implements ChangeListener

Set of cuts associated with an event display view.

Author:
Dmitry Onoprienko

Field Summary
protected  ChangeEvent _defaultEvent
           
protected  boolean _enabled
           
protected  boolean _inverted
           
protected  boolean _passThrough
           
 
Constructor Summary
CutSet()
           
CutSet(CutSet set)
           
 
Method Summary
 void addChangeListener(ChangeListener listener)
          Adds a listener that will be notified of any changes in this CutSet, its enabled Cuts and Conditions.
protected  void disable(Cut cut)
           
protected  void enable(Cut cut)
           
protected  void enable(Cut cut, boolean inverted)
           
 void fireStateChanged(ChangeEvent event)
          Sends the event to listeners.
 Set<String> getConditionNames()
          Returns a set of names of all enabled conditions in this CutSet.
 Set<Cut> getCuts()
          Returns a set of all cuts this CutSet knows about - both enabled and disabled.
 Boolean isCutEnabled(Cut cut)
          Returns true if the specified cut is enabled in this CutSet.
 Boolean isCutInverted(Cut cut)
          Returns true if the specified cut is inverted in this CutSet.
 boolean isEnabled()
          Returns true if this CutSet is currently enabled.
 boolean isInverted()
          Returns true if this CutSet is inverted.
 boolean isPassThrough()
          Returns true if this CutSet is in "pass through" mode.
 boolean pass(Map<String,org.freehep.util.Value> data)
          Returns true if the supplied data satisfies this CutSet.
 boolean pass(Map<String,org.freehep.util.Value> data, Object moreData)
          Returns true if the supplied data satisfies this CutSet.
 void remove(Cut cut)
          Removes the specified cut from this CutSet.
 void removeChangeListener(ChangeListener listener)
          Removes a listener.
 void setEnabled(boolean enabled)
          Sets whether or not this CutSet is enabled.
 void setEnabled(Cut cut, boolean enabled)
          Sets whether or not the specified cut is enabled in this CutSet.
 void setInverted(boolean inverted)
          Sets whether or not this CutSet is inverted.
 void setInverted(Cut cut, boolean inverted)
          Sets whether or not the specified cut is inverted in this CutSet.
 void setPathThrough(boolean passThrough)
          Sets whether or not this CutSet is in "pass through" mode.
 int size()
          Returns the number of enabled cuts in this CutSet.
 void stateChanged(ChangeEvent event)
          Forwards the event to listeners if this CutSet is currently enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_enabled

protected boolean _enabled

_inverted

protected boolean _inverted

_passThrough

protected boolean _passThrough

_defaultEvent

protected ChangeEvent _defaultEvent
Constructor Detail

CutSet

public CutSet()

CutSet

public CutSet(CutSet set)
Method Detail

setEnabled

public void setEnabled(boolean enabled)
Sets whether or not this CutSet is enabled.


setInverted

public void setInverted(boolean inverted)
Sets whether or not this CutSet is inverted.


setPathThrough

public void setPathThrough(boolean passThrough)
Sets whether or not this CutSet is in "pass through" mode. When in "pass through" mode, inverting cuts allows objects that do not have attributes used by cuts to remain visible. When not in "pass through" mode, inverting cuts forces objects that would be visible if the cuts were not inverted to become invisible. If the cut is not inverted, "pass through" mode has no effect.


setEnabled

public void setEnabled(Cut cut,
                       boolean enabled)
Sets whether or not the specified cut is enabled in this CutSet.


setInverted

public void setInverted(Cut cut,
                        boolean inverted)
Sets whether or not the specified cut is inverted in this CutSet. Implementation assumes that the specified cut is enabled.


remove

public void remove(Cut cut)
Removes the specified cut from this CutSet.


enable

protected void enable(Cut cut)

enable

protected void enable(Cut cut,
                      boolean inverted)

disable

protected void disable(Cut cut)

isEnabled

public boolean isEnabled()
Returns true if this CutSet is currently enabled.


isInverted

public boolean isInverted()
Returns true if this CutSet is inverted.


isPassThrough

public boolean isPassThrough()
Returns true if this CutSet is in "pass through" mode.


getCuts

public Set<Cut> getCuts()
Returns a set of all cuts this CutSet knows about - both enabled and disabled.


getConditionNames

public Set<String> getConditionNames()
Returns a set of names of all enabled conditions in this CutSet.


isCutInverted

public Boolean isCutInverted(Cut cut)
Returns true if the specified cut is inverted in this CutSet.


isCutEnabled

public Boolean isCutEnabled(Cut cut)
Returns true if the specified cut is enabled in this CutSet.


size

public int size()
Returns the number of enabled cuts in this CutSet.


pass

public boolean pass(Map<String,org.freehep.util.Value> data,
                    Object moreData)
Returns true if the supplied data satisfies this CutSet. The returned value is determined by combining results returned by Cut.pass(Map,Object,boolean) methods of all enabled cuts. If this CutSet is not inverted, returns true if all cuts return either PASS or IGNORE. If this CutSet is inverted and in "pass through" mode, returns true if either at least one cut returns FAIL, or all cuts return IGNORE. If this CutSet is inverted and not in "pass through" mode, returns true if at least one cut returns FAIL.

Parameters:
data - Map of attribute names to their values.
moreData - Additional data that can be used in making the decision - ignored by the implementation provided by this class.

pass

public boolean pass(Map<String,org.freehep.util.Value> data)
Returns true if the supplied data satisfies this CutSet. Inversion and pass through modes are taken into account.

Parameters:
data - Map of attribute names to their values.

addChangeListener

public void addChangeListener(ChangeListener listener)
Adds a listener that will be notified of any changes in this CutSet, its enabled Cuts and Conditions.


removeChangeListener

public void removeChangeListener(ChangeListener listener)
Removes a listener.


fireStateChanged

public void fireStateChanged(ChangeEvent event)
Sends the event to listeners.


stateChanged

public void stateChanged(ChangeEvent event)
Forwards the event to listeners if this CutSet is currently enabled.

Specified by:
stateChanged in interface ChangeListener


Copyright © 1996-2013 FreeHEP. All Rights Reserved.