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:JPFamiliaGenerico.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Open Source Project license - unknown
    lblCodigo = new JLabel();
    txtCodigo = new JTextField();
    lblNombre = new JLabel();
    txtNombre = new JTextField();
    spTblFamiliaGenerico = new JScrollPane();
    tblFamiliaGenerico = new JTable();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setLayout(new FormLayout(
            new ColumnSpec[] { new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    new ColumnSpec(Sizes.dluX(50)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    new ColumnSpec(Sizes.dluX(150)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    new ColumnSpec(ColumnSpec.FILL, Sizes.dluX(60), FormSpec.DEFAULT_GROW),
                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(10)) },
            new RowSpec[] { new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC,
                    new RowSpec(Sizes.dluY(15)), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(15)),
                    FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC,
                    FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                    new RowSpec(RowSpec.CENTER, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                    FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                    new RowSpec(Sizes.dluY(10)) }));

    //---- lblCodigo ----
    lblCodigo.setText("C\u00f3digo:");
    lblCodigo.setHorizontalAlignment(SwingConstants.RIGHT);
    add(lblCodigo, cc.xywh(3, 3, 1, 1, CellConstraints.RIGHT, CellConstraints.FILL));
    add(txtCodigo, cc.xywh(5, 3, 1, 1, CellConstraints.DEFAULT, CellConstraints.FILL));

    //---- lblNombre ----
    lblNombre.setText("Nombre:");
    lblNombre.setHorizontalAlignment(SwingConstants.RIGHT);
    add(lblNombre, cc.xywh(3, 5, 1, 1, CellConstraints.RIGHT, CellConstraints.FILL));
    add(txtNombre, cc.xywh(5, 5, 3, 1, CellConstraints.DEFAULT, CellConstraints.FILL));

    //======== spTblFamiliaGenerico ========
    {//from   w w w .j ava  2s . co  m

        //---- tblFamiliaGenerico ----
        tblFamiliaGenerico
                .setModel(new DefaultTableModel(new Object[][] {}, new String[] { "C\u00f3digo", "Nombre" }) {
                    boolean[] columnEditable = new boolean[] { false, false };

                    @Override
                    public boolean isCellEditable(int rowIndex, int columnIndex) {
                        return columnEditable[columnIndex];
                    }
                });
        spTblFamiliaGenerico.setViewportView(tblFamiliaGenerico);
    }
    add(spTblFamiliaGenerico, cc.xywh(3, 9, 7, 5));
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:UserPreferencesDialog.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Open Source Project license - unknown
    ResourceBundle bundle = ResourceBundle.getBundle("UserPreferencesDialog");
    JPanel dialogPane = new JPanel();
    JPanel contentPanel = new JPanel();
    toolbar = new JButtonBar();
    panelCard = new JPanel();
    JPanel panelGeneral = new JPanel();
    JPanel panelGeneralSettings = new JPanel();
    checkShowIconInSystemTray = new JCheckBox();
    JPanel panelAlarm = new JPanel();
    JPanel panelWhenAlarmGoesOff = new JPanel();
    JPanel panelAlarmDefaults = new JPanel();
    JPanel panelPlugins = new JPanel();
    JTabbedPane pluginTabbedPane = new JTabbedPane();
    JPanel pluginPanelSettings = new JPanel();
    JScrollPane scrollPane1 = new JScrollPane();
    pluginTable = new JXTable();
    JXButtonPanel pluginsButtonPanel = new JXButtonPanel();
    JLabel labelPluginInfo = new JLabel();
    popmenuButton = ComponentFactory.getPopdownButton();
    btnPluginOptions = new JButton();
    JPanel pluginPanelUpdates = new JPanel();
    check4PluginUpdatesAutomatically = new JCheckBox();
    JLabel labelAfterDetectUpdate = new JLabel();
    comboHowToUpdate = new JComboBox();
    checkDownloadNotExistingPlugins = new JCheckBox();
    JLabel labelCheckForUpdateEvery = new JLabel();
    spinnerUpdateHour = new JSpinner();
    JLabel labelHours = new JLabel();
    JLabel labelUpdateFromServer = new JLabel();
    comboPluginServers = new JComboBox();
    btnResetDefaultPluginServer = new JButton();
    JLabel labelManualCheck = new JLabel();
    buttonBar = new JXButtonPanel();
    btnOK = new JButton();
    btnCancel = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setTitle(bundle.getString("this.title"));
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== dialogPane ========
    {//from www . j  a  v  a2 s  . c o  m
        dialogPane.setLayout(new BorderLayout());

        //======== contentPanel ========
        {
            contentPanel.setLayout(new BorderLayout());

            //======== toolbar ========
            {
                toolbar.setBorder(LineBorder.createBlackLineBorder());
                toolbar.setLayout(null);
            }
            contentPanel.add(toolbar, BorderLayout.NORTH);

            //======== panelCard ========
            {
                panelCard.setLayout(new CardLayout());

                //======== panelGeneral ========
                {
                    panelGeneral.setBorder(Borders.TABBED_DIALOG);

                    //======== panelGeneralSettings ========
                    {
                        panelGeneralSettings.setBorder(
                                new TitledBorder(null, bundle.getString("panelGeneralSettings.border"),
                                        TitledBorder.LEADING, TitledBorder.TOP));

                        //---- checkShowIconInSystemTray ----
                        checkShowIconInSystemTray.setText(bundle.getString("checkShowIconInSystemTray.text"));

                        PanelBuilder panelGeneralSettingsBuilder = new PanelBuilder(new FormLayout(
                                new ColumnSpec[] {
                                        new ColumnSpec(ColumnSpec.LEFT, Sizes.dluX(0), FormSpec.NO_GROW),
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC },
                                RowSpec.decodeSpecs("default")), panelGeneralSettings);

                        panelGeneralSettingsBuilder.add(checkShowIconInSystemTray, cc.xy(3, 1));
                    }

                    PanelBuilder panelGeneralBuilder = new PanelBuilder(
                            new FormLayout(ColumnSpec.decodeSpecs("default:grow"),
                                    new RowSpec[] { new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW),
                                            FormSpecs.RELATED_GAP_ROWSPEC,
                                            new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW) }),
                            panelGeneral);

                    panelGeneralBuilder.add(panelGeneralSettings, cc.xy(1, 1));
                }
                panelCard.add(panelGeneral, "CARD1");

                //======== panelAlarm ========
                {
                    panelAlarm.setBorder(Borders.TABBED_DIALOG);

                    //======== panelWhenAlarmGoesOff ========
                    {
                        panelWhenAlarmGoesOff.setBorder(
                                new TitledBorder(null, bundle.getString("panelWhenAlarmGoesOff.border"),
                                        TitledBorder.LEADING, TitledBorder.TOP));

                        PanelBuilder panelWhenAlarmGoesOffBuilder = new PanelBuilder(
                                new FormLayout(new ColumnSpec[] {
                                        new ColumnSpec(ColumnSpec.LEFT, Sizes.dluX(0), FormSpec.NO_GROW),
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                        new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC },
                                        new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC,
                                                FormSpecs.NARROW_LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                                                FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                                                FormSpecs.DEFAULT_ROWSPEC }),
                                panelWhenAlarmGoesOff);
                        ((FormLayout) panelWhenAlarmGoesOff.getLayout())
                                .setColumnGroups(new int[][] { { 9, 11 } });

                    }

                    //======== panelAlarmDefaults ========
                    {
                        panelAlarmDefaults
                                .setBorder(new TitledBorder(null, bundle.getString("panelAlarmDefaults.border"),
                                        TitledBorder.LEADING, TitledBorder.TOP));

                        PanelBuilder panelAlarmDefaultsBuilder = new PanelBuilder(new FormLayout(
                                new ColumnSpec[] {
                                        new ColumnSpec(ColumnSpec.LEFT, Sizes.dluX(0), FormSpec.NO_GROW),
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                        FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC },
                                new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.NARROW_LINE_GAP_ROWSPEC,
                                        FormSpecs.DEFAULT_ROWSPEC, FormSpecs.NARROW_LINE_GAP_ROWSPEC,
                                        FormSpecs.DEFAULT_ROWSPEC, FormSpecs.NARROW_LINE_GAP_ROWSPEC,
                                        FormSpecs.DEFAULT_ROWSPEC }),
                                panelAlarmDefaults);

                    }

                    PanelBuilder panelAlarmBuilder = new PanelBuilder(new FormLayout(
                            ColumnSpec.decodeSpecs("default:grow"), new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC,
                                    FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }),
                            panelAlarm);

                    panelAlarmBuilder.add(panelWhenAlarmGoesOff, cc.xy(1, 1));
                    panelAlarmBuilder.add(panelAlarmDefaults, cc.xy(1, 3));
                }
                panelCard.add(panelAlarm, "CARD2");

                //======== panelPlugins ========
                {
                    panelPlugins.setBorder(Borders.TABBED_DIALOG);

                    //======== pluginTabbedPane ========
                    {

                        //======== pluginPanelSettings ========
                        {
                            pluginPanelSettings.setBorder(
                                    new CompoundBorder(new EmptyBorder(4, 4, 4, 4), new EtchedBorder()));
                            pluginPanelSettings.setLayout(new BorderLayout());

                            //======== scrollPane1 ========
                            {
                                scrollPane1.setViewportView(pluginTable);
                            }
                            pluginPanelSettings.add(scrollPane1, BorderLayout.CENTER);

                            //======== pluginsButtonPanel ========
                            {
                                pluginsButtonPanel.setBorder(new EmptyBorder(4, 4, 4, 4));

                                //---- labelPluginInfo ----
                                labelPluginInfo.setText(bundle.getString("labelPluginInfo.text"));

                                //---- popmenuButton ----
                                popmenuButton.setText(bundle.getString("popmenuButton.text"));

                                //---- btnPluginOptions ----
                                btnPluginOptions.setText(bundle.getString("btnPluginOptions.text"));

                                PanelBuilder pluginsButtonPanelBuilder = new PanelBuilder(new FormLayout(
                                        new ColumnSpec[] { FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                                new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT,
                                                        FormSpec.DEFAULT_GROW),
                                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                                FormSpecs.DEFAULT_COLSPEC, FormSpecs.UNRELATED_GAP_COLSPEC,
                                                FormSpecs.DEFAULT_COLSPEC,
                                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                                FormSpecs.UNRELATED_GAP_COLSPEC },
                                        RowSpec.decodeSpecs("default")), pluginsButtonPanel);

                                pluginsButtonPanelBuilder.add(labelPluginInfo, cc.xy(3, 1));
                                pluginsButtonPanelBuilder.add(popmenuButton, cc.xy(5, 1));
                                pluginsButtonPanelBuilder.add(btnPluginOptions, cc.xy(7, 1));
                            }
                            pluginPanelSettings.add(pluginsButtonPanel, BorderLayout.SOUTH);
                        }
                        pluginTabbedPane.addTab(bundle.getString("pluginPanelSettings.tab.title"),
                                pluginPanelSettings);

                        //======== pluginPanelUpdates ========
                        {
                            pluginPanelUpdates.setBorder(new CompoundBorder(new EmptyBorder(4, 4, 4, 4),
                                    new TitledBorder(bundle.getString("pluginPanelUpdates.border"))));

                            //---- check4PluginUpdatesAutomatically ----
                            check4PluginUpdatesAutomatically
                                    .setText(bundle.getString("check4PluginUpdatesAutomatically.text"));

                            //---- labelAfterDetectUpdate ----
                            labelAfterDetectUpdate.setText(bundle.getString("labelAfterDetectUpdate.text"));

                            //---- checkDownloadNotExistingPlugins ----
                            checkDownloadNotExistingPlugins
                                    .setText(bundle.getString("checkDownloadNotExistingPlugins.text"));

                            //---- labelCheckForUpdateEvery ----
                            labelCheckForUpdateEvery.setText(bundle.getString("labelCheckForUpdateEvery.text"));

                            //---- labelHours ----
                            labelHours.setText(bundle.getString("labelHours.text"));

                            //---- labelUpdateFromServer ----
                            labelUpdateFromServer.setText(bundle.getString("labelUpdateFromServer.text"));
                            labelUpdateFromServer.setLabelFor(comboPluginServers);

                            //---- comboPluginServers ----
                            comboPluginServers.setEditable(true);

                            //---- btnResetDefaultPluginServer ----
                            btnResetDefaultPluginServer
                                    .setText(bundle.getString("btnResetDefaultPluginServer.text"));

                            //---- labelManualCheck ----
                            labelManualCheck.setText(bundle.getString("labelManualCheck.text"));

                            PanelBuilder pluginPanelUpdatesBuilder = new PanelBuilder(new FormLayout(
                                    new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC,
                                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                            new ColumnSpec(Sizes
                                                    .bounded(Sizes.MINIMUM, Sizes.dluX(30), Sizes.dluX(30))),
                                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                            new ColumnSpec(ColumnSpec.FILL,
                                                    Sizes.bounded(Sizes.DEFAULT, Sizes.dluX(50),
                                                            Sizes.dluX(75)),
                                                    FormSpec.DEFAULT_GROW),
                                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                            FormSpecs.UNRELATED_GAP_COLSPEC },
                                    new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                            FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                            FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                            FormSpecs.DEFAULT_ROWSPEC, FormSpecs.UNRELATED_GAP_ROWSPEC,
                                            FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                            FormSpecs.UNRELATED_GAP_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                            FormSpecs.DEFAULT_ROWSPEC }),
                                    pluginPanelUpdates);

                            pluginPanelUpdatesBuilder.add(check4PluginUpdatesAutomatically,
                                    cc.xywh(1, 1, 5, 1));
                            pluginPanelUpdatesBuilder.add(labelAfterDetectUpdate,
                                    cc.xywh(1, 3, 3, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
                            pluginPanelUpdatesBuilder.add(comboHowToUpdate,
                                    cc.xywh(5, 3, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));
                            pluginPanelUpdatesBuilder.add(checkDownloadNotExistingPlugins, cc.xywh(1, 5, 5, 1));
                            pluginPanelUpdatesBuilder.add(labelCheckForUpdateEvery,
                                    cc.xywh(1, 7, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
                            pluginPanelUpdatesBuilder.add(spinnerUpdateHour, cc.xy(3, 7));
                            pluginPanelUpdatesBuilder.add(labelHours, cc.xy(5, 7));
                            pluginPanelUpdatesBuilder.add(labelUpdateFromServer,
                                    cc.xywh(1, 9, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
                            pluginPanelUpdatesBuilder.add(comboPluginServers, cc.xywh(3, 9, 3, 1));
                            pluginPanelUpdatesBuilder.add(btnResetDefaultPluginServer, cc.xy(7, 9));
                            pluginPanelUpdatesBuilder.add(labelManualCheck, cc.xywh(1, 13, 7, 1));
                        }
                        pluginTabbedPane.addTab(bundle.getString("pluginPanelUpdates.tab.title"),
                                pluginPanelUpdates);

                    }

                    PanelBuilder panelPluginsBuilder = new PanelBuilder(
                            new FormLayout(ColumnSpec.decodeSpecs("default:grow"),
                                    new RowSpec[] {
                                            new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                                            FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("5px") }),
                            panelPlugins);

                    panelPluginsBuilder.add(pluginTabbedPane, cc.xy(1, 1));
                }
                panelCard.add(panelPlugins, "CARD6");
            }
            contentPanel.add(panelCard, BorderLayout.CENTER);
        }
        dialogPane.add(contentPanel, BorderLayout.CENTER);

        //======== buttonBar ========
        {
            buttonBar.setBorder(Borders.BUTTON_BAR_PAD);
            buttonBar.setCyclic(true);

            //---- btnOK ----
            btnOK.setText(bundle.getString("btnOK.text"));

            //---- btnCancel ----
            btnCancel.setText(bundle.getString("btnCancel.text"));

            PanelBuilder buttonBarBuilder = new PanelBuilder(new FormLayout(
                    new ColumnSpec[] { FormSpecs.GLUE_COLSPEC, ColumnSpec.decode("max(pref;42dlu)"),
                            FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.PREF_COLSPEC },
                    RowSpec.decodeSpecs("pref")), buttonBar);
            ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] { { 2, 4 } });

            buttonBarBuilder.add(btnOK, cc.xy(2, 1));
            buttonBarBuilder.add(btnCancel, cc.xy(4, 1));
        }
        dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:ai.aitia.meme.paramsweep.gui.Page_Recorders.java

License:Open Source License

private void layoutGUI() {

    stopPanel = FormsUtils.build("p ~ p:g p:g ~ p", "0011|" + "22__|" + "33__||" + "4556", iterationRadioButton,
            conditionRadioButton, "      (constant or appropriate", "        method or variable)", stopLabel,
            stopField, stopEEButton).getPanel();

    treePanel = FormsUtils.build("p:g ~ p ~ p ~ p ~ p:g", "00000 f:p:g||" + "_123_ p", recorderScr,
            newRecorderButton, editRecorderButton, removeButton).getPanel();

    generalPanel = FormsUtils.build("p ~ p:g ' p", "011||" + "234", " Name: ", nameField, " Output: ",
            outputField, outputBrowseButton).getPanel();

    whenPanel = FormsUtils.build("p ~ p:g ~ p ~ p", "0000|" + "1111|" + "234_|" + "5555|" + "6666|" + "7889|",
            new Separator("Record"), whenIterationButton, whenIterationIntervalButton,
            whenIterationIntervalField, wiiLabel, whenRunRadioButton, whenConditionRadioButton,
            whenConditionLabel, whenConditionField, whenEEButton).getPanel();

    recordableTabbedPane.addTab("Variables", recordableVariableScr);
    recordableTabbedPane.addTab("Methods", recordableMethodScr);
    recordableTabbedPane.addChangeListener(this);

    recordablePanel = FormsUtils.build("p:g ~ p ~ p ~ p",
            "_012 d||" + "3333 p||" + "4445|" + "4446||" + "4447||" + "4448||" + "4449||" + "444A||"
                    + "444_ f:p:g||" + "444B p",
            advancedButton, addRecorderButton, cancelButton, CellConstraints.RIGHT,
            new Separator("Select recording related elements"), recordableTabbedPane, " ", addButton,
            addAsButton, createScriptButton, editScriptButton, removeScriptButton, testScriptButton).getPanel();

    editPanel = FormsUtils.build("p:g", "0||" + "1||" + "2", generalPanel, whenPanel, recordablePanel)
            .getPanel();/*  ww  w.  jav a2 s.  c o m*/

    content = FormsUtils
            .build("~ f:p:g(0.4) f:p:g(0.6) ~", "01|" + "21 f:p:g|", stopPanel, treePanel, editPanel)
            .getPanel();

    this.setLayout(new BorderLayout());
    final JScrollPane sp = new JScrollPane(content);
    this.add(sp, BorderLayout.CENTER);
    this.setPreferredSize(new Dimension(579, 636));

    iterationRadioButton.setName("rbtn_wizard_record_stopiteration");
    conditionRadioButton.setName("rbtn_wizard_record_stopcondition");
    whenIterationButton.setName("rbtn_wizard_record_enditeration");
    whenIterationIntervalButton.setName("rbtn_wizard_record_afteriteration");
    whenRunRadioButton.setName("rbtn_wizard_record_endrun");
    whenConditionRadioButton.setName("rbtn_wizard_record_whencnd");
    stopField.setName("fld_wizard_record_stopfld");
    nameField.setName("fld_wizard_record_namefld");
    outputField.setName("fld_wizard_record_output");
    whenIterationIntervalField.setName("fld_wizard_record_afteriteration");
    whenConditionField.setName("fld_wizard_record_whencnd");
    stopEEButton.setName("btn_wizard_record_stopextended");
    whenEEButton.setName("btn_wizard_record_whenextended");
    outputBrowseButton.setName("btn_wizard_record_browseoutput");
    advancedButton.setName("btn_wizard_record_advanced");
    addRecorderButton.setName("btn_wizard_record_addrecorder");
    cancelButton.setName("btn_wizard_record_cancel");
    recordableTabbedPane.setName("pane_wizard_record_recordables");
    addButton.setName("btn_wizard_record_add");
    addAsButton.setName("btn_wizard_record_addas");
    createScriptButton.setName("btn_wizard_record_create");
    editScriptButton.setName("btn_wizard_record_edit");
    removeScriptButton.setName("btn_wizard_record_remove");
    recordableVariables.setName("lst_wizard_record_varlst");
    recordableMethods.setName("lst_wizard_record_methodlst");
    recordableScripts.setName("lst_wizard_record_datasrclst");
    nonRecordableScripts.setName("lst_wizard_record_misclst");
    recorderTree.setName("tree_wizard_record_recordertree");
    createScriptButton.setName("btn_wizard_record_createscript");
    removeScriptButton.setName("btn_wizard_record_removescript");
    editScriptButton.setName("btn_wizard_record_editscript");
    testScriptButton.setName("btn_wizard_record_testscript");
}

From source file:ai.aitia.meme.paramsweep.intellisweepPlugin.jgap.configurator.BestChromosomeSelectorConfigurator.java

License:Open Source License

@Override
public JPanel getSettingsPanel() {
    originalRateSlider = new JSlider(model);
    originalRateSlider.setMajorTickSpacing(100);
    originalRateSlider.setMinorTickSpacing(10);
    originalRateSlider.setPaintTicks(true);
    originalRateSlider.setPaintLabels(true);
    originalRateValueField = new JTextField("50");
    originalRateValueField.setPreferredSize(new Dimension(40, 30));
    originalRateSlider.addChangeListener(new ChangeListener() {
        @Override/*from   www. j av  a  2 s  .c om*/
        public void stateChanged(ChangeEvent arg0) {
            if (originalRateSlider.hasFocus())
                originalRateValueField.setText(String.valueOf(originalRateSlider.getValue()));
        }
    });
    originalRateValueField.getDocument().addDocumentListener(new DocumentListener() {

        //====================================================================================================
        // members

        private Popup errorPopup;

        //====================================================================================================
        // methods

        //----------------------------------------------------------------------------------------------------
        @Override
        public void removeUpdate(final DocumentEvent event) {
            textFieldChanged();
        }

        //----------------------------------------------------------------------------------------------------
        @Override
        public void insertUpdate(final DocumentEvent event) {
            textFieldChanged();
        }

        //----------------------------------------------------------------------------------------------------
        @Override
        public void changedUpdate(final DocumentEvent event) {
            textFieldChanged();
        }

        //----------------------------------------------------------------------------------------------------
        private void textFieldChanged() {
            if (!originalRateValueField.hasFocus()) {
                return;
            }

            try {
                int value = Integer.parseInt(originalRateValueField.getText());
                originalRateSlider.setValue(value);

                if (errorPopup != null) {
                    errorPopup.hide();
                    errorPopup = null;
                }
            } catch (NumberFormatException ex) {
                PopupFactory popupFactory = PopupFactory.getSharedInstance();
                Point locationOnScreen = originalRateValueField.getLocationOnScreen();
                JLabel message = new JLabel("Please specify an integer number!");
                message.setBorder(new LineBorder(Color.RED, 2, true));
                errorPopup = popupFactory.getPopup(originalRateValueField, message, locationOnScreen.x - 10,
                        locationOnScreen.y - 30);

                errorPopup.show();
            }
        }
    });

    final JButton infoButton = new DefaultJButton();
    infoButton.setIcon(Page_IntelliExtension.DESCRIPTION_ICON);
    infoButton.setBorder(null);
    infoButton.setBorderPainted(false);
    infoButton.setContentAreaFilled(false);
    infoButton.setFocusPainted(false);

    infoButton.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseEntered(final MouseEvent e) {
            final DescriptionPopupFactory popupFactory = DescriptionPopupFactory.getInstance();
            final Popup parameterDescriptionPopup = popupFactory.getPopup(infoButton, getDescription());

            parameterDescriptionPopup.show();
        }

    });

    return FormsUtils.build("p ~ p p p p:g", "01234", new JLabel("Rate of original population to survive"),
            originalRateValueField, new JLabel("%"), originalRateSlider, infoButton, CellConstraints.RIGHT)
            .getPanel();
}

From source file:ai.aitia.meme.paramsweep.intellisweepPlugin.jgap.configurator.CrossoverOperatorConfigurator.java

License:Open Source License

/**
 * {@inheritDoc}//w ww .jav  a2  s. co m
 */
@Override
public JPanel getSettingsPanel() {
    final JButton infoButton = new DefaultJButton();
    infoButton.setIcon(Page_IntelliExtension.DESCRIPTION_ICON);
    infoButton.setBorder(null);
    infoButton.setBorderPainted(false);
    infoButton.setContentAreaFilled(false);
    infoButton.setFocusPainted(false);

    infoButton.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseEntered(final MouseEvent e) {
            final DescriptionPopupFactory popupFactory = DescriptionPopupFactory.getInstance();
            final Popup parameterDescriptionPopup = popupFactory.getPopup(infoButton, getDescription());

            parameterDescriptionPopup.show();
        }

    });

    return FormsUtils.build("p:g", "0", infoButton, CellConstraints.RIGHT).getPanel();
}

From source file:ai.aitia.meme.paramsweep.intellisweepPlugin.jgap.configurator.MutationOperatorConfigurator.java

License:Open Source License

public JPanel getSettingsPanel() {
    mutationRateSpinner = new JSpinner(model);

    final JButton infoButton = new DefaultJButton();
    infoButton.setIcon(Page_IntelliExtension.DESCRIPTION_ICON);
    infoButton.setBorder(null);/*  www . j av a 2 s.  com*/
    infoButton.setBorderPainted(false);
    infoButton.setContentAreaFilled(false);
    infoButton.setFocusPainted(false);

    infoButton.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseEntered(final MouseEvent e) {
            final DescriptionPopupFactory popupFactory = DescriptionPopupFactory.getInstance();
            final Popup parameterDescriptionPopup = popupFactory.getPopup(infoButton, getDescription());

            parameterDescriptionPopup.show();
        }

    });

    return FormsUtils.build("p ~ p p f:p:g", "0123||" + "444_", "Mutation rate", new JLabel("1 / "),
            mutationRateSpinner, infoButton, CellConstraints.RIGHT, "(Zero value disables mutation entirely.)")
            .getPanel();
}

From source file:ai.aitia.meme.paramsweep.intellisweepPlugin.jgap.configurator.TournamentSelectorConfigurator.java

License:Open Source License

/**
 * {@inheritDoc}//from  w ww.ja v  a2  s  .  c o  m
 */
@Override
public JPanel getSettingsPanel() {
    tournamentSizeSpinner = new JSpinner(tournamentSizeModel);

    selectionProbability = new JSlider(selectionProbabilityModel);
    selectionProbability.setMajorTickSpacing(99);
    selectionProbability.setMinorTickSpacing(10);
    selectionProbability.setPaintTicks(true);
    selectionProbability.setPaintLabels(true);
    selectionProbabilityValueField = new JTextField("50");
    selectionProbabilityValueField.setPreferredSize(new Dimension(40, 30));
    selectionProbability.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent arg0) {
            if (selectionProbability.hasFocus())
                selectionProbabilityValueField.setText(String.valueOf(selectionProbability.getValue()));
        }
    });
    selectionProbabilityValueField.getDocument().addDocumentListener(new DocumentListener() {

        //====================================================================================================
        // members

        private Popup errorPopup;

        //====================================================================================================
        // methods

        //----------------------------------------------------------------------------------------------------
        @Override
        public void removeUpdate(final DocumentEvent event) {
            textFieldChanged();
        }

        //----------------------------------------------------------------------------------------------------
        @Override
        public void insertUpdate(final DocumentEvent event) {
            textFieldChanged();
        }

        //----------------------------------------------------------------------------------------------------
        @Override
        public void changedUpdate(DocumentEvent event) {
            textFieldChanged();
        }

        //----------------------------------------------------------------------------------------------------
        private void textFieldChanged() {
            if (!selectionProbabilityValueField.hasFocus()) {
                return;
            }

            try {
                int value = Integer.parseInt(selectionProbabilityValueField.getText());
                selectionProbability.setValue(value);

                if (errorPopup != null) {
                    errorPopup.hide();
                    errorPopup = null;
                }
            } catch (NumberFormatException ex) {
                PopupFactory popupFactory = PopupFactory.getSharedInstance();
                Point locationOnScreen = selectionProbabilityValueField.getLocationOnScreen();
                JLabel message = new JLabel("Please specify an integer number!");
                message.setBorder(new LineBorder(Color.RED, 2, true));
                errorPopup = popupFactory.getPopup(selectionProbabilityValueField, message,
                        locationOnScreen.x - 10, locationOnScreen.y - 30);

                errorPopup.show();
            }
        }
    });

    final JButton infoButton = new DefaultJButton();
    infoButton.setIcon(Page_IntelliExtension.DESCRIPTION_ICON);
    infoButton.setBorder(null);
    infoButton.setBorderPainted(false);
    infoButton.setContentAreaFilled(false);
    infoButton.setFocusPainted(false);

    infoButton.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseEntered(final MouseEvent e) {
            final DescriptionPopupFactory popupFactory = DescriptionPopupFactory.getInstance();
            final Popup parameterDescriptionPopup = popupFactory.getPopup(infoButton, getDescription());

            parameterDescriptionPopup.show();
        }

    });

    return FormsUtils.build("p ~ p p p p:g", "01112 ||" + "3456_", new JLabel("Tournament size"),
            tournamentSizeSpinner, infoButton, CellConstraints.RIGHT, new JLabel("Selection probability "),
            selectionProbabilityValueField, new JLabel("%"), selectionProbability).getPanel();
}

From source file:ai.aitia.meme.utils.FormsUtils.java

License:Open Source License

/**
 * Returns a DefaultFormBuilder containing the specified components and layout.
 * @param cols This parameter corresponds to the <code>encodedColumnSpecs</code> 
 *   parameter of FormLayout's ctor. Besides the encoding defined by FormLayout, 
 *   the following extensions are also available: the characters defined in the 
 *   global <code>{@link #gapLength}</code> variable (hereafter: gap-characters) 
 *   can be used to insert gap-columns. Gap columns must not appear in the 
 *   cell-specification (explained below) and they're automatically included in
 *   column spans. /*from   w  w  w. j  a va 2s.  c  om*/
 *   Consecutive gap-characters are coalesced into 1 gap column by calculating
 *   their cumulated pixel size.
 * @param rows A string describing general builder settings + cell-specification 
 *   + row/colum spans + row heights + row groups. See the examples. 
 *   The digits and underscores specify which component goes into which cell(s) 
 *   of the layout grid (cell-specification). There can be at most one character 
 *   for every (non-gap) column specified by <code>cols</code>. Rows must be 
 *   separated by the '|' character. Only underscores, digits and letters are 
 *   allowed in the cell-specification (space isn't). Underscore means that a 
 *   cell is empty. A digit/letter character refers to a component in the varargs 
 *   list: '0'..'9', 'A'..'Z', 'a'..'z' (in this order) denote the first 62 
 *   components of the <code>args</code> list. Repeating the same digit specifies
 *   the component's column span (and row span, if repeated in consecutive rows
 *   in the same columns, like '3' in the example).<br> 
 *   After the cell-specification, but before the newline ('|') character
 *   the row height and row grouping can also be specified. It must begin 
 *   with a space to separate it from the cell-specification. The row
 *   height can be a gap-character (for constant heights only) or a string
 *   that is interpreted by RowSpec.decodeSpecs(). If omitted, the height 
 *   spec. of the most recent row is inherited. Content rows inherit the 
 *   height of the previous content row, gap rows inherit the height of 
 *   the previous gap row. A row is a gap row if its cell-specification is
 *   omitted.<br> 
 *   Row grouping forces equal heights to every member of the group. It  
 *   can be specified by "grp?" strings using any character in place of
 *   '?' (except space and '|'. In the example 'grp1' uses '1'). Rows 
 *   using the same grouping character will be in the same group.
 *   By default there're no groups.
 *    <br>
 *   General builder-settings can be specified at the beginning of the 
 *   string, enclosed in square brackets ([..]). (No space is allowed
 *   after the closing ']'). This is intended for future extensions, too. 
 *   The list of available settings is described at the {@link Prop} 
 *   enumeration. Note that setting names are case-sensitive, and should 
 *   be separated by commas.
 * @param args List of components. Besides java.awt.Component objects,
 *   the caller may use plain strings and instances of the {@link Separator}
 *   class. Plain strings are used to create labels (with mnemonic-expansion). 
 *   Separator objects will create and add separators to the form. 
 *   Any of these objects may be followed optionally by a {@link CellConstraints},
 *   a {@link CellConstraints.Alignment} or a {@link CellInsets} object, 
 *   which overrides the cell's default alignment, can extend its row/column 
 *   span and adjust its insets.<br>
 *   If the first element of <code>args</code> is a java.util.Map object,
 *   it is treated as an additional mapping for gap-characters. This 
 *   overrides the default global mapping. Note that gap-characters can 
 *   help you to set up uniform spacing on your forms. For example, if
 *   you use "-" as normal column-gap and "~" as normal row-gap, fine-tuning
 *   the sizes of these gaps later is as easy as changing the mapping for "-"
 *   and "~" &mdash; there's no need to update all the dlu sizes in all layouts.
 * @see   
 *   Example1: <pre>
  *       build("6dlu, p, 6dlu, 50dlu, 6dlu", 
  *                "_0_1_ pref| 6dlu|" + 
 *                "_2_33 pref:grow(0.5) grp1||" +
 *                "_4_33 grp1",
 *                component0, component1, component2, component3,
 *                component4, cellConstraintsForComponent4).getPanel()
 * </pre>
 *   The same exaple with gap-characters: <pre>
  *       build("~ p ~ 50dlu, 6dlu", 
  *                "01_ pref|~|" + 
 *                "233 pref:grow(0.5) grp1||" +
 *                "433 grp1",
 *                component0, component1, component2, component3,
 *                component4, cellConstraintsForComponent4).getPanel()
 * </pre>
 *   Example3 (only the second argument): <pre>
 *       "[LineGapSize=6dlu, ParagraphGapSize=20dlu]_0_1||_2_3||_4_5"
 * </pre>
 *  Note: this method can be used with no components and empty cell-specification,
 *  too. In this case only a {@link DefaultFormBuilder} is created, configured 
 *  and returned. Its operations can then be used to append components to the form.
 */
@SuppressWarnings("unchecked")
public static DefaultFormBuilder build(String cols, String rows, Object... args) {
    Context ctx = new Context();

    // Parse column widths
    //
    int firstArg = 0;
    if (args.length > 0 && args[0] instanceof java.util.Map) {
        ctx.localGapSpec = (java.util.Map<Character, String>) args[0];
        firstArg += 1;
    }
    StringBuilder colstmp = new StringBuilder();
    ctx.contentCol = parseColumnWidths(colstmp, cols, ctx.localGapSpec, 0);

    // Parse the list of components (may include individual cell-constraints)
    //
    ctx.components = new ArrayList<Rec>(args.length);
    for (int i = firstArg; i < args.length; ++i) {
        Rec r = new Rec(args[i]);
        if (i + 1 < args.length) {
            if (args[i + 1] instanceof CellConstraints) {
                r.cc = (CellConstraints) args[++i];
                r.useAlignment = true;
            } else if (args[i + 1] instanceof CellConstraints.Alignment) {
                CellConstraints.Alignment a = (CellConstraints.Alignment) args[++i];
                if (a == CellConstraints.BOTTOM || a == CellConstraints.TOP)
                    r.cc = new CellConstraints(1, 1, CellConstraints.DEFAULT, a);
                else if (a == CellConstraints.LEFT || a == CellConstraints.RIGHT)
                    r.cc = new CellConstraints(1, 1, a, CellConstraints.DEFAULT);
                else if (a == CellConstraints.CENTER || a == CellConstraints.FILL)
                    r.cc = new CellConstraints(1, 1, a, a);
                r.useAlignment = (r.cc != null);
            } else if (args[i + 1] instanceof CellInsets) {
                CellInsets ci = ((CellInsets) args[++i]);
                r.cc = ci.cc;
                r.useAlignment = ci.useAlignment;
                r.useInsets = true;
                //}
                //else if (args[i+1] == null) {   // this would allow superfluous 'null' values
                //   i += 1;
            }
        }
        ctx.components.add(r);
    }

    // Parse general settings (but don't apply yet) 
    //
    EnumMap<Prop, Object> props = null;
    int i = rows.indexOf(']');
    if (i >= 0) {
        String defaults = rows.substring(0, i);
        rows = rows.substring(++i);
        i = defaults.indexOf('[');
        ctx.input = defaults.substring(++i);
        props = Prop.parseGeneralSettings(ctx);
    }

    // Parse cell-specification, row heights and row groups
    //
    String cells[] = rows.split("\\|", -1);
    StringBuilder rowstmp = new StringBuilder();
    java.util.HashMap<Character, int[]> rowGroups = new HashMap<Character, int[]>();
    String lastContentRowHeight = "p", lastGapRowHeight = null;
    int rowcnt = 0;
    for (i = 0; i < cells.length; ++i) {
        rowcnt += 1;
        // See if it begins with a gap-character
        String g = (cells[i].length() > 0) ? getGap(cells[i].charAt(0), ctx.localGapSpec) : null;
        if (g != null)
            cells[i] = ' ' + cells[i];
        int j = cells[i].indexOf(' ');
        boolean gapRow = (j == 0) || (cells[i].length() == 0);
        String rh = null;
        if (j >= 0) {
            String tmp[] = cells[i].substring(j + 1).split("\\s"); // expect height and grouping specifications 
            cells[i] = cells[i].substring(0, j);
            ArrayList<String> gaps = new ArrayList<String>();
            for (j = 0; j < tmp.length; ++j) {
                if (tmp[j].length() == 0)
                    continue;
                if (tmp[j].length() == 4 && tmp[j].toLowerCase().startsWith("grp")) {
                    Character groupch = tmp[j].charAt(3);
                    rowGroups.put(groupch, appendIntArray(rowGroups.get(groupch), rowcnt));
                } else {
                    rh = tmp[j];
                    for (int k = 0, n = tmp[j].length(); k < n
                            && addGap(gaps, getGap(tmp[j].charAt(k), ctx.localGapSpec)); ++k)
                        ;
                }
            }
            if (!gaps.isEmpty()) {
                StringBuilder sb = new StringBuilder();
                flushGaps(gaps, sb, false);
                rh = sb.substring(0, sb.length() - 1);
            }
        }
        if (rh == null) {
            if (gapRow && lastGapRowHeight == null) {
                ctx.b = new DefaultFormBuilder(new FormLayout(colstmp.toString(), ""));
                Prop.setBuilder(props, ctx);
                lastGapRowHeight = parseableRowSpec(ctx.b.getLineGapSpec());
            }
            rh = gapRow ? lastGapRowHeight : lastContentRowHeight;
        } else {
            if (gapRow)
                lastGapRowHeight = rh;
            else
                lastContentRowHeight = rh;
        }
        if (i > 0)
            rowstmp.append(',');
        rowstmp.append(rh);
    }

    // Create builder
    //
    FormLayout fml = new FormLayout(colstmp.toString(), rowstmp.toString());
    ctx.b = new DefaultFormBuilder(fml, debuggable());

    // Apply builder settings (e.g. column groups)
    //
    Prop.setBuilder(props, ctx);
    props = null;

    // Set row groups
    //
    if (!rowGroups.isEmpty()) {
        int[][] tmp = new int[rowGroups.size()][]; // ???
        i = 0;
        for (int[] a : rowGroups.values())
            tmp[i++] = a;
        fml.setRowGroups(tmp);
    }
    rowGroups = null;

    JLabel lastLabel = null;
    java.util.HashSet<Character> done = new java.util.HashSet<Character>(ctx.components.size());
    int h = cells.length;
    for (int y = 0; y < cells.length; ++y) {
        int w = cells[y].length();
        int first = -1;
        for (int x = 0; x < w; ++x) {
            char ch = cells[y].charAt(x);
            if (ch == '_' || done.contains(ch))
                continue;
            int idx = intValue(ch);

            Rec rec;
            try {
                rec = ctx.components.get(idx);
            } catch (IndexOutOfBoundsException e) {
                throw new IndexOutOfBoundsException(
                        String.format("build() cells=\"%s\" ch=%c rows=\"%s\"", cells[y], ch, rows));
            }
            CellConstraints cc = (rec.cc == null) ? new CellConstraints() : (CellConstraints) rec.cc.clone();

            int sx = cc.gridWidth, sy = cc.gridHeight; // span x, span y
            while (x + sx < w && cells[y].charAt(x + sx) == ch)
                sx += 1;
            while (y + sy < h && ((x < cells[y + sy].length() && cells[y + sy].charAt(x) == ch)
                    || (cells[y + sy].length() == 0 && y + sy + 1 < h && x < cells[y + sy + 1].length()
                            && cells[y + sy + 1].charAt(x) == ch))) {
                sy += 1;
            }
            int colSpan = ctx.contentCol[x + sx - 1] - ctx.contentCol[x] + 1;
            ctx.b.setBounds(ctx.contentCol[x] + 1, ctx.b.getRow(), colSpan, sy);
            ctx.b.setLeadingColumnOffset(first & ctx.contentCol[x]); // 0 vagy x (itt nem kell a +1)
            first = 0;
            x += (sx - 1);

            Object comp = ctx.components.get(idx).component;
            if (comp instanceof Component) {
                ctx.b.append((Component) comp, colSpan);
                if (comp instanceof JLabel)
                    lastLabel = (JLabel) comp;
                else {
                    if (lastLabel != null)
                        lastLabel.setLabelFor((Component) comp);
                    lastLabel = null;
                }
            } else if (comp instanceof Separator) {
                comp = ctx.b.appendSeparator(comp.toString());
                lastLabel = null;
            } else {
                comp = lastLabel = ctx.b.getComponentFactory().createLabel(comp.toString());
                ctx.b.append(lastLabel, colSpan);
            }
            if (rec.useAlignment || rec.useInsets) {
                CellConstraints cc2 = fml.getConstraints((Component) comp);
                cc2.insets = cc.insets;
                cc2.hAlign = cc.hAlign;
                cc2.vAlign = cc.vAlign;
                fml.setConstraints((Component) comp, cc2);
            }

            done.add(ch);
        }
        lastLabel = null;
        ctx.b.nextLine();
    }
    return ctx.b;
}

From source file:calendarexportplugin.CalendarSettingsTab.java

License:Open Source License

public JPanel createSettingsPanel() {
    final EnhancedPanelBuilder pb = new EnhancedPanelBuilder(
            FormFactory.RELATED_GAP_COLSPEC.encode() + "," + FormFactory.PREF_COLSPEC.encode() + ","
                    + FormFactory.RELATED_GAP_COLSPEC.encode() + ",default:grow,"
                    + FormFactory.RELATED_GAP_COLSPEC.encode() + "," + FormFactory.PREF_COLSPEC.encode());
    CellConstraints cc = new CellConstraints();

    mCategorie = new JTextField(mSettings.getCategory());

    String[] reservedValues = { mLocalizer.msg("Busy", "Busy"), mLocalizer.msg("Free", "Free") };

    mShowTime = new JComboBox(reservedValues);
    if (mSettings.isShowBusy()) {
        mShowTime.setSelectedIndex(0);/*from   w ww. java  2  s  .  com*/
    } else if (mSettings.isShowFree()) {
        mShowTime.setSelectedIndex(1);
    }

    String[] classificationValues = { mLocalizer.msg("Public", "Public"), mLocalizer.msg("Private", "Private"),
            mLocalizer.msg("Confidential", "Confidential") };

    mClassification = new JComboBox(classificationValues);

    if (mSettings.isClassificationPublic()) {
        mClassification.setSelectedIndex(0);
    } else if (mSettings.isClassificationPrivate()) {
        mClassification.setSelectedIndex(1);
    } else if (mSettings.isClassificationConfidential()) {
        mClassification.setSelectedIndex(2);
    }

    mNulltime = new JCheckBox(mLocalizer.msg("nullTime", "Set length to 0 Minutes"));

    if (mSettings.getNullTime()) {
        mNulltime.setSelected(true);
    }

    pb.addRow();
    pb.addLabel(mLocalizer.msg("Categorie", "Categorie") + ':', cc.xy(2, pb.getRow()));
    pb.add(mCategorie, cc.xyw(4, pb.getRow(), pb.getColumnCount() - 3));

    pb.addRow();
    pb.addLabel(mLocalizer.msg("ShowTime", "Show Time as") + ':', cc.xy(2, pb.getRow()));
    pb.add(mShowTime, cc.xyw(4, pb.getRow(), pb.getColumnCount() - 3));

    pb.addRow();
    pb.addLabel(mLocalizer.msg("Classification", "Classification") + ':', cc.xy(2, pb.getRow()));
    pb.add(mClassification, cc.xyw(4, pb.getRow(), pb.getColumnCount() - 3));

    mUseAlarm = new JCheckBox(mLocalizer.msg("reminder", "Use reminder"));
    pb.addRow();
    pb.add(mUseAlarm, cc.xy(2, pb.getRow()));

    SpinnerModel model = new SpinnerNumberModel(0, 0, 1440, 1);
    mAlarmMinutes = new JSpinner(model);
    JPanel panel = new JPanel(new BorderLayout());

    panel.add(mAlarmMinutes, BorderLayout.WEST);

    final JLabel label = new JLabel(mLocalizer.msg("minutesBefore", "Minutes before start."));
    label.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
    panel.add(label, BorderLayout.CENTER);

    mUseAlarm.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            mAlarmMinutes.setEnabled(mUseAlarm.isSelected());
            label.setEnabled(mUseAlarm.isSelected());
        }
    });

    if (mSettings.getUseAlarm()) {
        mUseAlarm.setSelected(true);
    }

    try {
        mAlarmMinutes.setValue(mSettings.getAlarmMinutes());
    } catch (Exception e) {
        // empty
    }

    mAlarmMinutes.setEnabled(mUseAlarm.isSelected());
    label.setEnabled(mUseAlarm.isSelected());

    pb.add(panel, cc.xyw(4, pb.getRow(), 2));

    pb.addRow();
    pb.add(mNulltime, cc.xyw(2, pb.getRow(), 4));

    mMarkItems = new JCheckBox(mLocalizer.msg("markItems", "Mark items when exported"));
    if (mSettings.getMarkItems()) {
        mMarkItems.setSelected(true);
    }

    pb.addRow();
    pb.add(mMarkItems, cc.xyw(2, pb.getRow(), 4));

    pb.addParagraph(mLocalizer.msg("interface", "Interface"));

    mExporterList = new SelectableItemList(mPlugin.getExporterFactory().getActiveExporters(),
            mPlugin.getExporterFactory().getAllExporters());
    pb.addRow("120");
    pb.add(mExporterList, cc.xyw(2, pb.getRow(), 3));

    final JButton settings = new JButton(Localizer.getLocalization(Localizer.I18N_SETTINGS));
    settings.setEnabled(false);

    mExporterList.addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            Object[] ob = mExporterList.getListSelection();
            if ((ob.length == 1) && (((ExporterIf) ob[0]).hasSettingsDialog())) {
                settings.setEnabled(true);
            } else {
                settings.setEnabled(false);
            }
        }
    });

    settings.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            Object[] ob = mExporterList.getListSelection();
            if (ob.length == 1) {
                ((ExporterIf) ob[0]).showSettingsDialog(mSettings);
            }
        }
    });

    pb.add(settings, cc.xy(6, pb.getRow(), CellConstraints.RIGHT, CellConstraints.TOP));

    pb.addParagraph(mLocalizer.msg("formattings", "Formattings"));

    JButton extended = new JButton(mLocalizer.msg("formattings", "Formattings"));

    extended.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            showExtendedDialog(pb.getPanel());
        }
    });

    pb.addRow();
    pb.add(extended, cc.xy(2, pb.getRow()));

    return pb.getPanel();
}

From source file:com.archivas.clienttools.arcmover.gui.ssl.SSLCertificateForm.java

License:Open Source License

/**
 * Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR
 * call it in your code!// www  .jav a 2s .  c  o  m
 *
 * @noinspection ALL
 */
private void $$$setupUI$$$() {
    contentPane = new JPanel();
    contentPane.setLayout(new FormLayout("fill:d:grow", "center:d:grow"));
    contentPane.setMinimumSize(new Dimension(400, 390));
    tabbedPane1 = new JTabbedPane();
    tabbedPane1.setMinimumSize(new Dimension(400, 200));
    tabbedPane1.setOpaque(false);
    tabbedPane1.setPreferredSize(new Dimension(400, 200));
    CellConstraints cc = new CellConstraints();
    contentPane.add(tabbedPane1, cc.xy(1, 1, CellConstraints.DEFAULT, CellConstraints.FILL));
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new FormLayout("fill:6dlu:noGrow,right:d:noGrow,fill:d:grow,left:5dlu:noGrow",
            "center:7dlu:noGrow,center:max(d;4px):noGrow,center:d: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:8dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:16px:noGrow,top:8dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:8dlu:noGrow,center:max(d;4px):noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,top:15px:grow,top:4dlu:noGrow,center:d:grow,center:18px:noGrow,top:15dlu:noGrow"));
    panel1.setMinimumSize(new Dimension(400, 220));
    panel1.setPreferredSize(new Dimension(400, 220));
    tabbedPane1.addTab("General", panel1);
    final JLabel label1 = new JLabel();
    label1.setName("Issued to:");
    label1.setText("Common Name (CN)");
    panel1.add(label1, cc.xy(2, 3, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    issuedToCommonNameLabel = new JLabel();
    issuedToCommonNameLabel.setText("Issued to Value");
    panel1.add(issuedToCommonNameLabel, cc.xy(3, 3));
    final JLabel label2 = new JLabel();
    label2.setText("Common Name (CN)");
    panel1.add(label2, cc.xy(2, 14));
    issuedByCommonNameLabel = new JLabel();
    issuedByCommonNameLabel.setText("Issued by Value");
    panel1.add(issuedByCommonNameLabel, cc.xy(3, 14));
    final JLabel label3 = new JLabel();
    label3.setText("Valid From");
    panel1.add(label3, cc.xy(2, 22));
    validDateRangeLabel = new JLabel();
    validDateRangeLabel.setAutoscrolls(false);
    validDateRangeLabel.setText("Valid from Value");
    panel1.add(validDateRangeLabel, cc.xy(3, 22));
    final JLabel label4 = new JLabel();
    label4.setText("MD5 Fingerprint");
    panel1.add(label4, cc.xy(2, 27));
    md5FingerprintLabel = new JLabel();
    md5FingerprintLabel.setAutoscrolls(true);
    md5FingerprintLabel.setEnabled(true);
    md5FingerprintLabel.setText("MD5 Fingerprint value");
    panel1.add(md5FingerprintLabel, cc.xy(3, 27));
    final JLabel label5 = new JLabel();
    label5.setText("Organization (O)");
    panel1.add(label5, cc.xy(2, 5));
    issuedToOrganizationLabel = new JLabel();
    issuedToOrganizationLabel.setText("Organization Value");
    panel1.add(issuedToOrganizationLabel, cc.xy(3, 5));
    final JLabel label6 = new JLabel();
    label6.setFont(new Font(label6.getFont().getName(), Font.BOLD, label6.getFont().getSize()));
    label6.setText("Issued To");
    panel1.add(label6, cc.xy(2, 2, CellConstraints.LEFT, CellConstraints.DEFAULT));
    final JLabel label7 = new JLabel();
    label7.setFont(new Font(label7.getFont().getName(), Font.BOLD, label7.getFont().getSize()));
    label7.setText("Issued By");
    panel1.add(label7, cc.xy(2, 11, CellConstraints.LEFT, CellConstraints.DEFAULT));
    final JLabel label8 = new JLabel();
    label8.setText("Organization (O)");
    panel1.add(label8, cc.xy(2, 16));
    issuedByOrganizationLabel = new JLabel();
    issuedByOrganizationLabel.setText("Organization Value");
    panel1.add(issuedByOrganizationLabel, cc.xy(3, 16));
    final JLabel label9 = new JLabel();
    label9.setText("Organizational Unit (OU)");
    panel1.add(label9, cc.xy(2, 7));
    issuedToOrganizationalUnitLabel = new JLabel();
    issuedToOrganizationalUnitLabel.setText("Organizational Unit Value");
    panel1.add(issuedToOrganizationalUnitLabel, cc.xy(3, 7));
    final JLabel label10 = new JLabel();
    label10.setText("Organizational Unit (OU)");
    panel1.add(label10, cc.xy(2, 18));
    issuedByOrganizationalUnitLabel = new JLabel();
    issuedByOrganizationalUnitLabel.setText("Organizational Unit Value");
    panel1.add(issuedByOrganizationalUnitLabel, cc.xy(3, 18));
    final JLabel label11 = new JLabel();
    label11.setFont(new Font(label11.getFont().getName(), Font.BOLD, label11.getFont().getSize()));
    label11.setText("Validity");
    panel1.add(label11, cc.xy(2, 20, CellConstraints.LEFT, CellConstraints.DEFAULT));
    final JLabel label12 = new JLabel();
    label12.setFont(new Font(label12.getFont().getName(), Font.BOLD, label12.getFont().getSize()));
    label12.setText("Fingerprints");
    panel1.add(label12, cc.xy(2, 24, CellConstraints.LEFT, CellConstraints.DEFAULT));
    final JLabel label13 = new JLabel();
    label13.setText("Serial Number");
    panel1.add(label13, cc.xy(2, 9));
    serialNumberLabel = new JLabel();
    serialNumberLabel.setEnabled(true);
    serialNumberLabel.setText("Serial Number Value");
    panel1.add(serialNumberLabel, cc.xy(3, 9));
    final JLabel label14 = new JLabel();
    label14.setText("SHA1 Fingerprint");
    panel1.add(label14, cc.xy(2, 25));
    shaFingerprintLabel = new JLabel();
    shaFingerprintLabel.setText("SHA1 Fingerprint vale");
    panel1.add(shaFingerprintLabel, cc.xy(3, 25));
    permStoreCertCheckBox = new JCheckBox();
    permStoreCertCheckBox.setEnabled(false);
    permStoreCertCheckBox.setText("Permanently store this exception");
    permStoreCertCheckBox.setToolTipText("Save this exception permanently");
    permStoreCertCheckBox.setVisible(true);
    panel1.add(permStoreCertCheckBox, cc.xy(2, 33));
    final JLabel label15 = new JLabel();
    label15.setFont(new Font(label15.getFont().getName(), Font.BOLD, label15.getFont().getSize()));
    label15.setText("Other Warnings");
    panel1.add(label15, cc.xy(2, 30, CellConstraints.LEFT, CellConstraints.DEFAULT));
    otherWarnings = new JTextPane();
    otherWarnings.setBackground(UIManager.getColor("Label.background"));
    otherWarnings.setEditable(false);
    panel1.add(otherWarnings, cc.xyw(2, 32, 2, CellConstraints.CENTER, CellConstraints.CENTER));
    final JPanel panel2 = new JPanel();
    panel2.setLayout(new FormLayout("fill:d:grow", "center:d:grow"));
    tabbedPane1.addTab("Details", panel2);
    final JScrollPane scrollPane1 = new JScrollPane();
    panel2.add(scrollPane1, cc.xy(1, 1, CellConstraints.FILL, CellConstraints.FILL));
    detailsTextArea = new JTextArea();
    detailsTextArea.setEditable(false);
    detailsTextArea.setEnabled(true);
    scrollPane1.setViewportView(detailsTextArea);
}