Examples of AttributeTable


Examples of org.gephi.data.attributes.api.AttributeTable

                report.log("Edge property found: label");
            } else if (columnName.equals("labelvisible")) {
                edgeColumns[i - 2] = new GDFColumn(GDFColumn.EdgeGuessColumn.LABELVISIBLE);
                report.log("Edge property found: labelvisible");
            } else {
                AttributeTable edgeClass = container.getAttributeModel().getEdgeTable();
                if (!edgeClass.hasColumn(columnName)) {
                    AttributeColumn newColumn = edgeClass.addColumn(columnName, type);
                    edgeColumns[i - 2] = new GDFColumn(newColumn);
                    report.log("Edge attribute " + columnName + " (" + type.getTypeString() + ")");
                } else {
                    report.logIssue(new Issue(NbBundle.getMessage(ImporterGDF.class, "importerGDF_error_dataformat9", columnName), Issue.Level.SEVERE));
                }
View Full Code Here

Examples of org.gephi.data.attributes.api.AttributeTable

    public String getDescription() {
        return "";
    }

    public boolean canExecute() {
        AttributeTable currentTable = getCurrentTable();
        return currentTable != null && Lookup.getDefault().lookup(AttributeColumnsController.class).getTableRowsCount(currentTable) > 0;//Make sure that there is at least 1 row
    }
View Full Code Here

Examples of org.gephi.data.attributes.api.AttributeTable

        writer.writeEndElement();
    }

    private void readDataTablesModel(XMLStreamReader reader, Workspace workspace) throws XMLStreamException {
        AttributeModel attributeModel = workspace.getLookup().lookup(AttributeModel.class);
        AttributeTable nodesTable = attributeModel.getNodeTable();
        AttributeTable edgesTable = attributeModel.getEdgeTable();
        DataTablesModel dataTablesModel = workspace.getLookup().lookup(DataTablesModel.class);
        if (dataTablesModel == null) {
            workspace.add(dataTablesModel = new DataTablesModel());
        }
        AvailableColumnsModel nodeColumns = dataTablesModel.getNodeAvailableColumnsModel();
        nodeColumns.removeAllColumns();
        AvailableColumnsModel edgeColumns = dataTablesModel.getEdgeAvailableColumnsModel();
        edgeColumns.removeAllColumns();

        boolean end = false;
        while (reader.hasNext() && !end) {
            Integer eventType = reader.next();
            if (eventType.equals(XMLEvent.START_ELEMENT)) {
                String name = reader.getLocalName();
                if (NODE_COLUMN.equalsIgnoreCase(name)) {
                    Integer id = Integer.parseInt(reader.getAttributeValue(null, "id"));
                    AttributeColumn column = nodesTable.getColumn(id);
                    if (column != null) {
                        nodeColumns.addAvailableColumn(column);
                    }
                } else if (EDGE_COLUMN.equalsIgnoreCase(name)) {
                    String id = reader.getAttributeValue(null, "id");
                    AttributeColumn column = edgesTable.getColumn(id);
                    if (column != null) {
                        edgeColumns.addAvailableColumn(column);
                    }
                }
            } else if (eventType.equals(XMLStreamReader.END_ELEMENT)) {
View Full Code Here

Examples of org.gephi.data.attributes.api.AttributeTable

    private void createSearchOptions() {
        boolean onlyVisibleElements = Lookup.getDefault().lookup(DataTablesController.class).isShowOnlyVisible();
        searchResult = null;
        columnsToSearchComboBox.removeAllItems();
        AttributeTable table;
        if (mode == Mode.NODES_TABLE) {
            Node[] nodes;
            if (onlyVisibleElements) {
                //Search on visible nodes:
                nodes = Lookup.getDefault().lookup(GraphController.class).getModel().getHierarchicalGraphVisible().getNodesTree().toArray();
            } else {
                nodes = new Node[0];//Search on all nodes
            }
            searchOptions = new SearchOptions(nodes, null);
            table = Lookup.getDefault().lookup(AttributeController.class).getModel().getNodeTable();
        } else {
            Edge[] edges;
            if (onlyVisibleElements) {
                //Search on visible edges:
                edges = Lookup.getDefault().lookup(GraphController.class).getModel().getHierarchicalGraphVisible().getEdges().toArray();
            } else {
                edges = new Edge[0];//Search on all edges
            }
            searchOptions = new SearchOptions(edges, null);
            table = Lookup.getDefault().lookup(AttributeController.class).getModel().getEdgeTable();
        }

        //Fill possible columns to search (first value is all columns):
        columnsToSearchComboBox.addItem(NbBundle.getMessage(SearchReplaceUI.class, "SearchReplaceUI.allColumns"));
        for (AttributeColumn c : table.getColumns()) {
            columnsToSearchComboBox.addItem(new ColumnWrapper(c));
        }
    }
View Full Code Here

Examples of org.gephi.data.attributes.api.AttributeTable

    }

    public void weaklyConnected(HierarchicalUndirectedGraph hgraph, AttributeModel attributeModel) {
        isCanceled = false;
        componentCount = 0;
        AttributeTable nodeTable = attributeModel.getNodeTable();
        AttributeColumn componentCol = nodeTable.getColumn(WEAKLY);
        if (componentCol == null) {
            componentCol = nodeTable.addColumn(WEAKLY, "Component ID", AttributeType.INT, AttributeOrigin.COMPUTED, new Integer(0));
        }

        List<Integer> sizeList = new ArrayList<Integer>();

        hgraph.readLock();
View Full Code Here

Examples of org.gephi.data.attributes.api.AttributeTable

    }

    public void top_tarjans(HierarchicalDirectedGraph hgraph, AttributeModel attributeModel) {
        count = 1;
        stronglyCount = 0;
        AttributeTable nodeTable = attributeModel.getNodeTable();
        AttributeColumn componentCol = nodeTable.getColumn(STRONG);
        if (componentCol == null) {
            componentCol = nodeTable.addColumn(STRONG, "Strongly-Connected ID", AttributeType.INT, AttributeOrigin.COMPUTED, new Integer(0));
        }

        hgraph.readLock();

        HashMap<Node, Integer> indicies = new HashMap<Node, Integer>();
View Full Code Here

Examples of org.gephi.data.attributes.api.AttributeTable

        execute(graph, attributeModel);
    }

    public void execute(HierarchicalGraph hgraph, AttributeModel attributeModel) {
        isCanceled = false;
        AttributeTable nodeTable = attributeModel.getNodeTable();
        AttributeColumn eccentricityCol = nodeTable.getColumn(ECCENTRICITY);
        AttributeColumn closenessCol = nodeTable.getColumn(CLOSENESS);
        AttributeColumn betweenessCol = nodeTable.getColumn(BETWEENNESS);
        if (eccentricityCol == null) {
            eccentricityCol = nodeTable.addColumn(ECCENTRICITY, "Eccentricity", AttributeType.DOUBLE, AttributeOrigin.COMPUTED, new Double(0));
        }
        if (closenessCol == null) {
            closenessCol = nodeTable.addColumn(CLOSENESS, "Closeness Centrality", AttributeType.DOUBLE, AttributeOrigin.COMPUTED, new Double(0));
        }
        if (betweenessCol == null) {
            betweenessCol = nodeTable.addColumn(BETWEENNESS, "Betweenness Centrality", AttributeType.DOUBLE, AttributeOrigin.COMPUTED, new Double(0));
        }

        hgraph.readLock();

        N = hgraph.getNodeCount();
View Full Code Here

Examples of org.gephi.data.attributes.api.AttributeTable

        return findNext(result.getSearchOptions());
    }

    public boolean canReplace(SearchResult result) {
        AttributeController ac = Lookup.getDefault().lookup(AttributeController.class);
        AttributeTable table;
        AttributeColumn column;
        if (result.getFoundNode() != null) {
            table = ac.getModel().getNodeTable();
            column = table.getColumn(result.getFoundColumnIndex());
        } else {
            table = ac.getModel().getEdgeTable();
            column = table.getColumn(result.getFoundColumnIndex());
        }
        return Lookup.getDefault().lookup(AttributeColumnsController.class).canChangeColumnData(column);
    }
View Full Code Here

Examples of org.gephi.data.attributes.api.AttributeTable

    /**
     * Creates the buttons that call the AttributeColumnManipulators.
     */
    private void prepareColumnManipulatorsButtons() {
        AttributeModel attributeModel = Lookup.getDefault().lookup(ProjectController.class).getCurrentWorkspace().getLookup().lookup(AttributeModel.class);
        AttributeTable table;
        AttributeColumn[] columns;
        if (classDisplayed == ClassDisplayed.NODE) {
            table = attributeModel.getNodeTable();
            columns = nodeAvailableColumnsModel.getAvailableColumns();
        } else {
View Full Code Here

Examples of org.gephi.data.attributes.api.AttributeTable

        NbPreferences.forModule(DataTableTopComponent.class).putBoolean(DATA_LABORATORY_TIME_INTERVAL_GRAPHICS, timeIntervalGraphics);
        NbPreferences.forModule(DataTableTopComponent.class).putBoolean(DATA_LABORATORY_EDGES_NODES_LABELS, showEdgesNodesLabels);
    }//GEN-LAST:event_configurationButtonActionPerformed

    private void availableColumnsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_availableColumnsButtonActionPerformed
        AttributeTable table;
        AvailableColumnsModel availableColumnsModel;
        if (classDisplayed == classDisplayed.NODE) {
            table = Lookup.getDefault().lookup(AttributeController.class).getModel().getNodeTable();
        } else {
            table = Lookup.getDefault().lookup(AttributeController.class).getModel().getEdgeTable();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.