Methods Summary |
---|
public java.net.ContentHandler | createContentHandler(java.lang.String mimetype)
if (mimetype.equalsIgnoreCase("image/x-fits")) return fc;
return null;
|
public void | init()
try {
u = new URL("http://sunsite.unc.edu/javafaq/" + name);
ImageProducer ip = (ImageProducer) u.getContent();
if (ip == null) {
System.err.println("Content handler returned null");
}
else {
theImage = createImage(ip);
}
}
catch (MalformedURLException e) {
System.err.println(e);
}
catch (IOException e) {
System.err.println(e);
}
catch (NullPointerException e) {
System.err.println(e);
e.printStackTrace();
}
|
public static void | main(java.lang.String[] args)
String name;
if (args.length == 0) name = "test.fit";
else name = args[0] + ".fits";
fits f = new fits(name);
URLConnection.setContentHandlerFactory(f);
f.resize(252, 252);
f.fc = new fitsContentHandler();
f.init();
f.show();
|
public void | paint(java.awt.Graphics g)
g.drawImage(theImage, 0, 0, this);
|