Graphics/UMLDiagramBuilder.py

Sat, 19 Nov 2016 12:51:02 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 19 Nov 2016 12:51:02 +0100
branch
maintenance
changeset 5335
112840bac20c
parent 4631
5c1a96925da4
child 5389
9b1c800daff3
permissions
-rw-r--r--

Prepared release 16.11.1

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

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

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

from __future__ import unicode_literals

from PyQt5.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.
        
        @exception NotImplementedError raised to indicate that this class
            must be subclassed
        """
        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