Changeset 8299:fa7fa9268c91 in orange


Ignore:
Timestamp:
06/04/11 12:26:47 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
3b2d3bc121f3de883dd60dd2ae9953da2f85ceb7
Message:

More work on shapes and sizes for data points

Location:
orange/OrangeWidgets
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Graph/curve.py

    r8298 r8299  
    22from OWBaseWidget import * 
    33from palette import * 
     4from OWGraphQt import * 
    45 
    56from PyQt4.QtGui import QGraphicsItemGroup, QGraphicsEllipseItem, QGraphicsLineItem, QGraphicsPathItem 
     
    7576        if not parent: 
    7677            parent = self 
    77         if self.style.point_shape is CircleShape: 
     78        if self.style.point_shape is Ellipse: 
    7879            i = QGraphicsEllipseItem(x-s/2, y-s/2, s, s, parent) 
    79         elif self.style.point_shape is SquareShape: 
     80        elif self.style.point_shape is Rect: 
    8081            i = QGraphicsRectItem(x-s/2, y-s/2, s, s, parent) 
    81         elif self.style.point_shape is EllipseShape: 
    82             i = QGraphicsEllipseItem(x-s/2, y-s/2, 1.5*s, 0.8*s, parent) 
    8382        else: 
     83            ## TODO: Implement all the other shapes 
    8484            i = QGraphicsRectItem(x-s/2, y-s/2, 1.5*s, 0.8*s, parent) 
    8585        i.setPen(QPen(Qt.NoPen)) 
  • orange/OrangeWidgets/Graph/palette.py

    r8291 r8299  
    3535""" 
    3636 
     37from OWGraphQt import * 
     38 
    3739from PyQt4.QtGui import QColor, QPen, QBrush 
    3840from PyQt4.QtCore import Qt 
    39  
    40 NoShape = 0 
    41 CircleShape = 1 
    42 SquareShape = 2 
    43 CrossShape = 3 
    44 PlusShape = 4 
    45 EllipseShape = 5 
    4641 
    4742_shared_palette = None 
    4843 
    4944class LineStyle: 
    50     def __init__(self,  color=Qt.black,  width=1,  type=Qt.SolidLine,  point_shape=CircleShape, point_size=5): 
     45    def __init__(self,  color=Qt.black,  width=1,  type=Qt.SolidLine,  point_shape=Ellipse, point_size=5): 
    5146        self.color = color 
    5247        self.width = width 
     
    7469        self.point_styles = [] 
    7570        self.axis_style = LineStyle(Qt.black, 1, Qt.SolidLine) 
    76         self.curve_symbols = [ EllipseShape, CrossShape, SquareShape ] 
     71        self.curve_symbols = range(13) 
    7772         
    7873    def line_style(self, id): 
  • orange/OrangeWidgets/OWGraphQt.py

    r8298 r8299  
    5050ExternalLegend = 4 
    5151 
     52Ellipse = 0 
     53Rect = 1 
     54Diamond = 2 
     55Triangle = 3 
     56DTriangle = 4 
     57UTriangle = 5 
     58LTriangle = 6 
     59RTriangle = 7 
     60Cross = 8 
     61XCross = 9 
     62HLine = 10 
     63VLine = 11 
     64Star1 = 12 
     65Star2 = 13 
     66Hexagon = 14 
     67UserStyle = 1000  
     68 
    5269from Graph import * 
    5370from PyQt4.QtGui import QGraphicsView,  QGraphicsScene, QPainter 
     
    5875 
    5976class OWGraph(QGraphicsView): 
     77     
     78     
    6079    def __init__(self, parent=None,  name="None",  show_legend=1 ): 
    6180        QGraphicsView.__init__(self, parent) 
     
    85104        # OWScatterPlot needs these: 
    86105        self.alphaValue = 1 
    87         self.useAntialiasing = False 
     106        self.useAntialiasing = True 
    88107         
    89108        self.palette = palette.shared_palette() 
     
    249268         
    250269    def addCurve(self, name, brushColor = Qt.black, penColor = Qt.black, size = 5, style = Qt.NoPen,  
    251                  symbol = palette.CircleShape, enableLegend = 0, xData = [], yData = [], showFilledSymbols = None, 
     270                 symbol = Ellipse, enableLegend = 0, xData = [], yData = [], showFilledSymbols = None, 
    252271                 lineWidth = 1, pen = None, autoScale = 0, antiAlias = None, penAlpha = 255, brushAlpha = 255): 
    253272        data = [] 
Note: See TracChangeset for help on using the changeset viewer.