# This file is part of the Coral project.
# Please read the copyright notice in the LICENSE file.

import coral
from renderer import *
from coral.modeler.diagram.presentation import *
DI = coral.lang.XMIDI20


import qt

#
# Edge layouters
#

class DIMLEdgeLAY( layout.GraphEdgeLayouter ):
    def moveLabels(self, sizeHinter, startDiff, endDiff):
        edge=self.graphElement
        if len(edge.contained) != 1:
            return
        middleDiff=((startDiff[0]+endDiff[0])/2,(startDiff[1]+endDiff[1])/2)
        p = self.graphElement.contained[0].position
        p.x += middleDiff[0]
        p.y += middleDiff[1]


class GraphElementPartLAY( layout.VBoxLayouterMaster ):
    def minSize(self):
        return 100,60

    def padX(self):
        return 6

    def padY(self):
        return 4
