Package saui_pr4 :: Module latticeui :: Class LatticeView
[hide private]
[frames] | no frames]

Class LatticeView

source code

        object --+                
                 |                
   gobject.GObject --+            
                     |            
            gtk.Object --+        
                         |        
        object --+       |        
                 |       |        
gobject.GInterface --+   |        
                     |   |        
  atk.ImplementorIface --+        
                         |        
        object --+       |        
                 |       |        
gobject.GInterface --+   |        
                     |   |        
         gtk.Buildable --+        
                         |        
                gtk.Widget --+    
                             |    
               gtk.DrawingArea --+
                                 |
                                LatticeView

Handles the visual presentation of word lattices for multitouch error correction. Since user input and display are tightly coupled, there is no separate controller object.

Nested Classes [hide private]
  DisplayWord
One word to be displayed in the lattice view.
  DisplayCloud
A "cloud" of words to be displayed in the lattice view.
Instance Methods [hide private]
 
__init__(self, model)
Construct a LatticeView.
source code
LatticeView.DisplayWord
find_word(self, x, y)
Find and return the display word (if any) which contains point (x,y).
source code
LatticeView.DisplayCloud
find_cloud(self, x, y)
Find and return the display cloud (if any) which contains point (x,y).
source code
 
absorb_cloud(self, cloud)
Reclaim output words from a cloud and dispose of it.
source code
 
extend_cloud(self, cloud, x, y)
Merge cloud with adjoining cloud or word at (x,y).
source code
 
button_press(self, widget, event)
Repond to button press events.
source code
 
button_release(self, widget, event)
Repond to button release events.
source code
 
motion_notify(self, widget, event)
Repond to motion notify events.
source code
 
configure(self, widget, event)
Respond to configure events.
source code
 
expose(self, widget, event)
Respond to expose events.
source code
 
draw(self)
Draw or re-draw the lattice presentation
source code

Inherited from gtk.DrawingArea: size

Inherited from gtk.Widget: activate, add_accelerator, add_events, add_mnemonic_label, can_activate_accel, child_focus, child_notify, class_path, create_pango_context, create_pango_layout, destroy, do_button_press_event, do_button_release_event, do_can_activate_accel, do_client_event, do_composited_changed, do_configure_event, do_delete_event, do_destroy_event, do_direction_changed, do_drag_begin, do_drag_data_delete, do_drag_data_get, do_drag_data_received, do_drag_drop, do_drag_end, do_drag_leave, do_drag_motion, do_enter_notify_event, do_event, do_expose_event, do_focus, do_focus_in_event, do_focus_out_event, do_get_accessible, do_grab_broken_event, do_grab_focus, do_grab_notify, do_hide, do_hide_all, do_hierarchy_changed, do_key_press_event, do_key_release_event, do_leave_notify_event, do_map, do_map_event, do_mnemonic_activate, do_motion_notify_event, do_no_expose_event, do_parent_set, do_popup_menu, do_property_notify_event, do_proximity_in_event, do_proximity_out_event, do_realize, do_screen_changed, do_scroll_event, do_selection_clear_event, do_selection_get, do_selection_notify_event, do_selection_received, do_selection_request_event, do_show, do_show_all, do_show_help, do_size_allocate, do_size_request, do_state_changed, do_style_set, do_unmap, do_unmap_event, do_unrealize, do_visibility_notify_event, do_window_state_event, drag_begin, drag_check_threshold, drag_dest_add_image_targets, drag_dest_add_text_targets, drag_dest_add_uri_targets, drag_dest_find_target, drag_dest_get_target_list, drag_dest_get_track_motion, drag_dest_set, drag_dest_set_proxy, drag_dest_set_target_list, drag_dest_set_track_motion, drag_dest_unset, drag_get_data, drag_highlight, drag_source_add_image_targets, drag_source_add_text_targets, drag_source_add_uri_targets, drag_source_get_target_list, drag_source_set, drag_source_set_icon, drag_source_set_icon_name, drag_source_set_icon_pixbuf, drag_source_set_icon_stock, drag_source_set_target_list, drag_source_unset, drag_unhighlight, ensure_style, error_bell, event, freeze_child_notify, get_accessible, get_action, get_activate_signal, get_allocation, get_ancestor, get_child_requisition, get_child_visible, get_clipboard, get_colormap, get_composite_name, get_direction, get_display, get_events, get_extension_events, get_has_tooltip, get_modifier_style, get_name, get_no_show_all, get_pango_context, get_parent, get_parent_window, get_pointer, get_root_window, get_screen, get_settings, get_size_request, get_style, get_tooltip_markup, get_tooltip_text, get_tooltip_window, get_toplevel, get_visual, grab_add, grab_default, grab_focus, grab_remove, has_screen, hide, hide_all, hide_on_delete, input_shape_combine_mask, intersect, is_ancestor, is_composited, is_focus, keynav_failed, list_mnemonic_labels, map, menu_get_for_attach_widget, mnemonic_activate, modify_base, modify_bg, modify_cursor, modify_fg, modify_font, modify_style, modify_text, path, queue_clear, queue_clear_area, queue_draw, queue_draw_area, queue_resize, queue_resize_no_redraw, rc_get_style, realize, region_intersect, remove_accelerator, remove_mnemonic_label, render_icon, reparent, reset_rc_styles, reset_shapes, selection_add_target, selection_add_targets, selection_clear_targets, selection_convert, selection_owner_set, selection_remove_all, send_expose, set_accel_path, set_activate_signal, set_app_paintable, set_child_visible, set_colormap, set_composite_name, set_direction, set_double_buffered, set_events, set_extension_events, set_name, set_no_show_all, set_parent, set_parent_window, set_redraw_on_allocate, set_scroll_adjustments, set_sensitive, set_set_scroll_adjustments_signal, set_size_request, set_state, set_style, set_tooltip_markup, set_tooltip_text, set_tooltip_window, set_uposition, set_usize, shape_combine_mask, show, show_all, show_now, size_allocate, size_request, style_get_property, thaw_child_notify, translate_coordinates, trigger_tooltip_query, unmap, unparent, unrealize

Inherited from gtk.Object: do_destroy, flags, remove_data, remove_no_notify, set_flags, unset_flags

Inherited from gobject.GObject: __cmp__, __delattr__, __gdoc__, __gobject_init__, __hash__, __new__, __repr__, __setattr__, chain, connect, connect_after, connect_object, connect_object_after, disconnect, disconnect_by_func, emit, emit_stop_by_name, freeze_notify, get_data, get_properties, get_property, handler_block, handler_block_by_func, handler_disconnect, handler_is_connected, handler_unblock, handler_unblock_by_func, notify, props, set_data, set_properties, set_property, stop_emission, thaw_notify, weak_ref

Inherited from atk.ImplementorIface: ref_accessible

Inherited from gtk.Buildable: add_child, construct_child, do_add_child, do_construct_child, do_get_internal_child, do_parser_finished, do_set_name, get_internal_child, parser_finished

Inherited from object: __getattribute__, __reduce__, __reduce_ex__, __str__

Class Variables [hide private]
  XPADDING = 25
Horizontal padding to add to the edges of the text
  YPADDING = 150
Vertical expansion area to add to the edges of the text
  FONTSIZE = 24.0
Basic font size for text
  PROBSCALE = 0.75
Squashing factor to apply to probabilities
  NO_DRAG = 0
No dragging or expansion currently in progress
  PRE_DRAG = 2
Dragging might start if the mouse moves
  IN_DRAG = 3
Dragging is going on

Inherited from gtk.DrawingArea: __gtype__

Instance Variables [hide private]
int drag_state
State of dragging/expansion
  drag_word
Word currently being dragged
  drag_cloud
Cloud currently being dragged
set(LatticeView.DisplayCloud) clouds
Clouds in the display
LatticeModel model
Model object representing the word lattice
set(LatticeView.DisplayWord) words
Words in the display
Properties [hide private]

Inherited from gtk.Widget: allocation, name, parent, saved_state, state, style, window

Inherited from gobject.GObject: __grefcount__

Inherited from object: __class__

Method Details [hide private]

__init__(self, model)
(Constructor)

source code 
Construct a LatticeView.
Parameters:
  • model (LatticeModel) - model containing the word lattice and best hypothesis to be displayed.
Overrides: gtk.DrawingArea.__init__

find_word(self, x, y)

source code 
Find and return the display word (if any) which contains point (x,y).
Parameters:
  • x (int) - Horizontal pixel position inside this view.
  • y (int) - Vertical pixel position inside this view.
Returns: LatticeView.DisplayWord
Word which contains point (x,y)

find_cloud(self, x, y)

source code 
Find and return the display cloud (if any) which contains point (x,y).
Parameters:
  • x (int) - Horizontal pixel position inside this view.
  • y (int) - Vertical pixel position inside this view.
Returns: LatticeView.DisplayCloud
Cloud which contains point (x,y)

absorb_cloud(self, cloud)

source code 
Reclaim output words from a cloud and dispose of it.
Parameters:
  • cloud (LatticeView.DisplayCloud) - The cloud to get rid of

extend_cloud(self, cloud, x, y)

source code 
Merge cloud with adjoining cloud or word at (x,y).
Parameters:
  • cloud (LatticeView.DisplayCloud) - The cloud to expand
  • x (int) - Horizontal pixel position inside adjoining cloud/word
  • y (int) - Vertical pixel position inside adjoining cloud/word

button_press(self, widget, event)

source code 
Repond to button press events.
Parameters:
  • widget (gtk.Widget) - reference to widget where event occurred
  • event (gtk.gdk.Event) - reference to the event

button_release(self, widget, event)

source code 
Repond to button release events.
Parameters:
  • widget (gtk.Widget) - reference to widget where event occurred
  • event (gtk.gdk.Event) - reference to the event

motion_notify(self, widget, event)

source code 
Repond to motion notify events.
Parameters:
  • widget (gtk.Widget) - reference to widget where event occurred
  • event (gtk.gdk.Event) - reference to the event

configure(self, widget, event)

source code 
Respond to configure events.
Parameters:
  • widget (gtk.Widget) - reference to widget where event occurred
  • event (gtk.gdk.Event) - reference to the event

expose(self, widget, event)

source code 
Respond to expose events.
Parameters:
  • widget (gtk.Widget) - reference to widget where event occurred
  • event (gtk.gdk.Event) - reference to the event

draw(self)

source code 
Draw or re-draw the lattice presentation
Overrides: gtk.Widget.draw