/** * Recalculates and reapplies all of the edge appearances. The visual attributes are calculated by * delegating to the EdgePainter member of the current visual style. */ public void applyEdgeAppearances() { for (PEdgeView edgeView : edgeViewMap.values()) { FNode node = edgeView.getEdge().getSource(); HGHandle h = graph.getTypeSystem().getTypeHandle(node.getHandle()); EdgePainter p = getVisualStyle(true).getEdgePainter(h); if (p == null) p = def_edge_painter; p.paintEdge(edgeView); } }
/** * Removes a PEdgeView given its FEdge from the GraphView. * * @param edge the edge * @return the removed view or null if no such view */ public PEdgeView removeEdgeView(FEdge e) { if (!edgeViewMap.containsKey(e)) return null; PEdgeView view = getEdgeView(e); view.removeFromParent(); if (isEdgeSelectionEnabled()) getEdgeSelectionHandler().unselect(view); edgeViewMap.remove(e); fireGraphChanged(new GraphViewEdgesRemovedEvent(this, new FEdge[] {e})); return view; }
/** Selects all edges in the GraphView. */ public void selectAllEdges() { if (isEdgeSelectionEnabled()) for (PEdgeView nv : edgeViewMap.values()) nv.setSelected(true); }
/** * Removes a PEdgeView from the GraphView. * * @param edge_view the view * @return the removed view or null if no such view */ public PEdgeView removeEdgeView(PEdgeView edge_view) { return removeEdgeView(edge_view.getEdge()); }