if (root instanceof JSONArray) {
JSONArray array = (JSONArray) root;
List<ActiveNodeInfo> activeNodeInfos = new ArrayList<ActiveNodeInfo>();
for (int i = 0; i < array.size(); i++) {
JSONWalk walk = JSONWalk.on(array.get(i));
JSONWrapper wrapper = walk.next("activeNode");
JSONObject activeNode = wrapper.asObject();
int x = JSONWalk.on(activeNode).next("x").asInt();
int y = JSONWalk.on(activeNode).next("y").asInt();
int width = JSONWalk.on(activeNode).next("width").asInt();
int height = JSONWalk.on(activeNode).next("height").asInt();
String name = JSONWalk.on(activeNode).next("name").asString();
activeNodeInfos.add(
new ActiveNodeInfo(
-1, -1,
new DiagramNodeInfo(name, x, y, width, height)
)
);
wrapper = walk.next("activeNode");
}
// update view
ActivityDiagramView view = (ActivityDiagramView) controller.getView(ActivityDiagramView.ID);
view.update(