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

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

Introduction

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

Prototype

Alignment RIGHT

To view the source code for com.jgoodies.forms.layout CellConstraints RIGHT.

Click Source Link

Document

Put the component in the right.

Usage

From source file:com.atlassian.theplugin.idea.config.ProjectDefaultsConfigurationPanel.java

License:Apache License

public ProjectDefaultsConfigurationPanel(final Project project, final ProjectConfiguration projectConfiguration,
        final FishEyeServerFacade fishEyeServerFacade, final BambooServerFacade bambooServerFacade,
        final JiraServerFacade jiraServerFacade, final UiTaskExecutor uiTaskExecutor,
        @NotNull UserCfg defaultCredentials) {
    this.project = project;
    this.projectConfiguration = projectConfiguration;
    this.bambooServerFacade = bambooServerFacade;
    this.jiraServerFacade = jiraServerFacade;
    this.uiTaskExecutor = uiTaskExecutor;
    this.defaultCredentials = defaultCredentials;
    this.fishEyeServerFacade = fishEyeServerFacade;

    pathToProjectEdit.setToolTipText("Path to root directory in your repository. "
            + "E.g. trunk/myproject. Leave it blank if your project is located at the repository root");

    final FormLayout layout = new FormLayout("10dlu, 20dlu, right:pref, 3dlu, min(150dlu;default):grow, 3dlu", //columns
            "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 10dlu, " + //14
                    "p, 3dlu, p, 3dlu, p, 10dlu, " + //20
                    "p, 3dlu, p, 3dlu, p, 3dlu, p, 20dlu, fill:p"); //rows

    //CHECKSTYLE:MAGIC:OFF
    PanelBuilder builder = new PanelBuilder(layout, this);
    builder.setDefaultDialogBorder();/* www .  j  a va 2s. c om*/

    final CellConstraints cc = new CellConstraints();
    builder.addSeparator("FishEye", cc.xyw(1, 1, ALL_COLUMNS)); //11
    JLabel fshHelp1 = new JLabel(FISHEYE_HELP_TEXT_1);
    fshHelp1.setFont(fshHelp1.getFont().deriveFont(10.0f));
    fshHelp1.setMaximumSize(new Dimension(600, Integer.MAX_VALUE));
    builder.add(fshHelp1, cc.xyw(2, 3, ALL_COLUMNS - 1));
    builder.addLabel("Default Server:", cc.xy(3, 5));
    builder.add(defaultFishEyeServerCombo, cc.xy(5, 5));
    builder.addLabel("Default Repository:", cc.xy(3, 7));
    builder.add(defaultFishEyeRepositoryCombo, cc.xy(5, 7));
    builder.addLabel("Path to Project:", cc.xy(3, 9));
    builder.add(pathToProjectEdit, cc.xy(5, 9));
    JLabel fshHelp2 = new JLabel(FISHEYE_HELP_TEXT_2);
    fshHelp2.setFont(fshHelp2.getFont().deriveFont(10.0f));
    fshHelp2.setMaximumSize(new Dimension(600, Integer.MAX_VALUE));
    builder.add(fshHelp2, cc.xy(5, 11));

    builder.addSeparator("JIRA", cc.xyw(1, 13, ALL_COLUMNS));
    JLabel jiraHelp = new JLabel(JIRA_HELP_TEXT);
    jiraHelp.setFont(jiraHelp.getFont().deriveFont(10.0f));
    // jgorycki: well, it seems like FormLayout doesn't give a shit about JLabel's maximum width. However,
    // if I set it to something sane, at least the JLabel seems to wrap its HTML contents properly, instead
    // of producing one long line
    jiraHelp.setMaximumSize(new Dimension(600, Integer.MAX_VALUE));
    builder.add(jiraHelp, cc.xyw(2, 15, ALL_COLUMNS - 1));
    builder.addLabel("Default Server:", cc.xy(3, 17));
    builder.add(defaultJiraServerCombo, cc.xy(5, 17));

    builder.addSeparator("Default Credentials", cc.xyw(1, 19, ALL_COLUMNS));
    final String DEFAULT_CREDENTIALS_TEXT = "Default credentials for selected servers";
    JLabel defaultCredentialsLabel = new JLabel(DEFAULT_CREDENTIALS_TEXT);
    defaultCredentialsLabel.setFont(defaultCredentialsLabel.getFont().deriveFont(10.0f));
    builder.add(defaultCredentialsLabel, cc.xyw(2, 21, ALL_COLUMNS - 1));
    builder.addLabel("Username:", cc.xy(3, 23));
    builder.add(defaultUsername, cc.xy(5, 23));
    builder.addLabel("Password:", cc.xy(3, 25));
    builder.add(defaultPassword, cc.xy(5, 25));
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(defaultCredentialsTestButton, BorderLayout.EAST);
    defaultCredentialsTestButton.setMaximumSize(defaultCredentialsTestButton.getPreferredSize());

    builder.add(defaultCredentialsTestButton, cc.xy(5, 27, CellConstraints.RIGHT, CellConstraints.CENTER));

    initializeControls();
    registerListeners();

    //CHECKSTYLE:MAGIC:ON

}

From source file:com.atlassian.theplugin.idea.config.serverconfig.BambooGeneralForm.java

License:Apache License

/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL/*  w  ww . j  av  a  2  s .c o  m*/
 */
private void $$$setupUI$$$() {
    rootComponent = new JPanel();
    rootComponent.setLayout(new FormLayout(
            "fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:d:grow",
            "center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:d:grow"));
    rootComponent
            .setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12), null));
    allFailuresFirstSuccess = new JRadioButton();
    allFailuresFirstSuccess.setSelected(true);
    allFailuresFirstSuccess.setText("All Build Failures and First Build Success");
    CellConstraints cc = new CellConstraints();
    rootComponent.add(allFailuresFirstSuccess, cc.xy(3, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));
    firstFailureFirstSuccess = new JRadioButton();
    firstFailureFirstSuccess.setText("First Build Failure and First Build Success");
    rootComponent.add(firstFailureFirstSuccess, cc.xy(3, 3, CellConstraints.LEFT, CellConstraints.DEFAULT));
    never = new JRadioButton();
    never.setText("Never");
    rootComponent.add(never, cc.xy(3, 5, CellConstraints.LEFT, CellConstraints.DEFAULT));
    final Spacer spacer1 = new Spacer();
    rootComponent.add(spacer1, cc.xy(3, 11, CellConstraints.DEFAULT, CellConstraints.FILL));
    final Spacer spacer2 = new Spacer();
    rootComponent.add(spacer2, cc.xy(5, 11, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JLabel label1 = new JLabel();
    label1.setText("Popups:");
    rootComponent.add(label1, cc.xy(1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    final JLabel label2 = new JLabel();
    label2.setText("Background refresh  every:");
    rootComponent.add(label2, cc.xy(1, 9));
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridLayoutManager(1, 4, new Insets(0, 0, 0, 0), -1, -1));
    rootComponent.add(panel1, cc.xy(3, 9));
    pollTimeSpinner = new JSpinner();
    panel1.add(pollTimeSpinner,
            new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
                    new Dimension(50, -1), null, 0, false));
    final JLabel label3 = new JLabel();
    label3.setText("minute(s)");
    panel1.add(label3, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
            GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer3 = new Spacer();
    panel1.add(spacer3,
            new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
    onlyMyBuilds = new JCheckBox();
    onlyMyBuilds.setText("Only for My Builds");
    onlyMyBuilds.setToolTipText(
            "Shows notification popup only for builds triggered by commit of the logged in user");
    rootComponent.add(onlyMyBuilds, new CellConstraints(3, 7, 1, 1, CellConstraints.DEFAULT,
            CellConstraints.DEFAULT, new Insets(0, 20, 0, 0)));
    label3.setLabelFor(pollTimeSpinner);
    ButtonGroup buttonGroup;
    buttonGroup = new ButtonGroup();
    buttonGroup.add(allFailuresFirstSuccess);
    buttonGroup.add(firstFailureFirstSuccess);
    buttonGroup.add(never);
}

From source file:com.atlassian.theplugin.idea.crucible.CrucibleReviewCreateForm.java

License:Apache License

/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL//w ww.j  ava  2  s .c  o m
 */
private void $$$setupUI$$$() {
    rootComponent = new JPanel();
    rootComponent.setLayout(new FormLayout("fill:d:grow",
            "center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,center:max(d;4px):noGrow,center:p:grow,top:3dlu:noGrow,fill:d:noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow"));
    rootComponent.setMinimumSize(new Dimension(800, 505));
    final JLabel label1 = new JLabel();
    label1.setText("Title:");
    CellConstraints cc = new CellConstraints();
    rootComponent.add(label1, cc.xy(1, 1));
    titleText = new JTextField();
    rootComponent.add(titleText, cc.xy(1, 3, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new FormLayout(
            "fill:d:noGrow,left:4dlu:noGrow,fill:300px:grow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(p;4px):grow",
            "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:4dlu:noGrow,center:max(d;4px):noGrow"));
    rootComponent.add(panel1, cc.xy(1, 5));
    final JLabel label2 = new JLabel();
    label2.setText("Server:");
    panel1.add(label2, cc.xy(1, 1, CellConstraints.DEFAULT, CellConstraints.CENTER));
    crucibleServersComboBox = new JComboBox();
    panel1.add(crucibleServersComboBox, cc.xy(3, 1));
    final JLabel label3 = new JLabel();
    label3.setInheritsPopupMenu(false);
    label3.setText("Project:");
    panel1.add(label3, cc.xy(1, 3, CellConstraints.DEFAULT, CellConstraints.CENTER));
    projectsComboBox = new JComboBox();
    panel1.add(projectsComboBox, cc.xy(3, 3));
    final JLabel label4 = new JLabel();
    label4.setText("Moderator:");
    panel1.add(label4, cc.xy(1, 7, CellConstraints.DEFAULT, CellConstraints.CENTER));
    final JLabel label5 = new JLabel();
    label5.setText("Author:");
    panel1.add(label5, cc.xy(1, 9, CellConstraints.DEFAULT, CellConstraints.CENTER));
    moderatorComboBox = new JComboBox();
    panel1.add(moderatorComboBox, cc.xy(3, 7));
    authorComboBox = new JComboBox();
    panel1.add(authorComboBox, cc.xy(3, 9));
    final JPanel panel2 = new JPanel();
    panel2.setLayout(new BorderLayout(0, 0));
    panel1.add(panel2, cc.xywh(7, 1, 1, 7, CellConstraints.DEFAULT, CellConstraints.FILL));
    final JScrollPane scrollPane1 = new JScrollPane();
    panel2.add(scrollPane1, BorderLayout.CENTER);
    final JLabel label6 = new JLabel();
    label6.setText("Reviewers: ");
    panel1.add(label6, cc.xy(5, 1, CellConstraints.RIGHT, CellConstraints.TOP));
    final JLabel label7 = new JLabel();
    label7.setText("Selected: ");
    panel1.add(label7, cc.xy(5, 9, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    final JLabel label8 = new JLabel();
    label8.setText("Statement of Objectives:");
    rootComponent.add(label8, cc.xy(1, 7));
    final JScrollPane scrollPane2 = new JScrollPane();
    rootComponent.add(scrollPane2, cc.xy(1, 9, CellConstraints.FILL, CellConstraints.FILL));
    statementArea = new JTextArea();
    statementArea.setLineWrap(true);
    statementArea.setRows(5);
    scrollPane2.setViewportView(statementArea);
    customComponentPanel = new JPanel();
    customComponentPanel.setLayout(new BorderLayout(0, 0));
    rootComponent.add(customComponentPanel, cc.xy(1, 11, CellConstraints.DEFAULT, CellConstraints.FILL));
    label1.setLabelFor(titleText);
    label2.setLabelFor(crucibleServersComboBox);
    label5.setLabelFor(scrollPane1);
    label8.setLabelFor(statementArea);
}

From source file:com.atlassian.theplugin.idea.jira.PerformIssueActionForm.java

License:Apache License

private void createContent(final List<JIRAActionField> fieldList) {

    String columns = "3dlu, right:pref, 3dlu, fill:1dlu:grow, 3dlu";
    String rows = "3dlu";

    Collection<JIRAActionField> sortedFieldList = JiraActionFieldType.sortFieldList(fieldList);

    JIRAServerModel jiraServerModel = IdeaHelper.getJIRAServerModel(project);

    List<ActionFieldEditor> editors = Lists.newArrayList();
    List<String> unsupportedFields = Lists.newArrayList();

    for (JIRAActionField field : sortedFieldList) {

        ActionFieldEditor editor = null;
        String row = null;// w w  w .  j  a v  a2  s  . c o m

        switch (JiraActionFieldType.getFieldTypeForFieldId(field)) {
        case SUMMARY:
            editor = new FieldTextField(issue.getSummary(), field);
            row = ", pref, 3dlu";
            break;
        case DESCRIPTION:
            editor = new FieldTextArea(Html2text.translate(issue.getWikiDescription()), field);
            row = ", fill:pref:grow, 3dlu";
            break;
        case ISSUE_TYPE:
            editor = new FieldIssueType(jiraServerModel, issue, field, this);
            row = ", p, 3dlu";
            break;
        case RESOLUTION:
            editor = new FieldResolution(jiraServerModel, issue, field, this);
            row = ", p, 3dlu";
            break;
        case ASSIGNEE:
            editor = new FieldUser(jiraServerModel, issue.getJiraServerData(), issue.getAssigneeId(), field);
            row = ", p, 3dlu";
            break;
        case PRIORITY:
            editor = new FieldPriority(jiraServerModel, issue, field, this);
            row = ", p, 3dlu";
            break;
        case VERSIONS:
            editor = new FieldAffectsVersion(jiraServerModel, issue, field, this);
            row = ", p, 3dlu";
            break;
        case FIX_VERSIONS:
            editor = new FieldFixForVersion(jiraServerModel, issue, field, this);
            row = ", p, 3dlu";
            break;
        case COMPONENTS:
            editor = new FieldComponents(jiraServerModel, issue, field, this);
            row = ", p, 3dlu";
            break;
        case REPORTER:
            editor = new FieldUser(jiraServerModel, issue.getJiraServerData(), issue.getReporterId(), field);
            row = ", p, 3dlu";
            break;
        case ENVIRONMENT:
            //                    editor = new FieldTextArea(field.getValues().get(0), field);
            editor = new FieldTextArea(Html2text.translate(issue.getEnvironment()), field);
            row = ", fill:pref:grow, 3dlu";
            break;
        case TIMETRACKING:
            editor = new FieldTimeTracking(field.getValues().get(0), issue, field, this);
            row = ", p, 3dlu";
            break;
        case DUE_DATE:
            String content = "";
            if (field.getValues() != null && field.getValues().size() > 0) {
                content = field.getValues().get(0);
            }
            editor = new FieldDueDate(content, field, this);
            row = ", p, 3dlu";
            break;
        case CUSTOM_FIELD:
            for (JiraCustomField custom : issue.getCustomFields()) {
                if (custom.getId().equals(field.getFieldId())) {
                    List<String> values = custom.getValues();
                    String val = values != null && values.size() > 0 ? values.get(0) : null;
                    switch (custom.getTypeKey()) {
                    case NUMERIC:
                        editor = new FieldTextField(val, field);
                        row = ", p, 3dlu";
                        break;
                    case TEXT:
                        editor = new FieldTextField(val, field);
                        row = ", p, 3dlu";
                        break;
                    case TEXT_AREA:
                        //                                    editor = new FieldEditorPane(custom.getValues().get(0).replaceAll("<br/>", "\n"), field, true);
                        editor = new FieldTextArea(val != null ? val.replaceAll("<br/>", "") : "", field);
                        row = ", p, 3dlu";
                        break;
                    case DATE_PICKER:
                        editor = new FieldDueDate(custom.getFormattedValue(), field, this);
                        row = ", p, 3dlu";
                        break;
                    case URL:
                        editor = new FieldTextField(custom.getFormattedValue(), field);
                        row = ", p, 3dlu";
                    case UNSUPPORTED:
                    default:
                        break;
                    }
                }
            }
            break;
        case UNSUPPORTED:
        default:
            unsupportedFields.add(field.getName());
            break;
        }

        if (editor != null) {
            editors.add(editor);
            rows += row;
        }
    }

    rows += ", fill:pref:grow, 3dlu"; // Comments text area

    if (!unsupportedFields.isEmpty()) {
        rows += ", pref, 3dlu"; // warning status line about not handled
    }

    contentPanel.setLayout(new FormLayout(columns, rows));
    final CellConstraints cc = new CellConstraints();

    int y = 2;

    for (ActionFieldEditor editor : editors) {
        final JLabel label = new JLabel(editor.getFieldName() + ":");
        contentPanel.add(label, cc.xy(2, y, CellConstraints.RIGHT, CellConstraints.TOP));
        contentPanel.add(editor.getComponent(), cc.xy(4, y));
        createdFieldEditors.add(editor);
        y += 2;
    }

    final JLabel label = new JLabel("Comment :");
    contentPanel.add(label, cc.xy(2, y, CellConstraints.RIGHT, CellConstraints.TOP));
    // todo create field for Comments
    commentTextArea = new CommentTextArea();
    contentPanel.add(commentTextArea, cc.xy(4, y));

    y += 2;

    if (!unsupportedFields.isEmpty()) {
        String warning = issue.usesRest() ? "Unsupported fields (skipped): "
                : "Unsupported fields (original values copied): ";
        warning += StringUtils.join(unsupportedFields, ", ");
        contentPanel.add(new JLabel(warning), cc.xyw(2, y, 3, CellConstraints.LEFT, CellConstraints.CENTER));
    }

    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            contentPanel.validate();
        }
    });
}

From source file:com.atlassian.theplugin.idea.jira.WorkLogCreateAndMaybeDeactivateDialog.java

License:Apache License

private JPanel createTimePanel() {
    CellConstraints cc = new CellConstraints();
    timePanel = new JPanel(new FormLayout(
            "3dlu, right:pref, 3dlu, left:pref, 3dlu, 10dlu, left:pref, 3dlu, left:pref:grow, 3dlu",
            "3dlu, pref, 3dlu, pref, pref, pref, 3dlu, pref, 10dlu, 40dlu, 3dlu"));

    timePanel.add(new JLabel("Time Spent:"), cc.xy(2, 2));

    timeSpentField = createFixedTextField(120, 28);
    timePanel.add(timeSpentField, cc.xy(4, 2));

    explanationText = new JTextPane();
    explanationText.setText("An estimate of how much time you have spent working."
            + "\nThe format of this is ' *w *d *h *m ' (representing weeks,"
            + "\ndays, hours and minutes - where * can be any number)" + "\nExamples: 4d, 5h 30m, 60m and 3w.");

    explanationText.setEditable(false);/*from w w w .  j  a  v  a 2  s .  c o m*/
    explanationText.setEnabled(true);
    explanationText
            .setFont(new Font(explanationText.getFont().getName(), explanationText.getFont().getStyle(), 10));
    explanationText.setOpaque(false);

    timePanel.add(explanationText, cc.xywh(4, 4, 1, 4));

    timePanel.add(new JLabel("Remaining Estimate:"), cc.xyw(6, 2, 2));

    btnAutoUpdate = new JRadioButton("Auto Update", true);
    btnLeaveUnchanged = new JRadioButton("Leave Unchanged");
    btnUpdateManually = new JRadioButton("Update Manually:");

    timePanel.add(btnAutoUpdate, cc.xy(7, 4));
    timePanel.add(btnLeaveUnchanged, cc.xy(7, 5));
    timePanel.add(btnUpdateManually, cc.xy(7, 6));

    remainingEstimateField = createFixedTextField(120, 28);
    timePanel.add(remainingEstimateField, cc.xy(9, 6));

    ButtonGroup group = new ButtonGroup();
    group.add(btnUpdateManually);
    group.add(btnAutoUpdate);
    group.add(btnLeaveUnchanged);

    endTimePanel = new JPanel(new FormLayout("fill:pref:grow, 3dlu, pref", "pref"));
    endDateLabel = new JLabel("1/01/08 12:00");
    endTimePanel.add(endDateLabel, cc.xy(1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT));
    endDateChange = new JButton("Change");
    endTimePanel.add(endDateChange, cc.xy(3, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));

    if (!deactivateActiveIssue) {
        timePanel.add(new JLabel("End Time:"), cc.xy(2, 8));
        timePanel.add(endTimePanel, cc.xy(4, 8));
    }

    timePanel.add(new JLabel("Comment:"), cc.xy(2, 10, CellConstraints.RIGHT, CellConstraints.TOP));
    issueComment = new JTextArea();
    issueComment.setLineWrap(true);
    final JScrollPane scroll = new JScrollPane();
    scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    scroll.setViewportView(issueComment);

    timePanel.add(scroll, cc.xyw(4, 10, 6, CellConstraints.FILL, CellConstraints.FILL));

    UIUtil.setEnabled(timePanel, chkLogWork.isSelected() || !deactivateActiveIssue, true);
    remainingEstimateField.setEnabled(false);
    return timePanel;
}

From source file:com.aw.swing.mvp.cmp.pick.FrmPick.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  w w. j a  v a2 s  .  co m
 */
private void $$$setupUI$$$() {
    createUIComponents();
    pnlMain = new JPanel();
    pnlMain.setLayout(new FormLayout(
            "left:25dlu:noGrow,fill:52dlu:noGrow,left:8dlu:noGrow,fill:85dlu:noGrow,left:58dlu:noGrow,fill:10px:noGrow,fill:50dlu:noGrow,left:22dlu:noGrow",
            "center:12dlu:noGrow,top:4dlu:noGrow,center:12dlu:noGrow,top:5dlu:noGrow,center:18px:noGrow,top:4dlu:noGrow,top:12dlu:noGrow,center:188dlu:noGrow,top:4dlu:noGrow,top:12dlu:noGrow,center:max(d;4dlu):noGrow,center:12dlu:noGrow"));
    pnlMain.setMinimumSize(new Dimension(501, 425));
    pnlMain.setOpaque(true);
    pnlMain.setPreferredSize(new Dimension(501, 425));
    lblSearch = new JLabel();
    lblSearch.setText("Descripcin");
    lblSearch.setDisplayedMnemonic('D');
    lblSearch.setDisplayedMnemonicIndex(0);
    CellConstraints cc = new CellConstraints();
    pnlMain.add(lblSearch, cc.xy(2, 3, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    btnSearch = new JButton();
    btnSearch.setText("Buscar");
    btnSearch.setMnemonic('B');
    btnSearch.setDisplayedMnemonicIndex(0);
    pnlMain.add(btnSearch, cc.xy(7, 3));
    footerPanel.setLayout(
            new FormLayout("fill:73dlu:noGrow,left:191dlu:noGrow,fill:48dlu:noGrow", "center:12dlu:noGrow"));
    pnlMain.add(footerPanel, cc.xyw(1, 12, 8, CellConstraints.DEFAULT, CellConstraints.FILL));
    lblF10 = new JLabel();
    lblF10.setText(" [F10] Aceptar");
    footerPanel.add(lblF10, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));
    lblEsc = new JLabel();
    lblEsc.setText(" [Esc] Salir");
    footerPanel.add(lblEsc, cc.xy(3, 1));
    sepCriterioBusqueda.setSeparatorTitle("Criterio de Bsqueda");
    pnlMain.add(sepCriterioBusqueda, cc.xyw(1, 1, 8, CellConstraints.FILL, CellConstraints.FILL));
    pnlTitGrid.setLayout(
            new FormLayout("fill:204dlu:noGrow,left:88dlu:noGrow,fill:15dlu:noGrow", "center:12dlu:noGrow"));
    pnlMain.add(pnlTitGrid, cc.xyw(1, 7, 8, CellConstraints.FILL, CellConstraints.FILL));
    lblTitGrid = new JLabel();
    lblTitGrid.setText(" Relacin :");
    lblTitGrid.setDisplayedMnemonic('R');
    lblTitGrid.setDisplayedMnemonicIndex(1);
    pnlTitGrid.add(lblTitGrid, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));
    chkSel = new JCheckBox();
    chkSel.setBackground(new Color(-16747105));
    chkSel.setText("");
    pnlTitGrid.add(chkSel, cc.xy(3, 1));
    final JScrollPane scrollPane1 = new JScrollPane();
    scrollPane1.setMinimumSize(new Dimension(454, 418));
    pnlMain.add(scrollPane1, cc.xyw(1, 8, 8, CellConstraints.FILL, CellConstraints.FILL));
    tblGrid = new JTable();
    tblGrid.setMinimumSize(new Dimension(450, 400));
    scrollPane1.setViewportView(tblGrid);
    final JLabel label1 = new JLabel();
    label1.setText(" Nmero de Registros:");
    pnlMain.add(label1, cc.xyw(1, 10, 3));
    lblNumRegistros = new JLabel();
    lblNumRegistros.setText("Label");
    pnlMain.add(lblNumRegistros, cc.xyw(4, 10, 3));
    txtSearch = new JTextField();
    pnlMain.add(txtSearch, cc.xyw(4, 3, 2, CellConstraints.FILL, CellConstraints.DEFAULT));
    lblSearch2 = new JLabel();
    lblSearch2.setText("Descripcin2");
    lblSearch2.setDisplayedMnemonic('D');
    lblSearch2.setDisplayedMnemonicIndex(0);
    pnlMain.add(lblSearch2, cc.xy(2, 5, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    cmbAlmacen = new JComboBox();
    pnlMain.add(cmbAlmacen, cc.xy(4, 5));
    lblSearch.setLabelFor(txtSearch);
    lblSearch2.setLabelFor(txtSearch);
}

From source file:com.aw.swing.mvp.cmp.pick.FrmPickDocVenta.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  va 2s.  c  o  m*/
 */
private void $$$setupUI$$$() {
    createUIComponents();
    pnlMain = new JPanel();
    pnlMain.setLayout(new FormLayout(
            "left:25dlu:noGrow,fill:52dlu:noGrow,left:8dlu:noGrow,fill:56dlu:noGrow,left:4dlu:noGrow,fill:36px:noGrow,fill:max(d;4px):noGrow,left:57dlu:noGrow,fill:10px:noGrow,fill:54dlu:noGrow,left:16dlu:noGrow",
            "center:12dlu:noGrow,top:4dlu:noGrow,center:12dlu:noGrow,top:6dlu:noGrow,top:12dlu:noGrow,top:4dlu:noGrow,center:12dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,top:12dlu:noGrow,center:146dlu:noGrow,top:4dlu:noGrow,top:12dlu:noGrow,center:max(d;4dlu):noGrow,center:12dlu:noGrow"));
    pnlMain.setMinimumSize(new Dimension(501, 425));
    pnlMain.setOpaque(true);
    pnlMain.setPreferredSize(new Dimension(501, 425));
    lblSearch = new JLabel();
    lblSearch.setHorizontalAlignment(4);
    lblSearch.setText("Descripcin");
    lblSearch.setDisplayedMnemonic('D');
    lblSearch.setDisplayedMnemonicIndex(0);
    CellConstraints cc = new CellConstraints();
    pnlMain.add(lblSearch, cc.xyw(1, 3, 2, CellConstraints.FILL, CellConstraints.DEFAULT));
    btnSearch = new JButton();
    btnSearch.setText("Buscar");
    btnSearch.setMnemonic('B');
    btnSearch.setDisplayedMnemonicIndex(0);
    pnlMain.add(btnSearch, cc.xy(10, 3));
    footerPanel.setLayout(
            new FormLayout("fill:73dlu:noGrow,left:191dlu:noGrow,fill:48dlu:noGrow", "center:12dlu:noGrow"));
    pnlMain.add(footerPanel, cc.xyw(1, 15, 11, CellConstraints.DEFAULT, CellConstraints.FILL));
    lblF10 = new JLabel();
    lblF10.setText(" [F10] Aceptar");
    footerPanel.add(lblF10, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));
    lblEsc = new JLabel();
    lblEsc.setText(" [Esc] Salir");
    footerPanel.add(lblEsc, cc.xy(3, 1));
    sepCriterioBusqueda.setSeparatorTitle("Criterio de Bsqueda");
    pnlMain.add(sepCriterioBusqueda, cc.xyw(1, 1, 11, CellConstraints.FILL, CellConstraints.FILL));
    pnlTitGrid.setLayout(
            new FormLayout("fill:204dlu:noGrow,left:88dlu:noGrow,fill:15dlu:noGrow", "center:12dlu:noGrow"));
    pnlMain.add(pnlTitGrid, cc.xyw(1, 10, 11, CellConstraints.FILL, CellConstraints.FILL));
    lblTitGrid = new JLabel();
    lblTitGrid.setText(" Relacin :");
    lblTitGrid.setDisplayedMnemonic('R');
    lblTitGrid.setDisplayedMnemonicIndex(1);
    pnlTitGrid.add(lblTitGrid, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));
    chkSel = new JCheckBox();
    chkSel.setBackground(new Color(-16747105));
    chkSel.setText("");
    pnlTitGrid.add(chkSel, cc.xy(3, 1));
    final JScrollPane scrollPane1 = new JScrollPane();
    scrollPane1.setMinimumSize(new Dimension(454, 418));
    pnlMain.add(scrollPane1, cc.xyw(1, 11, 11, CellConstraints.FILL, CellConstraints.FILL));
    tblGrid = new JTable();
    tblGrid.setMinimumSize(new Dimension(450, 400));
    scrollPane1.setViewportView(tblGrid);
    final JLabel label1 = new JLabel();
    label1.setText(" Nmero de Registros:");
    pnlMain.add(label1, cc.xyw(1, 13, 3));
    lblNumRegistros = new JLabel();
    lblNumRegistros.setText("Label");
    pnlMain.add(lblNumRegistros, cc.xyw(4, 13, 6));
    txtSearch = new JTextField();
    pnlMain.add(txtSearch, cc.xyw(4, 3, 5, CellConstraints.FILL, CellConstraints.DEFAULT));
    lblFecIni = new JLabel();
    lblFecIni.setText("Fecha del");
    pnlMain.add(lblFecIni, cc.xy(2, 5, CellConstraints.RIGHT, CellConstraints.CENTER));
    lblFecFin = new JLabel();
    lblFecFin.setText("al");
    pnlMain.add(lblFecFin, cc.xy(6, 5, CellConstraints.RIGHT, CellConstraints.CENTER));
    txtFecIni = new JTextField();
    pnlMain.add(txtFecIni, cc.xy(4, 5, CellConstraints.FILL, CellConstraints.DEFAULT));
    txtFecFin = new JTextField();
    pnlMain.add(txtFecFin, cc.xy(8, 5, CellConstraints.FILL, CellConstraints.DEFAULT));
    lblEntInm = new JLabel();
    lblEntInm.setHorizontalAlignment(4);
    lblEntInm.setText("Entrega Inmediata");
    pnlMain.add(lblEntInm, cc.xyw(1, 7, 2, CellConstraints.FILL, CellConstraints.CENTER));
    cmbEntInm = new JComboBox();
    pnlMain.add(cmbEntInm, cc.xy(4, 7));
    lblSearch.setLabelFor(txtSearch);
    lblFecIni.setLabelFor(txtSearch);
    lblFecFin.setLabelFor(txtSearch);
    lblEntInm.setLabelFor(txtSearch);
}

From source file:com.aw.swing.mvp.cmp.pick.FrmPickMovAlm.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/*  w  w w. jav a  2 s.c o  m*/
 */
private void $$$setupUI$$$() {
    createUIComponents();
    pnlMain = new JPanel();
    pnlMain.setLayout(new FormLayout(
            "left:25dlu:noGrow,fill:52dlu:noGrow,left:8dlu:noGrow,fill:43dlu:noGrow,left:10dlu:noGrow,fill:13px:noGrow,left:19dlu:noGrow,fill:8px:noGrow,left:56dlu:noGrow,fill:10px:noGrow,fill:50dlu:noGrow,left:22dlu:noGrow",
            "center:12dlu:noGrow,top:4dlu:noGrow,center:12dlu:noGrow,top:5dlu:noGrow,center:12dlu:noGrow,top:3dlu:noGrow,center:18px:noGrow,top:4dlu:noGrow,top:12dlu:noGrow,center:149dlu:noGrow,top:4dlu:noGrow,top:12dlu:noGrow,center:max(d;4dlu):noGrow,center:12dlu:noGrow"));
    pnlMain.setMinimumSize(new Dimension(501, 425));
    pnlMain.setOpaque(true);
    pnlMain.setPreferredSize(new Dimension(501, 425));
    lblSearch = new JLabel();
    lblSearch.setText("Descripcin");
    lblSearch.setDisplayedMnemonic('D');
    lblSearch.setDisplayedMnemonicIndex(0);
    CellConstraints cc = new CellConstraints();
    pnlMain.add(lblSearch, cc.xyw(1, 3, 2, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    btnSearch = new JButton();
    btnSearch.setText("Buscar");
    btnSearch.setMnemonic('B');
    btnSearch.setDisplayedMnemonicIndex(0);
    pnlMain.add(btnSearch, cc.xy(11, 3));
    footerPanel.setLayout(
            new FormLayout("fill:73dlu:noGrow,left:191dlu:noGrow,fill:48dlu:noGrow", "center:12dlu:noGrow"));
    pnlMain.add(footerPanel, cc.xyw(1, 14, 12, CellConstraints.DEFAULT, CellConstraints.FILL));
    lblF10 = new JLabel();
    lblF10.setText(" [F10] Aceptar");
    footerPanel.add(lblF10, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));
    lblEsc = new JLabel();
    lblEsc.setText(" [Esc] Salir");
    footerPanel.add(lblEsc, cc.xy(3, 1));
    sepCriterioBusqueda.setSeparatorTitle("Criterio de Bsqueda");
    pnlMain.add(sepCriterioBusqueda, cc.xyw(1, 1, 12, CellConstraints.FILL, CellConstraints.FILL));
    pnlTitGrid.setLayout(
            new FormLayout("fill:204dlu:noGrow,left:88dlu:noGrow,fill:15dlu:noGrow", "center:12dlu:noGrow"));
    pnlMain.add(pnlTitGrid, cc.xyw(1, 9, 12, CellConstraints.FILL, CellConstraints.FILL));
    lblTitGrid = new JLabel();
    lblTitGrid.setText(" Relacin :");
    lblTitGrid.setDisplayedMnemonic('R');
    lblTitGrid.setDisplayedMnemonicIndex(1);
    pnlTitGrid.add(lblTitGrid, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));
    chkSel = new JCheckBox();
    chkSel.setBackground(new Color(-16747105));
    chkSel.setText("");
    pnlTitGrid.add(chkSel, cc.xy(3, 1));
    final JScrollPane scrollPane1 = new JScrollPane();
    scrollPane1.setMinimumSize(new Dimension(454, 418));
    pnlMain.add(scrollPane1, cc.xyw(1, 10, 12, CellConstraints.FILL, CellConstraints.FILL));
    tblGrid = new JTable();
    tblGrid.setMinimumSize(new Dimension(450, 400));
    scrollPane1.setViewportView(tblGrid);
    final JLabel label1 = new JLabel();
    label1.setText(" Nmero de Registros:");
    pnlMain.add(label1, cc.xyw(1, 12, 3));
    lblNumRegistros = new JLabel();
    lblNumRegistros.setText("Label");
    pnlMain.add(lblNumRegistros, cc.xyw(4, 12, 7));
    txtSearch = new JTextField();
    pnlMain.add(txtSearch, cc.xyw(4, 3, 6, CellConstraints.FILL, CellConstraints.DEFAULT));
    lblSearch2 = new JLabel();
    lblSearch2.setText("Descripcin2");
    lblSearch2.setDisplayedMnemonic('D');
    lblSearch2.setDisplayedMnemonicIndex(0);
    pnlMain.add(lblSearch2, cc.xyw(1, 7, 2, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    cmbAlmacen = new JComboBox();
    pnlMain.add(cmbAlmacen, cc.xyw(4, 7, 6));
    lblFecIni = new JLabel();
    lblFecIni.setText("Fecha del");
    pnlMain.add(lblFecIni, cc.xyw(1, 5, 2, CellConstraints.RIGHT, CellConstraints.CENTER));
    txtFecIni = new JTextField();
    pnlMain.add(txtFecIni, cc.xyw(4, 5, 3, CellConstraints.FILL, CellConstraints.DEFAULT));
    lblFecFin = new JLabel();
    lblFecFin.setText("al");
    pnlMain.add(lblFecFin, cc.xy(7, 5, CellConstraints.RIGHT, CellConstraints.CENTER));
    txtFecFin = new JTextField();
    pnlMain.add(txtFecFin, cc.xy(9, 5, CellConstraints.FILL, CellConstraints.DEFAULT));
    lblSearch.setLabelFor(txtSearch);
    lblSearch2.setLabelFor(txtSearch);
    lblFecIni.setLabelFor(txtSearch);
    lblFecFin.setLabelFor(txtSearch);
}

From source file:com.aw.swing.mvp.ui.painter.ErrorBorderPainter.java

License:Open Source License

public void paintError(List components) {
    clearError(components);/*ww  w  . j  a v  a 2s  .  c  o  m*/
    for (Iterator iterator = components.iterator(); iterator.hasNext();) {
        BindingComponent bindingComponent = (BindingComponent) iterator.next();
        JLabel label = (JLabel) ((JComponent) bindingComponent.getJComponent())
                .getClientProperty(BindingComponent.ATTR_ICONO);
        if (label != null) {
            return;
        }
        logger.debug("creating icon for " + bindingComponent.getFieldName());
        JComponent feedbackComponent = createFeedbackComponent();
        if (feedbackComponent == null) {
            return;
        }
        Container container = bindingComponent.getJComponent().getParent();
        // GMC Todo  ver q pasa cuando no se envia null ->  Ver como manejar este caso para los diferentes layouts       
        //            container.add(feedbackComponent, null);
        CellConstraints cc = new CellConstraints();
        container.add(feedbackComponent, cc.xy(1, 1));
        Point overlayPosition = getFeedbackComponentOrigin(feedbackComponent, bindingComponent.getJComponent());
        overlayPosition.translate(-3, +2);
        feedbackComponent.setLocation(overlayPosition);

        FormLayout layout = ((FormLayout) container.getLayout());
        CellConstraints cc1 = layout.getConstraints(bindingComponent.getJComponent());

        container.add(feedbackComponent,
                cc1.xy(cc1.gridX - 1, cc1.gridY + 1, CellConstraints.RIGHT, CellConstraints.BOTTOM));

        bindingComponent.getJComponent().putClientProperty(BindingComponent.ATTR_ICONO, feedbackComponent);
    }
}

From source file:com.pavelfatin.sleeparchiver.gui.preferences.PreferencesDialog.java

License:Open Source License

private JPanel createGeneral() {
    Builder b = new Builder("default:grow", "default, 3 * ($lgap, default)");

    _language = b.createComboBox("comboboxLanguage");
    _language.setRenderer(new NamedRenderer());
    DefaultComboBoxModel model = new DefaultComboBoxModel();
    for (Language each : Language.values()) {
        model.addElement(toNamed(each));
    }//from  w  w w  . j a v  a 2 s.c om
    _language.setModel(model);

    _backups = b.createCheckBox("checkboxBackups");
    _prefill = b.createCheckBox("checkboxPrefill");

    JLabel asterisk = b.createLabel("labelAsterisk");
    asterisk.setVerticalAlignment(SwingConstants.TOP);

    b.add(b.createLine(b.createLabel("labelLanguage", _language), _language, asterisk), 1, 1);
    b.add(b.createLabel("labelFootnote"), 1, 3, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT);
    b.add(_backups, 1, 5);
    b.add(_prefill, 1, 7);

    return b.getPanel();
}