示例#1
0
    def __positionAndSetupDiagramFrame(
        self,
        umlFrame: UmlDiagramsFrame,
        documentNode: Element,
    ):

        xStr: str = documentNode.getAttribute(
            PyutXmlConstants.ATTR_SCROLL_POSITION_X)
        yStr: str = documentNode.getAttribute(
            PyutXmlConstants.ATTR_SCROLL_POSITION_Y)

        scrollPosX: int = PyutUtils.secureInteger(xStr)
        scrollPosY: int = PyutUtils.secureInteger(yStr)

        umlFrame.Scroll(scrollPosX, scrollPosY)

        xPerUnitStr: str = documentNode.getAttribute(
            PyutXmlConstants.ATTR_PIXELS_PER_UNIT_X)
        yPerUnitStr: str = documentNode.getAttribute(
            PyutXmlConstants.ATTR_PIXELS_PER_UNIT_Y)

        pixelsPerUnitX: int = PyutUtils.secureInteger(xPerUnitStr)
        pixelsPerUnitY: int = PyutUtils.secureInteger(yPerUnitStr)
        if pixelsPerUnitX != 0 and pixelsPerUnitY != 0:
            umlFrame.SetScrollRate(xstep=pixelsPerUnitX, ystep=pixelsPerUnitY)
示例#2
0
    def __displayTheInterfaces(self, oglInterfaces: OglInterfaces,
                               umlFrame: UmlDiagramsFrame):

        for oglInterface in oglInterfaces:

            attachmentAnchor = oglInterface.destinationAnchor
            x, y = attachmentAnchor.GetPosition()

            umlFrame.addShape(oglInterface, x, y, withModelUpdate=True)
    def __init__(self, parent):
        """
        Constructor.

        @param wx.Window parent : parent window
        @since 1.0
        @author C.Dutoit <*****@*****.**>
        """
        UmlDiagramsFrame.__init__(self, parent)
        self.newDiagram()
        self._cdInstances = []
示例#4
0
    def __displayTheLinks(self, oglLinks: OglLinks,
                          umlFrame: UmlDiagramsFrame):
        """
        Place the OGL links on the input frame at their respective positions

        Args:
            oglLinks:   A dictionary of OGL links
            umlFrame:   The UML Frame to place the OGL objects on
        """
        umlDiagram = umlFrame.GetDiagram()
        for oglLink in oglLinks:
            umlDiagram.AddShape(oglLink, withModelUpdate=True)
            controlPoints = oglLink.GetControlPoints()
            for controlPoint in controlPoints:
                umlDiagram.AddShape(controlPoint)
示例#5
0
    def __cleanupProgressDialog(self, umlFrame: UmlDiagramsFrame):

        umlFrame.Refresh()
        self._gauge.SetValue(5)
        wxYield()
        self._dlgGauge.Destroy()
示例#6
0
 def __displayAnOglObject(self, oglObject: OglObject,
                          umlFrame: UmlDiagramsFrame):
     x, y = oglObject.GetPosition()
     umlFrame.addShape(oglObject, x, y)
示例#7
0
    def __displayTheSDMessages(self, oglSDMessages: OglSDMessages,
                               umlFrame: UmlDiagramsFrame):

        for oglSDMessage in oglSDMessages.values():
            umlFrame.getDiagram().AddShape(oglSDMessage)