use of org.pushingpixels.flamingo.api.common.JCommandButtonStrip in project gephi by gephi.
the class DataTableTopComponent method prepareAddColumnButton.
/**
* Create the special Add new column button.
*/
private void prepareAddColumnButton() {
JCommandButtonStrip strip = new JCommandButtonStrip(JCommandButtonStrip.StripOrientation.HORIZONTAL);
strip.setDisplayState(CommandButtonDisplayState.BIG);
JCommandButton button = new JCommandButton(NbBundle.getMessage(DataTableTopComponent.class, "DataTableTopComponent.addColumnButton.text"), ImageWrapperResizableIcon.getIcon(ImageUtilities.loadImage("org/gephi/desktop/datalab/resources/table-insert-column.png", true), new Dimension(16, 16)));
button.setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_ONLY);
button.setDisplayState(CommandButtonDisplayState.BIG);
if (isShowingNodesTable()) {
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
showAddColumnUI(AddColumnUI.Mode.NODES_TABLE);
}
});
} else {
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
showAddColumnUI(AddColumnUI.Mode.EDGES_TABLE);
}
});
}
strip.add(button);
columnManipulatorsPanel.add(strip);
}
use of org.pushingpixels.flamingo.api.common.JCommandButtonStrip in project gephi by gephi.
the class DataTableTopComponent method prepareMergeColumnsButton.
/**
* Create the special merge columns button.
*/
private void prepareMergeColumnsButton() {
JCommandButtonStrip strip = new JCommandButtonStrip(JCommandButtonStrip.StripOrientation.HORIZONTAL);
strip.setDisplayState(CommandButtonDisplayState.BIG);
JCommandButton button = new JCommandButton(NbBundle.getMessage(DataTableTopComponent.class, "DataTableTopComponent.mergeColumnsButton.text"), ImageWrapperResizableIcon.getIcon(ImageUtilities.loadImage("org/gephi/desktop/datalab/resources/merge.png", true), new Dimension(16, 16)));
button.setCommandButtonKind(JCommandButton.CommandButtonKind.ACTION_ONLY);
button.setDisplayState(CommandButtonDisplayState.BIG);
if (isShowingNodesTable()) {
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
showMergeColumnsUI(MergeColumnsUI.Mode.NODES_TABLE);
}
});
} else {
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
showMergeColumnsUI(MergeColumnsUI.Mode.EDGES_TABLE);
}
});
}
strip.add(button);
columnManipulatorsPanel.add(strip);
}
use of org.pushingpixels.flamingo.api.common.JCommandButtonStrip 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