public void setVertices(List<Vertex> vertices) { clearVertices(); addVertices(vertices); fireVertexSetChanged(); }
public void setVertices(List<Vertex> vertices) { clearVertices(); addVertices(vertices); fireVertexSetChanged(); }
@Override public boolean setParent(VertexRef child, VertexRef parent) { if (child.equals(parent)) return false; // Set the parent value on the vertex object getVertex(child).setParent(parent); // Add a parent mapping if (parent == null) { m_parents.remove(child); } else { m_parents.put(child, parent); } // Remove the child from any existing m_children mappings for (Set<VertexRef> vertex : m_children.values()) { vertex.remove(child); } boolean retval = false; if (parent == null) { retval = true; } else { // Add the child to m_children under the new parent Set<VertexRef> children = m_children.get(parent); if (children == null) { children = new TreeSet<VertexRef>(); m_children.put(parent, children); } retval = children.add(child); } fireVertexSetChanged(); return retval; }
public void setVertices(List<Vertex> vertices) { clearVertices(); addVertices(vertices); fireVertexSetChanged(); }
@Override public boolean setParent(VertexRef child, VertexRef parent) { if (child.equals(parent)) return false; // Set the parent value on the vertex object getVertex(child).setParent(parent); // Add a parent mapping if (parent == null) { m_parents.remove(child); } else { m_parents.put(child, parent); } // Remove the child from any existing m_children mappings for (Set<VertexRef> vertex : m_children.values()) { vertex.remove(child); } boolean retval = false; if (parent == null) { retval = true; } else { // Add the child to m_children under the new parent Set<VertexRef> children = m_children.get(parent); if (children == null) { children = new TreeSet<VertexRef>(); m_children.put(parent, children); } retval = children.add(child); } fireVertexSetChanged(); return retval; }
@Override public boolean setParent(VertexRef child, VertexRef parent) { if (child.equals(parent)) return false; // Set the parent value on the vertex object getVertex(child).setParent(parent); // Add a parent mapping if (parent == null) { m_parents.remove(child); } else { m_parents.put(child, parent); } // Remove the child from any existing m_children mappings for (Set<VertexRef> vertex : m_children.values()) { vertex.remove(child); } boolean retval = false; if (parent == null) { retval = true; } else { // Add the child to m_children under the new parent Set<VertexRef> children = m_children.get(parent); if (children == null) { children = new TreeSet<VertexRef>(); m_children.put(parent, children); } retval = children.add(child); } fireVertexSetChanged(); return retval; }