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

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

Introduction

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

Prototype

Alignment TOP

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

Click Source Link

Document

Put the component in the top.

Usage

From source file:com.archivas.clienttools.arcmover.gui.settings.DefaultNamespaceSettingsForm.java

License:Open Source License

/**
 * Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR
 * call it in your code!//from w  w w  .jav  a2  s .co  m
 *
 * @noinspection ALL
 */
private void $$$setupUI$$$() {
    contentPane = new JPanel();
    contentPane.setLayout(new FormLayout("fill:d:grow", "center:d:grow"));
    defaultNamespaceTab = new JPanel();
    defaultNamespaceTab.setLayout(new FormLayout(
            "fill:4dlu:noGrow,fill:max(d;4px):noGrow,left:max(d;4px):noGrow,fill:max(d;4px):grow,fill:d:noGrow",
            "center:4dlu:noGrow,center:max(d;4px):noGrow,top:15px:noGrow,center:max(d;4px):noGrow,top:5dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(m;4px):grow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow"));
    CellConstraints cc = new CellConstraints();
    contentPane.add(defaultNamespaceTab, cc.xy(1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));
    final JLabel label1 = new JLabel();
    label1.setFont(new Font(label1.getFont().getName(), Font.BOLD, 14));
    label1.setText("POSIX Ownership and Permissions");
    defaultNamespaceTab.add(label1, cc.xyw(2, 2, 3));
    uidCheckbox = new JCheckBox();
    uidCheckbox.setText("UID");
    uidCheckbox.setToolTipText("Enable setting UID");
    defaultNamespaceTab.add(uidCheckbox, cc.xy(2, 6));
    uidTextField = new JTextField();
    uidTextField.setEnabled(false);
    uidTextField.setToolTipText("Number to set for UID");
    defaultNamespaceTab.add(uidTextField, cc.xy(4, 6, CellConstraints.FILL, CellConstraints.DEFAULT));
    gidCheckbox = new JCheckBox();
    gidCheckbox.setText("GID");
    gidCheckbox.setToolTipText("Enable setting GID");
    defaultNamespaceTab.add(gidCheckbox, cc.xy(2, 8));
    fileModeCheckbox = new JCheckBox();
    fileModeCheckbox.setText("Object permissions");
    fileModeCheckbox.setToolTipText("Enable setting object permissions");
    defaultNamespaceTab.add(fileModeCheckbox, cc.xy(2, 10, CellConstraints.DEFAULT, CellConstraints.TOP));
    dirModeCheckbox = new JCheckBox();
    dirModeCheckbox.setText("Directory permissions");
    dirModeCheckbox.setToolTipText("Enable setting directory permissions");
    defaultNamespaceTab.add(dirModeCheckbox, cc.xy(2, 12, CellConstraints.DEFAULT, CellConstraints.TOP));
    gidTextField = new JTextField();
    gidTextField.setEnabled(false);
    gidTextField.setToolTipText("Number to set for GID");
    defaultNamespaceTab.add(gidTextField, cc.xy(4, 8, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JLabel label2 = new JLabel();
    label2.setFont(new Font(label2.getFont().getName(), label2.getFont().getStyle(), 12));
    label2.setText("These settings apply only to the HCP default namespace and HCAP 2.x.");
    defaultNamespaceTab.add(label2, cc.xyw(2, 3, 3));
    objectPermissionsForm = new PermissionsForm();
    defaultNamespaceTab.add(objectPermissionsForm.$$$getRootComponent$$$(),
            cc.xy(4, 10, CellConstraints.FILL, CellConstraints.FILL));
    dirPermissionsForm = new PermissionsForm();
    defaultNamespaceTab.add(dirPermissionsForm.$$$getRootComponent$$$(),
            cc.xy(4, 12, CellConstraints.FILL, CellConstraints.FILL));
}

From source file:com.atlassian.theplugin.idea.AboutForm.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/*from   ww w.  j  a v  a 2 s  .com*/
 */
private void $$$setupUI$$$() {
    mainPanel = new JPanel();
    mainPanel
            .setLayout(new FormLayout("fill:d:grow", "center:max(d;4px):noGrow,top:3dlu:noGrow,center:d:grow"));
    mainPanel.setBackground(new Color(-1));
    mainPanel.setMaximumSize(new Dimension(600, 500));
    mainPanel.setMinimumSize(new Dimension(600, 500));
    mainPanel.setPreferredSize(new Dimension(600, 500));
    aboutText = new JEditorPane();
    aboutText.setMaximumSize(new Dimension(500, 250));
    aboutText.setMinimumSize(new Dimension(500, 250));
    aboutText.setPreferredSize(new Dimension(500, 250));
    CellConstraints cc = new CellConstraints();
    mainPanel.add(aboutText, cc.xy(1, 3, CellConstraints.CENTER, CellConstraints.FILL));
    iconLabel = new JLabel();
    iconLabel.setMaximumSize(new Dimension(500, 216));
    iconLabel.setMinimumSize(new Dimension(500, 216));
    iconLabel.setPreferredSize(new Dimension(500, 216));
    iconLabel.setRequestFocusEnabled(false);
    iconLabel.setText("Label");
    mainPanel.add(iconLabel, cc.xy(1, 1, CellConstraints.CENTER, CellConstraints.TOP));
}

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/*from w  w  w.  j av  a 2s  . c om*/
 */
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.GeneralConfigForm.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//from   w w w .  ja  v  a2  s.co  m
 */
private void $$$setupUI$$$() {
    createUIComponents();
    mainPanel = new JPanel();
    mainPanel.setLayout(new FormLayout("fill:d:grow",
            "center:max(d;4px):noGrow,top:3dlu:noGrow,center:d:noGrow,top:4dlu:noGrow,center:max(d;4px):grow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow"));
    mainPanel
            .setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12), null));
    autoUpdateConfigPanel = new JPanel();
    autoUpdateConfigPanel.setLayout(new GridLayoutManager(3, 3, new Insets(0, 12, 12, 12), -1, -1));
    CellConstraints cc = new CellConstraints();
    mainPanel.add(autoUpdateConfigPanel, cc.xy(1, 1));
    autoUpdateConfigPanel
            .setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Auto Upgrade"));
    checkNowButton = new JButton();
    checkNowButton.setText("Check Now");
    checkNowButton.setMnemonic('C');
    checkNowButton.setDisplayedMnemonicIndex(0);
    autoUpdateConfigPanel.add(checkNowButton,
            new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
    autoUpdateConfigPanel.add(panel1,
            new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_VERTICAL,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    chkUnstableVersionsCheckBox = new JCheckBox();
    chkUnstableVersionsCheckBox.setEnabled(false);
    chkUnstableVersionsCheckBox.setText("Check Snapshot Versions");
    panel1.add(chkUnstableVersionsCheckBox,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer1 = new Spacer();
    panel1.add(spacer1,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, 1, new Dimension(12, -1), null, null, 0, false));
    chkAutoUpdateEnabled = new JCheckBox();
    chkAutoUpdateEnabled.setText("Enabled (Stable Version)");
    chkAutoUpdateEnabled.setMnemonic('E');
    chkAutoUpdateEnabled.setDisplayedMnemonicIndex(0);
    autoUpdateConfigPanel.add(chkAutoUpdateEnabled,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer2 = new Spacer();
    autoUpdateConfigPanel.add(spacer2,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
    checkNewVersionStable = new JRadioButton();
    checkNewVersionStable.setSelected(true);
    checkNewVersionStable.setText("Stable Only");
    autoUpdateConfigPanel.add(checkNewVersionStable,
            new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    checkNewVersionAll = new JRadioButton();
    checkNewVersionAll.setText("Stable + Snapshot");
    autoUpdateConfigPanel.add(checkNewVersionAll,
            new GridConstraints(2, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    httpProxyPanel = new JPanel();
    httpProxyPanel.setLayout(new GridLayoutManager(4, 2, new Insets(0, 12, 12, 0), -1, -1));
    mainPanel.add(httpProxyPanel, cc.xy(1, 3, CellConstraints.DEFAULT, CellConstraints.TOP));
    httpProxyPanel
            .setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "HTTP Proxy"));
    chkUseIdeaProxy = new JRadioButton();
    chkUseIdeaProxy.setText("Use IDEA Proxy Settings");
    httpProxyPanel.add(chkUseIdeaProxy,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    httpProxyButton = new JButton();
    httpProxyButton.setText("Edit IDEA Proxy Settings");
    httpProxyPanel.add(httpProxyButton,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_NORTHWEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    chkNoProxy = new JRadioButton();
    chkNoProxy.setText("Do Not Use Proxy");
    httpProxyPanel.add(chkNoProxy,
            new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer3 = new Spacer();
    httpProxyPanel.add(spacer3,
            new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1,
                    GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
    final JLabel label1 = new JLabel();
    label1.setFont(new Font(label1.getFont().getName(), label1.getFont().getStyle(), 10));
    label1.setText("Information: You have to restart IDEA to apply changes in the proxy configuration");
    httpProxyPanel.add(label1,
            new GridConstraints(3, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    final JPanel panel2 = new JPanel();
    panel2.setLayout(new FormLayout("left:p:noGrow,left:p:noGrow", "center:d:grow"));
    mainPanel.add(panel2, cc.xy(1, 9));
    reportAnonymousUsageStatisticsCheckBox = new JCheckBox();
    reportAnonymousUsageStatisticsCheckBox.setEnabled(true);
    reportAnonymousUsageStatisticsCheckBox.setSelected(false);
    reportAnonymousUsageStatisticsCheckBox
            .setText("Provide anonymous usage statistics to help us develop a better plugin");
    reportAnonymousUsageStatisticsCheckBox.setMnemonic('P');
    reportAnonymousUsageStatisticsCheckBox.setDisplayedMnemonicIndex(0);
    panel2.add(reportAnonymousUsageStatisticsCheckBox, cc.xy(1, 1));
    panel2.add(usageStatsHelp, cc.xy(2, 1, CellConstraints.LEFT, CellConstraints.CENTER));
    final JPanel panel3 = new JPanel();
    panel3.setLayout(new GridLayoutManager(5, 3, new Insets(0, 12, 12, 12), -1, -1));
    mainPanel.add(panel3, cc.xy(1, 5, CellConstraints.DEFAULT, CellConstraints.TOP));
    panel3.setBorder(
            BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Direct Click Through"));
    ctrlHttpServer = new JCheckBox();
    ctrlHttpServer.setSelected(false);
    ctrlHttpServer.setText("Enable Direct Click Through");
    panel3.add(ctrlHttpServer,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer4 = new Spacer();
    panel3.add(spacer4,
            new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1,
                    GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
    final JLabel label2 = new JLabel();
    label2.setFont(new Font(label2.getFont().getName(), label2.getFont().getStyle(), 10));
    label2.setText("Information: You have to restart IDEA to apply changes (start/stop http server)");
    panel3.add(label2, new GridConstraints(3, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
            GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final JLabel label3 = new JLabel();
    label3.setText("  Direct Click Through TCP/IP Port: ");
    panel3.add(label3, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
            GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer5 = new Spacer();
    panel3.add(spacer5,
            new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
    final Spacer spacer6 = new Spacer();
    panel3.add(spacer6,
            new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1,
                    GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
    ctrlHttpServerPort = new JSpinner();
    panel3.add(ctrlHttpServerPort,
            new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, new Dimension(70, -1),
                    new Dimension(70, -1), null, 0, false));
    ButtonGroup buttonGroup;
    buttonGroup = new ButtonGroup();
    buttonGroup.add(checkNewVersionStable);
    buttonGroup.add(checkNewVersionAll);
    buttonGroup = new ButtonGroup();
    buttonGroup.add(chkNoProxy);
    buttonGroup.add(chkUseIdeaProxy);
}

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;/*from  w w w  .j  a v  a 2 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);/*w  ww.  ja  va2 s.  c om*/
    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.atlassian.theplugin.idea.ui.ScrollableTwoColumnPanel.java

License:Apache License

public void updateContent(@Nullable Collection<Entry> entries) {
    panel.removeAll();/*from   w  ww  . j a v  a  2s.c o m*/
    if (entries == null || entries.size() == 0) {
        panel.setLayout(new BorderLayout());
        final JLabel label = new JLabel("No Custom Filter Defined", JLabel.CENTER);
        panel.setPreferredSize(label.getPreferredSize());
        panel.add(label);
        return;
    }

    FormLayout layout = new FormLayout("4dlu, right:p, 4dlu, left:d, 4dlu");
    PanelBuilder builder = new PanelBuilder(layout, panel);

    int row = 1;
    CellConstraints cc = new CellConstraints();
    for (Entry entry : entries) {
        builder.appendRow("2dlu");
        builder.appendRow("p");
        cc.xy(2, row * 2).vAlign = CellConstraints.TOP;
        builder.addLabel(entry.getLabel() + ":", cc);
        cc.xy(VAL_COL, row * 2).vAlign = CellConstraints.TOP;
        if (entry.isError()) {
            builder.addLabel("<html>" + "<font color=\"red\">" + entry.getValue(), cc);
        } else {
            builder.addLabel("<html>" + entry.getValue(), cc);
        }
        row++;
    }
    // this lines (simulating JScrollPane resize)
    // are needed to more or less workaround the problem of revalidating whole scrollpane when more or fewer
    // rows could have been added. Without them you may end up with JScrollPane not completely showing its viewport
    panel.setPreferredSize(null);
    panel.setPreferredSize(new Dimension(getWidth(), panel.getPreferredSize().height));
    panel.validate();
    // it was needed here as sometimes panel was left with some old rubbish
    panel.repaint();
}

From source file:com.floreantpos.ui.dialog.DiscountListDialog.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 .  j a  v  a2  s.c  o m*/
 */
private void $$$setupUI$$$() {
    contentPane = new JPanel();
    contentPane.setLayout(new GridLayoutManager(2, 1, new Insets(10, 10, 10, 10), -1, -1));
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
    contentPane.add(panel1,
            new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_SOUTH, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null,
                    null, 0, false));
    final Spacer spacer1 = new Spacer();
    panel1.add(spacer1,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
    final JPanel panel2 = new JPanel();
    panel2.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
    panel1.add(panel2,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    btnDeleteSelected = new PosButton();
    btnDeleteSelected.setIcon(IconFactory.getIcon("/ui_icons/", "delete.png")); //$NON-NLS-1$ //$NON-NLS-2$
    btnDeleteSelected.setPreferredSize(new Dimension(140, 50));
    btnDeleteSelected.setText(Messages.getString("DiscountListDialog.5")); //$NON-NLS-1$
    panel2.add(btnDeleteSelected);
    buttonOK = new PosButton();
    buttonOK.setIcon(IconFactory.getIcon("/ui_icons/", "finish.png")); //$NON-NLS-1$ //$NON-NLS-2$
    buttonOK.setPreferredSize(new Dimension(120, 50));
    buttonOK.setText(com.floreantpos.POSConstants.OK);
    panel2.add(buttonOK);
    buttonCancel = new PosButton();
    buttonCancel.setIcon(IconFactory.getIcon("/ui_icons/", "cancel.png")); //$NON-NLS-1$ //$NON-NLS-2$
    buttonCancel.setPreferredSize(new Dimension(120, 50));
    buttonCancel.setText(com.floreantpos.POSConstants.CANCEL);
    panel2.add(buttonCancel);
    final JPanel panel3 = new JPanel();
    panel3.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
    contentPane.add(panel3,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null,
                    new Dimension(458, 310), null, 0, false));
    final JScrollPane scrollPane1 = new JScrollPane();
    panel3.add(scrollPane1,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null,
                    null, 0, false));
    tableDiscounts = new JTable();
    scrollPane1.setViewportView(tableDiscounts);
    final JPanel panel4 = new JPanel();
    panel4.setLayout(new FormLayout("fill:p:grow", "center:d:grow,top:4dlu:noGrow,center:d:grow")); //$NON-NLS-1$ //$NON-NLS-2$
    panel3.add(panel4,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null,
                    null, 0, false));
    btnScrollUp = new PosButton();
    btnScrollUp.setIcon(IconFactory.getIcon("/ui_icons/", "up.png")); //$NON-NLS-1$ //$NON-NLS-2$
    btnScrollUp.setPreferredSize(new Dimension(50, 50));
    btnScrollUp.setText(""); //$NON-NLS-1$
    CellConstraints cc = new CellConstraints();
    panel4.add(btnScrollUp, cc.xy(1, 1, CellConstraints.CENTER, CellConstraints.BOTTOM));
    btnScrollDown = new PosButton();
    btnScrollDown.setIcon(IconFactory.getIcon("/ui_icons/", "down.png")); //$NON-NLS-1$ //$NON-NLS-2$
    btnScrollDown.setPreferredSize(new Dimension(50, 50));
    btnScrollDown.setText(""); //$NON-NLS-1$
    panel4.add(btnScrollDown, cc.xy(1, 3, CellConstraints.CENTER, CellConstraints.TOP));
}

From source file:com.pianobakery.complsa.MainGui.java

/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL/*ww  w. j  a  v  a  2  s  .c om*/
 */
private void $$$setupUI$$$() {
    createUIComponents();
    mainPanel = new JPanel();
    mainPanel.setLayout(new FormLayout("fill:max(m;620px):grow", "center:max(m;600px):grow"));
    tabbedPane1 = new JTabbedPane();
    tabbedPane1.setEnabled(true);
    CellConstraints cc = new CellConstraints();
    mainPanel.add(tabbedPane1, cc.xy(1, 1, CellConstraints.DEFAULT, CellConstraints.FILL));
    setupPanel = new JPanel();
    setupPanel.setLayout(new FormLayout(
            "fill:d:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:126px:noGrow,fill:max(d;4px):noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:5dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:52px:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:grow,fill:d:grow,fill:d:grow,fill:66px:noGrow",
            "center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu: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"));
    tabbedPane1.addTab("Project", setupPanel);
    newFolderButton = new JButton();
    newFolderButton.setText("New Folder");
    setupPanel.add(newFolderButton, cc.xy(1, 5));
    final JLabel label1 = new JLabel();
    label1.setText("Project Folder:");
    setupPanel.add(label1, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));
    selectFolderButton = new JButton();
    selectFolderButton.setText("Select Folder");
    setupPanel.add(selectFolderButton, cc.xy(5, 5));
    wDirText = new JTextField();
    wDirText.setEditable(false);
    wDirText.setText("Create or select Project Folder");
    setupPanel.add(wDirText, cc.xyw(7, 5, 48, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JLabel label2 = new JLabel();
    label2.setText("The Project Folder contains all the Project Data.");
    setupPanel.add(label2, cc.xyw(1, 3, 54));
    final JLabel label3 = new JLabel();
    label3.setText("Arrange your Documents in a Folder. Then add it to the Software.");
    setupPanel.add(label3, cc.xyw(1, 15, 54));
    downloadModelButton = new JButton();
    downloadModelButton.setText("Download Models");
    setupPanel.add(downloadModelButton, cc.xy(1, 9));
    final JLabel label4 = new JLabel();
    label4.setText("Language Models:");
    setupPanel.add(label4, cc.xy(5, 9));
    langModelsText = new JLabel();
    langModelsText.setText("");
    setupPanel.add(langModelsText, cc.xyw(7, 9, 48));
    trainCorpButton = new JButton();
    trainCorpButton.setText("Train Semantics");
    setupPanel.add(trainCorpButton, cc.xy(1, 33, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JLabel label5 = new JLabel();
    label5.setText("Create Semantic Knowledge with selected Training Corpus:");
    setupPanel.add(label5, cc.xyw(1, 25, 7));
    addTopicCorpusButton = new JButton();
    addTopicCorpusButton.setEnabled(true);
    addTopicCorpusButton.setText(" Add Corpus Folder");
    setupPanel.add(addTopicCorpusButton, cc.xy(1, 19));
    addCorpRecursiveCheckBox = new JCheckBox();
    addCorpRecursiveCheckBox.setSelected(true);
    addCorpRecursiveCheckBox.setText("Recursive");
    setupPanel.add(addCorpRecursiveCheckBox, cc.xy(5, 19));
    createChunksCheckBox = new JCheckBox();
    createChunksCheckBox.setSelected(true);
    createChunksCheckBox.setText("Split in Paragraph of:");
    setupPanel.add(createChunksCheckBox, cc.xy(7, 19));
    final JLabel label6 = new JLabel();
    label6.setText("Add/Remove Training Corpus:");
    setupPanel.add(label6, cc.xyw(1, 17, 5));
    final JLabel label7 = new JLabel();
    label7.setText("Select Training Corpus:");
    setupPanel.add(label7, cc.xyw(1, 21, 54));
    selectTrainCorp = new JComboBox();
    selectTrainCorp.setEnabled(true);
    setupPanel.add(selectTrainCorp, cc.xyw(1, 23, 5));
    removeTopicCorpusButton = new JButton();
    removeTopicCorpusButton.setEnabled(true);
    removeTopicCorpusButton.setHorizontalAlignment(2);
    removeTopicCorpusButton.setText("Remove Training Corpus");
    setupPanel.add(removeTopicCorpusButton, cc.xy(7, 23));
    setupPanel.add(indexTypeComboBox, cc.xy(7, 33));
    amountOfSentencesPerTextField = new JTextField();
    amountOfSentencesPerTextField.setHorizontalAlignment(2);
    amountOfSentencesPerTextField.setText("20");
    setupPanel.add(amountOfSentencesPerTextField,
            cc.xyw(9, 19, 6, CellConstraints.FILL, CellConstraints.DEFAULT));
    posIndRadiusTextField = new JTextField();
    posIndRadiusTextField.setHorizontalAlignment(2);
    posIndRadiusTextField.setText("20");
    setupPanel.add(posIndRadiusTextField, cc.xyw(9, 33, 6, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JLabel label8 = new JLabel();
    label8.setText("Indextype:");
    setupPanel.add(label8, cc.xy(5, 33, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    final JLabel label9 = new JLabel();
    label9.setHorizontalAlignment(2);
    label9.setText("Sentences");
    setupPanel.add(label9, cc.xy(15, 19));
    final JLabel label10 = new JLabel();
    label10.setHorizontalAlignment(2);
    label10.setText("Words");
    setupPanel.add(label10, cc.xy(15, 33));
    setupPanel.add(termComboBox, cc.xyw(31, 33, 19));
    final JLabel label11 = new JLabel();
    label11.setText("Termweight:");
    setupPanel.add(label11, cc.xyw(18, 33, 13));
    updateIndexButton = new JButton();
    updateIndexButton.setText("Update Index");
    setupPanel.add(updateIndexButton, cc.xy(1, 29));
    removeIndexButton = new JButton();
    removeIndexButton.setText("Remove Index");
    setupPanel.add(removeIndexButton, cc.xy(5, 29));
    final JLabel label12 = new JLabel();
    label12.setText("Add/Remove Search Corpus:");
    setupPanel.add(label12, cc.xyw(1, 41, 5));
    impSearchCorpButton = new JButton();
    impSearchCorpButton.setText("Add Search Corpus");
    setupPanel.add(impSearchCorpButton, cc.xy(1, 43));
    impSearchCorpRecursiveCheckBox = new JCheckBox();
    impSearchCorpRecursiveCheckBox.setSelected(true);
    impSearchCorpRecursiveCheckBox.setText("Recursive");
    setupPanel.add(impSearchCorpRecursiveCheckBox, cc.xy(5, 43));
    splitSearchCorpCheckBox = new JCheckBox();
    splitSearchCorpCheckBox.setSelected(true);
    splitSearchCorpCheckBox.setText("Split in Paragraph of:");
    setupPanel.add(splitSearchCorpCheckBox, cc.xy(7, 43));
    amountSearchCorpSent = new JTextField();
    amountSearchCorpSent.setHorizontalAlignment(2);
    amountSearchCorpSent.setText("20");
    setupPanel.add(amountSearchCorpSent, cc.xyw(9, 43, 6, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JLabel label13 = new JLabel();
    label13.setHorizontalAlignment(2);
    label13.setText("Sentences");
    setupPanel.add(label13, cc.xy(15, 43));
    searchCorpComboBox = new JComboBox();
    setupPanel.add(searchCorpComboBox, cc.xyw(1, 47, 5, CellConstraints.DEFAULT, CellConstraints.TOP));
    removeSearchCorpButton = new JButton();
    removeSearchCorpButton.setText("Remove Search Corpus");
    setupPanel.add(removeSearchCorpButton, cc.xy(7, 47));
    final JLabel label14 = new JLabel();
    label14.setText("Select Search Corpus:");
    setupPanel.add(label14, cc.xyw(1, 45, 5));
    final JLabel label15 = new JLabel();
    label15.setText("Arrange your Search Corpus in a Folder. Then add it to the Software. ");
    setupPanel.add(label15, cc.xyw(1, 39, 54));
    final JLabel label16 = new JLabel();
    label16.setText("First update the Index.");
    setupPanel.add(label16, cc.xyw(1, 27, 5));
    final JLabel label17 = new JLabel();
    label17.setText(
            "Then select an Algorithm and train the Software. On the Search Tab you can select the Algorithms to run your semantic searches.");
    setupPanel.add(label17, cc.xyw(1, 31, 54));
    final JLabel label18 = new JLabel();
    label18.setText("Download Language Models:");
    setupPanel.add(label18, cc.xyw(1, 7, 54));
    final JLabel label19 = new JLabel();
    label19.setText("Training Corpora:");
    setupPanel.add(label19, cc.xyw(1, 13, 54));
    final JLabel label20 = new JLabel();
    label20.setText("Search Corpora:");
    setupPanel.add(label20, cc.xyw(1, 37, 54));
    final JLabel label21 = new JLabel();
    label21.setEnabled(true);
    label21.setText(" ");
    setupPanel.add(label21, cc.xy(1, 11));
    final JLabel label22 = new JLabel();
    label22.setText(" ");
    setupPanel.add(label22, cc.xy(1, 35));
    searchDocs = new JPanel();
    searchDocs.setLayout(new FormLayout(
            "left:4dlu:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:277px:noGrow,left:4dlu:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(m;400px):grow,left:4dlu:noGrow,fill:max(m;200px):grow",
            "center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,top:3dlu: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:243px:grow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu: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:38px:noGrow,top:3dlu:noGrow"));
    searchDocs.setEnabled(true);
    tabbedPane1.addTab("Search", searchDocs);
    final JLabel label23 = new JLabel();
    label23.setText("Choose Semantic Knowledge Algorithm:");
    searchDocs.add(label23, cc.xyw(3, 1, 5));
    final JLabel label24 = new JLabel();
    label24.setText("Enter Search Text or select Search Document:");
    searchDocs.add(label24, cc.xyw(3, 20, 5));
    final JLabel label25 = new JLabel();
    label25.setText("Document Search Results:");
    searchDocs.add(label25, cc.xyw(10, 1, 3));
    final JLabel label26 = new JLabel();
    label26.setText("Selection Metadata:");
    searchDocs.add(label26, cc.xyw(10, 27, 3));
    selectIndexTypeComboBox = new JComboBox();
    searchDocs.add(selectIndexTypeComboBox, cc.xyw(7, 10, 3));
    final JLabel label27 = new JLabel();
    label27.setText("Index Type:");
    searchDocs.add(label27, cc.xy(7, 8));
    final JLabel label28 = new JLabel();
    label28.setText("Termweight:");
    searchDocs.add(label28, cc.xy(7, 12));
    selectTermweightComboBox = new JComboBox();
    searchDocs.add(selectTermweightComboBox, cc.xy(7, 14));
    final JLabel label29 = new JLabel();
    label29.setText("Number of search results:");
    searchDocs.add(label29, cc.xy(7, 16));
    noOfSearchResultsText = new JTextField();
    noOfSearchResultsText.setText("20");
    searchDocs.add(noOfSearchResultsText, cc.xy(7, 18, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JScrollPane scrollPane1 = new JScrollPane();
    searchDocs.add(scrollPane1, cc.xywh(7, 22, 1, 2, CellConstraints.FILL, CellConstraints.FILL));
    searchTextArea = new JTextArea();
    searchTextArea.setLineWrap(true);
    searchTextArea.setText("");
    searchTextArea.setWrapStyleWord(true);
    scrollPane1.setViewportView(searchTextArea);
    selTextRadioButton = new JRadioButton();
    selTextRadioButton.setSelected(true);
    selTextRadioButton.setText("");
    searchDocs.add(selTextRadioButton, cc.xy(5, 22));
    algTextField = new JLabel();
    algTextField.setText("Knowledge Corpus: null");
    searchDocs.add(algTextField, cc.xy(7, 3, CellConstraints.DEFAULT, CellConstraints.FILL));
    selectDocumentButton = new JButton();
    selectDocumentButton.setEnabled(false);
    selectDocumentButton.setText("Select Document");
    searchDocs.add(selectDocumentButton, cc.xy(7, 25));
    selDocRadioButton = new JRadioButton();
    selDocRadioButton.setText("");
    searchDocs.add(selDocRadioButton, cc.xy(5, 25));
    final JLabel label30 = new JLabel();
    label30.setText("Select Corpus to Search:");
    searchDocs.add(label30, cc.xyw(3, 30, 5));
    searchTopCorpRadioButton = new JRadioButton();
    searchTopCorpRadioButton.setSelected(true);
    searchTopCorpRadioButton.setText("Topic Corpus");
    searchDocs.add(searchTopCorpRadioButton, cc.xy(7, 32, CellConstraints.DEFAULT, CellConstraints.TOP));
    searchSearchCorpRadioButton = new JRadioButton();
    searchSearchCorpRadioButton.setSelected(false);
    searchSearchCorpRadioButton.setText("Search Corpus");
    searchDocs.add(searchSearchCorpRadioButton, cc.xy(7, 34, CellConstraints.DEFAULT, CellConstraints.TOP));
    searchButton = new JButton();
    searchButton.setText("Search");
    searchDocs.add(searchButton, cc.xy(7, 36));
    final JScrollPane scrollPane2 = new JScrollPane();
    searchDocs.add(scrollPane2, cc.xywh(10, 30, 3, 7, CellConstraints.FILL, CellConstraints.FILL));
    metadataTextField = new JTextArea();
    metadataTextField.setEditable(false);
    scrollPane2.setViewportView(metadataTextField);
    termTablePane = new JScrollPane();
    termTablePane.setEnabled(true);
    termTablePane.setVerticalScrollBarPolicy(22);
    searchDocs.add(termTablePane, cc.xywh(14, 3, 1, 21, CellConstraints.FILL, CellConstraints.FILL));
    termSearchResTable.setAutoCreateRowSorter(true);
    termSearchResTable.setAutoResizeMode(2);
    termSearchResTable.setFillsViewportHeight(false);
    termSearchResTable.setForeground(new Color(-16777216));
    termTablePane.setViewportView(termSearchResTable);
    docTablePane = new JScrollPane();
    docTablePane.setVerticalScrollBarPolicy(22);
    searchDocs.add(docTablePane, cc.xywh(10, 3, 3, 21, CellConstraints.FILL, CellConstraints.FILL));
    docSearchResTable.setAutoCreateRowSorter(true);
    docTablePane.setViewportView(docSearchResTable);
    final JLabel label31 = new JLabel();
    label31.setText("Term Search Result:");
    searchDocs.add(label31, cc.xy(14, 1));
    searchDocValue = new JLabel();
    searchDocValue.setText("nothing selected");
    searchDocs.add(searchDocValue, cc.xyw(12, 25, 3, CellConstraints.LEFT, CellConstraints.DEFAULT));
    openSearchDocumentButton = new JButton();
    openSearchDocumentButton.setEnabled(false);
    openSearchDocumentButton.setText("Open Search Document");
    searchDocs.add(openSearchDocumentButton, cc.xy(10, 25, CellConstraints.LEFT, CellConstraints.DEFAULT));
}

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

License:Open Source License

/**
 * Creates basic tab component.//  w  ww  .  jav  a 2s .c o  m
 *
 * @return basic tab.
 */
private Component createBasicTab() {
    JScrollPane spDescription = new JScrollPane(taDescription);

    BBFormBuilder builder = new BBFormBuilder("pref, 4dlu, 0:grow, 2dlu, p");
    builder.setDefaultDialogBorder();

    builder.append(Strings.message("show.feed.properties.tab.basic.title"), tfTitle, 3);
    builder.appendRelatedComponentsGapRow(2);
    builder.appendRow("50dlu");
    JLabel label = builder.append(Strings.message("show.feed.properties.tab.basic.description"), 1,
            CellConstraints.FILL, CellConstraints.TOP);
    label.setLabelFor(taDescription);
    builder.append(spDescription, 3, CellConstraints.FILL, CellConstraints.FILL);
    builder.append(Strings.message("show.feed.properties.tab.basic.author"), tfAuthor);
    builder.append(btnSendEmail);
    builder.append(Strings.message("show.feed.properties.tab.basic.siteurl"), tfSiteUrl, 3);
    builder.append(Strings.message("show.feed.properties.tab.basic.xmlurl"), tfXmlUrl, 3);
    builder.append(Strings.message("show.feed.properties.tab.basic.language"),
            new JLabel(convertLang2String(feed.getLanguage())), 3);
    builder.appendUnrelatedComponentsGapRow(2);
    builder.append(ButtonBarFactory.buildCenteredBar(createRevertButton()), 5);
    builder.appendRow("14dlu:grow");

    return builder.getPanel();
}