Package topo :: Package tkgui :: Module plotgrouppanel :: Class PlotGroupPanel
[hide private]
[frames] | no frames]

Class PlotGroupPanel

source code


Nested Classes [hide private]

Inherited from param.parameterized.Parameterized: __metaclass__

Inherited from Tkinter.Misc: getdouble, getint

Instance Methods [hide private]
 
get_plotgroup(self) source code
 
set_plotgroup(self, new_pg) source code
 
__init__(self, master, plotgroup, **params)
If your parameter should be available in history, add its name to the params_in_history list, otherwise it will be disabled in historical views.
source code
 
set_dock(self) source code
 
setup_plotgroup(self)
Perform any necessary initialization of the plotgroup.
source code
 
__process_canvas_event(self, event, func)
Return a dictionary containing the event itself, and, if the event occurs on a plot of a sheet, store the plot and the coordinates ((r,c) and (x,y) for the cell center) on the sheet.
source code
 
_canvas_right_click(self, event_info, show_menu=True)
Update labels on right-click menu and popup the menu, plus store the event info for access by any menu commands that require it.
source code
 
_update_dynamic_info(self, event_info)
Update dynamic information.
source code
 
_dynamic_info_string(self, event_info, x)
Subclasses can override to add extra relevant information.
source code
 
update_plot_frame(self, plots=True, labels=True, geom=False)
set geom True for any action that user would expect to lose his/her manual window size (e.g.
source code
 
refresh_plots(widget, *args, **kw)
Call plotgroup's make_plots with update=True (i.e.
source code
 
redraw_plots(widget, *args, **kw)
Call plotgroup's make_plots with update=False (i.e.
source code
 
rescale_plots(self)
Rescale the existing plots, without calling either the plot_hooks or the pre_plot_hooks, then display the result.
source code
 
refresh(self, update=True)
Main steps for generating plots in the Frame.
source code
 
_determine_layout_of_plots(self, plots)
Calculate self._rows and self._cols, together giving the grid position of each plot.
source code
 
display_plots(self)
This function should be redefined in subclasses for interesting things such as 2D grids.
source code
 
_add_canvas_bindings(self) source code
 
display_labels(self)
This function should be redefined by subclasses to match any changes made to display__plots().
source code
 
reduce_plots(self)
Function called by widget to reduce the plot size, when possible.
source code
 
enlarge_plots(self)
Function called by widget to increase the plot size, when possible.
source code
 
add_to_plotgroups_history(self)
If there are plots on display, and we're not doing a history research, the plotgroup is stored in the history.
source code
 
__set_widget_state(self, widget, state) source code
 
__update_widgets_for_history(self)
The plotgroup's non-history widgets are all irrelevant when the plotgroup's from history.
source code
 
__update_history_buttons(self)
Enable/disable the back and forward buttons depending on where we are in a history research.
source code
 
navigate_pg_history(self, steps) source code
 
_switch_plotgroup(self, newpg)
Switch to a different plotgroup, e.g.
source code
 
_plot_title(self)
Provide a string describing the current set of plots.
source code
 
refresh_title(self)
Set Window title and plot frame's title.
source code
 
destroy(self)
overrides toplevel destroy, adding removal from autorefresh panels
source code

Inherited from param.tk.TkParameterized: gui_get_param, gui_set_param, hide_param, pack_param, repack_param, unhide_param, unpack_param, update_selector

Inherited from param.tk.TkParameterizedBase: __getattribute__, __repr__, __setattr__, change_PO, get_parameter_object, get_parameter_value, get_source_po, set_parameter_value

Inherited from param.parameterized.Parameterized: __getstate__, __setstate__, __str__, debug, defaults, force_new_dynamic_value, get_param_values, get_value_generator, inspect_value, message, print_param_values, script_repr, set_default, set_dynamic_time_fn, set_param, state_pop, state_push, verbose, warning

Inherited from object: __delattr__, __format__, __hash__, __new__, __reduce__, __reduce_ex__, __sizeof__, __subclasshook__

Inherited from Tkinter.BaseWidget (private): _do, _setup

Inherited from Tkinter.Misc: __contains__, __getitem__, __setitem__, after, after_cancel, after_idle, bbox, bell, bind, bind_all, bind_class, bindtags, cget, clipboard_append, clipboard_clear, clipboard_get, colormodel, columnconfigure, config, configure, deletecommand, event_add, event_delete, event_generate, event_info, focus, focus_displayof, focus_force, focus_get, focus_lastfor, focus_set, getboolean, getvar, grab_current, grab_release, grab_set, grab_set_global, grab_status, grid_bbox, grid_columnconfigure, grid_location, grid_propagate, grid_rowconfigure, grid_size, grid_slaves, image_names, image_types, keys, lift, lower, mainloop, nametowidget, option_add, option_clear, option_get, option_readfile, pack_propagate, pack_slaves, place_slaves, propagate, quit, register, rowconfigure, selection_clear, selection_get, selection_handle, selection_own, selection_own_get, send, setvar, size, slaves, tk_bisque, tk_focusFollowsMouse, tk_focusNext, tk_focusPrev, tk_menuBar, tk_setPalette, tk_strictMotif, tkraise, unbind, unbind_all, unbind_class, update, update_idletasks, wait_variable, wait_visibility, wait_window, waitvar, winfo_atom, winfo_atomname, winfo_cells, winfo_children, winfo_class, winfo_colormapfull, winfo_containing, winfo_depth, winfo_exists, winfo_fpixels, winfo_geometry, winfo_height, winfo_id, winfo_interps, winfo_ismapped, winfo_manager, winfo_name, winfo_parent, winfo_pathname, winfo_pixels, winfo_pointerx, winfo_pointerxy, winfo_pointery, winfo_reqheight, winfo_reqwidth, winfo_rgb, winfo_rootx, winfo_rooty, winfo_screen, winfo_screencells, winfo_screendepth, winfo_screenheight, winfo_screenmmheight, winfo_screenmmwidth, winfo_screenvisual, winfo_screenwidth, winfo_server, winfo_toplevel, winfo_viewable, winfo_visual, winfo_visualid, winfo_visualsavailable, winfo_vrootheight, winfo_vrootwidth, winfo_vrootx, winfo_vrooty, winfo_width, winfo_x, winfo_y

Inherited from Tkinter.Misc (private): _bind, _configure, _displayof, _getboolean, _getdoubles, _getints, _grid_configure, _nametowidget, _options, _register, _report_exception, _root, _substitute

Inherited from Tkinter.Pack: forget, info, pack, pack_configure, pack_forget, pack_info

Inherited from Tkinter.Place: place, place_configure, place_forget, place_info

Inherited from Tkinter.Grid: grid, grid_configure, grid_forget, grid_info, grid_remove, location

Class Methods [hide private]

Inherited from param.parameterized.Parameterized: params, print_param_defaults

Class Variables [hide private]
  __abstract = True
bool(x) -> bool
  dock = param.Boolean(default= False, doc= "on console or not")
on console or not
  button_image_size = (20, 20)
tuple() -> an empty tuple tuple(sequence) -> tuple initialized from sequence's items
  Refresh = tk.Button(image_path= "tkgui/icons/redo-small.png", ...
Refresh the current plot (i.e.
  Redraw = tk.Button(image_path= "tkgui/icons/redo-small.png", s...
Redraw the plot from existing data (i.e.
  Enlarge = tk.Button(image_path= "tkgui/icons/viewmag+_2.2.png"...
Increase the displayed size of the current plots by about 20%.
  Reduce = tk.Button(image_path= "tkgui/icons/viewmag-_2.1.png",...
Reduce the displayed size of the current plots by about 20%.
  Fwd = tk.Button(image_path= "tkgui/icons/forward-2.0.png", siz...
Move forward through the history of all the plots shown in this window.
  Back = tk.Button(image_path= "tkgui/icons/back-2.0.png", size=...
Move backward through the history of all the plots shown in this window.
  gui_desired_maximum_plot_height = param.Integer(default= 150, ...
Value to provide for PlotGroup.desired_maximum_plot_height for PlotGroups opened by the GUI.
  name = <param.parameterized.String object at 0xb32eeac>
String identifier for this object.

Inherited from param.tk.TkParameterized: pretty_parameters

Inherited from param.tk.TkParameterizedBase (private): _extraPO

Inherited from param.parameterized.Parameterized: print_level

Inherited from Tkinter.Misc: _noarg_

Inherited from Tkinter.Misc (private): _subst_format, _subst_format_str, _tclCommands

Properties [hide private]
  plotgroup

Inherited from object: __class__

Method Details [hide private]

__init__(self, master, plotgroup, **params)
(Constructor)

source code 
If your parameter should be available in history, add its name to the params_in_history list, otherwise it will be disabled in historical views.
Overrides: Tkinter.BaseWidget.__init__

setup_plotgroup(self)

source code 

Perform any necessary initialization of the plotgroup.

Subclasses can use this to set Parameters on their PlotGroups.

__process_canvas_event(self, event, func)

source code 

Return a dictionary containing the event itself, and, if the event occurs on a plot of a sheet, store the plot and the coordinates ((r,c) and (x,y) for the cell center) on the sheet.

Then, call func.

_canvas_right_click(self, event_info, show_menu=True)

source code 

Update labels on right-click menu and popup the menu, plus store the event info for access by any menu commands that require it.

If show_menu is False, popup menu is not displayed (in case subclasses wish to add extra menu items first).

update_plot_frame(self, plots=True, labels=True, geom=False)

source code 
set geom True for any action that user would expect to lose his/her manual window size (e.g. pressing enlarge button)

refresh_plots(widget, *args, **kw)

source code 
Call plotgroup's make_plots with update=True (i.e. run pre_plot_hooks and plot_hooks), then display the result.
Decorators:
  • @with_busy_cursor

redraw_plots(widget, *args, **kw)

source code 
Call plotgroup's make_plots with update=False (i.e. run only plot_hooks, not pre_plot_hooks), then display the result.
Decorators:
  • @with_busy_cursor

refresh(self, update=True)

source code 

Main steps for generating plots in the Frame.

# if update is True, the SheetViews are re-generated

display_labels(self)

source code 
This function should be redefined by subclasses to match any changes made to display__plots(). Depending on the situation, it may be useful to make this function a stub, and display the labels at the same time the images are displayed.

_switch_plotgroup(self, newpg)

source code 
Switch to a different plotgroup, e.g. one from the history buffer. Preserves some attributes from the current plotgroup that can apply across history, but leaves the others as-is.

_plot_title(self)

source code 

Provide a string describing the current set of plots.

Override in subclasses to provide more information.

destroy(self)

source code 
overrides toplevel destroy, adding removal from autorefresh panels
Overrides: Tkinter.Misc.destroy

Class Variable Details [hide private]

__abstract

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

Value:
True

button_image_size

tuple() -> an empty tuple tuple(sequence) -> tuple initialized from sequence's items

If the argument is a tuple, the return value is the same object.

Value:
(20, 20)

Refresh

Refresh the current plot (i.e. force the current plot to be regenerated by executing pre_plot_hooks and plot_hooks).
Value:
tk.Button(image_path= "tkgui/icons/redo-small.png", size= button_image_size, doc= \
"""
        Refresh the current plot (i.e. force the current plot to be regenerated
        by executing pre_plot_hooks and plot_hooks).""")

Redraw

Redraw the plot from existing data (i.e. execute plot_hooks only).
Value:
tk.Button(image_path= "tkgui/icons/redo-small.png", size= button_image_size, doc= \
"""Redraw the plot from existing data (i.e. execute plot_hooks only).""")

Enlarge

Increase the displayed size of the current plots by about 20%.
Value:
tk.Button(image_path= "tkgui/icons/viewmag+_2.2.png", size= button_image_size, doc\
= """Increase the displayed size of the current plots by about 20%.""")

Reduce

Reduce the displayed size of the current plots by about 20%. A minimum size that preserves at least one pixel per unit is enforced, to ensure that no data is lost when displaying.
Value:
tk.Button(image_path= "tkgui/icons/viewmag-_2.1.png", size= button_image_size, doc\
= """
        Reduce the displayed size of the current plots by about 20%.
        A minimum size that preserves at least one pixel per unit is
        enforced, to ensure that no data is lost when displaying.""")

Fwd

Move forward through the history of all the plots shown in this window.
Value:
tk.Button(image_path= "tkgui/icons/forward-2.0.png", size= button_image_size, doc=\
 """
        Move forward through the history of all the plots shown in this window."""\
)

Back

Move backward through the history of all the plots shown in this window. When showing a historical plot, some functions will be disabled, because the original data is no longer available.
Value:
tk.Button(image_path= "tkgui/icons/back-2.0.png", size= button_image_size, doc= ""\
"
        Move backward through the history of all the plots shown in
        this window.  When showing a historical plot, some functions
        will be disabled, because the original data is no longer
        available.""")

gui_desired_maximum_plot_height

Value to provide for PlotGroup.desired_maximum_plot_height for PlotGroups opened by the GUI. Determines the initial, default scaling for the PlotGroup.
Value:
param.Integer(default= 150, bounds= (0, None), doc= """
        Value to provide for PlotGroup.desired_maximum_plot_height for
        PlotGroups opened by the GUI.  Determines the initial, default
        scaling for the PlotGroup.""")

Property Details [hide private]

plotgroup

Get Method:
get_plotgroup(self)
Set Method:
set_plotgroup(self, new_pg)