override fun extractConnectionPath()

in code/nxt-integration/src/main/kotlin/org/fbme/integration/nxt/importer/FBNetworkNxtImporter.kt [32:55]


    override fun extractConnectionPath(connectionElement: Element): ConnectionPath {
        val dx1Attribute = connectionElement.getAttribute("dx1")
        val dyAttribute = connectionElement.getAttribute("dy")
        val dx2Attribute = connectionElement.getAttribute("dx2")
        var kind = ConnectionPath.Kind.Straight
        var dx1 = 0
        var dy = 0
        var dx2 = 0
        return try {
            if (dx1Attribute != null && dyAttribute != null && dx2Attribute != null) {
                kind = ConnectionPath.Kind.FourAngles
                dx1 = dx1Attribute.floatValue.toInt()
                dy = dyAttribute.floatValue.toInt()
                dx2 = dx2Attribute.floatValue.toInt()
            } else if (dx1Attribute != null) {
                kind = ConnectionPath.Kind.TwoAngles
                dx1 = dx1Attribute.floatValue.toInt()
            }
            val pointList = getPointList(connectionElement)
            pointList?.let { LongConnectionPath(dx1, dy, dx2, it) } ?: ConnectionPath(kind, dx1, dy, dx2)
        } catch (e: DataConversionException) {
            ConnectionPath()
        }
    }