8 import java.awt.image.*;
13 static final int SMALL_FONT=14, LARGE_FONT=26;
15 public void run(String arg) {
17 String[] text =
new String[lines];
18 text[0] =
"Squiz Image Editor";
19 text[1] =
"based on ImageJ "+
ImageJ.VERSION;
20 text[2] =
"by Wayne Rasband from the";
21 text[3] =
"National Institutes of Health, USA";
22 text[4] =
"http://rsb.info.nih.gov/ij/";
23 text[5] =
"Java "+System.getProperty(
"java.version");
24 text[6] =
IJ.freeMemory();
25 text[7] =
"ImageJ is in the public domain";
26 ImageProcessor ip = null;
28 URL url = ij .getClass() .getResource(
"/about.jpg");
31 try {img = ij.createImage((ImageProducer)url.getContent());}
40 ip = ip.resize(ip.getWidth()*4, ip.getHeight()*4);
41 ip.setFont(
new Font(
"SansSerif", Font.PLAIN, LARGE_FONT));
42 ip.setAntialiasedText(
true);
43 int[] widths =
new int[lines];
44 widths[0] = ip.getStringWidth(text[0]);
45 ip.setFont(
new Font(
"SansSerif", Font.PLAIN, SMALL_FONT));
46 for (
int i=1; i<lines-1; i++)
47 widths[i] = ip.getStringWidth(text[i]);
50 ip.setColor(
new Color(255,255,140));
51 ip.setFont(
new Font(
"SansSerif", Font.PLAIN, LARGE_FONT));
53 ip.drawString(text[0], x(text[0],ip,max), y);
54 ip.setFont(
new Font(
"SansSerif", Font.PLAIN, SMALL_FONT));
56 ip.drawString(text[1], x(text[1],ip,max), y);
58 ip.drawString(text[2], x(text[2],ip,max), y);
60 ip.drawString(text[3], x(text[3],ip,max), y);
62 ip.drawString(text[4], x(text[4],ip,max), y);
63 if (
IJ.maxMemory()>0L) {
65 ip.drawString(text[5], x(text[5],ip,max), y);
68 ip.drawString(text[6], x(text[6],ip,max), y);
70 ip.drawString(text[7], x(text[7],ip,max), y);
74 int x(String text, ImageProcessor ip,
int max) {
75 return ip.getWidth() - max + (max - ip.getStringWidth(text))/2 - 10;