Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -753,16 +753,27 @@ final class JsonImporter {
*/

private def ElkNode register(ElkNode node, Object obj) {
val id = obj.toJsonObject.id

var id = obj.toJsonObject.id
// If the id is an integer or begins with a number, construct a string id with a leading 'n' character.
if (id instanceof Integer) {
id = 'n' + id.toString
} else if (id instanceof String && (id as String).matches("^[0-9].*")) {
id = 'n' + id
}
nodeIdMap.put(id, node)
nodeJsonMap.put(node, obj)

return node
}

private def ElkPort register(ElkPort port, Object obj) {
val id = obj.toJsonObject.id
var id = obj.toJsonObject.id
// If the id is an integer or begins with a number, construct a string id with a leading 'p' character.
if (id instanceof Integer) {
id = 'p' + id.toString
} else if (id instanceof String && (id as String).matches("^[0-9].*")) {
id = 'p' + id
}

portIdMap.put(id, port)
portJsonMap.put(port, obj)
Expand All @@ -771,7 +782,13 @@ final class JsonImporter {
}

private def ElkEdge register(ElkEdge edge, Object obj) {
val id = obj.toJsonObject.id
var id = obj.toJsonObject.id
// If the id is an integer or begins with a number, construct a string id with a leading 'e' character.
if (id instanceof Integer) {
id = 'e' + id.toString
} else if (id instanceof String && (id as String).matches("^[0-9].*")) {
id = 'e' + id
}

edgeIdMap.put(id, edge)
edgeJsonMap.put(edge, obj)
Expand Down Expand Up @@ -858,4 +875,4 @@ final class JsonImporter {
return edgeCoordsMap.get(element)
}

}
}
Loading