Show
Ignore:
Timestamp:
04/08/08 16:53:20 (8 months ago)
Author:
wrobe..@pld-linux.org
Message:

- documentation updates

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphor/trunk/gaphor/diagram/classes/association.py

    r2294 r2296  
    1  
    2 """AssociationItem -- Graphical representation of an association. 
     1""" 
     2Association item - graphical representation of an association. 
    33 
    44Plan: 
     
    66 - for assocation name and direction tag, use the same trick as is used 
    77   for line ends. 
    8  -  
    9  
    108""" 
    119 
     
    107105 
    108106    def invert_direction(self): 
    109         """Invert the direction of the association, this is done by 
    110         swapping the head and tail-ends subjects. 
     107        """ 
     108        Invert the direction of the association, this is done by swapping 
     109        the head and tail-ends subjects. 
    111110        """ 
    112111        if not self.subject: 
     
    118117    def on_named_element_name(self, event): 
    119118        """ 
     119        Update names of the association as well as its ends. 
     120 
    120121        Override NamedLine.on_named_element_name. 
    121         Update names of the association as well as its ends. 
    122122        """ 
    123123        if event is None: 
     
    206206 
    207207    def point(self, x, y): 
    208         """Returns the distance from the Association to the (mouse) cursor. 
     208        """ 
     209        Returns the distance from the Association to the (mouse) cursor. 
    209210        """ 
    210211        return min(super(AssociationItem, self).point(x, y), 
     
    213214 
    214215    def draw_head_none(self, context): 
    215         """Draw an 'x' on the line end, indicating no traversing. 
     216        """ 
     217        Draw an 'x' on the line end to indicate no navigability at 
     218        association head. 
    216219        """ 
    217220        cr = context.cairo 
     
    223226        cr.move_to(0, 0) 
    224227 
     228 
    225229    def draw_tail_none(self, context): 
    226         """Draw an 'x' on the line end, indicating no traversing. 
     230        """ 
     231        Draw an 'x' on the line end to indicate no navigability at 
     232        association tail. 
    227233        """ 
    228234        cr = context.cairo 
     
    234240        cr.stroke() 
    235241 
     242 
    236243    def _draw_diamond(self, cr): 
     244        """ 
     245        Helper function to draw diamond shape for shared and composite 
     246        aggregations. 
     247        """ 
    237248        cr.move_to(20, 0) 
    238249        cr.line_to(10, -6) 
     
    242253        cr.close_path() 
    243254 
     255 
    244256    def draw_head_composite(self, context): 
    245         """Draw a closed diamond on the line end. 
     257        """ 
     258        Draw a closed diamond on the line end to indicate composite 
     259        aggregation at association head. 
    246260        """ 
    247261        cr = context.cairo 
     
    251265        cr.move_to(20, 0) 
    252266 
     267 
    253268    def draw_tail_composite(self, context): 
    254         """Draw a closed diamond on the line end. 
     269        """ 
     270        Draw a closed diamond on the line end to indicate composite 
     271        aggregation at association tail. 
    255272        """ 
    256273        cr = context.cairo 
     
    261278        cr.stroke() 
    262279 
     280 
    263281    def draw_head_shared(self, context): 
    264         """Draw an open diamond on the line end. 
     282        """ 
     283        Draw an open diamond on the line end to indicate shared aggregation 
     284        at association head. 
    265285        """ 
    266286        cr = context.cairo 
     
    268288        cr.move_to(20, 0) 
    269289 
     290 
    270291    def draw_tail_shared(self, context): 
    271         """Draw an open diamond on the line end. 
     292        """ 
     293        Draw an open diamond on the line end to indicate shared aggregation 
     294        at association tail. 
    272295        """ 
    273296        cr = context.cairo 
     
    277300        cr.stroke() 
    278301 
     302 
    279303    def draw_head_navigable(self, context): 
    280         """Draw a normal arrow. 
     304        """ 
     305        Draw a normal arrow to indicate association end navigability at 
     306        association head. 
    281307        """ 
    282308        cr = context.cairo 
     
    287313        cr.move_to(0, 0) 
    288314 
     315 
    289316    def draw_tail_navigable(self, context): 
    290         """Draw a normal arrow. 
     317        """ 
     318        Draw a normal arrow to indicate association end navigability at 
     319        association tail. 
    291320        """ 
    292321        cr = context.cairo 
     
    297326        cr.line_to(15, 6) 
    298327 
     328 
    299329    def draw_head_undefined(self, context): 
    300         """Draw nothing. undefined. 
     330        """ 
     331        Draw nothing to indicate undefined association end at association 
     332        head. 
    301333        """ 
    302334        context.cairo.move_to(0, 0) 
    303335 
     336 
    304337    def draw_tail_undefined(self, context): 
    305         """Draw nothing. undefined. 
     338        """ 
     339        Draw nothing to indicate undefined association end at association 
     340        tail. 
    306341        """ 
    307342        context.cairo.line_to(0, 0) 
     343 
    308344 
    309345    def draw(self, context):