Example usage for com.jgoodies.forms.builder PanelBuilder addSeparator

List of usage examples for com.jgoodies.forms.builder PanelBuilder addSeparator

Introduction

In this page you can find the example usage for com.jgoodies.forms.builder PanelBuilder addSeparator.

Prototype

public final JComponent addSeparator(String textWithMnemonic, int columnSpan) 

Source Link

Document

Adds a titled separator to the form that spans the specified columns.

 addSeparator("Name",       3); // No Mnemonic addSeparator("N&ame",      3); // Mnemonic is 'a' addSeparator("Save &as",   3); // Mnemonic is the second 'a' addSeparator("Look&&Feel", 3); // No mnemonic, text is "look&feel" 

Usage

From source file:ambit2.dbui.dictionary.DictionaryQueryPanel.java

License:Open Source License

public JComponent buildPanel() {
    initRows();/*from  w  w w.  java 2s  .co m*/
    FormLayout layout = new FormLayout("331dlu", "pref,48dlu,pref:grow");
    PanelBuilder panel = new PanelBuilder(layout);
    panel.setDefaultDialogBorder();

    CellConstraints cc = new CellConstraints();
    JComponent c = null;

    c = createNavigator(panel.getPanel(), path);
    // c.setBackground(panel.getPanel().getBackground());
    // c.setBorder(BorderFactory.createRaisedBevelBorder());
    panel.addSeparator("Filter by templates", cc.xywh(1, 1, 1, 1));
    panel.add(c, cc.xywh(1, 2, 1, 1));
    panel.add(createValueComponent(), cc.xywh(1, 3, 1, 1));
    return panel.getPanel();
}

From source file:ambit2.dbui.QueryDatasetEditor.java

License:Open Source License

public JComponent buildPanel() {
    datasets = new AmbitRows<SourceDataset>();
    FormLayout layout = new FormLayout("75dlu,3dlu,125dlu,3dlu,125dlu", "pref,pref");
    PanelBuilder panel = new PanelBuilder(layout);
    panel.setDefaultDialogBorder();//from ww  w . j a  va 2 s . c om

    CellConstraints cc = new CellConstraints();

    panel.addSeparator("Dataset name", cc.xywh(1, 1, 5, 1));

    JComponent c = createConditionComponent();
    if (c != null)
        panel.add(c, cc.xywh(1, 2, 1, 1));
    c = createValueComponent();
    if (c != null)
        panel.add(c, cc.xywh(3, 2, 3, 1));
    return panel.getPanel();
}

From source file:ambit2.dbui.QueryEditor.java

License:Open Source License

public JComponent buildPanel() {

    FormLayout layout = new FormLayout("125dlu,3dlu,75dlu,3dlu,125dlu", "pref,pref");
    PanelBuilder panel = new PanelBuilder(layout);
    panel.setDefaultDialogBorder();//from   w w  w . j a  va2s . com

    CellConstraints cc = new CellConstraints();

    panel.addSeparator("Field name", cc.xywh(1, 1, 1, 1));
    panel.addSeparator("Condition", cc.xywh(3, 1, 1, 1));
    panel.addSeparator("Value", cc.xywh(5, 1, 1, 1));

    JComponent c = createFieldnameComponent();
    if (c != null)
        panel.add(c, cc.xywh(1, 2, 1, 1));
    c = createConditionComponent();
    if (c != null)
        panel.add(c, cc.xywh(3, 2, 1, 1));
    c = createValueComponent();
    if (c != null)
        panel.add(c, cc.xywh(5, 2, 1, 1));
    return panel.getPanel();
}

From source file:ambit2.dbui.QueryFieldNumericEditor.java

License:Open Source License

public JComponent buildPanel() {
    properties = new AmbitRows<Property>();
    stats = new AmbitRows<PropertyStats>();
    FormLayout layout = new FormLayout("125dlu,3dlu,75dlu,3dlu,61dlu,3dlu,61dlu", "pref,pref,pref,pref");
    PanelBuilder panel = new PanelBuilder(layout);
    panel.setDefaultDialogBorder();//from  w  w w .j  a va2s.  c  om

    CellConstraints cc = new CellConstraints();

    panel.addSeparator("Field name", cc.xywh(1, 1, 1, 1));
    panel.addSeparator("Condition", cc.xywh(3, 1, 1, 1));
    panel.addSeparator("Value", cc.xywh(5, 1, 3, 1));

    panel.add(createFieldnameComponent(), cc.xywh(1, 2, 1, 1));
    panel.add(createConditionComponent(), cc.xywh(3, 2, 1, 1));
    panel.add(createValueComponent(), cc.xywh(5, 2, 1, 1));
    JComponent mv = createMaxValueComponent();
    panel.add(mv, cc.xywh(7, 2, 1, 1));

    panel.add(createStatsButton(), cc.xywh(1, 4, 1, 1));
    JComponent[] s = createStatsFields();
    for (JComponent c : s)
        c.setBackground(panel.getPanel().getBackground());

    //panel.add(createStatsCheckBox(), cc.xywh(1,3,1,1));
    panel.addSeparator("Average", cc.xywh(3, 3, 1, 1));
    panel.addSeparator("Min", cc.xywh(5, 3, 1, 1));
    panel.addSeparator("Max", cc.xywh(7, 3, 1, 1));
    panel.add(s[0], cc.xywh(3, 4, 1, 1));
    panel.add(s[1], cc.xywh(5, 4, 1, 1));
    panel.add(s[2], cc.xywh(7, 4, 1, 1));
    return panel.getPanel();
}

From source file:ambit2.dbui.QueryFunctionalGroupsEditor.java

License:Open Source License

public JComponent buildPanel() {

    FormLayout layout = new FormLayout("125dlu,3dlu,75dlu,3dlu,125dlu", "pref,pref");
    PanelBuilder panel = new PanelBuilder(layout);
    panel.setDefaultDialogBorder();//from  w w  w. ja v a 2s. c  o  m

    CellConstraints cc = new CellConstraints();

    panel.addSeparator("Functional groups", cc.xywh(1, 1, 5, 1));

    JComponent c = createFieldnameComponent();
    panel.add(c, cc.xywh(1, 2, 5, 1));
    return panel.getPanel();
}

From source file:ambit2.dbui.QueryStoredResultsEditor.java

License:Open Source License

@Override
public JComponent buildPanel() {
    queries = new AmbitRows<IStoredQuery>();
    searchStoredQuery = new SearchStoredQueries();
    searchStoredQuery.setCondition(/*from  ww  w.j  av  a 2s.  c  o m*/
            StringCondition.getInstance(StringCondition.STRING_CONDITION.S_STARTS_WITH.getName()));

    FormLayout layout = new FormLayout("125dlu,3dlu,75dlu,3dlu,125dlu", "pref,pref");
    PanelBuilder panel = new PanelBuilder(layout);
    panel.setDefaultDialogBorder();

    CellConstraints cc = new CellConstraints();

    panel.addSeparator("Query name [number of structures]", cc.xywh(1, 1, 5, 1));

    JComponent c = createFieldnameComponent();
    if (c != null)
        panel.add(c, cc.xywh(1, 2, 5, 1));
    return panel.getPanel();
}

From source file:ambit2.ui.editors.BeanEditor.java

License:Open Source License

public void buildFields(PanelBuilder builder, CellConstraints cc) {

    builder.addLabel(detailsCaption, cc.xyw(1, 1, 3));
    int row = 3;/*from w w w .  j  a  v a  2s . c  o m*/
    for (int i = 0; i < columns.length; i++) {
        if (null == columns[i]) {
            builder.addSeparator(captions[i], cc.xyw(1, row, 3));
            row++;
        } else {
            builder.addLabel(capitalizeFirstLetter(captions[i]), cc.xy(1, row));
            builder.add(fields[i], cc.xy(3, row));
            row += 2;
        }
    }
}

From source file:at.lame.hellonzb.preferences.tabs.PrefDownloadTab.java

License:Open Source License

private void createPanel() {
    String sepString = null;//from www.  j  av a 2s  . co m
    CompContainer compc = new CompContainer(null, null);

    par2CmdLineAppButton = new JButton(localer.getBundleText("DownloadSettingsPar2ChooseButton"));
    par2CmdLineAppButton.setName("DownloadSettingsPar2ExeLocation-Button");
    unrarCmdLineAppButton = new JButton(localer.getBundleText("DownloadSettingsPar2ChooseButton"));
    unrarCmdLineAppButton.setName("DownloadSettingsUnrarExeLocation-Button");

    // create layout for this tab/panel
    FormLayout layout = new FormLayout("right:pref, 3dlu, [100dlu,pref]:grow, 3dlu, pref", // cols
            "p, 3dlu, p, 9dlu, p, 3dlu, p, 3dlu, p, 9dlu, p, 3dlu, p, 3dlu, p"); // rows

    // create builder
    PanelBuilder builder = new PanelBuilder(layout, panel);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();

    // fill the grid with components

    //////////////////////////////////////////////////////////////////////
    // group "connection"
    sepString = localer.getBundleText("DownloadSettingsGroupConnection");
    builder.addSeparator(sepString, cc.xyw(1, 1, 5));

    // max connection speed
    createTextfield(compc, "DownloadSettingsMaxConnectionSpeed", "NumericTextField");
    compc.label.setText(compc.label.getText() + " (KB/s)");
    builder.add(compc.label, cc.xy(1, 3));
    builder.add(compc.comp, cc.xy(3, 3));

    //////////////////////////////////////////////////////////////////////
    // group "par2 check"
    sepString = localer.getBundleText("DownloadSettingsGroupPar2Check");
    builder.addSeparator(sepString, cc.xyw(1, 5, 5));

    // par2 check after download
    createCheckbox(compc, "DownloadSettingsPar2Check", false);
    par2ExtractCheckbox = (JCheckBox) compc.comp;
    builder.add(compc.label, cc.xy(1, 7));
    builder.add(compc.comp, cc.xy(3, 7));

    // path to par2 command line tool
    createTextfield(compc, "DownloadSettingsPar2ExeLocation", "JTextField");
    par2LocationTextField = (JTextField) compc.comp;
    builder.add(compc.label, cc.xy(1, 9));
    builder.add(compc.comp, cc.xy(3, 9));
    builder.add(par2CmdLineAppButton, cc.xy(5, 9));

    if (!par2ExtractCheckbox.isSelected()) {
        par2LocationTextField.setEnabled(false);
        par2CmdLineAppButton.setEnabled(false);
    }

    //////////////////////////////////////////////////////////////////////
    // group "RAR archives"
    sepString = localer.getBundleText("DownloadSettingsGroupArcExtract");
    builder.addSeparator(sepString, cc.xyw(1, 11, 5));

    // automatically extract (RAR) archive files
    createCheckbox(compc, "DownloadSettingsExtractRARArchives", false);
    rarExtractCheckbox = (JCheckBox) compc.comp;
    builder.add(compc.label, cc.xy(1, 13));
    builder.add(compc.comp, cc.xy(3, 13));

    // path to unrar command line tool
    createTextfield(compc, "DownloadSettingsUnrarExeLocation", "JTextField");
    unrarLocationTextField = (JTextField) compc.comp;
    builder.add(compc.label, cc.xy(1, 15));
    builder.add(compc.comp, cc.xy(3, 15));
    builder.add(unrarCmdLineAppButton, cc.xy(5, 15));

    if (!rarExtractCheckbox.isSelected()) {
        unrarLocationTextField.setEnabled(false);
        unrarCmdLineAppButton.setEnabled(false);
    }
}

From source file:at.lame.hellonzb.preferences.tabs.PrefExtendedTab.java

License:Open Source License

private void createPanel() {
    CompContainer compc = new CompContainer(null, null);
    String sepString = null;/*from  w  w w  .j  av  a2 s  . c o m*/

    // create layout for this tab/panel
    FormLayout layout = new FormLayout("right:pref, 3dlu, pref:grow", // cols
            "p, 3dlu, p, 9dlu, p, 3dlu, p, 9dlu, p, 9dlu, p"); // rows

    // create builder
    PanelBuilder builder = new PanelBuilder(layout, panel);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();

    // fill the grid with components

    //////////////////////////////////////////////////////////////////////
    // group "locale settings"
    sepString = localer.getBundleText("ExtendedSettingsGroupLocaleSettings");
    builder.addSeparator(sepString, cc.xyw(1, 1, 3));

    // choose language
    String[] boxvalues = new String[] { "-default-", "English", "German", "Dutch", "Turkish" };
    createCombobox(compc, "ExtendedSettingsChooseLanguage", boxvalues, 0);
    builder.add(compc.label, cc.xy(1, 3));
    builder.add(compc.comp, cc.xy(3, 3));

    //////////////////////////////////////////////////////////////////////
    // group "console output"
    sepString = localer.getBundleText("ExtendedSettingsGroupConsole");
    builder.addSeparator(sepString, cc.xyw(1, 5, 3));

    // activate console output 
    createCheckbox(compc, "ExtendedSettingsConsoleOutput", true);
    builder.add(compc.label, cc.xy(1, 7));
    builder.add(compc.comp, cc.xy(3, 7));

    //////////////////////////////////////////////////////////////////////
    // group "program settings"
    sepString = localer.getBundleText("GeneralSettingsGroupProgramSettings");
    builder.addSeparator(sepString, cc.xyw(1, 9, 3));

    // reset all hidden messages
    resetAllMsg = new JButton(localer.getBundleText("ExtendedSettingsResetMessages"));
    builder.add(resetAllMsg, cc.xyw(1, 11, 3));
}

From source file:at.lame.hellonzb.preferences.tabs.PrefGeneralTab.java

License:Open Source License

private void createPanel() {
    String sepString = null;/*from w w  w  . j  av  a2  s  .c  o  m*/
    CompContainer compc = new CompContainer(null, null);
    downloadDirChooseButton = new JButton(localer.getBundleText("GeneralSettingsChooseDownloadDir"));
    downloadDirChooseButton.setName("GeneralSettingsChooseDownloadDir-Button");
    autoLoadDirChooseButton = new JButton(localer.getBundleText("GeneralSettingsChooseAutoLoadDir"));
    autoLoadDirChooseButton.setName("GeneralSettingsChooseAutoLoadDir-Button");

    // create layout for this tab/panel
    FormLayout layout = new FormLayout("right:pref, 3dlu, [200dlu,pref]:grow, 3dlu, pref", // cols
            "p, 3dlu, p, 3dlu, p, 9dlu, p, 3dlu, p, 9dlu, p, 3dlu, p, 3dlu, p"); // rows

    // create builder
    PanelBuilder builder = new PanelBuilder(layout, panel);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();

    // fill the grid with components

    //////////////////////////////////////////////////////////////////////
    // group "general settings"
    sepString = localer.getBundleText("GeneralSettingsGroupGeneralSettings");
    builder.addSeparator(sepString, cc.xyw(1, 1, 5));

    // download directory
    createTextfield(compc, "GeneralSettingsDownloadDir", "JTextField");
    builder.add(compc.label, cc.xy(1, 3));
    builder.add(compc.comp, cc.xy(3, 3));
    builder.add(downloadDirChooseButton, cc.xy(5, 3));

    // auto-load directory
    createTextfield(compc, "GeneralSettingsAutoLoadDir", "JTextField");
    builder.add(compc.label, cc.xy(1, 5));
    builder.add(compc.comp, cc.xy(3, 5));
    builder.add(autoLoadDirChooseButton, cc.xy(5, 5));

    //////////////////////////////////////////////////////////////////////
    // group "nzb file loading"
    sepString = localer.getBundleText("GeneralSettingsGroupNzbLoadBehaviour");
    builder.addSeparator(sepString, cc.xyw(1, 7, 5));

    // delete nzb file after loading
    createCheckbox(compc, "GeneralSettingsDelNzbAfterLoading", true);
    builder.add(compc.label, cc.xy(1, 9));
    builder.add(compc.comp, cc.xy(3, 9));

    //////////////////////////////////////////////////////////////////////
    // group "program settings"
    sepString = localer.getBundleText("GeneralSettingsGroupProgramSettings");
    builder.addSeparator(sepString, cc.xyw(1, 11, 5));

    // show system tray icon
    createCheckbox(compc, "GeneralSettingsShowTrayIcon", false);
    builder.add(compc.label, cc.xy(1, 13));
    builder.add(compc.comp, cc.xy(3, 13));

    // check for new progarm version
    createCheckbox(compc, "GeneralSettingsCheckForUpdates", true);
    builder.add(compc.label, cc.xy(1, 15));
    builder.add(compc.comp, cc.xy(3, 15));
}