public DataTablesObservers(Workspace workspace) { this.workspace = workspace; this.graphModel = Lookup.getDefault().lookup(GraphController.class).getGraphModel(workspace); this.columnObservers = new HashSet<>(); }
public Hits() { GraphController graphController = Lookup.getDefault().lookup(GraphController.class); if (graphController != null && graphController.getGraphModel() != null) { useUndirected = graphController.getGraphModel().isUndirected(); } }
public void injectGraph() { GraphController graphController = Lookup.getDefault().lookup(GraphController.class); if (selectedLayout != null && graphController.getGraphModel(workspace) != null) { selectedLayout.setGraphModel(graphController.getGraphModel(workspace)); } }
/** * 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 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(); } }
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 Filter getFilter(Workspace workspace) { GraphModel am = Lookup.getDefault().lookup(GraphController.class).getGraphModel(workspace); return new EdgeTypeFilter(am); }
@Override public void select(Workspace workspace) { GraphController gc = Lookup.getDefault().lookup(GraphController.class); GraphModel gm = gc.getGraphModel(workspace); contextPanel.refreshModel(gm); }
private AvailableColumnsModel getTableAvailableColumnsModel(Table table) { if (Lookup.getDefault().lookup(GraphController.class).getGraphModel().getNodeTable() == table) { return nodeAvailableColumnsModel; } else if (Lookup.getDefault().lookup(GraphController.class).getGraphModel().getEdgeTable() == table) { return edgeAvailableColumnsModel; } else { return null;//Graph table or other table, not supported in data laboratory for now. } }
/** * **********Private methods : *********** */ private Graph getCurrentGraph() { return Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraph(); }
@Override public FilterBuilder[] getBuilders(Workspace workspace) { List<FilterBuilder> builders = new ArrayList<>(); GraphModel am = Lookup.getDefault().lookup(GraphController.class).getGraphModel(workspace); if (am.isDynamic()) { builders.add(new DynamicRangeFilterBuilder(am)); } return builders.toArray(new FilterBuilder[0]); }
@Override public void execute() { if (JOptionPane.showConfirmDialog(null, NbBundle.getMessage(ClearGraph.class, "ClearGraph.dialog.text"), NbBundle.getMessage(ClearGraph.class, "ClearGraph.name"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) { Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraph().clear(); } }
@Override public void setup(Edge[] edges, Edge clickedEdge) { this.edges = edges; AttributeColumnsController ac = Lookup.getDefault().lookup(AttributeColumnsController.class); ArrayList<Column> columnsToClearDataList = new ArrayList<>(); for (Column column : Lookup.getDefault().lookup(GraphController.class).getGraphModel().getEdgeTable()) { if (ac.canClearColumnData(column)) { columnsToClearDataList.add(column); } } columnsToClearData = columnsToClearDataList.toArray(new Column[0]); }
@Override public void setup(Node[] nodes, Node clickedNode) { this.nodes = nodes; AttributeColumnsController ac = Lookup.getDefault().lookup(AttributeColumnsController.class); ArrayList<Column> columnsToClearDataList = new ArrayList<>(); for (Column column : Lookup.getDefault().lookup(GraphController.class).getGraphModel().getNodeTable()) { if (ac.canClearColumnData(column)) { columnsToClearDataList.add(column); } } columnsToClearData = columnsToClearDataList.toArray(new Column[0]); }
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")); } }