casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
Public Member Functions | Public Attributes | Private Member Functions
TablePlotTkAgg.PlotFlag Class Reference

List of all members.

Public Member Functions

def __init__
def sub
def setup_custom_features
def plotflag_cleanup
def set_cursor
def add_buttons
def configure_buttons
def flag
def unflag
def locate
def operate
def iterplotnext
def iterplotstop
def clearplot
def savefig
def enable_iter_button
def disable_iter_button
def enable_markregion_button
def disable_markregion_button
def enable_flag_button
def disable_flag_button
def enable_unflag_button
def disable_unflag_button
def enable_locate_button
def disable_locate_button
def enable_clear_button
def disable_clear_button
def enable_quit_button
def disable_quit_button
def draw_rubberband
def draw_rect
def erase_rects
def redraw_rects
def resize
def destroy
def quit
def key_release
def home
def back
def forward
def configure_subplots
def markregion
def press_markregion
def release_markregion
def zoom
def press_zoom
def release_zoom
def pan
def press_pan
def release_pan
def drag_pan
def mouse_move
def update_relief
def ismatlab_new
 Workarounds for Matplotlib version handling (ugly) ####.
def get_inverse_xy
def get_xy
def copy_trans
def get_bbox_size
def switch_func
def get_called_or_attr

Public Attributes

 PyBind
 newtoolbar
 quitted
 toolbar
 canvas
 window
 figmanager
 panel
 workaround for matplotlib API changes self.toolbar._xypress.append(( x, y, a, i, lim, a.transData.deepcopy() )) #0.91.4 self.toolbar._xypress.append(( x, y, a, i, lim, a.transData.frozen() )) #>=0.98
 rows
 cols
 regionlist
 panelregionlist
 axeslist
 newframe

Private Member Functions

def _NewButton

Detailed Description

(1) Start the internal python interpreter... 
and make the 'pylab' module from the main python/casapy namespace 
visible inside it. ( done inside TPPlotter )  Note that 'pylab' is the 
only module of casapy that is visible from this internal interpreter.

(2) figmanager = pl.get_current_fig_manager() 
-> This gets a handle to the current window, canvas, toolbar.
    
(3) Create the python-C++ call-back module -> PyBind. 
    ( description in tables/implement/TablePlot/PlotterGlobals.cc )
    
(3) TablePlotTkAgg.py  implements a python class called 'PlotFlag'
    which takes an instance of 'PyBind' and 'figmanager' and makes 
    the connection between the two.

    - Additional buttons are placed in the toolbar, and their callbacks
      defined to call methods of PyBind.
    - The toolbar event-loop is captured - by explicitly disconnecting
      previous bindings, and re-defining them for 'pan','zoom','mark-region'
      modes. (need to do all three, to get them to interact properly with each other)
    - Some Canvas events are also redefined to allow mark-region boxes to
      automatically resize and move around, when the window is resized or
      when in pan or zoom modes. ( This is needed to allow flagging with
      zooming ).
     
(4) Back to the internal python interpreter. The following steps are carried out.
    -> figmanager = pl.get_current_fig_manager()
    -> import PyBind
    -> from TablePlotTkagg import PlotFlag
    -> pf = PlotFlag( PyBind )
    -> pf.setup_custom_features( figmanager )

    ----> All binding is complete at this point.
    ----> All other logic is to ensure things like... make sure new buttons are
          added only when needed... make sure they *are* added when needed... and
          this has to keep up with the native TkAgg matplotlib backend's
          whimsical decisions of when to create a new figure and when not to.

Definition at line 17 of file TablePlotTkAgg.py.


Constructor & Destructor Documentation

def TablePlotTkAgg.PlotFlag.__init__ (   self,
  PyBind 
)

Definition at line 58 of file TablePlotTkAgg.py.


Member Function Documentation

def TablePlotTkAgg.PlotFlag._NewButton (   self,
  frame,
  text,
  file,
  command,
  side = Tk.LEFT 
) [private]

Definition at line 116 of file TablePlotTkAgg.py.

Definition at line 129 of file TablePlotTkAgg.py.

def TablePlotTkAgg.PlotFlag.back (   self,
  args 
)
def TablePlotTkAgg.PlotFlag.clearplot (   self,
  args 
)

Definition at line 235 of file TablePlotTkAgg.py.

def TablePlotTkAgg.PlotFlag.copy_trans (   self,
  trans 
)
def TablePlotTkAgg.PlotFlag.destroy (   self,
  args 
)

Definition at line 312 of file TablePlotTkAgg.py.

Definition at line 276 of file TablePlotTkAgg.py.

Definition at line 252 of file TablePlotTkAgg.py.

Definition at line 300 of file TablePlotTkAgg.py.

Definition at line 264 of file TablePlotTkAgg.py.

Definition at line 324 of file TablePlotTkAgg.py.

Definition at line 288 of file TablePlotTkAgg.py.

def TablePlotTkAgg.PlotFlag.drag_pan (   self,
  event 
)
def TablePlotTkAgg.PlotFlag.draw_rect (   self,
  x0,
  y0,
  x1,
  y1,
  x0data,
  y0data,
  x1data,
  y1data,
  a,
  panel,
  rows,
  cols 
)
def TablePlotTkAgg.PlotFlag.draw_rubberband (   self,
  event,
  x0,
  y0,
  x1,
  y1 
)

Definition at line 306 of file TablePlotTkAgg.py.

Definition at line 270 of file TablePlotTkAgg.py.

Definition at line 246 of file TablePlotTkAgg.py.

Definition at line 294 of file TablePlotTkAgg.py.

Definition at line 258 of file TablePlotTkAgg.py.

Definition at line 318 of file TablePlotTkAgg.py.

Definition at line 282 of file TablePlotTkAgg.py.

def TablePlotTkAgg.PlotFlag.flag (   self,
  args 
)
def TablePlotTkAgg.PlotFlag.forward (   self,
  args 
)
def TablePlotTkAgg.PlotFlag.get_bbox_size (   self,
  obj,
  func = "" 
)
def TablePlotTkAgg.PlotFlag.get_called_or_attr (   self,
  obj,
  func = "",
  args,
  kwargs 
)
Returns a result from function call if it's callable.
If not callable, returns the attribute or False (non-existent). 

Definition at line 1042 of file TablePlotTkAgg.py.

Referenced by TablePlotTkAgg.PlotFlag.get_bbox_size(), and TablePlotTkAgg.PlotFlag.switch_func().

def TablePlotTkAgg.PlotFlag.get_inverse_xy (   self,
  trans,
  x,
  y 
)
def TablePlotTkAgg.PlotFlag.get_xy (   self,
  trans,
  x,
  y 
)
def TablePlotTkAgg.PlotFlag.home (   self,
  args 
)

Workarounds for Matplotlib version handling (ugly) ####.

Definition at line 1012 of file TablePlotTkAgg.py.

def TablePlotTkAgg.PlotFlag.iterplotnext (   self,
  args 
)

Definition at line 229 of file TablePlotTkAgg.py.

Referenced by TablePlotTkAgg.PlotFlag.configure_buttons().

def TablePlotTkAgg.PlotFlag.iterplotstop (   self,
  args 
)

Definition at line 232 of file TablePlotTkAgg.py.

def TablePlotTkAgg.PlotFlag.key_release (   self,
  event 
)

Definition at line 423 of file TablePlotTkAgg.py.

References TablePlotTkAgg.PlotFlag.regionlist.

def TablePlotTkAgg.PlotFlag.locate (   self,
  args 
)
def TablePlotTkAgg.PlotFlag.markregion (   self,
  args 
)
def TablePlotTkAgg.PlotFlag.mouse_move (   self,
  event 
)
def TablePlotTkAgg.PlotFlag.operate (   self,
  flag = 1 
)
def TablePlotTkAgg.PlotFlag.pan (   self,
  args 
)

Definition at line 109 of file TablePlotTkAgg.py.

def TablePlotTkAgg.PlotFlag.press_markregion (   self,
  event 
)
def TablePlotTkAgg.PlotFlag.press_pan (   self,
  event 
)
def TablePlotTkAgg.PlotFlag.press_zoom (   self,
  event 
)

Definition at line 635 of file TablePlotTkAgg.py.

References TablePlotTkAgg.PlotFlag.copy_trans().

Referenced by TablePlotTkAgg.PlotFlag.zoom().

def TablePlotTkAgg.PlotFlag.quit (   self,
  closewin = True 
)
def TablePlotTkAgg.PlotFlag.release_markregion (   self,
  event 
)
def TablePlotTkAgg.PlotFlag.release_pan (   self,
  event 
)
def TablePlotTkAgg.PlotFlag.release_zoom (   self,
  event 
)
def TablePlotTkAgg.PlotFlag.resize (   self,
  event 
)
def TablePlotTkAgg.PlotFlag.savefig (   self,
  args 
)

Definition at line 240 of file TablePlotTkAgg.py.

def TablePlotTkAgg.PlotFlag.set_cursor (   self,
  cursor 
)

Definition at line 112 of file TablePlotTkAgg.py.

Referenced by TablePlotTkAgg.PlotFlag.mouse_move().

def TablePlotTkAgg.PlotFlag.setup_custom_features (   self,
  cfigman 
)

Definition at line 69 of file TablePlotTkAgg.py.

Definition at line 64 of file TablePlotTkAgg.py.

References TablePlotTkAgg.PlotFlag.quitted.

def TablePlotTkAgg.PlotFlag.switch_func (   self,
  obj,
  funcs = [],
  args,
  kwargs 
)
Tries a list of functions and return a result from callable one.
Deals with function name changes but parameters have to be unchanged.

Definition at line 1032 of file TablePlotTkAgg.py.

References TablePlotTkAgg.PlotFlag.get_called_or_attr().

Referenced by TablePlotTkAgg.PlotFlag.copy_trans(), and TablePlotTkAgg.PlotFlag.get_xy().

def TablePlotTkAgg.PlotFlag.unflag (   self,
  args 
)
def TablePlotTkAgg.PlotFlag.update_relief (   self,
  newmode 
)
def TablePlotTkAgg.PlotFlag.zoom (   self,
  args 
)

Member Data Documentation

Definition at line 73 of file TablePlotTkAgg.py.

Definition at line 75 of file TablePlotTkAgg.py.

Definition at line 131 of file TablePlotTkAgg.py.

Definition at line 61 of file TablePlotTkAgg.py.

Referenced by TablePlotTkAgg.PlotFlag.destroy().

workaround for matplotlib API changes self.toolbar._xypress.append(( x, y, a, i, lim, a.transData.deepcopy() )) #0.91.4 self.toolbar._xypress.append(( x, y, a, i, lim, a.transData.frozen() )) #>=0.98

Definition at line 89 of file TablePlotTkAgg.py.

Referenced by task_sdplot.sdplot_worker.__setup_plotter(), TablePlotTkAgg.PlotFlag.press_markregion(), TablePlotTkAgg.PlotFlag.release_markregion(), tests.test_sdplot.sdplot_storageTest.testDF(), tests.test_sdplot.sdplot_storageTest.testDT(), tests.test_sdplot.sdplot_storageTest.testMF(), and tests.test_sdplot.sdplot_storageTest.testMT().

Definition at line 60 of file TablePlotTkAgg.py.

Definition at line 74 of file TablePlotTkAgg.py.


The documentation for this class was generated from the following file: