static { ResourceBundle rs = ResourceBundle.getBundle( SequenceDiagramConstant.SEQUENCE_DIAGRAM_STRINGS, Locale.getDefault()); LifelineNode lifelineNode = new LifelineNode(); lifelineNode.setToolTip(rs.getString("node0.tooltip")); NODE_PROTOTYPES.add(lifelineNode); ActivationBarNode activationBarNode = new ActivationBarNode(); activationBarNode.setToolTip(rs.getString("node1.tooltip")); NODE_PROTOTYPES.add(activationBarNode); NoteNode noteNode = new NoteNode(); noteNode.setToolTip(rs.getString("node2.tooltip")); NODE_PROTOTYPES.add(noteNode); EndLifeNode endLifeNode = new EndLifeNode(); endLifeNode.setToolTip(rs.getString("node3.tooltip")); NODE_PROTOTYPES.add(endLifeNode); IntegrationFrameNode integrationFrameNode = new IntegrationFrameNode(); integrationFrameNode.setToolTip(rs.getString("node4.tooltip")); NODE_PROTOTYPES.add(integrationFrameNode); CallEdge callEdge = new CallEdge(); callEdge.setToolTip(rs.getString("edge0.tooltip")); EDGE_PROTOTYPES.add(callEdge); ReturnEdge returnEdge = new ReturnEdge(); returnEdge.setToolTip(rs.getString("edge1.tooltip")); EDGE_PROTOTYPES.add(returnEdge); NoteEdge noteEdge = new NoteEdge(); noteEdge.setToolTip(rs.getString("edge2.tooltip")); EDGE_PROTOTYPES.add(noteEdge); }
/* process unification constraints */ protected void process(UnifyConstraint c) { Node n1 = c.node1.getRep(); Node n2 = c.node2.getRep(); assert (n1.graph == this); assert (n2.graph == this); if (n1 == n2) return; if (heapfix && n2.isheap && !n1.isheap) { Node sw = n1; n1 = n2; n2 = sw; } n1.mergeTags(n2); n1.mergeFlags(n2); n2.parent = n1; n2.tag = null; n2.region = null; if (secondary_index[0]) { for (FieldEdge e : n2.outfields.values()) { assert (e.src == n2); if (e.dst == n2) w.addLast(new FieldConstraint(n1, n1, e.field)); else { w.addLast(new FieldConstraint(n1, e.dst, e.field)); e.dst.infields.get(e.field).remove(e); } fedges.get(e.field).remove(e); } for (Field f : n2.infields.keySet()) for (FieldEdge e : n2.infields.get(f)) { assert (e.dst == n2); e.dst = n1; addInField(n1, f, e); } n2.outfields = null; n2.infields = null; } else { HashSet<FieldEdge> fremove = new HashSet<FieldEdge>(); for (Field f : fedges.keySet()) { Collection<FieldEdge> fed = fedges.get(f); int size = fed.size(); fremove.clear(); for (FieldEdge e : fed) { if (e.src == n2) { if (e.dst == n2) w.addLast(new FieldConstraint(n1, n1, e.field)); else w.addLast(new FieldConstraint(n1, e.dst, e.field)); } else { if (e.dst == n2) e.dst = n1; continue; } if (!fremove.contains(e)) { fremove.add(e); size--; } } fed.removeAll(fremove); assert (fed.size() == size); } } HashSet<CallEdge> cremove = new HashSet<CallEdge>(); for (Call ce : cedges.keySet()) { Collection<CallEdge> ced = cedges.get(ce); cremove.clear(); int size = ced.size(); for (CallEdge e : ced) { if (e.dst == n2) { if (e.src == n2) w.addLast(new CallConstraint(n1, n1, e.call)); else w.addLast(new CallConstraint(e.src, n1, e.call)); } else { if (e.src == n2) e.src = n1; continue; } if (!cremove.contains(e)) { cremove.add(e); size--; } } ced.removeAll(cremove); assert (ced.size() == size); } }