Example usage for com.jgoodies.forms.layout CellConstraints xyw

List of usage examples for com.jgoodies.forms.layout CellConstraints xyw

Introduction

In this page you can find the example usage for com.jgoodies.forms.layout CellConstraints xyw.

Prototype

public CellConstraints xyw(int col, int row, int colSpan) 

Source Link

Document

Sets the column, row, width, and height; uses a height (row span) of 1 and the horizontal and vertical default alignments.

Examples:

 cc.xyw(1, 3, 7); cc.xyw(1, 3, 2); 

Usage

From source file:com.salas.bb.dialogs.StarzPanel.java

License:Open Source License

/**
 * Creates a FormLayout and adds the UI components using a PanelBuilder.
 *//*  w  ww .  jav a  2s .  c o m*/
private void build() {
    FormLayout layout = new FormLayout("p, right:p, p:grow, right:p:grow",
            "p, min:grow, p, 2dlu, p, 2dlu, p, 2dlu, p, 2dlu, p: min:grow");

    PanelBuilder builder = new PanelBuilder(layout, this);
    CellConstraints cc = new CellConstraints();

    builder.add(whatIsBox, cc.xyw(1, 1, 4));

    builder.add(lessImportant, cc.xy(3, 3));
    builder.add(moreImportant, cc.xy(4, 3));

    builder.add(activity, cc.xy(2, 5));
    builder.add(activitySlider, cc.xyw(3, 5, 2));

    builder.add(popularitySlider, cc.xyw(3, 7, 2));
    builder.add(popularity, cc.xy(2, 7));

    builder.add(clickthroughs, cc.xy(2, 9));
    builder.add(clickthroughsSlider, cc.xyw(3, 9, 2));

    builder.add(feedViews, cc.xy(2, 11));
    builder.add(feedViewsSlider, cc.xyw(3, 11, 2));
}

From source file:com.salas.bb.installation.InstallationProgressDialog.java

License:Open Source License

/**
 * Builds content./*  w  ww  .  jav a  2s  .c om*/
 */
protected JComponent buildContent() {
    FormLayout layout = new FormLayout("15dlu, 150dlu:grow, 15dlu", "100dlu:grow, 2dlu, pref");

    PanelBuilder builder = new PanelBuilder(layout);
    CellConstraints cc = new CellConstraints();

    builder.add(buildStepsPanel(), cc.xy(2, 1));
    builder.add(buildButtonBar(), cc.xyw(1, 3, 3));

    return builder.getPanel();
}

From source file:com.salas.bb.installation.wizard.LaunchPage.java

License:Open Source License

/**
 * Builds the panel./*from  www.java 2  s  .c  o m*/
 */
private void build(JComponent buttonBar) {
    buttonBar.setBorder(Borders.createEmptyBorder("6dlu, 6dlu, 6dlu, 6dlu"));

    FormLayout layout = new FormLayout("15dlu, left:min:grow, 15dlu", "pref, 17dlu, min:grow, 2dlu, pref");
    PanelBuilder builder = new PanelBuilder(layout, this);
    CellConstraints cc = new CellConstraints();

    builder.add(buildHeader(), cc.xyw(1, 1, 3));
    builder.add(buildTutorialPanel(), cc.xy(2, 3, "f, f"));
    builder.add(buttonBar, cc.xyw(1, 5, 3));
}

From source file:com.salas.bb.installation.wizard.StartingPointsPage.java

License:Open Source License

/**
 * Builds the panel./*from   w ww  .  j a  va  2  s.  com*/
 */
public void build(JComponent buttonBar) {
    buttonBar.setBorder(Borders.createEmptyBorder("6dlu, 6dlu, 6dlu, 6dlu"));

    FormLayout layout = new FormLayout("15dlu, pref:grow, 15dlu", "pref, 17dlu, pref:grow, 8dlu, pref");

    PanelBuilder builder = new PanelBuilder(layout, this);
    CellConstraints cc = new CellConstraints();

    builder.add(buildHeader(), cc.xyw(1, 1, 3));
    builder.add(buildDataPage(), cc.xy(2, 3, "f, f"));
    builder.add(buttonBar, cc.xyw(1, 5, 3));
}

From source file:com.salas.bb.installation.wizard.TutorialPage.java

License:Open Source License

/**
 * Builds the panel.//from  w w  w. j  av  a 2  s.c  om
 */
public void build(JComponent buttonBar) {
    buttonBar.setBorder(Borders.createEmptyBorder("6dlu, 6dlu, 6dlu, 6dlu"));

    FormLayout layout = new FormLayout("15dlu, left:min:grow, 15dlu", "pref, 17dlu, min:grow, 2dlu, pref");
    PanelBuilder builder = new PanelBuilder(layout, this);
    CellConstraints cc = new CellConstraints();

    builder.add(buildHeader(), cc.xyw(1, 1, 3));
    builder.add(buildTutorialPanel(), cc.xy(2, 3, "f, f"));
    builder.add(buttonBar, cc.xyw(1, 5, 3));
}

From source file:com.salas.bb.utils.uif.CoolInternalFrame.java

License:Open Source License

/**
 * Creates the appropriately laied out Header for the CoolInternalFrame.
 *
 * @return the header.//from  w  w  w  .jav  a  2s.co m
 */
private JPanel buildHeader() {
    FormLayout layout = new FormLayout("11px, pref, min:grow, 2px, pref, 11px", "6px, pref, 1px, pref, 8px");
    headerPanel = new GradientPanel(layout);

    CellConstraints cc = new CellConstraints();
    headerPanel.add(titleLabel, cc.xy(2, 2));
    headerPanel.add(subtitleLabel, cc.xyw(2, 4, 3));
    if (headerCtrlComp != null)
        headerPanel.add(headerCtrlComp, cc.xywh(5, 2, 1, 3, "r, c"));

    headerPanel.setOpaque(SystemUtils.IS_OS_MAC);
    return headerPanel;
}

From source file:com.salas.bb.utils.uif.HeaderPanelExt.java

License:Open Source License

/**
 * Builds and answers the panel's center component.
 *///  w  w w.jav a2  s .c om
protected JComponent buildCenterComponent() {
    FormLayout fl = new FormLayout("7dlu, 9dlu, pref:grow, 14dlu, pref, 4dlu",
            "7dlu, pref, 2dlu, pref, 7dlu:grow");
    JPanel panel = new JPanel(fl);

    //        if (height != HEIGHT_AUTO)
    //        {
    Dimension size = new Dimension(300, height);
    panel.setMinimumSize(size);
    panel.setPreferredSize(size);
    //        }

    panel.setOpaque(false);

    CellConstraints cc = new CellConstraints();
    panel.add(titleLabel, cc.xyw(2, 2, 2));
    panel.add(descriptionArea, cc.xy(3, 4));
    panel.add(iconLabel, cc.xywh(5, 1, 1, 5));

    return panel;
}

From source file:com.tcay.slalom.UI.client.ClientRacePenaltiesUIDynamic.java

License:Open Source License

private void setupInnerPanelUI() {

    penaltyButtons = new ArrayList<GatePenaltyButton>();

    innerPanel = new JPanel();

    activeOrRecentRunsComboBox = new JComboBox();

    activeOrRecentRunsComboBox.setRenderer(new HighLightRowRenderer(activeOrRecentRunsComboBox.getRenderer()));
    activeOrRecentRunsComboBox.setToolTipText(
            "Entries with light green background have not been scored, light red backgrounds have been scored");

    doneBtn = new JButton();
    cancelBtn = new JButton();
    autoScroll = new JCheckBox();
    raceRunLabel = new JLabel();
    bibLabel = new BibLabel();

    StringBuffer columnSpec = new StringBuffer();
    StringBuffer rowSpec = new StringBuffer();
    int i;//from w  ww .  j a va  2  s .co m

    int maxCol = 5;
    if (onlyThisSection > 0) {
        maxCol = 3;
        for (i = 0; i < maxCol; i++) {
            if (i > 0)
                columnSpec.append(",");

            if (i % 2 == 0) {
                columnSpec.append("fill:50px:grow," + "left:6dlu:noGrow");
            } else {
                columnSpec.append("fill:120px:grow," + "left:6dlu:noGrow");
            }
        }
    } else {
        for (i = 0; i < maxCol; i++) {
            if (i > 0)
                columnSpec.append(",");

            columnSpec.append("fill:150px:grow," + "left:6dlu:noGrow");
        }
    }

    for (i = 0; i < 25 + 5; i++) { // figure on 25 rows maximum + 5
        if (i > 0)
            rowSpec.append(",");

        rowSpec.append("center:d:noGrow,top:3dlu:noGrow");
    }
    innerPanel.setLayout(new FormLayout(columnSpec.toString(), rowSpec.toString()));
    String title = new String(
            onlyThisSection == 0 ? "Penalty Scoring" : "Section " + onlyThisSection + " Penalty Scoring");

    innerPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLoweredBevelBorder(), title));

    CellConstraints cc = new CellConstraints();
    innerPanel.add(activeOrRecentRunsComboBox, cc.xyw(1, 1, 5));

    selectRaceRun = new JButton();
    selectRaceRun.setText("Select Boat");
    selectRaceRun.setBackground(SlalomApp.LIGHT_GREEN);
    selectRaceRun.setOpaque(true);
    innerPanel.add(selectRaceRun, cc.xy(3, 3)); //1,3

    innerPanel.add(new JLabel("Bib#"), cc.xy(1, 3));
    innerPanel.add(bibLabel, cc.xy(1, 5 + 2)); //+2 A20160730

    innerPanel.add(raceRunLabel, cc.xyw(3, 5 + 2, 3)); //+2 A20160730

    // todo fix kludge ordering here in calls
    int maxRow = setupPenaltyButtons(); // max Row set here

    //        innerPanel.add(penaltyDescriptionLabel,      cc.xyw(1, (5 + maxRow * 2), 5));
    //        innerPanel.add(penaltyDiagramLabel,          cc.xyw(1, (7 + maxRow * 2), 5));

    doneBtn.setText("Done");
    doneBtn.setBackground(SlalomApp.LIGHT_GREEN);
    doneBtn.setOpaque(true);

    cancelBtn.setText("Cancel");
    cancelBtn.setBackground(SlalomApp.LIGHT_RED);
    cancelBtn.setOpaque(true);

    //        innerPanel.add(doneBtn, cc.xy(1, (maxRow*2) + 5));
    ///    innerPanel.add(doneBtn, cc.xy(3, 3));//(maxRow*2) + 5));  //1,3
    //    innerPanel.add(cancelBtn, cc.xy(5, 3));//(maxRow*2) + 5));  //1,3

    innerPanel.add(doneBtn, cc.xy(3, 3));//(maxRow*2) + 5));  //1,3
    innerPanel.add(cancelBtn, cc.xy(3, 5));//(maxRow*2) + 5));  //1,3

    autoScroll.setText("Auto Scroll");
    autoScroll.setToolTipText(
            "When selected automatically advance to next run needing scoring after 'Done' or 'Cancel' Buttons");
    autoScroll.setSelected(false);
    innerPanel.add(autoScroll, cc.xy(3, ROW_OFFSET + (maxRow * 2) + 2)); /// 20170413 (ajm)

}

From source file:com.tcay.slalom.UI.RacePenaltiesUIDynamicOrig.java

License:Open Source License

private void setupUI() {
    createUIComponents();//w ww . ja  v  a2s .com
    panel1 = new JPanel();

    panel1.setLayout(new FormLayout(
            "fill:140px:grow,left:4dlu:noGrow,fill:139px:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:139px:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:29dlu:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,fill:max(d;4px):noGrow",
            "center:d:noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow"));
    panel1.setBorder(
            BorderFactory.createTitledBorder(BorderFactory.createLoweredBevelBorder(), "Penalty Scoring"));
    CellConstraints cc = new CellConstraints();
    panel1.add(activeOrRecentRunsComboBox, cc.xyw(3, 1, 4));
    selectRaceRun = new JButton();
    selectRaceRun.setText("Select Boat");
    panel1.add(selectRaceRun, cc.xy(7, 1));
    doneBtn.setText("Done");
    panel1.add(doneBtn, cc.xy(5, (nbrGates * 2) + 3));
    //  final Spacer spacer1 = new Spacer();
    //  panel1.add(spacer1, cc.xy(5, 13, CellConstraints.DEFAULT, CellConstraints.FILL));
}

From source file:com.tcay.slalom.UI.RacePenaltiesUI_REFERENCE.java

License:Open Source License

/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL/*from  w  ww .j  a  v  a 2s  . co m*/
 */
private void $$$setupUI$$$() {
    createUIComponents();
    panel1 = new JPanel();
    panel1.setLayout(new FormLayout(
            "fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:max(d;4px):noGrow",
            "center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:d:grow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:d:grow,top:3dlu:noGrow,center:max(d;4px):noGrow"));
    panel1.setMinimumSize(new Dimension(513, 200));
    panel1.setOpaque(false);
    panel1.setPreferredSize(new Dimension(513, 200));
    panel1.setBorder(
            BorderFactory.createTitledBorder(BorderFactory.createLoweredBevelBorder(), "Penalty Scoring"));
    CellConstraints cc = new CellConstraints();
    panel1.add(activeOrRecentRunsComboBox, cc.xyw(3, 1, 4));
    rb1_Touch.setText("Touch (2)");
    panel1.add(rb1_Touch, cc.xy(5, 5));
    rb1_Clean.setText("Clean");
    panel1.add(rb1_Clean, cc.xy(3, 5));
    panel1.add(gate1Label, cc.xy(1, 5));
    final JLabel label1 = new JLabel();
    label1.setText("Racer");
    panel1.add(label1, cc.xy(1, 3));
    rb1_50.setText("Missed (50)");
    panel1.add(rb1_50, cc.xywh(7, 5, 1, 2));
    panel1.add(raceRunLabel, cc.xy(3, 3));
    selectRaceRun = new JButton();
    selectRaceRun.setText("Select Boat");
    panel1.add(selectRaceRun, cc.xy(7, 1));
    rb2_Touch.setText("Touch (2)");
    panel1.add(rb2_Touch, cc.xy(5, 9));
    rb2_Clean.setText("Clean");
    panel1.add(rb2_Clean, cc.xy(3, 9));
    panel1.add(gate2Label, cc.xy(1, 9));
    rb2_50.setText("Missed (50)");
    panel1.add(rb2_50, cc.xy(7, 9));
    rb3_Touch.setText("Touch (2)");
    panel1.add(rb3_Touch, cc.xy(5, 13));
    rb3_Clean.setText("Clean");
    panel1.add(rb3_Clean, cc.xy(3, 13));
    panel1.add(gate3Label, cc.xy(1, 13));
    rb3_50.setText("Missed (50)");
    panel1.add(rb3_50, cc.xy(7, 13));
    doneBtn.setText("Done");
    panel1.add(doneBtn, cc.xy(5, 17));
    final Spacer spacer1 = new Spacer();
    panel1.add(spacer1, cc.xy(5, 15, CellConstraints.DEFAULT, CellConstraints.FILL));
    final Spacer spacer2 = new Spacer();
    panel1.add(spacer2, cc.xy(5, 11, CellConstraints.DEFAULT, CellConstraints.FILL));
    final JLabel label2 = new JLabel();
    label2.setText("Section 2");
    panel1.add(label2, cc.xy(1, 11));
    final JScrollPane scrollPane1 = new JScrollPane();
    panel1.add(scrollPane1, cc.xy(1, 1, CellConstraints.FILL, CellConstraints.FILL));
}