Graphics/UMLDiagramBuilder.py

Mon, 25 Mar 2013 03:11:06 +0100

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Mon, 25 Mar 2013 03:11:06 +0100
branch
Py2 comp.
changeset 2525
8b507a9a2d40
parent 2302
f29e9405c851
child 3057
10516539f238
permissions
-rw-r--r--

Script changes: Future import added, super calls modified and unicode behavior for str.

# -*- coding: utf-8 -*-

# Copyright (c) 2012 - 2013 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing the UML diagram builder base class.
"""

from __future__ import unicode_literals    # __IGNORE_WARNING__

from PyQt4.QtCore import QObject


class UMLDiagramBuilder(QObject):
    """
    Class implementing the UML diagram builder base class.
    """
    def __init__(self, dialog, view, project):
        """
        Constructor
        
        @param dialog reference to the UML dialog (UMLDialog)
        @param view reference to the view object (UMLGraphicsView)
        @param project reference to the project object (Project)
        """
        super(UMLDiagramBuilder, self).__init__(dialog)
        
        self.umlView = view
        self.scene = self.umlView.scene()
        self.project = project
    
    def initialize(self):
        """
        Public method to initialize the object.
        """
        return
    
    def buildDiagram(self):
        """
        Public method to build the diagram.
        
        This class must be implemented in subclasses.
        """
        raise NotImplementedError(
            "Method 'buildDiagram' must be implemented in subclasses.")
    
    def getPersistenceData(self):
        """
        Public method to get a string for data to be persisted.
        
        @return persisted data string (string)
        """
        return ""
    
    def parsePersistenceData(self, version, data):
        """
        Public method to parse persisted data.
        
        @param version version of the data (string)
        @param data persisted data to be parsed (string)
        @return flag indicating success (boolean)
        """
        return True

eric ide

mercurial