Search in sources :

Example 1 with MigLayout

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();
}
Also used : Column(org.gephi.graph.api.Column) MigLayout(net.miginfocom.swing.MigLayout)

Example 2 with MigLayout

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);
}
Also used : JPanel(javax.swing.JPanel) AttributeRowsMergeStrategy(org.gephi.datalab.spi.rows.merge.AttributeRowsMergeStrategy) MigLayout(net.miginfocom.swing.MigLayout) Node(org.gephi.graph.api.Node) JLabel(javax.swing.JLabel)

Example 3 with MigLayout

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());
        }
    }
}
Also used : JPanel(javax.swing.JPanel) MigLayout(net.miginfocom.swing.MigLayout) ArrayList(java.util.ArrayList) Comparator(java.util.Comparator)

Example 4 with MigLayout

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());
        }
    }
}
Also used : JPanel(javax.swing.JPanel) MigLayout(net.miginfocom.swing.MigLayout) ArrayList(java.util.ArrayList) Comparator(java.util.Comparator) StatisticsUI(org.gephi.statistics.spi.StatisticsUI)

Example 5 with MigLayout

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);
}
Also used : MigLayout(net.miginfocom.swing.MigLayout)

Aggregations

MigLayout (net.miginfocom.swing.MigLayout)29 JPanel (javax.swing.JPanel)7 ArrayList (java.util.ArrayList)5 CLabel (org.compiere.swing.CLabel)5 Column (org.gephi.graph.api.Column)5 CPanel (org.compiere.swing.CPanel)4 Comparator (java.util.Comparator)3 TitledBorder (javax.swing.border.TitledBorder)3 POSTextField (org.adempiere.pos.POSTextField)3 Dimension (java.awt.Dimension)2 JCheckBox (javax.swing.JCheckBox)2 ActionButton (com.intellij.openapi.actionSystem.impl.ActionButton)1 ValidationInfo (com.intellij.openapi.ui.ValidationInfo)1 ListPopup (com.intellij.openapi.ui.popup.ListPopup)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 RelativePoint (com.intellij.ui.awt.RelativePoint)1 JBCheckBox (com.intellij.ui.components.JBCheckBox)1 JBLabel (com.intellij.ui.components.JBLabel)1 JBScrollPane (com.intellij.ui.components.JBScrollPane)1 Wrapper (com.intellij.ui.components.panels.Wrapper)1