Re: [ba-ohs-talk] TouchGraph used on backlink DB
OK this works: (01)
public void getBDBGraph()
{
String line = ""; (02)
try
{
BufferedReader bdbReader = new BufferedReader(new
FileReader("C:\\Temp\\backlinks.txt"));
while(line != null)
{
line = bdbReader.readLine();
if(line == null) {continue;}
System.out.println(line);
int midspace = line.indexOf(9); //hunts TAB chars
if(midspace != -1)
{
System.out.println("midspace: " + midspace);
int linelngth= line.length();
String firststr = line.substring(0, midspace-1);
String secondstr= line.substring(midspace+1, linelngth);
Node r = tgPanel.getGES().findNode(firststr);
if(r == null)
{
r = new Node(firststr);
tgPanel.addNode(r);
} (03)
Node n = tgPanel.getGES().findNode(secondstr);
if(n == null)
{
n = new Node(secondstr);
tgPanel.addNode(n);
} (04)
if(tgPanel.findEdge(r, n)==null)
{
tgPanel.addEdge(r, n, 4000);
} (05)
}
}
}
catch(IOException exc)
{
System.out.println("getBDBGraph: " + exc);
} (06)
} (07)
--
Cheers,
Peter
----- Original Message -----
From: "Peter Jones" <ppj@concept67.fsnet.co.uk>
To: <ba-ohs-talk@bootstrap.org>
Sent: Friday, December 14, 2001 9:02 PM
Subject: Re: [ba-ohs-talk] TouchGraph used on Langreiter.com (08)
> Hi Eugene,
>
> I'm working with the TouchGraph GraphLayout code on Windows with jdk1.3.
>
> (Warning: crude but effective hack incoming! Good code purists might want
to
> take cover.)
>
> If you slap this:
>
> public void getBDBGraph()
> {
> String line = "";
>
> try
> {
> BufferedReader bdbReader = new BufferedReader(new
> FileReader("C:\\Temp\\backlinks.txt"));
> while(line != null)
> {
> line = bdbReader.readLine();
> if(line == null) {continue;}
> System.out.println(line);
> int midspace = line.indexOf(9); //hunts TAB chars
> if(midspace != -1)
> {
> System.out.println("midspace: " + midspace);
> int linelngth= line.length();
> String firststr = line.substring(0, midspace-1);
> String secondstr= line.substring(midspace+1, linelngth);
> Node r = new Node(firststr);
> Node n = new Node(secondstr);
> tgPanel.addNode(r);
> tgPanel.addNode(n);
>
> if(tgPanel.findEdge(r, n)==null)
> {
> tgPanel.addEdge(r, n, 4000);
> }
> }
> }
> }
> catch(IOException exc)
> {
> System.out.println("getBDBGraph: " + exc);
> }
>
> }
>
> ... into the GLPanel class, and then in the main() method replace the call
> to,
> //randomGraph();
> //with
> getBDBGraph();
>
> Making sure that the backlinks.txt file is in C:\temp\
>
> then you can look at the backlink data as a graph.... a bit slowly though,
> because the long Node names seem to really slow the lovely app down when
it
> comes to working out the tensions, label overlaps and so forth(on my box
> anyway).
> (Something to add to your list, I figure, Alex.)
>
> --
> Cheers,
> Peter
>
>
>
> ----- Original Message -----
> From: "Eugene Eric Kim" <eekim@eekim.com>
> To: <ba-ohs-talk@bootstrap.org>
> Sent: Friday, December 14, 2001 7:24 AM
> Subject: Re: [ba-ohs-talk] TouchGraph used on Langreiter.com
>
>
> > On Mon, 10 Dec 2001, Alex Shapiro wrote:
> >
> > > Great news: Christian Langreiter of http://www.langreiter.com has
> > > integrated TouchGraph into his Vanilla Hypertext System
> > > http://www.langreiter.com/space/vanilla-download
> >
> > This is really great news; congratulations, Alex! I'll look forward to
> > the day when TouchGraph is part of every Wiki implementation. :-)
> >
> > > This implementation is interesting, because one can easily see it
being
> > > applied to visualize that recently created Backlink Database. The same
> > > strategy of rendering the DB as a series of connected trees with a
> > > Date/Post/Internal-link hierarchy could be followed.
> > >
> > > Unfortunately, I don't have the time to undertake this task myself,
> > > because I am working hard to get out the next LinkBrowser version. As
> > > usual though, I would be more then happy to assist anyone willing to
try
> > > it. (Maybe it would be best to wait for the next LinkBrowser release,
> > > because this should clear up a lot of the coding issues.)
> >
> > I actually attempted this before posting my original announcement, but
> > couldn't do it in less than 15 minutes, and gave up. :-) I do want to
> > give this a shot myself when I do get a chance -- unless someone wants
to
> > beat me to it -- and will definitely take you up on your offer. When's
> > the ETA for the next release?
> >
> > -Eugene
> >
> > --
> > +=== Eugene Eric Kim ===== eekim@eekim.com ===== http://www.eekim.com/
> ===+
> > | "Writer's block is a fancy term made up by whiners so they
> |
> > +===== can have an excuse to drink alcohol." --Steve Martin
> ===========+
> >
> >
>
> (09)