[Jtreeview-cvs] jtreeview commit notification
Brought to you by:
alokito
From: Alok S. <al...@us...> - 2004-11-02 02:20:15
|
Update of /cvsroot/jtreeview/LinkedView/src/edu/stanford/genetics/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19258/src/edu/stanford/genetics/treeview Modified Files: BrowserControl.java Log Message: moved some unused code around. Index: BrowserControl.java =================================================================== RCS file: /cvsroot/jtreeview/LinkedView/src/edu/stanford/genetics/treeview/BrowserControl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** BrowserControl.java 5 Apr 2004 19:43:13 -0000 1.9 --- BrowserControl.java 2 Nov 2004 02:19:57 -0000 1.10 *************** *** 22,27 **** */ package edu.stanford.genetics.treeview; ! import java.net.*; import java.io.*; /** --- 22,31 ---- */ package edu.stanford.genetics.treeview; ! import java.awt.Frame; ! import java.awt.TextArea; ! import java.awt.event.WindowAdapter; ! import java.awt.event.WindowEvent; import java.io.*; + import java.net.URL; /** *************** *** 50,53 **** --- 54,91 ---- private final static String MAC_ID = "Mac"; + /** + * Pops up a window with the html source of a url. + * Primarily for debugging. + * + * @param url url to show. + */ + public final static void showText(java.net.URL url) { + try { + Reader st = new InputStreamReader(url.openStream()); + int ch; + TextArea mp = new TextArea(); + ch = st.read(); + while (ch != -1) { + char[] cbuf = new char[1]; + cbuf[0] = (char) ch; + mp.append(new String(cbuf)); + ch = st.read(); + } + final Frame top = new Frame("Show URL"); + top.addWindowListener( + new WindowAdapter() { + + public void windowClosing(WindowEvent windowEvent) { + top.dispose(); + } + }); + + top.add(mp); + top.pack(); + top.show(); + + } catch (java.io.IOException e) { + } + } /** |