/* * WordListPlotCanvas.java * * Created on September 11, 2006, 12:26 PM */ package Current.popups.ListPlotter; import Current.canvases.Plot.PlotCanvas; import Current.manage.*; import Current.basic.*; import java.awt.Color; /** * * @author pat */ public class WordListPlotCanvas extends PlotCanvas { public WordListPlotPopup wlpp; /** Creates a new instance of WordListPlotCanvas */ public WordListPlotCanvas(WordListPlotPopup wlpp) { super(wlpp.M); this.wlpp=wlpp; } public void run() { WordList wl=wlpp.wl; Word w=wl.get(); Color c; I=new Interrupter(); wlpp.s.repaint(); //System.out.println("Entered loop"); while ( (w!=null) && (! I.isInterrupted()) ) { //System.out.println("There are "+(wl.size())+" left."); c=w.c; if (c==null) c=wlpp.M.getColor(); try { Tile st=types[i].plot(w.w,c,I,wlpp.M); if (st==null) { System.out.println("Found no tile for word: "+w.w); } else { wlpp.M.plotTile(st); } } catch (Throwable T) { System.err.println("The list plotter had some trouble plotting the word: "+w.w+". Details..."); T.printStackTrace(); } wl.remove(); wlpp.s.repaint(); w=wl.get(); } //System.out.println("Done with plot"); donePlot(); wlpp.s.repaint(); } }