/* ListLinkedAlgThread.java */ import java.awt.*; import java.io.*; import java.net.*; import java.util.*; import ciips.animation.*; public class ListLinkedAlgThread extends AlgThread { ListLinked list; IntList int_list; static String[] ListLinkedDataSets = { "List 1", "List 2", "List 3"}; private static String base_data_file_name = "graph.rb"; // private static String base_data_file_name = "rbtlist"; static final int x_offset = 10; static final int y_offset = 50; public ListLinkedAlgThread( AlgAnimFrame frame ) { super(); // super( frame, ListLinkedDataSets, 2 ); setParms( frame, ListLinkedDataSets, 2 ); System.out.println("ListLinkedAlgThread constructed OK"); } public boolean loadData( int choice ) { String fn; DataInputStream inStream; String line; System.out.println("loadData: choice " + choice ); fn = base_data_file_name + choice; System.out.println("loadData: filename ["+fn+"]"); try { URL dataURL = new URL(frame.getApplet().getCodeBase(), fn); int_list = new IntList( dataURL ); } catch (IOException e) { System.out.println("Data file or source file not found"); } catch (NullPointerException e) {} return int_list != null; } public void run() { int k; Graphics g1, g2, g3; Image beforeOffSc = null; Graphics befOffGraphics = null; // Capture reference to the current panel DrawingPanel dpAfter = frame.getCurrentPanel(); // Temporary .. capture reference to the Before panel also DrawingPanel dpBefore = frame.getPreviousPanel(); System.out.println("ListLinkedAlgThread:run - enter"); if ( dpAfter == null ) { System.out.println( "run: null drawingPanel"); return; } list = new ListLinked(); //Initialise beforeOffsc list.initBeforeOffsc(frame, list); generateData(); if ( int_list != null ) { for(k=0;k