return "Title: XYZApp \nAuthor: James Gosling \nAn applet to put a Chemical model into a page.";
}
public String[][] getParameterInfo() {
String[][] info = {
{"model", "path string", "The path to the model to be displayed in .xyz format (see http://chem.leeds.ac.uk/Project/MIME.html). Default is model.obj."},
{"scale", "float", "Scale factor. Default is 1 (i.e. no scale)."}
};
return info;
}
} // end class XYZApp
class Atom {
private static Applet applet;
private static byte[] data;
private final static int R = 40;
private final static int hx = 15;
private final static int hy = 15;
private final static int bgGrey = 192;
private final static int nBalls = 16;
private static int maxr;
private int Rl;
private int Gl;
private int Bl;
private Image balls[];
static {
data = new byte[R * 2 * R * 2];
int mr = 0;
for (int Y = 2 * R; --Y >= 0;) {
int x0 = (int) (Math.sqrt(R * R - (Y - R) * (Y - R)) + 0.5);
int p = Y * (R * 2) + R - x0;
for (int X = -x0; X < x0; X++) {
int x = X + hx;
int y = Y - R + hy;
int r = (int) (Math.sqrt(x * x + y * y) + 0.5);
if (r > mr)
mr = r;
data[p++] = r <= 0 ? 1 : (byte) r;
}
}
maxr = mr;
}
static void setApplet(Applet app) {
applet = app;
}
Atom(int Rl, int Gl, int Bl) {
this.Rl = Rl;
this.Gl = Gl;
this.Bl = Bl;
}
private final int blend(int fg, int bg, float fgfactor) {