Changeset 1121

Show
Ignore:
Timestamp:
01/16/07 00:08:39 (2 years ago)
Author:
arjanmol
Message:

Merged changed from new-canvas branch to trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphor/trunk/ChangeLog

    r930 r1121  
     12006-11-20  arjan <arjan at yirdis dot nl> 
     2 
     3        * gaphor/storage.py: loading/saving works 
     4        * gaphor/adapters/connector.py: added connector for 
     5          commentline-diagramline. 
     6        * gaphor/diaram/diagramitem.py: made delete operation work. 
     7 
     82006-11-14  arjan <arjan at yirdis dot nl> 
     9 
     10        * setup.py: incremented version to 0.9.0 
     11 
     122006-10-30  arjan <arjan at yirdis dot nl> 
     13 
     14        * gaphor/storage.py: some updates, time to get it working again. 
     15        * gaphor/tests/test_storage.py: unit tests for storage.py 
     16        * tests/*: moved several tests to gaphor/*/tests directory 
     17 
     182006-10-24  arjan <arjan at yirdis dot nl> 
     19 
     20        * gaphor/diagram/association.py: Made direction and name drawing work. 
     21        * gaphor/diagram/diagramline.py: make lines easier to select (fuzzyness) 
     22 
     232006-10-17  arjan <arjan at yirdis dot nl> 
     24 
     25        * gaphor/adapters/editor.py: Added Association editor. 
     26 
     272006-09-29  arjan <arjan at yirdis dot nl> 
     28 
     29        * gaphor/actions/placementactions.py: enabled Association 
     30        * gaphor/diagram/association.py: partly works w/ gaphas 
     31        * gaphor/diagram/items.py: added association 
     32 
     332006-09-27  arjan <arjan at yirdis dot nl> 
     34 
     35        * gaphor/diagram/artifact.py: works now 
     36        * gaphor/diagram/component.py: works now 
     37        * gaphor/diagram/node.py: works now 
     38 
     392006-09-26  arjan <arjan at yirdis dot nl> 
     40 
     41        * gaphor/UML/elementfactory.py: select() now returns an iterator 
     42        * gaphor/actions/itemactions.py: 
     43        * gaphor/actions/placementactions.py: placement for ExtensionItem 
     44        * gaphor/actions/tests/test_placementactions.py: ... and tests 
     45        * gaphor/adapters/connectors.py: Connector for ExtensionItem 
     46        * gaphor/adapters/tests/test_connector.py: 
     47        * gaphor/diagram/diagramitem.py: removed set_subject() 
     48        * gaphor/diagram/extension.py: works 
     49        * setup.py: added unittest 
     50 
     512006-09-20  arjan <arjan at yirdis dot nl> 
     52 
     53        * utils/genUML.py: Removed. 
     54        * gaphor/ui/objectinspector.py: Use classes for adaption, in stead 
     55        of interfaces. Also removed interfaces from 
     56        gaphor/diagram/interfaces.py. 
     57        * gaphor/diagram/interfaces.py: cleaned up IDiagramElement interfaces. 
     58        * gaphor/ui/objectinspector.py: Updated to use classes iso interfaces 
     59 
     602006-09-19  arjan <arjan at yirdis dot nl> 
     61 
     62        * gaphor/diagram/items.py: New file. Gathered all *Item imports here 
     63        (used to be in gaphor/diagram/__init__.py) 
     64        * gaphor/actions/placementactions.py: Added actions for Include/Extends 
     65        * gaphor/actions/tests/test_placementactions.py: .. and tests 
     66        * gaphor/adapters/connectors.py: added connectors for Generalization, 
     67        Inlcude, Extend. 
     68        * gaphor/diagram/dependency.py: Cleanup 
     69        * gaphor/diagram/extend.py: Converted to new canvas 
     70        * gaphor/diagram/generalization.py: idem 
     71        * gaphor/diagram/implementation.py: idem 
     72        * gaphor/diagram/include.py: idem 
     73 
     742006-09-14  arjan <arjan at yirdis dot nl> 
     75 
     76        * gaphor/UML/tests/__init__.py: New file. 
     77        * gaphor/actions/tests/__init__.py: New file. 
     78        * gaphor/adapters/tests/__init__.py: New file. 
     79        * gaphor/diagram/tests/__init__.py: New file. 
     80        * gaphor/ui/tests/__init__.py: New file. 
     81        * setup.py: Implemented 'tests' target - runs all unit tests 
     82        * gaphor/*/tests/test_*.py: Updated to work well with overall test suite 
     83 
     842006-09-13  arjan <arjan at yirdis dot nl> 
     85 
     86        * updcl: New file. use this for easy updating of the changelog file. 
     87        Add a .developer to this directory with name and email. 
     88 
     892006-09-13  arjan <arjan at yirdis dot nl> 
     90 
     91        * gaphor/diagram/comment.py: fixed text rendering (mutiline) 
     92        * gaphor/diagram/interface.py: changed some code (box drawing now works) 
     93 
     942006-09-11  arjan <arjan at yirdis dot nl> 
     95 
     96        * gaphor/adapters: moved adapters from gaphor.diagram to this 
     97        separate package. 
     98        * gaphor/actions: collected all Action classes in one package. 
     99 
     1002006-09-05  arjan <arjan at yirdis dot nl> 
     101 
     102        * gaphor/diagram/classifier.py, gaphor/diagram/klass.py: works 
     103        * gaphor/diagram/package.py: works 
     104 
     1052006-09-03  arjan <arjan at yirdis dot nl> 
     106 
     107        * gaphor/diagram/classifier.py: cleanup 
     108        * gaphor.diagram/klass.py: is now placeable 
     109        * several fixes, cleanup and improved unit tests 
     110 
     1112006-08-21  arjan <arjan at yirdis dot nl> 
     112 
     113        * gaphor/diagram/usecase.py: drawing works 
     114 
     1152006-07-27  arjan <arjan at yirdis dot nl> 
     116 
     117        * Connect/disconnect works for comment-commentline 
     118        * gaphor/diagram/tool.py: Handle tool in place 
     119        * gaphor/diagram/interfaces.py: IConnect interface 
     120        * gaphor/diagram/actor.py: works 
     121 
     1222006-07-21  arjan <arjan at yirdis dot nl> 
     123 
     124        * gaphor/diagram/comment.py: text editining working 
     125        * gaphor/diagram/actor.py: draws 
     126 
     1272006-07-19  arjan <arjan at yirdis dot nl> 
     128 
     129        * gaphor/diagram/placementtool.py: works with Gaphas 
     130        * gaphor/diagram/comment.py: can be placed on new canvas 
     131        * gaphor/ui/*, gaphor/UML/*: use gaphas instead of diacanvas 
     132 
     1332006-07-07  arjan <arjan at yirdis dot nl> 
     134 
     135        * utils/coverage.py: new module for code coverage. 
     136        * setup.py: added --coverage option ro the run command, allowing for 
     137        code coverage output. 
     138 
    11392006-06-07  arjan <arjan at yirdis dot nl> 
    2140 
  • gaphor/trunk/NEWS

    r757 r1121  
     10.9.0 
     2----- 
     3- New pure-python canvas implementation (gaphas) 
     4- Zope Adapters used for item connections 
     5- Undo managements temporaly disabled 
     6- Added loads of unit tests 
     7NOTE: if you have Zope 3 installed it's probably not a good idea to install 
     8      Gaphor too, since Gaphor tries to install Zope3 packages too. 
     9      Don't worry, you can run Gaphor perfectly well using the run-gaphor.sh 
     10      script. 
     11 
    1120.8.1 
    213----- 
  • gaphor/trunk/TODO

    r933 r1121  
    11 
    2 !!! Create some example diagrams, 
     2For 0.10.0 and later: 
     3--------------------- 
     4 
     5 - use easysetup tools, move gaphas to a separate package and use 
     6   zope.interface in stead of our included zope tree. 
     7 
     8 - Undo functionality 
     9 - Load / save regression testing 
     10   !!! Create some example diagrams, 
    311 
    412 - using stereotypes 
    5  - associations 
    613 - components and stuff 
    714 
    8 ======== stereotypes branch ========= 
    9 - namedelement.py: from NamedElement 
    10 - items.tex: describe: 
    11   - __uml__ 
    12   - __stereotype__ 
    13   - __fixed_stereotype__ 
    14 ===== end of stereotypes branch ===== 
     15 - lot's of tests are dependent on a decently initialized main window. 
     16   There is no need for these actions to depend on a main window, they only 
     17   need a gaphas.View instance. 
    1518 
    16 ======= 0.8.0 ======== 
    17 - load uml2.gaphor and open other file or split flows and undo/redo. 
    18   exception is raised. seems to be related to diagram item unlinking. 
     19 - Use actions only for action definitions. use Events for notification 
     20   between actions. 
    1921 
    20     Traceback (most recent call last): 
    21       File "build/lib/gaphor/diagram/diagramitem.py", line 163, in disconnect 
    22         ids = self.__handler_to_id[key] 
    23     KeyError: (<bound method association.__on_unlink of <gaphor.UML.properties.association object at 0x3034e030>>, <gaphor.UML.uml2.ControlFlow object at 0x3083b150>) 
     22 - namedelement.py: from NamedElement 
     23 - items.tex: describe: 
     24    - __uml__ 
     25    - __stereotype__ 
     26    - __fixed_stereotype__ 
    2427 
    25 ======= End of 0.8.0 ======== 
    26  
    27 As always, there is much to do... 
     28Older (long term ;) todo items: 
     29------------------------------- 
    2830 
    2931- At this point we have three event systems: 
    30    1. GObject - used by GTK+, should be restricted to the GUI 
    3132   2. Actions - used for (pseudo) menu actions (artifical actions are triggered 
    3233                some times (e.g. to notify about changes in the Undo Manager) 
     
    3536             change. 
    3637 
    37    GObject will stay as long as we use GTK+. Restrict it's influence to the GUI. 
    38    (to much management overhead) 
    3938   Actions work fine, for menu actions. Gaphor specific and should work 
    4039   with the GTK+ menu manager classes. 
    4140   Zope classes are quite optimized. However, mainly provides the same 
    4241   functionality as Actions, but not as fine grained. 
    43  
    44 - Check association removal when connected to a class. 
    4542 
    4643- Add meta data (such as text alignment) to the model file (add a meta: 
     
    5350  Should use meta-classes for registration too (define __abstract__ or\something to prevent registration). 
    5451 
    55 #- Store application state: 
    56   #- last opened files 
    57   #- open/closed status of diagram toolbox 
    58   #- window size 
    59   #- reset tool option 
    60  
    61 #- When Stereotype has no submenu items, grey it out. Same goes for "Export" 
    62   menu. This will be handled by the UIManager in the near future. 
    63  
    6452- disable actions when editing. 
    6553 
     
    7058- Stereotype export and import function. Allow to export packages and import 
    7159  them into other models. 
    72  
    73 #- Create distinctive icons for Include and Extend relationships (use cases). 
    7460 
    7561- How to figure out if a module exists without loading it? 
     
    10591  Previous conclusion: keep using the gaphor.misc.action code 
    10692 
    107 #- Storing last open files or having a quick-list of most important 
    108   directories or so would be great  
    109   Problem: the existing <Placeholder> stuff works only on construction time. 
    110     For this we need a menu that can change during the life of the application. 
    111  
    112 #- Make associations look nice with usecases: 
    113    . No arrows at the end 
    114    . Disable popup menu for navigability and composition 
    115  
    116 #- Automatically draw relations when an item is DND-ed from the tree-view 
     93- Automatically draw relations when an item is DND-ed from the tree-view 
    11794  to the diagram. 
    11895 
    119 #- confirmation window when creating a new model. 
    120  
    121 #- Copy/Paste for diagramitems 
     96- Copy/Paste for diagramitems 
    12297  - in order to make copy/paste work, the load/save functions should be 
    12398    generatlised to allow a subset to be saved/loaded (which is needed 
     
    128103    on the canvas and make the uml element visible again. 
    129104 
    130 #- Undo/redo functionality 
    131  
    132 #- Make text selected when starting to edit it: fixed in DiaCanvas2 
     105- Undo/redo functionality 
    133106 
    134107#- Stereotypes: check documentation page 581 (597 absolute). Fixed. An extra 
    135108   association has been created between Stereotype and Class, Interface and 
    136109   Package. 
    137  
    138 #- Set up a plugin architecture. Since the internals of gaphor are pretty 
    139    modular, plugins should not be that hard. I'm very happy with the new one 
    140    it is easy to program, yet powerful (due to the XML description file, which 
    141    allows gaphor to check several dependencies upfront. 
    142110 
    143111Diagram Items 
     
    170138- The text editing also needs a facelift. 
    171139 
    172 #- Alert a user when deleting the last reference to an object (Are you 
    173   sure you want to remove all the selected elements from the model?) 
    174  
  • gaphor/trunk/data/plugins/pdfexport/__init__.py

    r720 r1121  
    22 
    33import gtk 
    4 import diacanvas 
     4#import diacanvas 
    55 
    66import cairo 
     
    2020        log.debug('Exporting PDF image to: %s' % filename) 
    2121        canvas = self.get_window().get_current_diagram_tab().get_canvas() 
    22         svg = diacanvas.ExportSVG() 
     22        #svg = diacanvas.ExportSVG() 
    2323        try: 
    2424            # first, export to svg 
    2525            fd, svg_name = tempfile.mkstemp() 
    26             svg = diacanvas.ExportSVG() 
     26            #svg = diacanvas.ExportSVG() 
    2727            svg.render(canvas) 
    2828            svg.save(svg_name) 
  • gaphor/trunk/data/plugins/pngexport/pngexport.py

    r720 r1121  
    33from gaphor.plugin import DiagramExportAction 
    44 
    5 import diacanvas 
     5#import diacanvas 
    66import gtk 
    77 
  • gaphor/trunk/data/plugins/svgexport/__init__.py

    r720 r1121  
    22 
    33import gtk 
    4 import diacanvas 
     4#import diacanvas 
    55from gaphor.plugin import DiagramExportAction 
    66 
     
    1313        log.debug('Exporting SVG image to: %s' % filename) 
    1414        canvas = self.get_window().get_current_diagram_tab().get_canvas() 
    15         export = diacanvas.ExportSVG() 
     15        #export = diacanvas.ExportSVG() 
    1616        try: 
    1717            export.render (canvas) 
  • gaphor/trunk/data/plugins/xmiexport/exportmodel.py

    r573 r1121  
    192192            attributes['ownerScope']='instance' 
    193193            attributes['isQuery']='false' 
    194             attributes['concurrency']='seqeuntial' 
     194            attributes['concurrency']='sequential' 
    195195            attributes['isRoot']='false' 
    196196            attributes['isLeaf']='false' 
  • gaphor/trunk/doc/items.tex

    r926 r1121  
    1 \documentclass[draft]{book} 
     1\documentclass{book} 
    22\usepackage[papername = a4paper, margin = 3cm]{geometry} 
    33\usepackage{graphicx} 
    44\usepackage{hyperref} 
     5\usepackage{listings} 
     6\usepackage{float} 
    57 
    68\title{Gaphor Diagram Item Model} 
    79\author{wrobell@pld-linux.org} 
     10 
     11\newfloat{code}{th}{code} 
     12 
     13\lstnewenvironment{pylst}{\lstset{language=Python}}{} 
    814 
    915\newcommand{\rmodule}[1]{\texttt{#1}} 
     
    96102\section{Introduction} 
    97103UML specification defines UML data model, which is used by Gaphor to store 
    98 information about modeled system. UML data model is visualized with 
    99 Diacanvas library used as canvas library. Notation 
    100 of UML diagram items is also specified by UML specification. 
    101  
    102 Diacanvas library supports basic drawing operations but there are many 
     104information about a modeled system. The UML data model is visualized by 
     105the Gaphas library, a general purpose diagram drawing library. Notation 
     106of UML diagram items is also specified by the UML specification. 
     107 
     108The Gaphas library supports basic drawing operations but there are many 
    103109entities and behaviors, which are common to many or all diagram items, i.e. 
    104 stereotypes, items' name, popup menu, positioning of associated items, etc. 
     110stereotypes, item name, popup menu, positioning of associated items, etc. 
    105111 
    106112We have to identify common elements and behaviors of UML diagram items 
     
    108114by Gaphor to provide modeling functionality. 
    109115 
     116Note that, the diagram item hierarchy does not have to follow the hierarchy 
     117defined in the UML model.  
     118 
    110119\section{Problem Description} 
    111120 
     
    117126\end{itemize} 
    118127 
    119 Because of differences between them, DiagramItem class cannot be directly 
    120 associated with canvas line or canvas element. Connection between diacanvas 
    121 classes and items has to be established by different abstract classes. 
     128Because of differences between them, Basic diagram item class cannot be 
     129directly associated with canvas lines or canvas elements. Connection between 
     130canvas classes and items has to be established by different abstract 
     131classes. 
    122132 
    123133\subsection{Items and UML Model Classes} 
    124 Generaly there is one to one association between an item and UML class 
    125 but it is not always so simple.  
     134Generaly there is a one to one association between an item and an UML class, 
     135but it is not always that simple.  
    126136For example one diagram item can visualize more than one UML class 
    127137\begin{itemize} 
     
    131141 
    132142Also, there can be situation, when there is no UML class visualized, i.e. 
    133 in case of CommentLine. 
     143in case of a CommentLine. 
    134144 
    135145\subsection{Line Items} 
    136 Line has at least two handles. These handles are reffered as head (first 
    137 handle) and tail (second handle) of line. 
    138  
    139 When user puts an item on a diagram, then last handle can be moved to 
    140 desired point. The same applies to line items. User puts line on diagram, 
     146Lines have at least two handles. These handles are reffered to as head (first 
     147handle) and tail (last handle) of line. 
     148 
     149When a user puts an item on a diagram, then the last handle can be moved to 
     150a desired point. The same applies to line items. User puts a line on diagram, 
    141151head is set in mouse cursor point and tail is moved to desired point. 
    142152 
    143 Head and tail concepts are also used in diacanvas in case of canvas line
     153Head and tail concepts are also used in Gaphas in case of canvas lines
    144154Head of line item is at the same end as head of canvas line. The same 
    145155applies for tail. 
    146156 
     157\subsection{Item Styles}\label{itemstyles} 
     158All the items are going to contain different parts. 
     159Many of such parts can be shared by other items, for example 
     160\begin{itemize} 
     161\item UML named elements (see named items) have names, which 
     162    can be displayed in different places, i.e. class --- top--center, 
     163    use case --- middle--center 
     164\item every UML class can have stereotypes, which should be displayed 
     165    over items' name 
     166\end{itemize} 
     167 
     168Above can be described as styles (i.e.\ similar to CSS). 
     169 
     170It should be possible to implement common behaviour in basic item classes, 
     171which should be parametrized by item's style information. For example, 
     172named element item should set position of name depending on styles. 
     173 
     174\section{Styles} 
     175Class \rclass{ElementItem} defined below should define following styles 
     176\begin{description} 
     177\item[min--size] minimal size of an item; minimal width and height are 
     178    initialized using this style information 
     179\end{description} 
     180 
    147181\section{Classes} 
    148182\rclass{DiagramItem} class is a basic, abstract class for all items. Every 
    149 item class is created using \rclass{DiagramItemMeta} metaclass. It 
    150 assigns information about UML class, stereotypes, 
    151 etc.\ to every item class. 
     183item class is created using \rclass{DiagramItemMeta} metaclass. 
    152184 
    153185Different canvas elements (see~\ref{gaphor:basic:itemsandcanvas}) are 
     
    164196\iattr{\_\_uml\_\_}{UML class associated with item} 
    165197\iattr{\_\_stereotype\_\_}{item static stereotype} 
    166 \iattr{s\_align}{stereotype align} 
     198\iattr{\_\_style\_\_}{used to define new and override item style information} 
     199\iattr{style}{used to obtain item style information, also information derived from base classes} 
    167200\end{attrs} 
    168201\begin{entitydesc} 
    169 Basic metaclass for all items. Stereotypes are aligned according to 
    170 \rattr{s\_align} attribute
     202Metaclass for all items. Assigns information about UML class, stereotypes, 
     203styles, etc.\ to every item class
    171204\end{entitydesc} 
    172205\end{class} 
     
    186219\iattr{head}{reference to head handle of a line} 
    187220\iattr{tail}{reference to tail handle of a line} 
    188 \iattr{s\_align}{stereotype align} 
    189221\end{attrs} 
    190222\begin{entitydesc} 
     
    194226 
    195227\begin{class}{ElementItem} 
     228\begin{attrs} 
     229\iattr{min\_width}{minimal item width} 
     230\iattr{min\_height}{minimal item height} 
     231\end{attrs} 
    196232\begin{entitydesc} 
    197233Canvas element based items like class, component, lifeline, 
    198234comment, activity nodes, etc. 
     235 
     236Minimal width and height are initialized from minimal size style 
     237information. These two values can change during item lifecycle (i.e.\ name 
     238can be expanded or shrinked), therefore minimal size style information 
     239guards initial minimal dimensions of element item. 
    199240\end{entitydesc} 
    200241\end{class} 
     
    264305Align constants and classes are defined in \rmodule{gaphor::diagram::align} module. 
    265306 
    266 \subsection{Stereotype and Name Align
     307\subsection{Stereotype and Name Alignment
    267308 
    268309There are two important elements of items 
     
    283324 
    284325\chapter{Named Items} 
    285 \section{Introduction} 
    286 Named items represent these UML classes, which derive from NamedElement. 
     326\section{Problem Description} 
     327Named items represent those UML classes, which derive from NamedElement. 
     328 
    287329All named items are editable, so user can double click on an item and 
    288330change or enter name of UML object. 
    289331 
    290 We have to distinguish between two kind of named elements. One is related 
    291 to canvas elements and second is related to canvas lines. For example, name 
    292 of UML object can be positioned inside or outside canvas element (class vs. 
    293 initial node), also name can be centered or on left/right side of canvas 
    294 element. In case of canvas line based items name can be near head, tail 
    295 or centre of a line and name can be put horizontaly or along line path. 
    296  
    297 \section{Problem Description} 
    298 \subsection{Canvas Element Named Items} 
    299  
    300 \subsection{Canvas Line Named Items} 
     332There should be minimal size (which is default, initial one) of named 
     333items. Every named item can have its own minimal size. Size of named item 
     334can be changed by an user. There are some cases, when size cannot be 
     335changed, i.e. initial node item. 
     336 
     337It should be possible to align name of named element with styles 
     338(see~\ref{itemstyles}) as depending on an element, the name can be 
     339displayed in different places related to an item, i.e. 
     340\begin{itemize} 
     341\item class               --- top center 
     342\item use case            --- middle center 
     343\item object node         --- middle center 
     344\item actor               --- bottom center, outside item bounduaries 
     345\item initial action node --- top left, outside item bounduaries 
     346\item decision node       --- bottom center, outside item bounduaries 
     347\end{itemize} 
     348 
     349%fixme: there can be items with initial name and without initial name 
     350 
     351\section{Styles} 
     352Kind of information we need to align the name 
     353\begin{itemize} 
     354\item horizontal align information (left, center or right) 
     355\item vertical align information (top, middle or bottom) 
     356\item padding specified as in CSS (top right bottom left) 
     357\item is name outside an item? 
     358\end{itemize} 
     359 
     360Styles for name align are defined in table~\ref{nameditems:styles:spec} 
     361(see diagram~\ref{nameditems:styles:example} for example). 
     362 
     363\begin{table} 
     364\begin{center} 
     365\begin{tabular}{|l|l|l|} 
     366\hline 
     367Name           & Default value     & Description \\ 
     368\hline 
     369name--align    & ('center', 'top') & align information \\ 
     370name--padding  & (5, 5, 5, 5)      & name padding \\ 
     371name--outside  & False             & name outside/inside item bounduaries \\ 
     372\hline 
     373\end{tabular} 
     374\caption{Specification of name align styles}\label{nameditems:styles:spec} 
     375\end{center} 
     376\end{table} 
     377 
     378\begin{code} 
     379\lstset{language={Python}} 
     380\begin{pylst} 
     381class NamedItem(DiagramItem): 
     382    __style__ = { 
     383        'name-align' : ('center', 'top'), 
     384        'name-padding': (5, 5, 5, 5), 
     385        'name-outside': False, 
     386    } 
     387\end{pylst} 
     388\caption{Named items style example}\label{nameditems:styles:example} 
     389\end{code} 
     390