import java.awt.*; import java.awt.event.*; import Supporting.*; abstract public class Cluster extends CloseableFrame { public static final int NUM_SLOTS = 293; public static final double LOAD_FACTOR = 0.7; public Random r = new Random( ); public int [ ] slots = new int [ NUM_SLOTS ]; public Cluster( ) { for( int i = 0; i < NUM_SLOTS; i++ ) slots[ i ] = 0; fillIt( ); } public void paint( Graphics g ) { for( int i = 0; i < NUM_SLOTS; i++ ) g.drawLine( i * 2 + 30, 20, i * 2 + 30, slots[ i ] * 50 + 40 ); } public static void main( String [ ] args ) { Frame f1 = new NoCluster( ); f1.setSize( NUM_SLOTS * 2 + 60, 100 ); f1.show( ); Frame f2 = new PrimaryCluster( ); f2.setSize( NUM_SLOTS * 2 + 60, 100 ); f2.show( ); Frame f3 = new SecondaryCluster( ); f3.setSize( NUM_SLOTS * 2 + 60, 100 ); f3.show( ); } abstract public void fillIt( ); }