Search in sources :

Example 16 with MigLayout

use of net.miginfocom.swing.MigLayout in project gephi by gephi.

the class GeneralChooseColumnsAndRowUI method refreshColumns.

private void refreshColumns() {
    Column[] columns = columnsAndRowChooser.getColumns();
    columnsCheckBoxes = new ColumnCheckBox[columns.length];
    contentPanel.removeAll();
    contentPanel.setLayout(new MigLayout("", "[pref!]"));
    for (int i = 0; i < columns.length; i++) {
        columnsCheckBoxes[i] = new ColumnCheckBox(columns[i], true);
        contentPanel.add(columnsCheckBoxes[i].getCheckBox(), "wrap");
    }
    contentPanel.revalidate();
    contentPanel.repaint();
}
Also used : Column(org.gephi.graph.api.Column) MigLayout(net.miginfocom.swing.MigLayout)

Example 17 with MigLayout

use of net.miginfocom.swing.MigLayout in project gephi by gephi.

the class GeneralChooseColumnsUI method refreshColumns.

private void refreshColumns() {
    Column[] columns = columnsChooser.getColumns();
    columnsCheckBoxes = new ColumnCheckBox[columns.length];
    contentPanel.removeAll();
    contentPanel.setLayout(new MigLayout("", "[pref!]"));
    for (int i = 0; i < columns.length; i++) {
        columnsCheckBoxes[i] = new ColumnCheckBox(columns[i], true);
        contentPanel.add(columnsCheckBoxes[i].getCheckBox(), "wrap");
    }
    contentPanel.revalidate();
    contentPanel.repaint();
}
Also used : Column(org.gephi.graph.api.Column) MigLayout(net.miginfocom.swing.MigLayout)

Example 18 with MigLayout

use of net.miginfocom.swing.MigLayout in project gephi by gephi.

the class ImportCSVUIVisualPanel2 method reloadSettings.

public void reloadSettings() {
    if (separator != null && file != null && file.exists() && mode != null && charset != null) {
        JPanel settingsPanel = new JPanel();
        settingsPanel.setLayout(new MigLayout());
        loadDescription(settingsPanel);
        graphModel = Lookup.getDefault().lookup(GraphController.class).getGraphModel();
        switch(mode) {
            case NODES_TABLE:
                table = graphModel.getNodeTable();
                loadColumns(settingsPanel);
                loadNodesTableSettings(settingsPanel);
                break;
            case EDGES_TABLE:
                table = graphModel.getEdgeTable();
                loadColumns(settingsPanel);
                loadEdgesTableSettings(settingsPanel);
                break;
        }
        scroll.setViewportView(settingsPanel);
    }
    //Enable/disable finish button
    wizard2.fireChangeEvent();
}
Also used : JPanel(javax.swing.JPanel) MigLayout(net.miginfocom.swing.MigLayout)

Example 19 with MigLayout

use of net.miginfocom.swing.MigLayout in project gephi by gephi.

the class MergeNodeDuplicatesUI method loadSettings.

public void loadSettings() {
    JPanel settingsPanel = new JPanel();
    settingsPanel.setLayout(new MigLayout("fillx"));
    loadDescription(settingsPanel);
    loadBaseColumn(settingsPanel);
    loadDeleteMergedNodesCheckBox(settingsPanel);
    scroll.setViewportView(settingsPanel);
    refreshDuplicatesAndStrategies();
}
Also used : JPanel(javax.swing.JPanel) MigLayout(net.miginfocom.swing.MigLayout)

Example 20 with MigLayout

use of net.miginfocom.swing.MigLayout in project gephi by gephi.

the class LabelAttributesPanel method refresh.

private void refresh() {
    GraphController graphController = Lookup.getDefault().lookup(GraphController.class);
    List<Column> availableColumns = new ArrayList<>();
    List<Column> selectedColumns = new ArrayList<>();
    AttributesCheckBox[] target;
    if (elementButtonGroup.getSelection() == nodesToggleButton.getModel()) {
        for (Column c : graphController.getGraphModel().getNodeTable()) {
            if (!c.isProperty()) {
                availableColumns.add(c);
            } else if (showProperties && c.isProperty() && !c.getId().equals("timeset")) {
                availableColumns.add(c);
            }
        }
        if (textModel.getNodeTextColumns() != null) {
            selectedColumns = Arrays.asList(textModel.getNodeTextColumns());
        }
        nodeCheckBoxs = new AttributesCheckBox[availableColumns.size()];
        target = nodeCheckBoxs;
    } else {
        for (Column c : graphController.getGraphModel().getEdgeTable()) {
            if (!c.isProperty()) {
                availableColumns.add(c);
            } else if (showProperties) {
                if (showProperties && c.isProperty() && !c.getId().equals("timeset")) {
                    availableColumns.add(c);
                }
            }
        }
        if (textModel.getEdgeTextColumns() != null) {
            selectedColumns = Arrays.asList(textModel.getEdgeTextColumns());
        }
        edgeCheckBoxs = new AttributesCheckBox[availableColumns.size()];
        target = edgeCheckBoxs;
    }
    contentPanel.removeAll();
    contentPanel.setLayout(new MigLayout("", "[pref!]"));
    for (int i = 0; i < availableColumns.size(); i++) {
        Column column = availableColumns.get(i);
        AttributesCheckBox c = new AttributesCheckBox(column, selectedColumns.contains(column));
        target[i] = c;
        contentPanel.add(c.getCheckBox(), "wrap");
    }
    contentPanel.revalidate();
    contentPanel.repaint();
}
Also used : Column(org.gephi.graph.api.Column) MigLayout(net.miginfocom.swing.MigLayout) ArrayList(java.util.ArrayList) GraphController(org.gephi.graph.api.GraphController)

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