Example usage for com.jgoodies.forms.layout FormLayout setRowGroups

List of usage examples for com.jgoodies.forms.layout FormLayout setRowGroups

Introduction

In this page you can find the example usage for com.jgoodies.forms.layout FormLayout setRowGroups.

Prototype

public void setRowGroups(int[][] groupOfIndices) 

Source Link

Document

Sets the row groups, where each row in such a group gets the same group wide height.

Usage

From source file:pl.edu.agh.iisg.salomon.plugin.wekatreegenerator.settings.WekaTreeGeneratorSettingsComponent.java

License:Open Source License

private JComponent createSettingsComponent(IDataEngine dataEngine) throws PlatformException {

    String[] algorithms = new String[] { "J48" };
    _algorithmName = new JComboBox(algorithms);

    IAttributeSet[] attributeSets = dataEngine.getAttributeManager().getAll();
    String[] attributeSetNames = new String[attributeSets.length];
    for (int i = 0; i < attributeSets.length; i++) {
        IAttributeSet attributeSet = attributeSets[i];
        attributeSetNames[i] = attributeSet.getName();

    }//from   w  ww.  j  a v  a2 s . co  m
    _attributeSetName = new JComboBox(attributeSetNames);

    IDataSet[] dataSets = dataEngine.getDataSetManager().getAll();
    String[] dataSetsNames = new String[dataSets.length];
    for (int i = 0; i < dataSets.length; i++) {
        IDataSet dataSet = dataSets[i];
        dataSetsNames[i] = dataSet.getName();
    }

    _dataSetName = new JComboBox(dataSetsNames);
    _resultTreeName = new JTextField();
    // TODO add support options

    FormLayout formLayout = new FormLayout("pref, 4dlu, pref:GROW, 4dlu, min", // columns
            "pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref"); // rows)
    formLayout.setRowGroups(new int[][] { { 3, 5, 7, 11 } });

    CellConstraints cellConstraints = new CellConstraints();
    PanelBuilder panelBuilder = new PanelBuilder(formLayout);
    panelBuilder.setDefaultDialogBorder();

    panelBuilder.addSeparator("Input", cellConstraints.xyw(1, 1, 5));
    panelBuilder.add(new JLabel("Algorithm:"), cellConstraints.xy(1, 3));
    panelBuilder.add(_algorithmName, cellConstraints.xy(3, 3));

    panelBuilder.add(new JLabel("Data set:"), cellConstraints.xy(1, 5));
    panelBuilder.add(_dataSetName, cellConstraints.xy(3, 5));

    panelBuilder.add(new JLabel("Attribute set:"), cellConstraints.xy(1, 7));
    panelBuilder.add(_attributeSetName, cellConstraints.xy(3, 7));

    panelBuilder.addSeparator("Output", cellConstraints.xyw(1, 9, 5));
    panelBuilder.add(new JLabel("Result tree:"), cellConstraints.xy(1, 11));
    panelBuilder.add(_resultTreeName, cellConstraints.xy(3, 11));

    return panelBuilder.getPanel();
}