use of net.miginfocom.swing.MigLayout in project gephi by gephi.
the class ManageColumnEstimatorsUI method refreshColumns.
private void refreshColumns() {
List<Column> columns = manipulator.getColumns();
columnsEstimators = new ColumnEstimator[columns.size()];
contentPanel.removeAll();
contentPanel.setLayout(new MigLayout("", "[pref!]"));
for (int i = 0; i < columnsEstimators.length; i++) {
columnsEstimators[i] = new ColumnEstimator(columns.get(i));
contentPanel.add(columnsEstimators[i].label, "wrap");
contentPanel.add(columnsEstimators[i].comboBox, "wrap");
}
contentPanel.revalidate();
contentPanel.repaint();
}
use of net.miginfocom.swing.MigLayout in project gephi by gephi.
the class MergeNodeDuplicatesUI method loadColumnsStrategies.
private void loadColumnsStrategies() {
JPanel strategiesPanel = new JPanel();
strategiesPanel.setLayout(new MigLayout("fillx"));
if (duplicateGroups != null && duplicateGroups.size() > 0) {
strategiesPanel.add(new JLabel(NbBundle.getMessage(MergeNodeDuplicatesUI.class, "MergeNodeDuplicatesUI.duplicateGroupsNumber", duplicateGroups.size())), "wrap 15px");
//Use first group of duplicated nodes to set strategies for all of them
List<Node> nodes = duplicateGroups.get(0);
//Prepare node rows:
rows = new Element[nodes.size()];
for (int i = 0; i < nodes.size(); i++) {
rows[i] = nodes.get(i);
}
strategiesConfigurationButtons = new StrategyConfigurationButton[columns.length];
strategiesComboBoxes = new StrategyComboBox[columns.length];
for (int i = 0; i < columns.length; i++) {
//Strategy information label:
StrategyInfoLabel infoLabel = new StrategyInfoLabel(i);
//Strategy configuration button:
strategiesConfigurationButtons[i] = new StrategyConfigurationButton(i);
//Strategy selection:
StrategyComboBox strategyComboBox = new StrategyComboBox(strategiesConfigurationButtons[i], infoLabel);
strategiesComboBoxes[i] = strategyComboBox;
for (AttributeRowsMergeStrategy strategy : getColumnAvailableStrategies(columns[i])) {
strategyComboBox.addItem(new StrategyWrapper(strategy));
}
strategyComboBox.refresh();
strategiesPanel.add(new JLabel(columns[i].getTitle() + ": "), "wrap");
strategiesPanel.add(infoLabel, "split 3");
strategiesPanel.add(strategiesConfigurationButtons[i]);
strategiesPanel.add(strategyComboBox, "growx, wrap 15px");
}
dialogControls.setOkButtonEnabled(true);
} else {
strategiesPanel.add(new JLabel(getMessage("MergeNodeDuplicatesUI.noDuplicatesText")));
dialogControls.setOkButtonEnabled(false);
}
scrollStrategies.setViewportView(strategiesPanel);
}
use of net.miginfocom.swing.MigLayout in project gephi by gephi.
the class StatisticsPanel method refreshFrontEnd.
private void refreshFrontEnd() {
squeezeBoxPanel.cleanPanels();
for (StatisticsCategory category : categories) {
//Find uis in this category
List<UIFrontEnd> uis = new ArrayList<>();
for (UIFrontEnd uife : frontEnds) {
if (uife.getCategory().equals(category) && uife.isVisible()) {
uis.add(uife);
}
}
if (uis.size() > 0) {
//Sort it by position
Collections.sort(uis, new Comparator() {
@Override
public int compare(Object o1, Object o2) {
Integer p1 = ((UIFrontEnd) o1).getStatisticsUI().getPosition();
Integer p2 = ((UIFrontEnd) o2).getStatisticsUI().getPosition();
return p1.compareTo(p2);
}
});
MigLayout migLayout = new MigLayout("insets 0");
migLayout.setColumnConstraints("[grow,fill]");
migLayout.setRowConstraints("[pref!]");
JPanel innerPanel = new JPanel(migLayout);
for (UIFrontEnd sui : uis) {
innerPanel.add(sui.frontEnd, "wrap");
}
squeezeBoxPanel.addPanel(innerPanel, category.getName());
}
}
}
use of net.miginfocom.swing.MigLayout in project gephi by gephi.
the class StatisticsPanel method initFrontEnds.
private void initFrontEnds() {
StatisticsUI[] statisticsUIs = Lookup.getDefault().lookupAll(StatisticsUI.class).toArray(new StatisticsUI[0]);
frontEnds = new ArrayList<>();
for (StatisticsCategory category : categories) {
//Find uis in this category
List<StatisticsUI> uis = new ArrayList<>();
for (StatisticsUI sui : statisticsUIs) {
if (sui.getCategory().equals(category.getName())) {
uis.add(sui);
}
}
if (uis.size() > 0) {
//Sort it by position
Collections.sort(uis, new Comparator() {
@Override
public int compare(Object o1, Object o2) {
Integer p1 = ((StatisticsUI) o1).getPosition();
Integer p2 = ((StatisticsUI) o2).getPosition();
return p1.compareTo(p2);
}
});
MigLayout migLayout = new MigLayout("insets 0");
migLayout.setColumnConstraints("[grow,fill]");
migLayout.setRowConstraints("[pref!]");
JPanel innerPanel = new JPanel(migLayout);
for (StatisticsUI sui : uis) {
StatisticsFrontEnd frontEnd = new StatisticsFrontEnd(sui);
UIFrontEnd uife = new UIFrontEnd(sui, frontEnd, category);
frontEnds.add(uife);
innerPanel.add(frontEnd, "wrap");
}
squeezeBoxPanel.addPanel(innerPanel, category.getName());
}
}
}
use of net.miginfocom.swing.MigLayout in project adempiere by adempiere.
the class VFactReconcile method jbInit.
/**
* Static Init
* @throws Exception
*/
private void jbInit() throws Exception {
CompiereColor.setBackground(this);
//
mainPanel.setLayout(mainLayout);
parameterLayout = new MigLayout("fillx, wrap 4, hidemode 0", " [150:150][250:250][100:100][200:200]");
parameterPanel.setLayout(parameterLayout);
bRefresh.addActionListener(this);
bReset.addActionListener(this);
bZoom.addActionListener(this);
bGenerate.setEnabled(false);
bReset.setEnabled(false);
//bRefresh.setText(Msg.getMsg(Env.getCtx(), "Query"));
bGenerate.setText(Msg.getMsg(Env.getCtx(), "Process"));
bReset.setText(Msg.getMsg(Env.getCtx(), "Reset"));
bZoom.setText(Msg.translate(Env.getCtx(), "Fact_Acct_ID"));
bSelectAll.addActionListener(this);
bSelectAll.setText(Msg.getMsg(Env.getCtx(), "SelectAll"));
//
labelAcctSchema.setText(Msg.translate(Env.getCtx(), "C_AcctSchema_ID"));
labelAccount.setText(Msg.translate(Env.getCtx(), "Account_ID"));
labelBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
labelDateAcct.setText(Msg.translate(Env.getCtx(), "DateAcct"));
labelDateAcct2.setText("-");
labelProduct.setText(Msg.translate(Env.getCtx(), "M_Product_ID"));
//
labelOrg.setText(Msg.translate(Env.getCtx(), "AD_Org_ID"));
isReconciled.setText(Msg.translate(Env.getCtx(), "IsReconciled"));
dataStatus.setText(" ");
differenceLabel.setText(Msg.getMsg(Env.getCtx(), "Difference"));
differenceField.setBackground(AdempierePLAF.getFieldBackground_Inactive());
differenceField.setEditable(false);
differenceField.setText("0");
differenceField.setColumns(8);
differenceField.setHorizontalAlignment(SwingConstants.RIGHT);
//
bGenerate.addActionListener(this);
bCancel.addActionListener(this);
//
mainPanel.add(parameterPanel, BorderLayout.NORTH);
parameterPanel.add(labelAcctSchema, "");
parameterPanel.add(fieldAcctSchema, "growx");
parameterPanel.add(labelOrg, "");
parameterPanel.add(fieldOrg, "growx");
parameterPanel.add(labelAccount, "");
parameterPanel.add(fieldAccount, "wmax 250");
parameterPanel.add(isReconciled, "skip 1");
parameterPanel.add(labelBPartner, "");
parameterPanel.add(fieldBPartner, "growx");
parameterPanel.add(labelProduct, "");
parameterPanel.add(fieldProduct, "growx");
parameterPanel.add(labelDateAcct, "");
parameterPanel.add(fieldDateAcct, "growx");
parameterPanel.add(labelDateAcct2, "");
parameterPanel.add(fieldDateAcct2, "growx");
parameterPanel.add(bRefresh, "growx");
mainPanel.add(dataStatus, BorderLayout.SOUTH);
mainPanel.add(dataPane, BorderLayout.CENTER);
dataPane.getViewport().add(miniTable, null);
//
commandPanel.setLayout(commandLayout);
commandLayout.setAlignment(FlowLayout.RIGHT);
commandLayout.setHgap(10);
commandPanel.add(bSelectAll);
commandPanel.add(bZoom, null);
commandPanel.add(differenceLabel, null);
commandPanel.add(differenceField, null);
commandPanel.add(bGenerate, null);
commandPanel.add(bReset, null);
commandPanel.add(bCancel, null);
}
Aggregations