ThreeB 1.1
ThreeBHelp.java
Go to the documentation of this file.
00001 import ij.plugin.*;
00002 import ij.plugin.filter.*;
00003 import ij.gui.*;
00004 
00005 import java.awt.event.*;
00006 import java.awt.geom.*;
00007 import java.util.*;
00008 import java.io.*;
00009 import javax.swing.*;
00010 import javax.swing.event.*;
00011 import java.lang.InterruptedException;
00012 import java.lang.System;
00013 import java.lang.Math.*;
00014 
00015 ///3B plugin cclass to bring up a basic help window.
00016 ///@ingroup gPlugin
00017 public class ThreeBHelp implements PlugIn {
00018 
00019     public void run(String arg)
00020     {
00021         String path = getClass().getResource("img/").toString();
00022         Reader htmlstream = new InputStreamReader(getClass().getClassLoader().getResourceAsStream("instructions.html"));
00023         String html = Util.read(htmlstream);
00024 
00025         html = html.replaceAll("img/", path);
00026 
00027         JFrame w = new JFrame("3B help");
00028 
00029         JEditorPane l = new JEditorPane();
00030         try{
00031             l.setPage(getClass().getResource("instructions.html").toString());
00032         }
00033         catch(IOException e)
00034         {}
00035         //l.resize(new java.awt.Dimension(800,600));
00036 
00037         JScrollPane s = new JScrollPane(l, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
00038 
00039         java.awt.Dimension  d = new java.awt.Dimension(600, 600);
00040 
00041         w.add(s);
00042         w.pack();
00043         w.setSize(d);
00044         w.setVisible(true);
00045         
00046     }
00047 
00048 };