/** * Draws a new vertex into the graph. * * @param vertex vertex to be added to the graph */ private void addJGraphTVertex(V vertex) { getModel().beginUpdate(); try { // create a new JGraphX vertex at position 0 mxICell cell = (mxICell) insertVertex(defaultParent, null, vertex, 0, 0, 0, 0); // update cell size so cell isn't "above" graph updateCellSize(cell); // Save reference between vertex and cell vertexToCellMap.put(vertex, cell); cellToVertexMap.put(cell, vertex); } finally { getModel().endUpdate(); } }
/** * Draws a new vertex into the graph. * * @param vertex vertex to be added to the graph */ private void addJGraphTVertex(V vertex) { getModel().beginUpdate(); try { // create a new JGraphX vertex at position 0 mxICell cell = (mxICell) insertVertex(defaultParent, null, vertex, 0, 0, 0, 0); // update cell size so cell isn't "above" graph updateCellSize(cell); // Save reference between vertex and cell vertexToCellMap.put(vertex, cell); cellToVertexMap.put(cell, vertex); } finally { getModel().endUpdate(); } }