import java.lang.*; import java.awt.*; import java.applet.Applet; // This code is distributed under the terms and conditions of the // CCP4 licence agreement as `Part i)' software. See the conditions // in the CCP4 manual for a copyright statement. // // The Xloggraph syntax cannot be implemented quite right due // to loss of carriage returns in the input parameters. // But it'll do for a proof of concept. by Kevin Cowtan // // This program uses the Applet class of the java.applet package which // contains the methods (subroutines) getParameter (returns specified // applet parameters as a string) and init (called by the browser to // initialize the applet, used here, apart from others. public class JLogGraph extends Applet { JLogCanvas jlc; // jlc is the variable declared to be of type JLogCanvas TextArea jlt; // TextArea and Panel are awt components. Panel cards; // These are subclasses of the package java.awt.Component String tabTitle; public String[] graphTitles; //declaring a string array public String[] graphFmts; public String[] colTitles; public int[] graphNCols; //declaring an integer array public int[][] graphCols; public float[][] data; public int ngraphs,ncols,nrows,ndata,currgr; Choice grChoice=new Choice(); //Choice is an awt component that provides // drop down lists from which choices can be // made. String wordise; int wordiseoff; public void init() { String[] delim={new String("$TAB"),new String("$GRA"),new String("$$"), new String("$$"),new String("$$"),new String("$$")}, token=new String[delim.length+1], subtok, subsub; // // delim is a string array containing the arrays specified within qoutes. // token is a string array whose length is determined by that of delim. // subtok and subsub are also declared as string arrays. // StringBuffer tabletext; String word; // // The strings created in quotes // or read into objects of the String class (like delim,token etc) // cannot be altered. The StringBuffer class allows alteration of the string. // tabletext is declared to be an object of StringBuffer class. // // read the loggraph String table=getParameter("table"); // // uses the getParameter method to read and store the 'value' of the parameter // named 'table' as a string. The 'value' in our log tables includes the table // titles, graph titles, graph data columns and the table data. // for (int i=0; i