Search in sources :

Example 1 with AttributeColumnsManipulator

use of org.gephi.datalab.spi.columns.AttributeColumnsManipulator in project gephi by gephi.

the class DataTableTopComponent method prepareColumnManipulatorsButtons.

/**
     * Creates the buttons that call the AttributeColumnManipulators.
     */
private void prepareColumnManipulatorsButtons() {
    Table table;
    Column[] columns;
    if (isShowingNodesTable()) {
        table = graphModel.getNodeTable();
    } else {
        table = graphModel.getEdgeTable();
    }
    columns = getTableAvailableColumnsModel(table).getAvailableColumns();
    DataLaboratoryHelper dlh = DataLaboratoryHelper.getDefault();
    AttributeColumnsManipulator[] manipulators = dlh.getAttributeColumnsManipulators();
    JCommandButtonStrip currentButtonGroup = new JCommandButtonStrip(JCommandButtonStrip.StripOrientation.HORIZONTAL);
    currentButtonGroup.setDisplayState(CommandButtonDisplayState.BIG);
    Integer lastManipulatorType = null;
    for (AttributeColumnsManipulator acm : manipulators) {
        if (lastManipulatorType == null) {
            lastManipulatorType = acm.getType();
        }
        if (lastManipulatorType != acm.getType()) {
            columnManipulatorsPanel.add(currentButtonGroup);
            currentButtonGroup = new JCommandButtonStrip(JCommandButtonStrip.StripOrientation.HORIZONTAL);
            currentButtonGroup.setDisplayState(CommandButtonDisplayState.BIG);
        }
        lastManipulatorType = acm.getType();
        currentButtonGroup.add(prepareJCommandButton(graphModel, table, columns, acm));
    }
    columnManipulatorsPanel.add(currentButtonGroup);
}
Also used : DataLaboratoryHelper(org.gephi.datalab.api.DataLaboratoryHelper) NodesDataTable(org.gephi.desktop.datalab.tables.NodesDataTable) Table(org.gephi.graph.api.Table) EdgesDataTable(org.gephi.desktop.datalab.tables.EdgesDataTable) Column(org.gephi.graph.api.Column) AttributeColumnsManipulator(org.gephi.datalab.spi.columns.AttributeColumnsManipulator) JCommandButtonStrip(org.pushingpixels.flamingo.api.common.JCommandButtonStrip)

Aggregations

DataLaboratoryHelper (org.gephi.datalab.api.DataLaboratoryHelper)1 AttributeColumnsManipulator (org.gephi.datalab.spi.columns.AttributeColumnsManipulator)1 EdgesDataTable (org.gephi.desktop.datalab.tables.EdgesDataTable)1 NodesDataTable (org.gephi.desktop.datalab.tables.NodesDataTable)1 Column (org.gephi.graph.api.Column)1 Table (org.gephi.graph.api.Table)1 JCommandButtonStrip (org.pushingpixels.flamingo.api.common.JCommandButtonStrip)1