public void FocusNodes(Set<Functionality.Node> nodes, boolean adjustVertexFilter) { PickedState<Functionality.Node> ps = vv.getPickedVertexState(); List<Functionality.Node> ln = DataModule.displayedGraph.getNodes(); List<Functionality.Node> pickedList = new ArrayList<Functionality.Node>(); for (int i = 0; i < ln.size(); i++) { if (nodes.contains(ln.get(i))) { ps.pick(ln.get(i), true); pickedList.add(ln.get(i)); } else { ps.pick(ln.get(i), false); } } VertexColorTransformer.vctInstance.setSelectedNodes(nodes); CastroGUI.setSelectedNodesDetail(pickedList); vv.setPickedVertexState(ps); // DataModule.displayedGraph.setCenter(n); if (vdp instanceof VertexDisplayPredicateDistance && adjustVertexFilter) { ((VertexDisplayPredicateDistance) vdp).setCentralNodes(ps.getPicked()); } // vv.repaint();*/ // vv.getRenderContext().setVertexFillPaintTransformer(previousTransformer); }
public JComponent actualizeGraph(boolean lockLayout) { // myGraph = g; System.err.println("Location: x = " + vv.getLocation().x + ", y = " + vv.getLocation().y); MultiLayerTransformer mlt = vv.getRenderContext().getMultiLayerTransformer(); Map<Functionality.Node, Point2d> locSet = new HashMap<Functionality.Node, Point2d>(); PickedState<Node> psn = vv.getPickedVertexState(); List<Functionality.Node> ln = DataModule.displayedGraph.getNodes(); for (int i = 0; i < ln.size(); i++) { locSet.put(ln.get(i), new Point2d(layout.getX(ln.get(i)), layout.getY(ln.get(i)))); } init(DataModule.displayedGraph, layout_width, layout_height); drawGraph(); for (int i = 0; i < ln.size(); i++) { layout.setLocation(ln.get(i), locSet.get(ln.get(i)).x, locSet.get(ln.get(i)).y); } PickedState<Node> newPsn = vv.getPickedVertexState(); for (int i = 0; i < ln.size(); i++) { newPsn.pick(ln.get(i), psn.isPicked(ln.get(i))); } if (vdp instanceof VertexDisplayPredicateDistance) { ((VertexDisplayPredicateDistance) vdp).Actualise(); } vv.getRenderContext().setVertexIncludePredicate(vdp); vv.getRenderContext().setEdgeIncludePredicate(eip); vv.setPickedVertexState(newPsn); vv.getRenderContext().setMultiLayerTransformer(mlt); vv.getRenderContext().setVertexFillPaintTransformer(VertexColorTransformer.vctInstance); layout.lock(lockLayout); MyGraphZoomScrollPane graphPane = new MyGraphZoomScrollPane(vv); return graphPane; }
public void mouseClicked(MouseEvent arg0) { PickedState<Functionality.Node> pickedState = vv.getPickedVertexState(); Set<Functionality.Node> ns = pickedState.getPicked(); Functionality.Node n; for (Iterator<Node> it = ns.iterator(); it.hasNext(); ) { n = it.next(); // FocusNode(n.getSpeech_id()); break; } GUI.CastroGUI.updateTableSelection(ns); }
public void setDistanceFilter( int _depth, VertexDisplayPredicateMode _vdpm, EdgeTypeEnum coreEdgeType) { vdp = new VertexDisplayPredicateDistance( _depth, _vdpm, vv.getPickedVertexState().getPicked(), coreEdgeType); vv.getRenderContext().setVertexIncludePredicate(vdp); // filter_setting_depth = _depth; // filter_setting_filter = _filter; vv.repaint(); System.err.println("SetDistanceFilter"); }