
The CLabelsTool allows labeling and highlighting (drawing circles) on objects on the screen. It also provides convenient C/Python API functions, allowing C and Python programs to label and/or highlight items on the screen.
TinkerCell is a Computer-Aided Design software tool for Synthetic Biology that promotes collaboration through its plugin interface. This blog is used to keep notes on updates to the project.




The console emits a signal whenever the user types a command. The plugins may then choose to respond to the command. The Python plugin in one such tool (the only one currently). The command window provides plugins with the ability to "freeze" the command window. Since Python runs on a separate thread, this is neccessary. Python "freezes" the command window when it starts executing the command and "unfreezes" the command window when it is done.
The Model Summary Tool is a window on which other tools can post relevant information. The Model Summary Tool sends two signals: the first allows the tools to declare the variables and equations that they are going to display, and the second allows each tool to look at what the other tools are displaying and modify the information presented. For example. the Stoichiometry and Rates tool posts all the rates, and the Numerical Attributes tool uses this information to show only the parameters that are being used in those equations (rather than showing all the numerical attributes). 
nodes = pytc.itemsOfFamily("node");
connections = pytc.itemsOfFamily("connection");
numNodes = len(nodes);
numConnections = len(connections);
M = [];
for i in range(0,numConnections):
pytc.setStraight(connections[i]);
connected_nodes = pytc.getConnectedParts( connections[i] );
for j in connected_nodes:
n = 0;
for k in range(0,numNodes):
if nodes[k] == j:
n = k;
break;
n += numConnections;
M.append( (i,n) ); #connection i and node k are connected
G = nx.Graph();
G.add_nodes_from( range( 0, numConnections + numNodes ) );
G.add_edges_from(M);
Pos = nx.spring_layout(G);
minx = 0;
maxx = 0;
miny = 0;
maxy = 0;
for i in range(0,len(Pos)):
if minx == 0 or minx > Pos[i][0]:
minx = Pos[i][0];
if miny == 0 or miny > Pos[i][1]:
miny = Pos[i][1];
if maxx == 0 or maxx <>
maxx = Pos[i][0];
if maxy == 0 or maxy <>
maxy = Pos[i][0];
for i in range(0,len(Pos)):
Pos[i][0] += - minx;
Pos[i][0] *= 500.0/(maxx - minx);
Pos[i][1] += - miny;
Pos[i][1] *= 500.0/(maxy - miny);
for i in range(0,numConnections):
pytc.setCenterPoint(connections[i],Pos[i][0],Pos[i][1]);
for i in range(numConnections,numConnections+numNodes):
pytc.setPos(nodes[i-numConnections],Pos[i][0],Pos[i][1]);
print "layout finished";