public EdgeTypePartitionImpl(Graph graph) { super(); this.graph = graph; this.model = graph.getModel(); }
private void refreshAvailableEdgeTypes() { for (Object edgeType : graph.getModel().getEdgeTypeLabels()) { edgeTypeComboBox.addItem(edgeType); } }
@Override public Table getTable() { return graph.getModel().getNodeTable(); }
@Override public Table getTable() { return graph.getModel().getEdgeTable(); }
protected ElementFunctionsModel(Graph graph) { this.graph = graph; simpleFunctions = new HashMap<>(); graphFunctions = new HashMap<>(); attributeFunctions = new HashMap<>(); columnObservers = new HashMap<>(); graphObserver = graph.getModel().createGraphObserver(graph, false); partitions = new HashMap<>(); rankings = new HashMap<>(); // Init simple initSimpleFunctions(); }
public GraphChangeObserver(Graph graph, Column column) { timer = new Timer("GraphChangeObserver", true); graphObserver = graph.getModel().createGraphObserver(graph, false); columnObserver = column != null ? column.createColumnObserver(false) : null; }
@Override public boolean init(Graph graph) { partition = appearanceModel.getNodePartition(graph.getModel().getGraph(), column); return partition != null; }
@Override public boolean init(Graph graph) { partition = appearanceModel.getEdgePartition(graph.getModel().getGraph(), column); return partition != null; } }
@Override public boolean init(Graph graph) { partition = appearanceModel.getNodePartition(graph.getModel().getGraph(), column); return partition != null; }
@Override public boolean init(Graph graph) { partition = appearanceModel.getNodePartition(graph.getModel().getGraph(), column); return partition != null; } }
@Override public boolean init(Graph graph) { partition = appearanceModel.getEdgePartition(graph.getModel().getGraph(), column); return partition != null; } }
@Override public boolean init(Graph graph) { partition = appearanceModel.getNodePartition(graph.getModel().getGraph(), column); return partition != null; } }
private Node buildNode(Graph graph, String label, String id) { Node newNode; if (id != null) { newNode = graph.getModel().factory().newNode(id); } else { newNode = graph.getModel().factory().newNode(); } newNode.setSize(DEFAULT_NODE_SIZE); newNode.setLabel(label); //Set random position to the node: newNode.setX((float) ((0.01 + Math.random()) * 1000) - 500); newNode.setY((float) ((0.01 + Math.random()) * 1000) - 500); return newNode; }
@Override public boolean init(Graph graph) { ConnectedComponents cc = new ConnectedComponents(); UndirectedGraph undirectedGraph = graph.getModel().getUndirectedGraph(graph.getView()); cc.weaklyConnected(undirectedGraph); componentId = cc.getGiantComponent(); column = graph.getModel().getNodeTable().getColumn(ConnectedComponents.WEAKLY); return column != null && componentId != -1; }
private void saveValues(int[] struct, Graph graph, CommunityStructure theStructure) { Table nodeTable = graph.getModel().getNodeTable(); Column modCol = nodeTable.getColumn(MODULARITY_CLASS); if (modCol == null) { modCol = nodeTable.addColumn(MODULARITY_CLASS, "Modularity Class", Integer.class, 0); } for (Node n : graph.getNodes()) { int n_index = theStructure.map.get(n); n.setAttribute(modCol, struct[n_index]); } }
public void execute(Graph graph) { isDirected = graph.isDirected(); isCanceled = false; initializeDegreeDists(); initializeAttributeColunms(graph.getModel()); graph.readLock(); try { avgWDegree = calculateAverageWeightedDegree(graph, isDirected, true); } finally { graph.readUnlockAll(); } }
public void execute(Graph graph) { isCanceled = false; Column column = initializeAttributeColunms(graph.getModel()); graph.readLock(); try { HashMap<Node, Integer> indicies = createIndiciesMap(graph); pageranks = calculatePagerank(graph, indicies, isDirected, useEdgeWeight, epsilon, probability); saveCalculatedValues(graph, column, indicies, pageranks); } finally { graph.readUnlockAll(); } }
public void execute(Graph graph) { isDirected = graph.isDirected(); isCanceled = false; initializeDegreeDists(); initializeAttributeColunms(graph.getModel()); graph.readLock(); try { avgDegree = calculateAverageDegree(graph, isDirected, true); graph.setAttribute(AVERAGE_DEGREE, avgDegree); } finally { graph.readUnlockAll(); } }
public void execute(Graph graph) { initializeAttributeColunms(graph.getModel()); graph.readLock(); try { int N = graph.getNodeCount(); authority = new double[N]; hubs = new double[N]; Map<Node, Integer> indices = createIndicesMap(graph); calculateHits(graph, hubs, authority, indices, !useUndirected, epsilon); saveCalculatedValues(indices, authority, hubs); } finally { graph.readUnlockAll(); } }