Class ::tycho::Node


Inherits: ::tycho::Picture - Source File - Contents: public procs - public commons
A "node" class for dataflow diagrams and the like. By default, this class provides a reasonable representation of a graph node, but it can be parameterized for different "icons" and "terminals." More complex control over appearance can be achieved by subclassing.

Note: Because this class is highly parameterized, it is not very efficient. A more efficient version with hardwired icon and terminal types could be created if this becomes a problem.

Reading Picture documentation.

Note: This is an experimental class.


Public constructs

Public Procs

construct id canvas slate tags x0 y0 x1 y1 args
Create a new item.
_font id canvas slate font
Update the -font option.
_icontype id canvas slate icontype
Update the -icontype option.
_inputs id canvas slate inputs
The option representing the positions of the input connections. Each of these is a list of connection positions, in % and relative to the top-left corner of the picture's outline. Each position is a pair, with each number the percentage distance along the horizontal and vertical axis respectively. For example, a single point in the center of the left edge is *{0 50}*; two points along the bottom edge could be *{25 100 75 100}*.

By default, there is one input on the left edge and one output on the right edge.

Setting this configuration option supports a handy shortcut: A single number sets the list to evenly spaced positions along the left (input) or right (output) edges. For example, the option *-inputs 2* to the constructor will result in the -inputs variable being set to *{0 25 0 75}*.

_intype id canvas slate intype
Update the -intype option.
_name id canvas slate name
Update the -name option.
_outputs id canvas slate outputs
See _inputs for comments.
_outtype id canvas slate outtype
Update the -outtype option.
aspect id canvas slate args
Return aspects of a node. Aspects are of the form input-n or $output-*n.

FIXME: Make more efficient.

FIXME: Do we really need this? Terminal positions can be found more easily by using component and then calling aspects on those. Plus it doesn't assume that the ports have an aspect called "terminal.".

coords id canvas slate args
Get or set the coordinates of the Node's icon.
component id canvas slate {name {}}
Return a component of a node. Component names are of the form input-n or $output-*n.
redrawinputs id canvas slate positions
redrawoutputs id canvas slate positions

Public Commons

_font
The font to use to display the icon name.
_icontype
The type of item to use for the icon.
_inputs
The positions of the input ports.
_intype
The type of item and options to use for the input ports.
_name
The name to display on the icon.
_outputs
The positions of the output ports.
_outtype
The type of item and options to use for the output ports.
iconitem
The item used as the node's icon.
textitem
The label attached to the icon.
inports
The input ports.
outports
The output ports.
methodtable
All methods are looked up through a table.
optiondefault
All options have a default value.
indirn
The "direction" of the input ports.
outdirn
The "direction" of the output ports.

Index of classes



Author: H. John Reekie
Version: @(#)Node.itcl 1.9 12/13/96
Copyright: (c) 1996 The Regents of the University of California.