Package stripchart :: Module striptableau :: Class StripTableau
[show private | hide private]
[frames | no frames]

Class StripTableau


Widget for displaying a table of strip charts.

This widget acts as a container for a set of TableauItem widgets, and acts to display a set, or tableau, of different sets of data that might be displayed on a StripChart or ScaledStripChart widget. Conceptually, the StripTableau may be thought of as containing a set of channels, each of which contains some data to be displayed. For example, each channel might contain the data from a single strain gauge in a rosette.

To make the best use of a StripTableau widget, the caller should set up the metadata region of the TableauItems it contains. If this is done, then the individual channels of the StripTableau can be "minimized" into a toolbar by clicking on each channel's close button. Channels can be restored from the toolbar by clicking on the toolbar button representing the channel.

To add a set of data to a StripTableau, you would do something like this:
>>> import gtk, striptableau
>>> hadj = gtk.Adjustment(0, 0, 100, 1, 10, 10)  # horizontal range
>>> sel  = gtk.Adjustment(-1)                    # selection
>>> striptableau = striptableau.StripTableau(hadj, sel)
>>> striptableau.metawidth  = 100  # width of the metadata region
>>> striptableau.gradewidth = 100  # width of the VGrade widget
>>> channel_vadj = gtk.Adjustment(-10, -20, 20, 0, 0, 20)
>>> channel_data = [ 0, 1, 2, 3, 4, 5 ]
>>> channel = striptableau.addChannel(channel_data, channel_vadj)
>>> channel.name = "My Data"
The widget is designed to work closely with the TableauItem widget.

See Also: TableauItem

Method Summary
  __init__(self, hadjustment, selection)
Initializes the widget.
  __delattr__(self, name, value)
Deletes attributes.
  __setattr__(self, name, value)
Sets attributes.
TableauItem addChannel(self, data, vadjustment)
Adds a channel to the widget.
TableauItem getChannel(self, data)
Returns the TableauItem associated with a particular channel.
  zoomIn(self)
Zoom in.
  zoomOut(self)
Zooms out.
  zoomSel(self)
Zoom to selection.
  __init_gui(self)
Does initial GUI setup for the StripTableau.
  __min_button_handler(self, widget, data)
Handles presses on the close buttons of the TableauItem sub-widgets.
  __set_gradewidth(self, value)
Sets the gradewidth of the TableauItem subwidgets.
  __set_hadjustment(self, value)
Sets the hadjustment for the widget.
  __set_metawidth(self, value)
Sets the metawidth of the TableauItem subwidgets.
  __set_selection(self, value)
Sets the selection for the widget.
  __toolbar_btn_handler(self, widget, data)
Handles clicks on the internal toolbar buttons.

Instance Variable Summary
int gradewidth: Width of the VGrade widgets displayed on the left of the StripTableau.
gtk.Adjustment hadjustment: Controls the horizontal range displayed.
int metawidth: Width of the metadata region on the right of the StripTableau.
gtk.Adjustment selection: Controls the selection.
gtk.VBox widget: Read-only pseudo-parent widget.

Method Details

__init__(self, hadjustment, selection=None)
(Constructor)

Initializes the widget.
Parameters:
hadjustment - Controls the horizontal range displayed on the widget.
           (type=gtk.Adjustment)
selection - Controls the selection displayed on the widget. Set this value to None to disable selection or to gtk.Adjustment(-1) to have an empty selection.
           (type=gtk.Adjustment)

__delattr__(self, name, value)

Deletes attributes.

__setattr__(self, name, value)

Sets attributes.

addChannel(self, data, vadjustment=None)

Adds a channel to the widget.

Call this method to add a data channel to the StripTableau. The method returns a TableauItem object which is the sub-widget that displays that data within the StripTableau.
Parameters:
data - Data to display. See the StripChart widget for a description of valid data objects.
           (type=Sequence object.)
vadjustment - Vertical range control.
           (type=gtk.Adjustment)
Returns:
TableauItem for the channel.
           (type=TableauItem)

getChannel(self, data)

Returns the TableauItem associated with a particular channel.

When a channel is added to the StripTableau using the addChannel method, a TableauItem is created to represent the channel data graphically within the StripTableau. This method returns the TableauItem that is associated with the data that was used to create the channel. data must be the original object that was used to create the channel; it cannot be a copy.
Parameters:
data - Data to return the TableauItem for.
           (type=TableauItem)
Returns:
TableauItem for a channel.
           (type=TableauItem)

See Also: addChannel

zoomIn(self)

Zoom in.

This method modifies the hadjustment of the StripTableau by halving its page_size property. This doubles the "zoom" of the widget.

zoomOut(self)

Zooms out.

This method modifies the hadjustment of the StripTableau by doubling its page_size property. This halves the "zoom" of the widget. If the change to the page_size puts any part of the view out of the lower to upper range then this is corrected for.

zoomSel(self)

Zoom to selection.

This method examines the selection of the StripTableau, and sets the hadjustment of the widget to match the selection. The selection is then cleared.

__init_gui(self)

Does initial GUI setup for the StripTableau.

__min_button_handler(self, widget, data)

Handles presses on the close buttons of the TableauItem sub-widgets.

__set_gradewidth(self, value)

Sets the gradewidth of the TableauItem subwidgets.

__set_hadjustment(self, value)

Sets the hadjustment for the widget.

__set_metawidth(self, value)

Sets the metawidth of the TableauItem subwidgets.

__set_selection(self, value)

Sets the selection for the widget.

__toolbar_btn_handler(self, widget, data)

Handles clicks on the internal toolbar buttons.

Instance Variable Details

gradewidth

Width of the VGrade widgets displayed on the left of the StripTableau.
Type:
int

hadjustment

Controls the horizontal range displayed.
Type:
gtk.Adjustment

metawidth

Width of the metadata region on the right of the StripTableau.
Type:
int

selection

Controls the selection. Set this value to None to have no selection or to gtk.Adjustment(-1) to have an empty selection.
Type:
gtk.Adjustment

widget

Read-only pseudo-parent widget.
Type:
gtk.VBox

Generated by Epydoc 2.0 on Sat Oct 25 11:04:43 2003 http://epydoc.sf.net