public ClusteringCoefficient() { GraphController graphController = Lookup.getDefault().lookup(GraphController.class); if (graphController != null && graphController.getGraphModel() != null) { isDirected = graphController.getGraphModel().isDirected(); } }
public ConnectedComponents() { GraphController graphController = Lookup.getDefault().lookup(GraphController.class); if (graphController != null && graphController.getGraphModel() != null) { isDirected = graphController.getGraphModel().isDirected(); } }
public GraphDensity() { GraphController graphController = Lookup.getDefault().lookup(GraphController.class); if (graphController != null && graphController.getGraphModel()!= null) { isDirected = graphController.getGraphModel().isDirected(); } }
/** * Construct a GraphDistance calculator for the current graph model */ public GraphDistance() { GraphController graphController = Lookup.getDefault().lookup(GraphController.class); if (graphController != null && graphController.getGraphModel() != null) { isDirected = graphController.getGraphModel().isDirected(); } }
public PageRank() { GraphController graphController = Lookup.getDefault().lookup(GraphController.class); if (graphController != null && graphController.getGraphModel() != null) { isDirected = graphController.getGraphModel().isDirected(); } }
public EigenvectorCentrality() { GraphController graphController = Lookup.getDefault().lookup(GraphController.class); if (graphController != null && graphController.getGraphModel() != null) { isDirected = graphController.getGraphModel().isDirected(); } }
public DynamicClusteringCoefficient() { GraphController graphController = Lookup.getDefault().lookup(GraphController.class); if (graphController != null && graphController.getGraphModel() != null) { isDirected = graphController.getGraphModel().isDirected(); } }
public DynamicDegree() { GraphController graphController = Lookup.getDefault().lookup(GraphController.class); if (graphController != null && graphController.getGraphModel() != null) { isDirected = graphController.getGraphModel().isDirected(); } }
@Override public void setup(Node[] nodes, Node clickedNode) { this.nodes = nodes; this.sourceNode = clickedNode;//Choose clicked node as source by default (but the user can select it or other one in the UI) GraphModel currentGraphModel = Lookup.getDefault().lookup(GraphController.class).getGraphModel(); if (graphModel != currentGraphModel) {//If graph model has changed since last execution, change default mode for edges to create in UI, else keep this parameter across calls directed = currentGraphModel.isDirected() || currentGraphModel.isMixed();//Get graph directed state. Set to true if graph is directed or mixed graphModel = currentGraphModel; } }
@Override public ManipulatorUI getUI() { GraphModel currentGraphModel = Lookup.getDefault().lookup(GraphController.class).getGraphModel(); if (graphModel != null && graphModel != currentGraphModel) {//If graph model has changed since last execution, change default mode for edges to create in UI, else keep this parameter across calls directed = currentGraphModel.isDirected() || currentGraphModel.isMixed();//Get graph directed state. Set to true if graph is directed or mixed graphModel = currentGraphModel; source = null; } return new AddEdgeToGraphUI(); }
private void updatePanel() { if (edgePencilPanel != null) { GraphController gc = Lookup.getDefault().lookup(GraphController.class); if (gc.getGraphModel() != null) { edgePencilPanel.setType(gc.getGraphModel().isDirected() || gc.getGraphModel().isMixed()); } sourceNode = null; edgePencilPanel.setStatus(NbBundle.getMessage(EdgePencil.class, "EdgePencil.status1")); } }
@Override public void execute(GraphModel graphModel) { this.graphModel = graphModel; this.isDirected = graphModel.isDirected(); this.averages = new HashMap<>(); //Attributes cols if (!averageOnly) { TimeRepresentation tr = graphModel.getConfiguration().getTimeRepresentation(); Table nodeTable = graphModel.getNodeTable(); dynamicCoefficientColumn = nodeTable.getColumn(DYNAMIC_CLUSTERING_COEFFICIENT); if (dynamicCoefficientColumn == null) { dynamicCoefficientColumn = nodeTable.addColumn(DYNAMIC_CLUSTERING_COEFFICIENT, NbBundle.getMessage(DynamicClusteringCoefficient.class, "DynamicClusteringCoefficient.nodecolumn.ClusteringCoefficient"), tr.equals(TimeRepresentation.INTERVAL) ? IntervalDoubleMap.class : TimestampDoubleMap.class, null); } } }
private Node[] getDiffusedNodes(Node[] input) { GraphModel model = Lookup.getDefault().lookup(GraphController.class).getGraphModel(); switch (diffusionMethod) { case NEIGHBORS: return DiffusionMethods.getNeighbors(model.getGraphVisible(), input); case NEIGHBORS_OF_NEIGHBORS: return DiffusionMethods.getNeighborsOfNeighbors(model.getGraphVisible(), input); case PREDECESSORS: if (model.isDirected()) { return DiffusionMethods.getPredecessors(model.getDirectedGraphVisible(), input); } else { return DiffusionMethods.getNeighbors(model.getGraphVisible(), input); } case SUCCESSORS: if (model.isDirected()) { return DiffusionMethods.getSuccessors(model.getDirectedGraphVisible(), input); } else { return DiffusionMethods.getNeighbors(model.getGraphVisible(), input); } } return new Node[0]; }
@Override public void execute(GraphModel graphModel) { this.graphModel = graphModel; this.isDirected = graphModel.isDirected(); this.averages = new HashMap<>(); //Attributes cols if (!averageOnly) { TimeRepresentation tr = graphModel.getConfiguration().getTimeRepresentation(); Table nodeTable = graphModel.getNodeTable(); dynamicInDegreeColumn = nodeTable.getColumn(DYNAMIC_INDEGREE); dynamicOutDegreeColumn = nodeTable.getColumn(DYNAMIC_OUTDEGREE); dynamicDegreeColumn = nodeTable.getColumn(DYNAMIC_DEGREE); if (isDirected) { if (dynamicInDegreeColumn == null) { dynamicInDegreeColumn = nodeTable.addColumn(DYNAMIC_INDEGREE, NbBundle.getMessage(DynamicDegree.class, "DynamicDegree.nodecolumn.InDegree"), tr.equals(TimeRepresentation.INTERVAL) ? IntervalIntegerMap.class : TimestampIntegerMap.class, null); } if (dynamicOutDegreeColumn == null) { dynamicOutDegreeColumn = nodeTable.addColumn(DYNAMIC_OUTDEGREE, NbBundle.getMessage(DynamicDegree.class, "DynamicDegree.nodecolumn.OutDegree"), tr.equals(TimeRepresentation.INTERVAL) ? IntervalIntegerMap.class : TimestampIntegerMap.class, null); } } if (dynamicDegreeColumn == null) { dynamicDegreeColumn = nodeTable.addColumn(DYNAMIC_DEGREE, NbBundle.getMessage(DynamicDegree.class, "DynamicDegree.nodecolumn.Degree"), tr.equals(TimeRepresentation.INTERVAL) ? IntervalIntegerMap.class : TimestampIntegerMap.class, null); } } }
@Override public void run() { Graph visibleGraph = model.getGraphVisible(); Graph fullGraph = model.getGraph(); final int nodesFull = fullGraph.getNodeCount(); final int nodesVisible = visibleGraph.getNodeCount(); final int edgesFull = fullGraph.getEdgeCount(); final int edgesVisible = visibleGraph.getEdgeCount(); final GraphType graphType = model.isDirected() ? GraphType.DIRECTED : model.isUndirected() ? GraphType.UNDIRECTED : GraphType.MIXED; SwingUtilities.invokeLater(new Runnable() { @Override public void run() { String visible = NbBundle.getMessage(ContextPanel.class, "ContextPanel.visible"); String nodeText = String.valueOf(nodesVisible); String edgeText = String.valueOf(edgesVisible); if (nodesFull != nodesVisible || edgesFull != edgesVisible) { nodeText += nodesFull > 0 ? " (" + formatter.format(nodesVisible / (double) nodesFull) + " " + visible + ")" : ""; edgeText += edgesFull > 0 ? " (" + formatter.format(edgesVisible / (double) edgesFull) + " " + visible + ")" : ""; } nodeLabel.setText(nodeText); edgeLabel.setText(edgeText); graphTypeLabel.setText(graphType.type); } }); } }
if (gc.getGraphModel().isDirected()) { DirectedGraph graph = gc.getGraphModel().getDirectedGraphVisible(); algorithm = new BellmanFordShortestPathAlgorithm(graph, n);
if (gm.isDirected()) { algorithm = new BellmanFordShortestPathAlgorithm(gm.getDirectedGraphVisible(), sourceNode); } else {
previewModel.getProperties().putValue(PreviewProperty.DIRECTED, graphModel.isDirected() || graphModel.isMixed());