package uk.ac.leeds.ccg.cluster; import uk.ac.leeds.ccg.geotools.*; import uk.ac.leeds.ccg.widgets.*; import java.util.*; //import com.sun.java.util.collections.*; //change for 1.2! public abstract class SimpleMethod implements Method{ Database database; SignificanceTest significanceTest; public void setData(Database d){database=d;} public void setSignificanceTest (SignificanceTest st) { System.out.println("Simple Method seting "+st); significanceTest=st; significanceTest.setParameters(getParameters()); } public SignificanceTest getSignificanceTest(){ return significanceTest; } Vector listeners = new Vector(); public void removeProgressEventListener(ProgressEventListener lcl) { listeners.removeElement(lcl); } public void addProgressEventListener(ProgressEventListener lcl) { listeners.addElement(lcl); } public void notifyProgressEventListener(double progress){ Vector l; ProgressChangedEvent lce = new ProgressChangedEvent(this,progress); synchronized(this) {l = (Vector)listeners.clone(); } for (int i = 0; i < l.size();i++) { ((ProgressEventListener)l.elementAt(i)).progressChanged(lce); } } }