Example usage for com.jgoodies.forms.layout FormSpecs PREF_ROWSPEC

List of usage examples for com.jgoodies.forms.layout FormSpecs PREF_ROWSPEC

Introduction

In this page you can find the example usage for com.jgoodies.forms.layout FormSpecs PREF_ROWSPEC.

Prototype

RowSpec PREF_ROWSPEC

To view the source code for com.jgoodies.forms.layout FormSpecs PREF_ROWSPEC.

Click Source Link

Document

An unmodifiable RowSpec that determines its height by computing the maximum of all column component preferred heights.

Usage

From source file:de.kernwelt.gpxtcx.MainFrame.java

License:Open Source License

/**
 * Create the frame./*from w  ww  .j  a  va2  s. c  o m*/
 */
public MainFrame() {
    setTitle("GPX/TCX Merge");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    // setBounds(100, 100, 490, 353);
    contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(new FormLayout(
            new ColumnSpec[] { FormSpecs.PREF_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.PREF_COLSPEC,
                    FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("left:default:grow"),
                    FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                    FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.PREF_COLSPEC, },
            new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.MIN_ROWSPEC,
                    FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.MIN_ROWSPEC,
                    FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC,
                    FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.PREF_ROWSPEC,
                    FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC,
                    FormSpecs.PREF_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                    FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.PREF_ROWSPEC, }));

    JLabel lblGpxFile = new JLabel("GPX File:");
    contentPane.add(lblGpxFile, "1, 3, right, default");

    gpxFileField = new JTextField();
    gpxFileField.setEditable(false);
    contentPane.add(gpxFileField, "3, 3, 4, 1, fill, default");
    gpxFileField.setColumns(10);

    readGpxBtn = new JButton("Read...");
    contentPane.add(readGpxBtn, "10, 3");

    JLabel lblTcxFile = new JLabel("TCX File:");
    contentPane.add(lblTcxFile, "1, 6, right, default");

    tcxFileField = new JTextField();
    tcxFileField.setEditable(false);
    contentPane.add(tcxFileField, "3, 6, 4, 1, fill, default");
    tcxFileField.setColumns(10);

    readTcxBtn = new JButton("Read...");
    contentPane.add(readTcxBtn, "10, 6");

    separator = new JSeparator();
    contentPane.add(separator, "1, 10, 10, 1, fill, default");

    lblNewLabel = new JLabel("GPX Start Time:");
    contentPane.add(lblNewLabel, "1, 12, right, default");

    gpxStartTime = new JTextField();
    gpxStartTime.setEditable(false);
    contentPane.add(gpxStartTime, "3, 12, left, default");
    gpxStartTime.setColumns(20);

    lblNewLabel_1 = new JLabel("TCX Start Time:");
    contentPane.add(lblNewLabel_1, "1, 16, right, default");

    tcxStartTime = new JTextField();
    tcxStartTime.setEditable(false);
    contentPane.add(tcxStartTime, "3, 16, left, default");
    tcxStartTime.setColumns(20);

    btnAlignTime = new JButton("Align Timebase");
    contentPane.add(btnAlignTime, "5, 16");

    separator_1 = new JSeparator();
    contentPane.add(separator_1, "1, 18, 10, 1");

    saveBtn = new JButton("Merge & Save");
    contentPane.add(saveBtn, "10, 20");
}

From source file:org.audiveris.omr.glyph.ui.EvaluationBoard.java

License:Open Source License

private void defineLayout() {
    String colSpec = Panel.makeColumns(3);
    FormLayout layout = new FormLayout(colSpec, "");

    int visibleButtons = Math.min(constants.visibleButtons.getValue(), selector.buttons.size());

    for (int i = 0; i < visibleButtons; i++) {
        if (i != 0) {
            layout.appendRow(FormSpecs.LINE_GAP_ROWSPEC);
        }/* www . j a v  a 2s. c o m*/

        layout.appendRow(FormSpecs.PREF_ROWSPEC);
    }

    PanelBuilder builder = new PanelBuilder(layout, getBody());
    CellConstraints cst = new CellConstraints();

    for (int i = 0; i < visibleButtons; i++) {
        int r = (2 * i) + 1; // --------------------------------
        EvalButton evb = selector.buttons.get(i);
        builder.add(evb.grade, cst.xy(5, r));
        builder.add(isActive ? evb.button : evb.field, cst.xyw(7, r, 5));
    }
}