Changeset 8379:1e7ba56b4a1e in orange


Ignore:
Timestamp:
07/06/11 17:58:24 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
73098ed2ea02edc9e405ff308d9d5dfcdccd14e8
Message:

Don't rebuild the entire graph in OWLinProj when only point size and transparency have changed.

Location:
orange/OrangeWidgets
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Prototypes/OWLinProjGraphQt.py

    r8363 r8379  
    88import OWColorPalette 
    99from plot.owtools import UnconnectedLinesCurve 
     10import numpy 
    1011 
    1112# indices in curveData 
     
    717718#            painter.drawImage(self.transform(QwtPlot.xBottom, -1), self.transform(QwtPlot.yLeft, 1), self.potentialsImage) 
    718719        OWPlot.drawCanvas(self, painter) 
     720         
     721    def updateCurves(self): 
     722        for c in self.itemList(): 
     723            if isinstance(c, OWCurve): 
     724                c.setPointSize(self.pointWidth) 
     725                color = c.color() 
     726                color.setAlpha(self.alphaValue) 
     727                c.setColor(color) 
     728                c.updateProperties() 
    719729 
    720730 
  • orange/OrangeWidgets/Prototypes/OWLinProjQt.py

    r8342 r8379  
    145145 
    146146        box = OWGUI.widgetBox(self.SettingsTab, "Point Properties") 
    147         OWGUI.hSlider(box, self, 'graph.pointWidth', label = "Size: ", minValue=1, maxValue=20, step=1, callback = self.updateGraph) 
    148         OWGUI.hSlider(box, self, 'graph.alphaValue', label = "Transparency: ", minValue=0, maxValue=255, step=10, callback = self.updateGraph) 
     147        OWGUI.hSlider(box, self, 'graph.pointWidth', label = "Size: ", minValue=1, maxValue=20, step=1, callback = self.graph.updateCurves) 
     148        OWGUI.hSlider(box, self, 'graph.alphaValue', label = "Transparency: ", minValue=0, maxValue=255, step=10, callback = self.graph.updateCurves) 
    149149 
    150150        box = OWGUI.widgetBox(self.SettingsTab, "Jittering Options") 
  • orange/OrangeWidgets/plot/owcurve.py

    r8374 r8379  
    2727    def __init__(self, xData=[], yData=[], x_axis_key=xBottom, y_axis_key=yLeft, tooltip=None, parent=None, scene=None): 
    2828        orangeplot.Curve.__init__(self, xData, yData, parent, scene) 
     29        self.setAutoUpdate(False) 
    2930        self.setAxes(x_axis_key, y_axis_key) 
    3031        if tooltip: 
Note: See TracChangeset for help on using the changeset viewer.