Home | Trees | Indices | Help |
|
---|
|
object --+ | ChartView
A component for viewing charts. This is used by
ChartDemo
to allow students to interactively experiment with
various chart parsing techniques. It is also used by
Chart.draw()
.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
_LEAF_SPACING = 10
|
|||
_MARGIN = 10
|
|||
_TREE_LEVEL_SIZE = 12
|
|||
_CHART_LEVEL_SIZE = 40
|
|
|||
_chart The chart that we are giving a view of. |
|||
_chart_canvas The canvas we're using to display the chart itself. |
|||
_chart_height The height of the chart canvas. |
|||
_edgelevels A list of edges at each level of the chart (the top level is the 0th element). |
|||
_edgetags A dictionary mapping from edges to the tags of the canvas elements (lines, etc) used to display that edge. |
|||
_fontsize The current font size |
|||
_marks A dictionary from edges to marks. |
|||
_root The root window. |
|||
_sentence The list of tokens that the chart spans. |
|||
_sentence_canvas The canvas we're using to display the sentence text. |
|||
_sentence_height The height of the sentence canvas. |
|||
_text_height The height of a text string (in the normal font). |
|||
_tree_canvas The canvas we're using to display the tree that each edge spans. |
|||
_tree_height The height of the tree |
|||
_treetags A list of all the tags that make up the tree; used to erase the tree (without erasing the loclines). |
|||
_unitsize Pixel size of one unit (from the location). |
|
|||
Inherited from |
|
Construct a new
|
The configure callback. This is called whenever the window is resized. It is also called when the window is first mapped. It figures out the unit size, and redraws the contents of each canvas. |
Draw any edges that have not been drawn. This is typically called
when a after modifies the canvas that a CanvasView is displaying.
If update is given a |
Return 1 if the given edge overlaps with any edge on the given level. This is used by _add_edge to figure out what level a new edge should be added to. |
Given a new edge, recalculate:
|
Add a single edge to the ChartView:
|
Color in an edge with the given colors. If no colors are specified, use intelligent defaults (dependant on selection, etc.) |
Update the scroll-regions for each canvas. This ensures that everything is within a scroll-region, so the user can use the scrollbars to view the entire display. This does not resize the window. |
Draw location lines. These are vertical gridlines used to show where each location unit is. |
|
|
_chartThe chart that we are giving a view of. This chart may be modified; after it is modified, you should callupdate .
|
_edgelevelsA list of edges at each level of the chart (the top level is the 0th element). This list is used to remember where edges should be drawn; and to make sure that no edges are overlapping on the chart view. |
_edgetagsA dictionary mapping from edges to the tags of the canvas elements (lines, etc) used to display that edge. The values of this dictionary have the form(linetag, rhstag1, dottag, rhstag2, lhstag) .
|
_marksA dictionary from edges to marks. Marks are strings, specifying colors (e.g. 'green'). |
_sentence_canvasThe canvas we're using to display the sentence text. May be None, if we're not displaying the sentence text. |
_tree_canvasThe canvas we're using to display the tree that each edge spans. May be None, if we're not displaying trees. |
_unitsizePixel size of one unit (from the location). This is determined by the span of the chart's location, and the width of the chart display canvas. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Wed Aug 27 15:08:54 2008 | http://epydoc.sourceforge.net |