Changeset 573

Show
Ignore:
Timestamp:
10/09/05 08:08:55 (3 years ago)
Author:
slmm
Message:

Added new Kid (http://kid.lesscode.org) based exporter for XMI. Kid is a
Pythonic templating language. The goal of this export facility is to get higher
compatibility with Poseidon's file format.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gaphor/data/plugins/xmiexport/exportmodel.py

    r491 r573  
    2626 
    2727class XMIExport(object): 
     28     
     29    # State diagram specific 
     30    # ====================== 
     31    def handleInitialNode(self, xmi, node): 
     32        attributes = XMLAttributes() 
     33        attributes['xmi.id']=node.id 
     34        attributes['name']="start" # Gaphor doens't have name support  
     35                                   # for start actions. 
     36        attributes['visibility'] = 'public' 
     37        attributes['isSpecification'] = 'false' 
     38        attributes['kind'] = 'initial' 
     39        xmi.startElement('UML2:Pseudostate', attrs=attributes) 
     40        xmi.startElement('UML2:Vertex.outgoing') 
     41         
     42                          
     43         
     44    def handleAction(self, xmi, node): 
     45        attributes = XMLAttributes() 
     46        attributes['xmi.id']=node.id 
     47        attributes['name']=node.name 
     48        attributes['visibility'] = 'public' 
     49        attributes['isSpecification'] = 'false' 
     50     
     51    def handleControlFlow(self, xmi, node): 
     52        pass 
     53     
     54     
     55    # Class diagram specific 
     56    #========================= 
    2857 
    2958    def handlePackage(self, xmi, node): 
     
    371400                handler=getattr(self, 'handle%s'%element.__class__.__name__) 
    372401            except AttributeError: 
     402                print element.__class__.__name__ 
    373403                continue 
    374404            handler(xmi, element)