Changeset 1051
- Timestamp:
- 10/28/06 10:09:05 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gaphor/branches/new-canvas/gaphor/diagram/__init__.py
r1050 r1051 37 37 """ 38 38 Item style information. Style information is provided through object's 39 attributes, i.e. 39 attributes, i.e.:: 40 40 41 __style__ = { 42 'name-align': ('center', 'top'), 43 } 41 class InitialNodeItem 42 __style__ = { 43 'name-align': ('center', 'top'), 44 } 44 45 45 is translated to 46 is translated to:: 46 47 47 48 >>> print style.name_align … … 55 56 underscode, i.e. 'name-align' -> 'name_align'. 56 57 57 name -style variable name58 value -style variable value58 @param name: style variable name 59 @param value: style variable value 59 60 """ 60 61 name = name.replace('-', '_') … … 71 72 72 73 class DiagramItemMeta(type): 73 """Initialize a new diagram item. 74 """ 75 Initialize a new diagram item. 74 76 1. Register UML.Elements by means of the __uml__ attribute (see 75 77 mapUMLClass method). 76 1. Set items styles information.78 2. Set items styles information. 77 79 78 styles -style information80 @ivar styles: style information 79 81 """ 80 82 … … 90 92 Map UML class to diagram item. 91 93 92 cls -new instance of item class93 data -metaclass data with UML class information94 @param cls: new instance of item class 95 @param data: metaclass data with UML class information 94 96 95 97 """ … … 108 110 style information from base classes. 109 111 110 cls -new instance of diagram item class111 bases -base classes of an item112 data -metaclass data with styles information112 @param cls: new instance of diagram item class 113 @param bases: base classes of an item 114 @param data: metaclass data with styles information 113 115 """ 114 116 styles = Styles() gaphor/branches/new-canvas/gaphor/diagram/diagramitem.py
r1049 r1051 29 29 disconnect = DiagramItem.disconnect 30 30 ... 31 32 @cvar style: styles information (derived from DiagramItemMeta) 31 33 """ 32 34
