6b07ae6f8e587fd27f9b30ec4922e255b428a794,enthought/chaco/tools/traits_tool.py,TraitsTool,normal_left_dclick,#TraitsTool#,72

Before Change


        // then we add its non-container components to the list of candidates;
        // any nested containers are lower priority than primary plot components.
        candidates = []
        component = self.component
        if isinstance(component, BasePlotContainer) or isinstance(component, BaseXYPlot):
            candidates = get_nested_components(self.component)
        elif isinstance(component, PlotAxis):
            candidates = [(component, (0,0))]
        else:
            // We don"t support clicking on unrecognized components
            return

        // Hittest against all the candidate and take the first one
        item = None
        for candidate, offset in candidates:
            if isinstance(candidate, PlotAxis):
                if candidate.is_in(x-offset[0], y-offset[1]):
                    item = candidate
                    break
            elif isinstance(candidate, BaseXYPlot):
                if candidate.hittest((x-offset[0], y-offset[1])):
                    item = candidate
                    break

        if item:
            self.component.active_tool = self
            item.edit_traits(kind="livemodal")
            event.handled = True

After Change


            
        if item is not None:
            self.component.active_tool = self
            if item.__class__ in self.views:
                item.edit_traits(kind="livemodal",
                                 view=self.views[item.__class__],
                                 parent=event.window.control)
            else:
                item.edit_traits(kind="livemodal",
                                 parent=event.window.control)
            event.handled = True
            self.component.active_tool = None
            item.request_redraw()

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: enthought/chaco
Commit Name: 6b07ae6f8e587fd27f9b30ec4922e255b428a794
Time: 2008-08-27
Author: kammeyer@651a555e-23ca-0310-84fe-ca9f7c59d2ea
File Name: enthought/chaco/tools/traits_tool.py
Class Name: TraitsTool
Method Name: normal_left_dclick


Project Name: ikostrikov/pytorch-a2c-ppo-acktr
Commit Name: 19f6bfac9d39794db025dc53f8921346f58080b9
Time: 2018-09-17
Author: meinhardt.tim@gmail.com
File Name: enjoy.py
Class Name:
Method Name:


Project Name: HsinYingLee/DRIT
Commit Name: 8776ca2dcfa98412a6dafc33d360ee1ba0d1b551
Time: 2018-07-25
Author: james371507@gmail.com
File Name: src/test.py
Class Name:
Method Name: main


Project Name: ilastik/ilastik
Commit Name: 8861dfa21d1cfd487b7a6eb7508885f084f58e6c
Time: 2019-07-10
Author: tomaz.vieira@embl.de
File Name: ilastik/applets/dataSelection/datasetInfoEditorWidget.py
Class Name: DatasetInfoEditorWidget
Method Name: get_new_axes_tags