Logo Search packages:      
Sourcecode: labyrinth version File versions  Download package

def src::MMapArea::MMapArea::draw (   self,
  event,
  context 
)

Draw the map and all the associated thoughts

Definition at line 698 of file MMapArea.py.

00698                                      :
            '''Draw the map and all the associated thoughts'''
            area = event.area
            context.rectangle (area.x, area.y, area.width, area.height)
            context.clip ()
            context.set_source_rgb (1.0,1.0,1.0)
            context.move_to (area.x, area.y)
            context.paint ()
            context.set_source_rgb (0.0,0.0,0.0)
            
            alloc = self.get_allocation ()
            context.translate(alloc.width/2., alloc.height/2.)
            context.scale(self.scale_fac, self.scale_fac)
            context.translate(-alloc.width/2., -alloc.height/2.)        
            context.translate(self.translation[0], self.translation[1])

            if self.is_bbox_selecting:
                  xs = self.bbox_origin[0]
                  ys = self.bbox_origin[1]
                  context.set_line_width(0.2)
                  context.rectangle(xs, ys, self.bbox_current[0] - xs, self.bbox_current[1] - ys)
                  context.stroke()
                  context.set_line_width(1.5)
            
            for l in self.links:
                  l.draw (context)
                  
            if self.unending_link:
                  self.unending_link.draw (context)
            
            self.untransform = context.get_matrix()
            self.transform = context.get_matrix()
            self.transform.invert()

            ax, ay = self.transform_coords(area.x, area.y)
            width  = area.width / self.scale_fac
            height = area.height / self.scale_fac
            for t in self.thoughts:
                  try:
                        if t.lr[0] >= ax and t.ul[0] <= ax + width and t.lr[1] <= ay + height and t.ul[1] >= ay:
                              t.draw (context)
                  except:
                        t.draw(context)


      def undo_create_cb (self, action, mode):


Generated by  Doxygen 1.6.0   Back to index