/* @author j.n.magee 14/08/98 */ package concurrency.primes; import java.awt.*; import java.applet.*; /**************************************************************/ class PrimesCanvas extends Canvas { String title_; int slots_; String[] buf_; String[] primes_; private final static String empty = " "; Font f1 = new Font("Helvetica",Font.ITALIC+Font.BOLD,24); Font f2 = new Font("TimesRoman",Font.BOLD,36); PrimesCanvas(String title, Color c, int slots) { super(); title_=title; slots_=slots; buf_ = new String[slots_]; primes_ = new String[slots_]; for(int i=0; i=0 && index0 && index0) { offgraphics.setColor(Color.white); offgraphics.fillRect(bx,y+70,50,50); offgraphics.setColor(Color.black); offgraphics.drawRect(bx,y+70,50,50); offgraphics.drawLine(bx+25,y+50,bx+25,y+70); if (primes_[i]!=null) offgraphics.drawString(primes_[i],bx+10,y+105); } } g.drawImage(offscreen, 0, 0, null); } } /**************************************************************/