Package utils :: Module udraw_connector :: Class udraw_connector
[show private | hide private]
[frames | no frames]

Class udraw_connector


This class provides an abstracted interface for communicating with uDraw(Graph) when it is configured to listen on a TCP socket in server mode.

To Do: Debug various broken routines, abstract more of the uDraw API.

Method Summary
  __init__(self, host, port)
  change_element_color(self, element, id, color)
This command is used to update the attributes of nodes and edges that exist in the current graph.
  focus_node(self, node_id, animated)
Scrolls the visible part of the graph visualization to the node specified by "node_id".
  graph_new(self, graph)
Sends a graph in term representation format to uDraw(Graph) for visualization.
  graph_update(self, graph)
This command can be used to update the structure of the currently loaded graph.
  layout_improve_all(self)
This command starts the layout algorithm to improve the visualization quality of the whole graph by reducing unnecessary edge crossings and edge bends.
  message_loop(self, arg1, arg2)
This routine should be threaded out.
  open_survey_view(self)
Open a survey view showing the whole graph in a reduced scale.
  parse(self, answer)
  scale(self, parameter)
Sets the scale to the given parameter which is a percent value that must be from 1 to 100.
  send(self, data)
  set_command_handler(self, command, callback_func)
Set a callback for the specified command.
  window_background(self, bg)
Sets the background of the base window to the color specified by parameter bg.
  window_status(self, msg)
Displays a message in the right footer area of the base window.
  window_title(self, msg)
Sets the title of the base window to msg.

Class Variable Summary
dict command_handlers = {}
NoneType sock = None                                                                  

Method Details

change_element_color(self, element, id, color)

This command is used to update the attributes of nodes and edges that exist in the current graph.

focus_node(self, node_id, animated=True)

Scrolls the visible part of the graph visualization to the node specified by "node_id".

To Do: This routine is buggy. Appears to only want to work when being called after a call to change_element_color(), though the element color change will not actually work. Need to debug.

graph_new(self, graph)

Sends a graph in term representation format to uDraw(Graph) for visualization.

graph_update(self, graph)

This command can be used to update the structure of the currently loaded graph.

To Do: This routine is not behaving appropriately, need to debug.

layout_improve_all(self)

This command starts the layout algorithm to improve the visualization quality of the whole graph by reducing unnecessary edge crossings and edge bends.

message_loop(self, arg1, arg2)

This routine should be threaded out. This routine will normally be called in the following fashion:

    thread.start_new_thread(udraw.message_loop, (None, None))

The arguments to this routine are not currently used and will be ignored.

open_survey_view(self)

Open a survey view showing the whole graph in a reduced scale.

scale(self, parameter)

Sets the scale to the given parameter which is a percent value that must be from 1 to 100.

set_command_handler(self, command, callback_func)

Set a callback for the specified command. The prototype of the callback routines is:
   func (udraw_connector, args)
You can register a callback for any command received from the udraw server.
Parameters:
command - Command string
           (type=String)
callback_func - Function to call when specified exception code is caught.
           (type=Function)

window_background(self, bg)

Sets the background of the base window to the color specified by parameter bg. This is a RGB value like "#0f331e" in the same format as used for command-line option -graphbg.

window_status(self, msg)

Displays a message in the right footer area of the base window.

window_title(self, msg)

Sets the title of the base window to msg.

Class Variable Details

command_handlers

Type:
dict
Value:
{}                                                                     

sock

Type:
NoneType
Value:
None                                                                  

Generated by Epydoc 2.1 on Fri Jun 16 17:16:26 2006 http://epydoc.sf.net