class Words { Hashtable ht=new Hashtable(); PFont font,smallfont; PImage img,masker; int maxcount=1; String mostpopular=""; String newest=""; float c=0; float radius=0; float f=1; float x,y; float a=width/2; float minAlpha=50,maxAlpha=175; float minTextAlpha=5,maxTextAlpha=200; float minColor=50,maxColor=255; float minRadius=3,maxRadius=40; float minFont=1,maxFont=38; float cstep = .01; float offsetY=maxFont; float offsetX=width/2; Words() { font = loadFont("Garamond-38.vlw"); smallfont = loadFont("Garamond-18.vlw"); } void reset() { ht.clear(); maxcount = 0; mostpopular = ""; } void addWord(String txt) { Word word; if (ht.containsKey(txt)) { word = (Word)ht.get(txt); word.count++; } else { word = new Word(txt); newest = txt; } if (word.count>maxcount) { maxcount=word.count; mostpopular=txt; } ht.put(txt,word); } void printWords() { for (Enumeration e = ht.keys() ; e.hasMoreElements() ;) { String name = e.nextElement().toString(); Word word = (Word)ht.get(name); println(word.txt + ": " + word.count); } } Word[] getWords() { Collection c = ht.values(); return (Word[]) c.toArray(new Word[0]); } void draw() { Word words[] = getWords(); if (mousePressed) { cstep=.1*float(mouseY)/float(height); f=166*float(mouseX)/float(width); } if ((c+=cstep)>TWO_PI) c=0; float g = mouseY; float h = mouseX; line(0,g,width,g); line(h,0,h,height); for (int i=0; i