Ignore:
Timestamp:
Jun 3, 2010 1:09:19 PM (14 years ago)
Author:
Gervaise Alina <gervyh@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
7e4a6ff
Parents:
d955bf19
Message:

working on documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • invariantview/perspectives/invariant/invariant.py

    r8f2069d5 rd7a39e5  
    1 """ 
    2 This software was developed by the University of Tennessee as part of the 
    3 Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
    4 project funded by the US National Science Foundation.  
    5  
    6 See the license text in license.txt 
    7  
    8 copyright 2009, University of Tennessee 
    9 """ 
     1 
     2 
     3 
     4################################################################################ 
     5#This software was developed by the University of Tennessee as part of the 
     6#Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 
     7#project funded by the US National Science Foundation.  
     8# 
     9#See the license text in license.txt 
     10# 
     11#copyright 2009, University of Tennessee 
     12################################################################################ 
     13 
    1014import wx 
    1115 
     
    1721from sans.guicomm.events import NewPlotEvent, StatusEvent 
    1822from sans.guicomm.events import ERR_DATA 
     23 
    1924class Plugin: 
    2025    """ 
    21         This class defines the interface for invariant Plugin class 
    22         that can be used by the gui_manager. 
     26    This class defines the interface for invariant Plugin class 
     27    that can be used by the gui_manager. 
    2328          
    2429    """ 
     
    2631    def __init__(self, standalone=False): 
    2732        """ 
    28             Abstract class for gui_manager Plugins. 
     33        Abstract class for gui_manager Plugins. 
    2934        """ 
    3035        ## Plug-in name. It will appear on the application menu. 
     
    4146    def populate_menu(self, id, parent): 
    4247        """ 
    43             Create and return the list of application menu 
    44             items for the plug-in.  
    45              
    46             @param id: deprecated. Un-used. 
    47             @param parent: parent window 
    48             @return: plug-in menu 
     48        Create and return the list of application menu 
     49        items for the plug-in.  
     50         
     51        :param id: deprecated. Un-used. 
     52        :param parent: parent window 
     53         
     54        :return: plug-in menu 
     55         
    4956        """ 
    5057        return [] 
     
    5259    def help(self, evt): 
    5360        """ 
    54             Show a general help dialog.  
    55             TODO: replace the text with a nice image 
    56             provide more hint on the SLD calculator 
     61        Show a general help dialog.  
     62     
    5763        """ 
    5864        from help_panel import  HelpWindow 
     
    6268    def get_panels(self, parent): 
    6369        """ 
    64             Create and return the list of wx.Panels for your plug-in. 
    65             Define the plug-in perspective. 
    66              
    67             Panels should inherit from DefaultPanel defined below, 
    68             or should present the same interface. They must define 
    69             "window_caption" and "window_name". 
    70              
    71             @param parent: parent window 
    72             @return: list of panels 
     70        Create and return the list of wx.Panels for your plug-in. 
     71        Define the plug-in perspective. 
     72         
     73        Panels should inherit from DefaultPanel defined below, 
     74        or should present the same interface. They must define 
     75        "window_caption" and "window_name". 
     76         
     77        :param parent: parent window 
     78         
     79        :return: list of panels 
     80         
    7381        """ 
    7482        ## Save a reference to the parent 
     
    8593    def get_tools(self): 
    8694        """ 
    87             Returns a set of menu entries for tools 
     95        Returns a set of menu entries for tools 
    8896        """ 
    8997        return [] 
     
    92100    def get_context_menu(self, graph=None): 
    93101        """ 
    94             This method is optional. 
    95          
    96             When the context menu of a plot is rendered, the  
    97             get_context_menu method will be called to give you a  
    98             chance to add a menu item to the context menu. 
    99              
    100             A ref to a Graph object is passed so that you can 
    101             investigate the plot content and decide whether you 
    102             need to add items to the context menu.   
    103              
    104             This method returns a list of menu items. 
    105             Each item is itself a list defining the text to  
    106             appear in the menu, a tool-tip help text, and a 
    107             call-back method. 
    108              
    109             @param graph: the Graph object to which we attach the context menu 
    110             @return: a list of menu items with call-back function 
     102        This method is optional. 
     103     
     104        When the context menu of a plot is rendered, the  
     105        get_context_menu method will be called to give you a  
     106        chance to add a menu item to the context menu. 
     107         
     108        A ref to a Graph object is passed so that you can 
     109        investigate the plot content and decide whether you 
     110        need to add items to the context menu.   
     111         
     112        This method returns a list of menu items. 
     113        Each item is itself a list defining the text to  
     114        appear in the menu, a tool-tip help text, and a 
     115        call-back method. 
     116         
     117        :param graph: the Graph object to which we attach the context menu 
     118         
     119        :return: a list of menu items with call-back function 
     120         
    111121        """ 
    112122        self.graph = graph 
     
    127137    def get_perspective(self): 
    128138        """ 
    129             Get the list of panel names for this perspective 
     139        Get the list of panel names for this perspective 
    130140        """ 
    131141        return self.perspective 
     
    133143    def on_perspective(self, event): 
    134144        """ 
    135             Call back function for the perspective menu item. 
    136             We notify the parent window that the perspective 
    137             has changed. 
    138             @param event: menu event 
     145        Call back function for the perspective menu item. 
     146        We notify the parent window that the perspective 
     147        has changed. 
     148         
     149        :param event: menu event 
     150         
    139151        """ 
    140152        self.parent.set_perspective(self.perspective) 
     
    142154    def post_init(self): 
    143155        """ 
    144             Post initialization call back to close the loose ends 
     156        Post initialization call back to close the loose ends 
    145157        """ 
    146158        pass 
     
    148160    def set_default_perspective(self): 
    149161        """ 
    150            Call back method that True to notify the parent that the current plug-in 
    151            can be set as default  perspective. 
    152            when returning False, the plug-in is not candidate for an automatic  
    153            default perspective setting 
     162        Call back method that True to notify the parent that the current plug-in 
     163        can be set as default  perspective. 
     164        when returning False, the plug-in is not candidate for an automatic  
     165        default perspective setting 
    154166        """ 
    155167        return False 
     
    157169    def copy_data(self, item, dy=None): 
    158170        """ 
    159             receive a data 1D and the list of errors on dy 
    160             and create a new data1D data 
    161             @param return  
     171        receive a data 1D and the list of errors on dy 
     172        and create a new data1D data 
     173         
    162174        """ 
    163175        id = None 
     
    179191    def _on_data_error(self, event): 
    180192        """ 
    181             receives and event from plotting plu-gins to store the data name and  
    182             their errors of y coordinates for 1Data hide and show error 
     193        receives and event from plotting plu-gins to store the data name and  
     194        their errors of y coordinates for 1Data hide and show error 
    183195        """ 
    184196        self.err_dy = event.err_dy 
     
    186198    def _compute_invariant(self, event):     
    187199        """ 
    188             Open the invariant panel to invariant computation 
     200        Open the invariant panel to invariant computation 
    189201        """ 
    190202        self.panel = event.GetEventObject() 
     
    208220    def plot_theory(self, data=None, name=None): 
    209221        """ 
    210             Receive a data set and post a NewPlotEvent to parent. 
    211             @param data: extrapolated data to be plotted 
    212             @param name: Data's name to use for the legend 
     222        Receive a data set and post a NewPlotEvent to parent. 
     223         
     224        :param data: extrapolated data to be plotted 
     225        :param name: Data's name to use for the legend 
     226         
    213227        """ 
    214228        if data is None: 
     
    235249    def plot_data(self, scale, background): 
    236250        """ 
    237             replot the current data if the user enters a new scale or background 
     251        replot the current data if the user enters a new scale or background 
    238252        """ 
    239253        new_plot = scale * self.__data - background 
Note: See TracChangeset for help on using the changeset viewer.