/* * BooleanSetFilter.java * * Created on 28 June 2001, 18:24 */ package uk.ac.leeds.ccg.geotools; /** * * @author James Macgill * @version */ public class LogicFilter extends uk.ac.leeds.ccg.geotools.SimpleFilter implements uk.ac.leeds.ccg.geotools.Filter { GeoData[] data; boolean flags[]; private boolean singleFlagMode; boolean orMode = true; /** Creates new BooleanSetFilter */ public LogicFilter(GeoData[] data, boolean[] flags) { this.data = data; this.flags = flags; } public void useOrMode(){ orMode = true; } public void useAndMode(){ //System.out.println("orMode set to false"); orMode = false; } public String getFlagName(int index){ return data[index].getName(); } /** * Check the given id against the filter, * @return boolean returns as true if features with this id should be included in any displays */ public boolean isVisible(int id){ if(orMode){ return testOrMode(id); } else{ return testAndMode(id); } } public void setSingleFlagMode(boolean flag){ singleFlagMode = flag; } public String getHeader(){ String head = "orMode"; for(int i=0;i