Changeset 994

Show
Ignore:
Timestamp:
07/11/07 03:51:29 (6 years ago)
Author:
ignotus21
Message:

Added focus+context.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branch/joao/umitMapper/RadialNet.py

    r988 r994  
    4343        self.__numberOfRings = numberOfRings 
    4444        """Number of rings in radial layout""" 
    45         self.__ringGap = 45 
     45        self.__ringGap = 20 
    4646        """Gap between rings""" 
    4747        self.__graph = None 
     
    5757        self.__animationRate = 1000 / 60 # 60Hz 
    5858        """""" 
    59         self.__paused = False 
    60         """""" 
     59        self.__ringFactor = [1] * self.__numberOfRings 
     60        self.__ringFactor[0] = 4 
     61        self.__ringFactor[1] = 3 
     62        self.__ringFactor[2] = 2 
     63 
    6164 
    6265        super(RadialNet, self).__init__() 
     
    132135        """ 
    133136        """ 
    134         if self.__paused == True: 
    135             self.__paused = False 
    136  
    137         if self.__paused == False: 
    138             self.__paused = True 
     137        key = gdk.keyval_name(event.keyval) 
     138 
     139        if key == "KP_Multiply": 
     140 
     141            print "hello" 
     142 
     143        self.queue_draw() 
    139144 
    140145        return True 
     
    304309        (xc, yc) = self.__centerOfWidget 
    305310 
     311        radius = 0 
     312 
    306313        # Drawing network rings 
    307         for i in range(self.__numberOfRings, 0, -1): 
    308  
    309             self.context.arc(xc, yc, self.__ringGap * i, 0, 2 * math.pi) 
    310             self.context.set_source_rgb(0.2, 0.2, 0.2) 
     314        for i in range(0, self.__numberOfRings): 
     315 
     316            radius += self.__ringGap * self.__ringFactor[i] 
     317 
     318            self.context.arc(xc, yc, radius, 0, 2 * math.pi) 
     319            self.context.set_source_rgb(0.0, 0.0, 0.0) 
    311320            self.context.set_dash([4, 6]) 
    312321            self.context.set_line_width(0.2) 
     
    397406        oldNodes = [] 
    398407 
     408        radius = 0 
     409 
    399410        # For each ring in visualization 
    400411        for i in range(self.__numberOfRings): 
     
    403414 
    404415            localNodes = [] 
     416 
     417            radius += self.__ringGap * self.__ringFactor[i] 
    405418 
    406419            # For each new node 
     
    428441                (min, max) = self.__angleRange[node.getID()] 
    429442                alpha = 0 
    430  
    431                 radius = self.__ringGap * (i + 1) 
    432443 
    433444                # Calculating nodes posintions