bamboo.vis
Class Vis

java.lang.Object
  extended by bamboo.vis.Vis

public class Vis
extends Object

The beginnings of a Bamboo visualizer, originally cribbed from the Diva Connector tutorial.

Version:
$Id: Vis.java,v 1.31 2005/03/02 02:25:13 srhea Exp $
Author:
Sean C. Rhea

Nested Class Summary
 class Vis.BambooNode
           
protected static interface Vis.ForNodeFn
           
 
Field Summary
protected  ASyncCore acore
           
protected  diva.canvas.interactor.SelectionInteractor bamboo_node_interactor
           
protected  Runnable check_all_nodes_cb
           
protected  long check_period_ms
           
protected  Curry.Thunk2<FetchNodeInfoThread.NodeInfo,SocketChannel> connect_cb
           
protected  double dot_radius
           
protected  diva.gui.BasicFrame frame
           
protected  HashMap<String,FetchNodeInfoThread.NodeInfo> inflight
           
protected static org.apache.log4j.Logger logger
           
protected  long max_concurrent
           
protected  BigInteger MODULUS
           
protected  JLabel node_count_label
           
protected  HashMap<BigInteger,Vis.BambooNode> nodes_by_id
           
protected  Curry.Thunk3<FetchNodeInfoThread.NodeInfo,SocketChannel,ByteBuffer> read_cb
           
protected  boolean ring_mode
           
protected  double ring_radius
           
protected  diva.canvas.toolbox.BasicEllipse the_ring
           
protected  HashMap<String,FetchNodeInfoThread.NodeInfo> waiting
           
protected  LinkedList<String> waitlist
           
protected  Curry.Thunk2<FetchNodeInfoThread.NodeInfo,SocketChannel> write_cb
           
protected  double x_offset
           
protected  JScrollBar x_scrollbar
           
protected  double y_offset
           
protected  JScrollBar y_scrollbar
           
protected  double zoom
           
protected  JSlider zoom_slider
           
 
Constructor Summary
Vis(ASyncCore acore, BigInteger mod)
           
 
Method Summary
protected  void add_node_dialog()
           
protected  void add_work(String url, BigInteger id)
           
protected  void change_dot_radius_dialog()
           
protected  void check_waiting()
           
protected  void create_menus(diva.gui.BasicFrame frame)
           
protected  void fetch_failed(FetchNodeInfoThread.NodeInfo ninfo)
           
protected  void fetch_node_info(FetchNodeInfoThread.NodeInfo ninfo)
           
protected  void fetch_succeeded(FetchNodeInfoThread.NodeInfo ninfo)
           
protected  void fit_in_window()
           
 void for_all_nodes(Vis.ForNodeFn fn)
           
static void main(String[] args)
           
protected  String nid2url(ostore.util.NodeId n)
           
protected  boolean outstanding(String url)
           
protected  void redraw_all()
           
 void run()
           
protected  void set_check_period_dialog()
           
protected  void set_dot_radius(double value)
           
protected  void show_path_dialog()
           
protected  double slider_to_zoom(int slider)
           
protected  void update_node_count()
           
protected  void update_transform()
           
protected static InetSocketAddress url2addr(String str)
           
 double x_pos_g(BigInteger guid)
           
 double y_pos_g(BigInteger guid)
           
protected  int zoom_to_slider(double zoom)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

ring_radius

protected double ring_radius

dot_radius

protected double dot_radius

MODULUS

protected BigInteger MODULUS

bamboo_node_interactor

protected diva.canvas.interactor.SelectionInteractor bamboo_node_interactor

ring_mode

protected boolean ring_mode

nodes_by_id

protected HashMap<BigInteger,Vis.BambooNode> nodes_by_id

zoom_slider

protected JSlider zoom_slider

zoom

protected double zoom

x_scrollbar

protected JScrollBar x_scrollbar

y_scrollbar

protected JScrollBar y_scrollbar

x_offset

protected double x_offset

y_offset

protected double y_offset

node_count_label

protected JLabel node_count_label

frame

protected diva.gui.BasicFrame frame

the_ring

protected diva.canvas.toolbox.BasicEllipse the_ring

check_period_ms

protected long check_period_ms

max_concurrent

protected long max_concurrent

acore

protected ASyncCore acore

waitlist

protected LinkedList<String> waitlist

waiting

protected HashMap<String,FetchNodeInfoThread.NodeInfo> waiting

inflight

protected HashMap<String,FetchNodeInfoThread.NodeInfo> inflight

check_all_nodes_cb

protected Runnable check_all_nodes_cb

connect_cb

protected Curry.Thunk2<FetchNodeInfoThread.NodeInfo,SocketChannel> connect_cb

write_cb

protected Curry.Thunk2<FetchNodeInfoThread.NodeInfo,SocketChannel> write_cb

read_cb

protected Curry.Thunk3<FetchNodeInfoThread.NodeInfo,SocketChannel,ByteBuffer> read_cb
Constructor Detail

Vis

public Vis(ASyncCore acore,
           BigInteger mod)
Method Detail

x_pos_g

public final double x_pos_g(BigInteger guid)

y_pos_g

public final double y_pos_g(BigInteger guid)

fit_in_window

protected void fit_in_window()

update_transform

protected void update_transform()

slider_to_zoom

protected double slider_to_zoom(int slider)

zoom_to_slider

protected int zoom_to_slider(double zoom)

create_menus

protected void create_menus(diva.gui.BasicFrame frame)

add_node_dialog

protected void add_node_dialog()

show_path_dialog

protected void show_path_dialog()

change_dot_radius_dialog

protected void change_dot_radius_dialog()

set_check_period_dialog

protected void set_check_period_dialog()

update_node_count

protected void update_node_count()

set_dot_radius

protected void set_dot_radius(double value)

redraw_all

protected void redraw_all()

for_all_nodes

public void for_all_nodes(Vis.ForNodeFn fn)

nid2url

protected String nid2url(ostore.util.NodeId n)

fetch_succeeded

protected void fetch_succeeded(FetchNodeInfoThread.NodeInfo ninfo)

fetch_failed

protected void fetch_failed(FetchNodeInfoThread.NodeInfo ninfo)

url2addr

protected static InetSocketAddress url2addr(String str)

outstanding

protected boolean outstanding(String url)

add_work

protected void add_work(String url,
                        BigInteger id)

check_waiting

protected void check_waiting()

fetch_node_info

protected void fetch_node_info(FetchNodeInfoThread.NodeInfo ninfo)

run

public void run()

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException