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);
}
Aggregations