Example usage for javax.swing JCheckBox JCheckBox

List of usage examples for javax.swing JCheckBox JCheckBox

Introduction

In this page you can find the example usage for javax.swing JCheckBox JCheckBox.

Prototype

public JCheckBox() 

Source Link

Document

Creates an initially unselected check box button with no text, no icon.

Usage

From source file:com.hccl.nlip.GUIMainPanel.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - Super Fan
    bestActionChartPanel = new JPanel();
    consolePanel = new JPanel();
    RLCaptionPanel = new JPanel();
    RLCaption = new JLabel();
    discountLabel = new JLabel();
    discountPanel = new JPanel();
    discountDec = new JButton();
    discountField = new JTextField();
    discountInc = new JButton();
    rewardCollisionLabel = new JLabel();
    rewardCollisionPanel = new JPanel();
    rewardCollisionDec = new JButton();
    rewardCollisionField = new JTextField();
    rewardCollisionInc = new JButton();
    rewadGoalLabel = new JLabel();
    rewardGoalPanel = new JPanel();
    rewardGoalDec = new JButton();
    rewardGoalField = new JTextField();
    rewardGoalInc = new JButton();
    rewardOneStepLabel = new JLabel();
    rewardOneStepPanel = new JPanel();
    rewardOneStepDec = new JButton();
    rewardOneStepField = new JTextField();
    rewardOneStepInc = new JButton();
    fixedEpsilonCheckBox = new JCheckBox();
    fixedEpsilonPanel = new JPanel();
    fixedEpsilonField = new JTextField();
    sepPanel1 = new JPanel();
    separator1 = new JSeparator();
    envCaptionPanel = new JPanel();
    envLabel = new JLabel();
    obstaclesLabel = new JLabel();
    obstaclesPanel = new JPanel();
    obstaclesComboBox = new JComboBox();
    goalsLabel = new JLabel();
    goalsPanel = new JPanel();
    goalsComboBox = new JComboBox();
    sepPanel2 = new JPanel();
    separator2 = new JSeparator();
    controlCaptionPanel = new JPanel();
    controlLabel = new JLabel();
    displayActionsPanel = new JPanel();
    displayActionsCheckBox = new JCheckBox();
    controlActionsPanel = new JPanel();
    stepBtn = new JButton();
    episodeBtn = new JButton();
    animateBtn = new JButton();
    resetBtn = new JButton();
    controlEpisodesPanel = new JPanel();
    performEpisodesBtn = new JButton();
    numberEpisodesField = new JTextField();
    numberEpisodesLabel = new JLabel();
    episodesProgressBar = new JProgressBar();
    sepPanel3 = new JPanel();
    separator3 = new JSeparator();
    totalStepsLabel = new JLabel();
    totalStepsField = new JLabel();
    totalEpisodesLabel = new JLabel();
    totalEpisodesFields = new JLabel();
    totalRewardLabel = new JLabel();
    totalRewardField = new JLabel();
    dicSizeField = new JLabel();
    dicSizeLabel = new JLabel();

    //======== this ========
    setPreferredSize(new Dimension(700, 500));
    setMinimumSize(new Dimension(780, 580));

    setLayout(new GridBagLayout());
    ((GridBagLayout) getLayout()).columnWidths = new int[] { 396, 239, 0 };
    ((GridBagLayout) getLayout()).rowHeights = new int[] { 0, 0 };
    ((GridBagLayout) getLayout()).columnWeights = new double[] { 1.0, 0.0, 1.0E-4 };
    ((GridBagLayout) getLayout()).rowWeights = new double[] { 1.0, 1.0E-4 };

    //======== bestActionChartPanel ========
    {//from   w w w .  j a  v  a2s.  co m
        bestActionChartPanel.setPreferredSize(new Dimension(250, 250));
        bestActionChartPanel.setLayout(new BorderLayout());
    }
    add(bestActionChartPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0));

    //======== consolePanel ========
    {
        consolePanel.setLayout(new GridBagLayout());
        ((GridBagLayout) consolePanel.getLayout()).columnWidths = new int[] { 108, 129, 0 };
        ((GridBagLayout) consolePanel.getLayout()).rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
        ((GridBagLayout) consolePanel.getLayout()).columnWeights = new double[] { 0.0, 0.0, 1.0E-4 };
        ((GridBagLayout) consolePanel.getLayout()).rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4 };

        //======== RLCaptionPanel ========
        {
            RLCaptionPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 1, 1));

            //---- RLCaption ----
            RLCaption.setText("RL Parameters");
            RLCaption.setFont(new Font("\u5b8b\u4f53", Font.PLAIN, 16));
            RLCaptionPanel.add(RLCaption);
        }
        consolePanel.add(RLCaptionPanel, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER,
                GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //---- discountLabel ----
        discountLabel.setText("Discount:");
        consolePanel.add(discountLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST,
                GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0));

        //======== discountPanel ========
        {
            discountPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 2));

            //---- discountDec ----
            discountDec.setText("-");
            discountDec.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    discountDecActionPerformed(e);
                }
            });
            discountPanel.add(discountDec);

            //---- discountField ----
            discountField.setText("000.00");
            discountField.setColumns(6);
            discountPanel.add(discountField);

            //---- discountInc ----
            discountInc.setText("+");
            discountInc.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    discountIncActionPerformed(e);
                }
            });
            discountPanel.add(discountInc);
        }
        consolePanel.add(discountPanel, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
                GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //---- rewardCollisionLabel ----
        rewardCollisionLabel.setText("Reward collision:");
        consolePanel.add(rewardCollisionLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,
                GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0));

        //======== rewardCollisionPanel ========
        {
            rewardCollisionPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 2));

            //---- rewardCollisionDec ----
            rewardCollisionDec.setText("-");
            rewardCollisionDec.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    rewardCollisionDecActionPerformed(e);
                }
            });
            rewardCollisionPanel.add(rewardCollisionDec);

            //---- rewardCollisionField ----
            rewardCollisionField.setText("000.00");
            rewardCollisionField.setColumns(6);
            rewardCollisionPanel.add(rewardCollisionField);

            //---- rewardCollisionInc ----
            rewardCollisionInc.setText("+");
            rewardCollisionInc.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    rewardCollisionIncActionPerformed(e);
                }
            });
            rewardCollisionPanel.add(rewardCollisionInc);
        }
        consolePanel.add(rewardCollisionPanel, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //---- rewadGoalLabel ----
        rewadGoalLabel.setText("Reward goal:");
        consolePanel.add(rewadGoalLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.EAST,
                GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0));

        //======== rewardGoalPanel ========
        {
            rewardGoalPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 2));

            //---- rewardGoalDec ----
            rewardGoalDec.setText("-");
            rewardGoalDec.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    rewardGoalDecActionPerformed(e);
                }
            });
            rewardGoalPanel.add(rewardGoalDec);

            //---- rewardGoalField ----
            rewardGoalField.setText("000.00");
            rewardGoalField.setColumns(6);
            rewardGoalPanel.add(rewardGoalField);

            //---- rewardGoalInc ----
            rewardGoalInc.setText("+");
            rewardGoalInc.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    rewardGoalIncActionPerformed(e);
                }
            });
            rewardGoalPanel.add(rewardGoalInc);
        }
        consolePanel.add(rewardGoalPanel, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //---- rewardOneStepLabel ----
        rewardOneStepLabel.setText("Reward one step:");
        consolePanel.add(rewardOneStepLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0,
                GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0));

        //======== rewardOneStepPanel ========
        {
            rewardOneStepPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 2));

            //---- rewardOneStepDec ----
            rewardOneStepDec.setText("-");
            rewardOneStepDec.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    rewardOneStepDecActionPerformed(e);
                }
            });
            rewardOneStepPanel.add(rewardOneStepDec);

            //---- rewardOneStepField ----
            rewardOneStepField.setText("000.00");
            rewardOneStepField.setColumns(6);
            rewardOneStepPanel.add(rewardOneStepField);

            //---- rewardOneStepInc ----
            rewardOneStepInc.setText("+");
            rewardOneStepInc.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    rewardOneStepIncActionPerformed(e);
                }
            });
            rewardOneStepPanel.add(rewardOneStepInc);
        }
        consolePanel.add(rewardOneStepPanel, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //---- fixedEpsilonCheckBox ----
        fixedEpsilonCheckBox.setText("Fixed Epsilon:");
        fixedEpsilonCheckBox.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                fixedEpsilonCheckBoxActionPerformed(e);
            }
        });
        consolePanel.add(fixedEpsilonCheckBox, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0,
                GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0));

        //======== fixedEpsilonPanel ========
        {
            fixedEpsilonPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 2));

            //---- fixedEpsilonField ----
            fixedEpsilonField.setText("00.10");
            fixedEpsilonField.setColumns(6);
            fixedEpsilonPanel.add(fixedEpsilonField);
        }
        consolePanel.add(fixedEpsilonPanel, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0,
                GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 0), 0, 0));

        //======== sepPanel1 ========
        {
            sepPanel1.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));

            //---- separator1 ----
            separator1.setPreferredSize(new Dimension(210, 2));
            sepPanel1.add(separator1);
        }
        consolePanel.add(sepPanel1, new GridBagConstraints(0, 6, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER,
                GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //======== envCaptionPanel ========
        {
            envCaptionPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 1, 1));

            //---- envLabel ----
            envLabel.setText("Environment");
            envLabel.setFont(new Font("\u5b8b\u4f53", Font.PLAIN, 16));
            envCaptionPanel.add(envLabel);
        }
        consolePanel.add(envCaptionPanel, new GridBagConstraints(0, 7, 2, 1, 0.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //---- obstaclesLabel ----
        obstaclesLabel.setText("Obstacles:");
        consolePanel.add(obstaclesLabel, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0, GridBagConstraints.EAST,
                GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0));

        //======== obstaclesPanel ========
        {
            obstaclesPanel.setLayout(new FlowLayout());

            //---- obstaclesComboBox ----
            obstaclesComboBox.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    obstaclesComboBoxActionPerformed(e);
                }
            });
            obstaclesPanel.add(obstaclesComboBox);
        }
        consolePanel.add(obstaclesPanel, new GridBagConstraints(1, 8, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
                GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 0), 0, 0));

        //---- goalsLabel ----
        goalsLabel.setText("Goals:");
        consolePanel.add(goalsLabel, new GridBagConstraints(0, 9, 1, 1, 0.0, 0.0, GridBagConstraints.EAST,
                GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0));

        //======== goalsPanel ========
        {
            goalsPanel.setLayout(new FlowLayout());

            //---- goalsComboBox ----
            goalsComboBox.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    goalsComboBoxActionPerformed(e);
                }
            });
            goalsPanel.add(goalsComboBox);
        }
        consolePanel.add(goalsPanel, new GridBagConstraints(1, 9, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
                GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 0), 0, 0));

        //======== sepPanel2 ========
        {
            sepPanel2.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));

            //---- separator2 ----
            separator2.setPreferredSize(new Dimension(210, 2));
            sepPanel2.add(separator2);
        }
        consolePanel.add(sepPanel2, new GridBagConstraints(0, 10, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER,
                GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //======== controlCaptionPanel ========
        {
            controlCaptionPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 1, 1));

            //---- controlLabel ----
            controlLabel.setText("Control");
            controlLabel.setFont(new Font("\u5b8b\u4f53", Font.PLAIN, 16));
            controlCaptionPanel.add(controlLabel);
        }
        consolePanel.add(controlCaptionPanel, new GridBagConstraints(0, 11, 2, 1, 0.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //======== displayActionsPanel ========
        {
            displayActionsPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));

            //---- displayActionsCheckBox ----
            displayActionsCheckBox.setText("Display action vectors");
            displayActionsCheckBox.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    displayActionsCheckBoxActionPerformed(e);
                }
            });
            displayActionsPanel.add(displayActionsCheckBox);
        }
        consolePanel.add(displayActionsPanel, new GridBagConstraints(0, 12, 2, 1, 0.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //======== controlActionsPanel ========
        {
            controlActionsPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 0));

            //---- stepBtn ----
            stepBtn.setText("1 Step");
            stepBtn.setMargin(new Insets(2, 2, 2, 2));
            stepBtn.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    stepBtnActionPerformed(e);
                }
            });
            controlActionsPanel.add(stepBtn);

            //---- episodeBtn ----
            episodeBtn.setText("1 Episode");
            episodeBtn.setMargin(new Insets(2, 4, 2, 4));
            episodeBtn.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    episodeBtnActionPerformed(e);
                }
            });
            controlActionsPanel.add(episodeBtn);

            //---- animateBtn ----
            animateBtn.setText("Animate");
            animateBtn.setMargin(new Insets(2, 2, 2, 2));
            animateBtn.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    animateBtnActionPerformed(e);
                }
            });
            controlActionsPanel.add(animateBtn);

            //---- resetBtn ----
            resetBtn.setText("Reset");
            resetBtn.setMargin(new Insets(2, 2, 2, 2));
            resetBtn.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    resetBtnActionPerformed(e);
                }
            });
            controlActionsPanel.add(resetBtn);
        }
        consolePanel.add(controlActionsPanel, new GridBagConstraints(0, 13, 2, 1, 0.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //======== controlEpisodesPanel ========
        {
            controlEpisodesPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 2, 0));

            //---- performEpisodesBtn ----
            performEpisodesBtn.setText("Perform");
            performEpisodesBtn.setMargin(new Insets(2, 2, 2, 2));
            performEpisodesBtn.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    performEpisodesBtnActionPerformed(e);
                }
            });
            controlEpisodesPanel.add(performEpisodesBtn);

            //---- numberEpisodesField ----
            numberEpisodesField.setText("100");
            numberEpisodesField.setColumns(5);
            controlEpisodesPanel.add(numberEpisodesField);

            //---- numberEpisodesLabel ----
            numberEpisodesLabel.setText("episodes");
            controlEpisodesPanel.add(numberEpisodesLabel);

            //---- episodesProgressBar ----
            episodesProgressBar.setMinimumSize(new Dimension(5, 10));
            episodesProgressBar.setPreferredSize(new Dimension(80, 20));
            controlEpisodesPanel.add(episodesProgressBar);
        }
        consolePanel.add(controlEpisodesPanel, new GridBagConstraints(0, 14, 2, 1, 0.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //======== sepPanel3 ========
        {
            sepPanel3.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));

            //---- separator3 ----
            separator3.setPreferredSize(new Dimension(210, 2));
            sepPanel3.add(separator3);
        }
        consolePanel.add(sepPanel3, new GridBagConstraints(0, 15, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER,
                GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //---- totalStepsLabel ----
        totalStepsLabel.setText("Total steps:");
        consolePanel.add(totalStepsLabel, new GridBagConstraints(0, 16, 1, 1, 0.0, 0.0, GridBagConstraints.EAST,
                GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0));

        //---- totalStepsField ----
        totalStepsField.setText("0000000");
        consolePanel.add(totalStepsField, new GridBagConstraints(1, 16, 1, 1, 0.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //---- totalEpisodesLabel ----
        totalEpisodesLabel.setText("Total episodes:");
        consolePanel.add(totalEpisodesLabel, new GridBagConstraints(0, 17, 1, 1, 0.0, 0.0,
                GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0));

        //---- totalEpisodesFields ----
        totalEpisodesFields.setText("0000000");
        consolePanel.add(totalEpisodesFields, new GridBagConstraints(1, 17, 1, 1, 0.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //---- totalRewardLabel ----
        totalRewardLabel.setText("Total reward:");
        consolePanel.add(totalRewardLabel, new GridBagConstraints(0, 18, 1, 1, 0.0, 0.0,
                GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0));

        //---- totalRewardField ----
        totalRewardField.setText("00000000.00000000");
        consolePanel.add(totalRewardField, new GridBagConstraints(1, 18, 1, 1, 0.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //---- dicSizeField ----
        dicSizeField.setText("00000000.00000000");
        consolePanel.add(dicSizeField, new GridBagConstraints(1, 19, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
                GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0));

        //---- dicSizeLabel ----
        dicSizeLabel.setText("Dictionary size:");
        consolePanel.add(dicSizeLabel, new GridBagConstraints(0, 19, 1, 1, 0.0, 0.0, GridBagConstraints.EAST,
                GridBagConstraints.VERTICAL, new Insets(0, 0, 5, 5), 0, 0));
    }
    add(consolePanel, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
            GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
    mazeEnv = new MazeEnvironment();
    controller = (GPSARSASparseController) mazeEnv.controller();
    JFreeChart jFreeChart = mazeEnv.genGraph();
    //Put the jFreeChart in a chartPanel
    ChartPanel chartPanel = new ChartPanel(jFreeChart);
    chartPanel.setPreferredSize(new Dimension(250, 250));
    syncParamsToGUI();
    syncStatusToGUI();
    bestActionChartPanel.add(chartPanel, BorderLayout.CENTER);
}

From source file:org.gumtree.vis.awt.time.TimePlotChartEditor.java

private JPanel createCurvesPanel() {
    JPanel wrap = new JPanel(new BorderLayout());
    JPanel curves = new JPanel(new BorderLayout());
    curves.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));

    //      JPanel general = new JPanel(new BorderLayout());
    //      general.setBorder(BorderFactory.createTitledBorder(
    //            BorderFactory.createEtchedBorder(), "General"));
    ////from  ww  w.  j  a v  a  2  s  .  c om
    //      JPanel inner = new JPanel(new LCBLayout(6));
    //      inner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    //
    //      inner.add(new JLabel("Show Marker"));
    //      showMarker = new JCheckBox();
    //      showMarker.setActionCommand(SHOW_MARKER_COMMAND);
    //      showMarker.addActionListener(this);
    //      inner.add(showMarker);
    //      inner.add(new JLabel());

    //      inner.add(new JLabel("Show Error"));
    //      showError = new JCheckBox();
    //      showError.setActionCommand(SHOW_ERROR_COMMAND);
    //      showError.addActionListener(this);
    //      inner.add(showError);
    //      inner.add(new JLabel());
    //
    //      general.add(inner, BorderLayout.NORTH);
    //      curves.add(general, BorderLayout.NORTH);

    JPanel individual = new JPanel(new BorderLayout());
    individual.setBorder(
            BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Individual Curve"));

    JPanel interior = new JPanel(new LCBLayout(7));
    interior.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));

    int numberOfDataset = chart.getXYPlot().getDatasetCount();
    currentDataset = null;
    currentSeriesIndex = -1;
    List<String> seriesNames = new ArrayList<String>();
    for (int i = 0; i < numberOfDataset; i++) {
        XYDataset dataset = chart.getXYPlot().getDataset(i);
        if (dataset != null && dataset instanceof ITimeSeriesSet) {
            int numberOfSeries = dataset.getSeriesCount();
            for (int j = 0; j < numberOfSeries; j++) {
                String seriesName = (String) dataset.getSeriesKey(j);
                seriesNames.add(seriesName);
                if (seriesName.equals(currentSeriesKey)) {
                    currentDataset = (IDataset) dataset;
                    currentSeriesIndex = j;
                }
            }
        }
    }
    if ((currentDataset == null || currentSeriesIndex < 0) && seriesNames.size() > 0) {
        for (int i = 0; i < numberOfDataset; i++) {
            XYDataset dataset = chart.getXYPlot().getDataset(i);
            if (dataset != null && dataset instanceof ITimeSeriesSet && dataset.getSeriesCount() > 0) {
                currentDataset = (IDataset) dataset;
                currentSeriesIndex = 0;
                currentSeriesKey = (String) dataset.getSeriesKey(currentSeriesIndex);
                break;
            }
        }
    }

    //Select curve combo
    this.seriesCombo = new JComboBox(seriesNames.toArray());
    seriesCombo.setActionCommand(CHANGE_CURVE_COMMAND);
    seriesCombo.addActionListener(this);
    interior.add(new JLabel("Select Curve"));
    interior.add(seriesCombo);
    interior.add(new JLabel(""));

    interior.add(new JLabel("Curve Stroke"));
    curveStrokeSample = new StrokeSample(new BasicStroke());
    curveStrokeSample.setEnabled(false);
    interior.add(curveStrokeSample);
    //      JButton button = new JButton(localizationResources.getString("Edit..."));
    Float[] strokes = new Float[] { 0f, 0.2f, 0.5f, 1f, 1.5f, 2f, 3f };
    strokeCombo = new JComboBox(strokes);
    strokeCombo.setActionCommand(CURVE_STROCK_COMMAND);
    strokeCombo.addActionListener(this);
    interior.add(strokeCombo);

    interior.add(new JLabel("Curve Colour"));
    curveColorPaint = new PaintSample(chart.getBackgroundPaint());
    interior.add(curveColorPaint);
    JButton button = new JButton(localizationResources.getString("Edit..."));
    button.setActionCommand(CURVE_COLOR_COMMAND);
    button.addActionListener(this);
    interior.add(button);

    interior.add(new JLabel("Marker Visible"));
    showMarker = new JCheckBox();
    showMarker.setActionCommand(SHOW_MARKER_COMMAND);
    showMarker.addActionListener(this);
    interior.add(showMarker);
    interior.add(new JLabel());

    interior.add(new JLabel("Marker Shape"));
    shapeLabel = new JLabel();
    interior.add(shapeLabel);
    Integer[] shapeIndex = new Integer[MarkerShape.size];
    for (int i = 0; i < shapeIndex.length; i++) {
        shapeIndex[i] = i;
    }
    shapeCombo = new JComboBox(shapeIndex);
    comboRender = new ImageComboRender();
    comboRender.setShapes(StaticValues.LOCAL_SHAPE_SERIES);
    shapeCombo.setRenderer(comboRender);
    shapeCombo.setMaximumRowCount(7);
    shapeCombo.setActionCommand(MARKER_SHAPE_COMMAND);
    shapeCombo.addActionListener(this);
    interior.add(shapeCombo);

    interior.add(new JLabel("Marker Filled"));
    markerFilled = new JCheckBox();
    markerFilled.setActionCommand(MARKER_FILLED_COMMAND);
    markerFilled.addActionListener(this);
    interior.add(markerFilled);
    interior.add(new JLabel());

    interior.add(new JLabel("Curve Visable"));
    curveVisable = new JCheckBox();
    curveVisable.setActionCommand(CURVE_VISIBLE_COMMAND);
    curveVisable.addActionListener(this);
    interior.add(curveVisable);
    interior.add(new JLabel());

    individual.add(interior, BorderLayout.NORTH);
    curves.add(individual, BorderLayout.NORTH);
    curves.setName("Curves");
    wrap.setName("Curves");
    wrap.add(curves, BorderLayout.NORTH);
    return wrap;
}

From source file:de.atomfrede.tools.evalutation.options.ui.OptionsDialog.java

private JCheckBox getCo2AbsoluteCo2AbsoluteCheckBox() {
    if (co2Absolute_isCo2AbsoluteAutoscaleCheckbox == null) {
        co2Absolute_isCo2AbsoluteAutoscaleCheckbox = new JCheckBox();
        co2Absolute_isCo2AbsoluteAutoscaleCheckbox.setText("Enable Autoscale");
        co2Absolute_isCo2AbsoluteAutoscaleCheckbox
                .setSelected(CO2AbsoluteOnlyEvaluationOptions.isAutoScaleCO2Absolute());

        co2Absolute_isCo2AbsoluteAutoscaleCheckbox.addActionListener(new ActionListener() {

            @Override/*from   www  . j  a va  2 s .c o  m*/
            public void actionPerformed(ActionEvent arg0) {
                // Autoscale is disabled enable minimum and maximum spinners
                getCo2Absolute_Co2AbsoluteMinimumSpinner()
                        .setEnabled(!co2Absolute_isCo2AbsoluteAutoscaleCheckbox.isSelected());
                getCo2Absolute_Co2AbsoluteMaximumSpinner()
                        .setEnabled(!co2Absolute_isCo2AbsoluteAutoscaleCheckbox.isSelected());
            }
        });
    }
    return co2Absolute_isCo2AbsoluteAutoscaleCheckbox;
}

From source file:com.sec.ose.osi.ui.frm.main.manage.ManagedProjectTableModel.java

public void setColumnType(JTable table) {
    table.setShowVerticalLines(false);//from  w ww. j a va2 s .  com
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    table.setColumnSelectionAllowed(false);
    table.setRowSelectionAllowed(false);
    table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    table.setRowHeight(30);

    JTableHeader header = table.getTableHeader();
    header.setPreferredSize(new java.awt.Dimension(table.getTableHeader().getWidth(), 30));
    header.setFont(new Font("Arial", Font.BOLD, 12));
    header.setReorderingAllowed(false);

    TableColumnModel cm = table.getColumnModel();
    TableColumn col = null;

    analyzeHeader = new CheckBoxHeader(new CheckboxHeaderItemListener(table, COL_ANALYZE_TARGET),
            "Analyze Target");
    col = cm.getColumn(COL_ANALYZE_TARGET);
    col.setHeaderRenderer(analyzeHeader);

    JCheckBox chkbox = new JCheckBox();
    chkbox.setBackground(Color.white);
    chkbox.setHorizontalAlignment(JLabel.CENTER);
    col.setCellRenderer(new DefaultTableCellRenderer() {
        private static final long serialVersionUID = 1L;

        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                boolean hasFocus, int row, int column) {
            ManagedProjectTableModel model = (ManagedProjectTableModel) table.getModel();

            String sPrjName = (String) table.getValueAt(row, ManagedProjectTableModel.COL_PROJECT_NAME);
            OSIProjectInfo item = model.getProjectInfo(sPrjName);

            JCheckBox chkbox = new JCheckBox();
            chkbox.setSelected(((Boolean) value).booleanValue());
            if (item != null) {
                chkbox.setEnabled(item.isLocationValid());
            }
            chkbox.setHorizontalAlignment(JLabel.CENTER);
            chkbox.setBackground(Color.white);

            return (Component) chkbox;
        }
    });
    col.setCellEditor(new DefaultCellEditor(chkbox));

    col = cm.getColumn(COL_ANALYZE_STATUS);
    col.setCellRenderer(new StatusIconCellRenderer());

    col = cm.getColumn(COL_SOURCE_LOCATION);
    col.setCellRenderer(new FileBrowseCellRenderer());
    col.setCellEditor(new FileBrowseCellEditor());
}

From source file:com.neurotec.samples.panels.EnrollFromScanner.java

@Override
protected void initGUI() {
    panelMain = new JPanel();
    panelScanners = new JPanel();
    scrollPaneList = new JScrollPane();
    scannerList = new JList();
    panelButtons = new JPanel();
    btnRefresh = new JButton();
    btnScan = new JButton();
    btnCancel = new JButton();
    btnForce = new JButton();
    cbAutomatic = new JCheckBox();
    scrollPane = new JScrollPane();
    panelSouth = new JPanel();
    panelInfo = new JPanel();
    lblInfo = new JLabel();
    panelSave = new JPanel();
    btnIdentifyPatient = new JButton();
    btnRegisterPatient = new JButton();
    cbShowProcessed = new JCheckBox();

    setLayout(new BorderLayout());

    panelMain.setLayout(new BorderLayout());

    panelScanners.setBorder(BorderFactory.createTitledBorder("Scanners list"));
    panelScanners.setLayout(new BorderLayout());

    scrollPaneList.setPreferredSize(new Dimension(0, 90));

    scannerList.setModel(new DefaultListModel());
    scannerList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    scannerList.setBorder(LineBorder.createBlackLineBorder());
    scrollPaneList.setViewportView(scannerList);

    panelScanners.add(scrollPaneList, BorderLayout.CENTER);

    panelButtons.setLayout(new FlowLayout(FlowLayout.LEADING));

    btnRefresh.setText("Refresh list");
    panelButtons.add(btnRefresh);//from   w w  w . j a v  a2 s  .c  o m

    btnScan.setText("Scan");
    panelButtons.add(btnScan);

    btnCancel.setText("Cancel");
    btnCancel.setEnabled(false);
    panelButtons.add(btnCancel);

    btnForce.setText("Force");
    panelButtons.add(btnForce);

    cbAutomatic.setSelected(true);
    cbAutomatic.setText("Scan automatically");
    panelButtons.add(cbAutomatic);

    panelScanners.add(panelButtons, BorderLayout.SOUTH);

    panelMain.add(panelScanners, BorderLayout.NORTH);
    panelMain.add(scrollPane, BorderLayout.CENTER);

    panelSouth.setLayout(new BorderLayout());

    panelInfo.setBorder(new SoftBevelBorder(BevelBorder.LOWERED));
    panelInfo.setLayout(new GridLayout(1, 1));

    lblInfo.setText(" ");
    panelInfo.add(lblInfo);

    panelSouth.add(panelInfo, BorderLayout.NORTH);

    panelSave.setLayout(new FlowLayout(FlowLayout.LEADING));

    btnIdentifyPatient.setText("Identify Patient");
    btnIdentifyPatient.setEnabled(false);
    panelSave.add(btnIdentifyPatient);

    btnRegisterPatient.setText("Register Patient");
    btnRegisterPatient.setEnabled(false);
    panelSave.add(btnRegisterPatient);

    cbShowProcessed.setSelected(true);
    cbShowProcessed.setText("Show processed image");
    panelSave.add(cbShowProcessed);

    panelSouth.add(panelSave, BorderLayout.SOUTH);

    panelMain.add(panelSouth, BorderLayout.SOUTH);

    add(panelMain, BorderLayout.CENTER);

    panelLicensing = new LicensingPanel(requiredLicenses, optionalLicenses);
    add(panelLicensing, java.awt.BorderLayout.NORTH);

    fcImage = new JFileChooser();
    fcImage.setFileFilter(new Utils.ImageFileFilter(NImages.getSaveFileFilter()));
    fcTemplate = new JFileChooser();
    view = new NFingerView();
    view.setShownImage(ShownImage.RESULT);
    view.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent ev) {
            super.mouseClicked(ev);
            if (ev.getButton() == MouseEvent.BUTTON3) {
                cbShowProcessed.doClick();
            }
        }

    });
    scrollPane.setViewportView(view);

    btnRefresh.addActionListener(this);
    btnScan.addActionListener(this);
    btnCancel.addActionListener(this);
    btnForce.addActionListener(this);
    btnIdentifyPatient.addActionListener(this);
    btnRegisterPatient.addActionListener(this);
    cbShowProcessed.addActionListener(this);
    scannerList.addListSelectionListener(new ScannerSelectionListener());
}

From source file:com.microsoft.alm.plugin.idea.tfvc.ui.settings.ProjectConfigurableForm.java

/**
 * 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  a 2  s .c  o  m
 */
private void $$$setupUI$$$() {
    myContentPane = new JPanel();
    myContentPane.setLayout(new GridLayoutManager(5, 3, new Insets(0, 0, 0, 0), -1, -1));
    serverLabel = new JPanel();
    serverLabel.setLayout(new GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1));
    myContentPane.add(serverLabel,
            new GridConstraints(1, 0, 1, 3, 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));
    serverLabel.setBorder(BorderFactory.createTitledBorder("Servers and workspaces"));
    myManageButton = new JButton();
    myManageButton.setText("Manage...");
    myManageButton.setMnemonic('M');
    myManageButton.setDisplayedMnemonicIndex(0);
    serverLabel.add(myManageButton,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer1 = new Spacer();
    serverLabel.add(spacer1,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
    myUseIdeaHttpProxyCheckBox = new JCheckBox();
    myUseIdeaHttpProxyCheckBox.setEnabled(true);
    myUseIdeaHttpProxyCheckBox.setSelected(false);
    myUseIdeaHttpProxyCheckBox.setText("Use HTTP Proxy settings");
    myUseIdeaHttpProxyCheckBox.setMnemonic('U');
    myUseIdeaHttpProxyCheckBox.setDisplayedMnemonicIndex(0);
    serverLabel.add(myUseIdeaHttpProxyCheckBox,
            new GridConstraints(1, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    passwordLabel = new JPanel();
    passwordLabel.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
    myContentPane.add(passwordLabel,
            new GridConstraints(2, 0, 1, 3, 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));
    passwordLabel.setBorder(BorderFactory.createTitledBorder("Passwords"));
    final Spacer spacer2 = new Spacer();
    passwordLabel.add(spacer2,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
    myResetPasswordsButton = new JButton();
    myResetPasswordsButton.setText("Reset Saved Passwords");
    myResetPasswordsButton.setMnemonic('R');
    myResetPasswordsButton.setDisplayedMnemonicIndex(0);
    passwordLabel.add(myResetPasswordsButton,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    checkinPolicyLabel = new JPanel();
    checkinPolicyLabel.setLayout(new GridLayoutManager(5, 1, new Insets(0, 0, 0, 0), -1, -1));
    myContentPane.add(checkinPolicyLabel,
            new GridConstraints(3, 0, 1, 3, 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));
    checkinPolicyLabel.setBorder(BorderFactory.createTitledBorder("Checkin policies compatibility"));
    myReportNotInstalledPoliciesCheckBox = new JCheckBox();
    myReportNotInstalledPoliciesCheckBox.setText("Warn about not installed policies");
    myReportNotInstalledPoliciesCheckBox.setMnemonic('W');
    myReportNotInstalledPoliciesCheckBox.setDisplayedMnemonicIndex(0);
    checkinPolicyLabel.add(myReportNotInstalledPoliciesCheckBox,
            new GridConstraints(2, 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));
    noteLabel = new JLabel();
    noteLabel.setText("(Note: these settings may be overridden for individual team project)");
    checkinPolicyLabel.add(noteLabel,
            new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    myTFSCheckBox = new JCheckBox();
    myTFSCheckBox.setText("Evaluate Team Explorer policies");
    myTFSCheckBox.setMnemonic('T');
    myTFSCheckBox.setDisplayedMnemonicIndex(9);
    checkinPolicyLabel.add(myTFSCheckBox,
            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));
    myStatefulCheckBox = new JCheckBox();
    myStatefulCheckBox.setText("Evaluate Teamprise policies");
    myStatefulCheckBox.setMnemonic('E');
    myStatefulCheckBox.setDisplayedMnemonicIndex(10);
    checkinPolicyLabel.add(myStatefulCheckBox,
            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));
    pathLabel = new JLabel();
    pathLabel.setText("Path to tf executable:");
    myContentPane.add(pathLabel,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    tfExeField = new TextFieldWithBrowseButton();
    myContentPane.add(tfExeField,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    testExeButton = new JButton();
    testExeButton.setText("Test");
    myContentPane.add(testExeButton,
            new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0,
                    false));
    final Spacer spacer3 = new Spacer();
    myContentPane.add(spacer3,
            new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1,
                    GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
}

From source file:levelBuilder.DialogMaker.java

/**
 * Displays properties of the currently selected node.
 * Also allows changing of most node properties. 
 *///from   w  w w .  j  a  v  a 2s .c o m
private static void nodePropertiesWindow() {
    //Performs actions based on button pushes.
    class ActionHandler implements ActionListener {
        @Override
        public void actionPerformed(ActionEvent e) {
            switch (e.getActionCommand()) {
            case "probSet":
                //parsing new probSet string to double[]
                ArrayList<double[]> probSets = selectedNode.getProbSets();
                if (probSetField.getText().equals(""))
                    probSets.remove(strategy);
                else {
                    String[] probSetInput = probSetField.getText().split(",");
                    int numChildren = probSetInput.length;
                    double[] newProbSet = new double[numChildren];
                    for (int c = 0; c < numChildren; c++)
                        newProbSet[c] = Double.parseDouble(probSetInput[c]);
                    if (probSets.size() > strategy)//TODO is this right?
                        probSets.add(strategy, newProbSet);
                    else
                        probSets.set(strategy, newProbSet);
                }
                selectedNode.setProbSets(probSets);
            case "npc":
                if (isNPCBoxChecked)
                    selectedNode.setNPC();
                else
                    selectedNode.setPC();
            case "text":
                dg.changeNodeText(selectedNode, textField.getText());
            case "strategy":
                strategy = Integer.parseInt(strategyField.getText());
            }
        }
    }

    JPanel fieldPanel = new JPanel(new GridLayout(0, 1, 0, 0));
    JPanel labelPanel = new JPanel(new GridLayout(0, 1, 0, 0));
    JPanel buttonPanel = new JPanel(new GridLayout(0, 1, 0, 0));
    JPanel masterPanel = new JPanel(new GridLayout(0, 3, 0, 0));

    //Buttons, ckeckboxes, textboxes, and labels
    textField = new JTextField("May I buy your wand?", 10);
    fieldPanel.add(textField);
    labelPanel.add(new JLabel("Node Text"));
    JButton button1 = new JButton("Change");
    button1.setActionCommand("text");
    button1.addActionListener(new ActionHandler());
    buttonPanel.add(button1);

    npcBox = new JCheckBox();
    npcBox.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.DESELECTED)
                isNPCBoxChecked = false;
            else
                isNPCBoxChecked = true;
        }
    });
    fieldPanel.add(npcBox);
    labelPanel.add(new JLabel("NPC"));
    JButton button2 = new JButton("Change");
    button2.setActionCommand("npc");
    button2.addActionListener(new ActionHandler());
    buttonPanel.add(button2);

    childrenField = new JTextField("child1,child2", 10);
    fieldPanel.add(childrenField);
    labelPanel.add(new JLabel("Children"));
    JButton button3 = new JButton("");
    buttonPanel.add(button3);

    probSetField = new JTextField("0.1,0.9", 10);
    fieldPanel.add(probSetField);
    labelPanel.add(new JLabel("Probability set"));
    JButton button4 = new JButton("Change");
    button4.setActionCommand("probSet");
    button4.addActionListener(new ActionHandler());
    buttonPanel.add(button4);

    strategyField = new JTextField("0", 10);
    fieldPanel.add(strategyField);
    labelPanel.add(new JLabel("Strategy"));
    JButton button5 = new JButton("Change");
    button5.setActionCommand("strategy");
    button5.addActionListener(new ActionHandler());
    buttonPanel.add(button5);

    masterPanel.add(buttonPanel);
    masterPanel.add(fieldPanel);
    masterPanel.add(labelPanel);

    JFrame frame = new JFrame("Node Properties");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    fieldPanel.setOpaque(true);
    frame.setContentPane(masterPanel);
    frame.pack();
    frame.setLocation(windowWidth, verticalWindowPlacement);
    frame.setVisible(true);

    verticalWindowPlacement += frame.getBounds().height;
}

From source file:au.org.ala.delta.editor.ui.image.ImageSettingsDialog.java

private void createUI() {
    JPanel overlayDefaultsPanel = new JPanel();
    String overlayDefaultsTitle = _resources.getString("imageSettingsOverlayDefaults.title");
    overlayDefaultsPanel.setBorder(//  ww  w. j  a v  a2  s. co  m
            new TitledBorder(null, overlayDefaultsTitle, TitledBorder.LEADING, TitledBorder.TOP, null, null));

    JPanel imagePathPanel = new JPanel();
    String imagePathTitle = _resources.getString("imageSettingsImagePath.title");
    imagePathPanel.setBorder(
            new TitledBorder(null, imagePathTitle, TitledBorder.LEADING, TitledBorder.TOP, null, null));

    JPanel overlayFontDefaultsPanel = new JPanel();
    String overlayFontTitle = _resources.getString("imageSettingsOverlayFonts.title");
    overlayFontDefaultsPanel.setBorder(
            new TitledBorder(null, overlayFontTitle, TitledBorder.LEADING, TitledBorder.TOP, null, null));

    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
            .createSequentialGroup().addContainerGap()
            .addComponent(overlayDefaultsPanel, GroupLayout.PREFERRED_SIZE, 236, GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(ComponentPlacement.RELATED)
            .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                    .addComponent(buttonPanel, GroupLayout.DEFAULT_SIZE, 685, Short.MAX_VALUE)
                    .addComponent(overlayFontDefaultsPanel, GroupLayout.DEFAULT_SIZE, 685, Short.MAX_VALUE)
                    .addComponent(imagePathPanel, GroupLayout.DEFAULT_SIZE, 685, Short.MAX_VALUE))
            .addContainerGap()));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
            .createSequentialGroup().addGap(10)
            .addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
                    .addComponent(overlayDefaultsPanel, 0, 0, Short.MAX_VALUE)
                    .addGroup(groupLayout.createSequentialGroup()
                            .addComponent(imagePathPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.RELATED).addComponent(overlayFontDefaultsPanel,
                                    GroupLayout.PREFERRED_SIZE, 260, GroupLayout.PREFERRED_SIZE)))
            .addPreferredGap(ComponentPlacement.RELATED).addComponent(buttonPanel, GroupLayout.PREFERRED_SIZE,
                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    btnOk = new JButton("Ok");
    buttonPanel.add(btnOk);

    btnCancel = new JButton("Cancel");
    buttonPanel.add(btnCancel);

    btnApply = new JButton("Apply");
    btnApply.setHorizontalAlignment(SwingConstants.RIGHT);
    buttonPanel.add(btnApply);

    chckbxCentreInBox = new JCheckBox();
    chckbxCentreInBox.setName("imageSettingsCentreInBox");
    chckbxIncludeComments = new JCheckBox();
    chckbxIncludeComments.setName("imageSettingsIncludeComments");
    chckbxOmitDescription = new JCheckBox();
    chckbxOmitDescription.setName("imageSettingsOmitDescription");
    chckbxUseIntegralHeight = new JCheckBox();
    chckbxUseIntegralHeight.setName("imageSettingsUseIntegralHeight");
    chckbxHotspotsPopUp = new JCheckBox();
    chckbxHotspotsPopUp.setName("imageSettingsHotspotsPopUp");
    chckbxCustomPopupColour = new JCheckBox();
    chckbxCustomPopupColour.setName("imageSettingsCustomPopupColour");
    JPanel panel = new JPanel();

    selectedColourLabel = new JLabel("");
    selectedColourLabel.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
    selectedColourLabel.setPreferredSize(new Dimension(25, 25));
    selectedColourLabel.setOpaque(true);
    selectedColourLabel.setEnabled(false);

    chooseColourButton = new JButton();
    chooseColourButton.setEnabled(false);

    JLabel lblButtonAlignment = new JLabel();
    lblButtonAlignment.setName("imageSettingsButtonAlignment");
    buttonAlignmentCombo = new JComboBox();
    buttonAlignmentCombo.setModel(new ButtonAlignmentModel());
    buttonAlignmentCombo.setRenderer(new ButtonAlignmentRenderer());
    GroupLayout gl_overlayDefaultsPanel = new GroupLayout(overlayDefaultsPanel);
    gl_overlayDefaultsPanel.setHorizontalGroup(gl_overlayDefaultsPanel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_overlayDefaultsPanel.createSequentialGroup().addContainerGap()
                    .addGroup(gl_overlayDefaultsPanel.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_overlayDefaultsPanel.createSequentialGroup().addGap(6)
                                    .addComponent(lblButtonAlignment))
                            .addComponent(chckbxIncludeComments).addComponent(chckbxOmitDescription)
                            .addComponent(chckbxUseIntegralHeight).addComponent(chckbxHotspotsPopUp)
                            .addComponent(chckbxCustomPopupColour)
                            .addComponent(buttonAlignmentCombo, GroupLayout.PREFERRED_SIZE, 167,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(panel, GroupLayout.PREFERRED_SIZE, 193, GroupLayout.PREFERRED_SIZE)
                            .addComponent(chckbxCentreInBox))
                    .addContainerGap(25, Short.MAX_VALUE)));
    gl_overlayDefaultsPanel
            .setVerticalGroup(gl_overlayDefaultsPanel.createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_overlayDefaultsPanel.createSequentialGroup().addGap(10)
                            .addComponent(chckbxCentreInBox).addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(chckbxIncludeComments).addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(chckbxOmitDescription).addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(chckbxUseIntegralHeight).addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(chckbxHotspotsPopUp).addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(chckbxCustomPopupColour).addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(panel, GroupLayout.PREFERRED_SIZE, 39, GroupLayout.PREFERRED_SIZE)
                            .addGap(12).addComponent(lblButtonAlignment)
                            .addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(buttonAlignmentCombo, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(144, Short.MAX_VALUE)));
    GroupLayout gl_panel = new GroupLayout(panel);
    gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel.createSequentialGroup().addContainerGap()
                    .addComponent(selectedColourLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(chooseColourButton).addGap(68)));
    gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(chooseColourButton)
                            .addComponent(selectedColourLabel, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    panel.setLayout(gl_panel);
    overlayDefaultsPanel.setLayout(gl_overlayDefaultsPanel);

    JLabel lblFontName = new JLabel();
    lblFontName.setName("imageSettingsFontName");
    JLabel lblSize = new JLabel();
    lblSize.setName("imageSettingsFontSize");
    JLabel lblBold = new JLabel();
    lblBold.setName("imageSettingsFontBold");
    JLabel lblItalic = new JLabel();
    lblItalic.setName("imageSettingsFontItalic");

    JLabel featureLabel = new JLabel();
    featureLabel.setName("imageSettingsFeatureFont");
    buttonFontCombo = new JComboBox();
    buttonFontCombo.setModel(new FontFamilyModel());

    featureSizeCombo = new JComboBox();
    featureSizeCombo.setModel(new FontSizeModel());

    buttonBoldCheckBox = new JCheckBox("");

    featureItalicCheckBox = new JCheckBox("");

    JLabel buttonLabel = new JLabel();
    buttonLabel.setName("imageSettingsButtonFont");

    featureFontCombo = new JComboBox();
    featureFontCombo.setModel(new FontFamilyModel());

    buttonSizeCombo = new JComboBox();
    buttonSizeCombo.setModel(new FontSizeModel());

    featureBoldCheckBox = new JCheckBox("");

    buttonItalicCheckBox = new JCheckBox("");

    JLabel defaultLabel = new JLabel();
    defaultLabel.setName("imageSettingsDefaultFont");
    defaultFontCombo = new JComboBox();
    defaultFontCombo.setModel(new FontFamilyModel());

    defaultSizeCombo = new JComboBox();
    defaultSizeCombo.setModel(new FontSizeModel());

    defaultBoldCheckBox = new JCheckBox("");

    defaultItalicCheckBox = new JCheckBox("");

    JLabel lblSample = new JLabel();
    lblSample.setName("imageSettingsSample");
    sampleTextField = new JTextField("");

    chckbxSaveSampleAs = new JCheckBox();
    chckbxSaveSampleAs.setSelected(true);
    chckbxSaveSampleAs.setName("imageSettingsSaveSampleAs");

    GroupLayout gl_overlayFontDefaultsPanel = new GroupLayout(overlayFontDefaultsPanel);
    gl_overlayFontDefaultsPanel.setHorizontalGroup(gl_overlayFontDefaultsPanel
            .createParallelGroup(Alignment.LEADING)
            .addGroup(gl_overlayFontDefaultsPanel.createSequentialGroup().addContainerGap()
                    .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_overlayFontDefaultsPanel.createSequentialGroup()
                                    .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING)
                                            .addComponent(defaultLabel).addComponent(featureLabel)
                                            .addComponent(buttonLabel))
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addGroup(gl_overlayFontDefaultsPanel
                                            .createParallelGroup(Alignment.TRAILING)
                                            .addComponent(lblFontName, 0, 345, Short.MAX_VALUE)
                                            .addGroup(gl_overlayFontDefaultsPanel.createSequentialGroup()
                                                    .addGroup(gl_overlayFontDefaultsPanel
                                                            .createParallelGroup(Alignment.TRAILING)
                                                            .addComponent(defaultFontCombo, Alignment.LEADING,
                                                                    0, 339, Short.MAX_VALUE)
                                                            .addComponent(featureFontCombo, 0, 339,
                                                                    Short.MAX_VALUE)
                                                            .addComponent(buttonFontCombo, 0, 339,
                                                                    Short.MAX_VALUE))
                                                    .addPreferredGap(ComponentPlacement.RELATED)))
                                    .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblSize, 0, 94, Short.MAX_VALUE)
                                            .addComponent(defaultSizeCombo, 0, 94, Short.MAX_VALUE)
                                            .addComponent(featureSizeCombo, 0, 94, Short.MAX_VALUE)
                                            .addComponent(buttonSizeCombo, 0, 94, Short.MAX_VALUE)))
                            .addGroup(gl_overlayFontDefaultsPanel.createSequentialGroup()
                                    .addComponent(lblSample).addPreferredGap(ComponentPlacement.RELATED)
                                    .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING)
                                            .addComponent(chckbxSaveSampleAs).addComponent(sampleTextField,
                                                    GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE))))
                    .addGap(18)
                    .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING, false)
                            .addComponent(featureBoldCheckBox, GroupLayout.PREFERRED_SIZE, 40,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(defaultBoldCheckBox, GroupLayout.PREFERRED_SIZE, 40,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(buttonBoldCheckBox, GroupLayout.PREFERRED_SIZE, 40,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblBold, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.TRAILING)
                            .addComponent(buttonItalicCheckBox, Alignment.LEADING, GroupLayout.PREFERRED_SIZE,
                                    40, GroupLayout.PREFERRED_SIZE)
                            .addComponent(featureItalicCheckBox, Alignment.LEADING, GroupLayout.PREFERRED_SIZE,
                                    40, GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblItalic, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 50,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(defaultItalicCheckBox, Alignment.LEADING, GroupLayout.PREFERRED_SIZE,
                                    40, GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));
    gl_overlayFontDefaultsPanel
            .setVerticalGroup(gl_overlayFontDefaultsPanel
                    .createParallelGroup(Alignment.LEADING).addGroup(gl_overlayFontDefaultsPanel
                            .createSequentialGroup().addContainerGap().addGroup(gl_overlayFontDefaultsPanel
                                    .createParallelGroup(Alignment.BASELINE).addComponent(
                                            lblSize)
                                    .addComponent(lblFontName).addComponent(lblItalic).addComponent(lblBold))
                            .addGap(10)
                            .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING)
                                    .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(
                                            Alignment.BASELINE)
                                            .addComponent(defaultFontCombo, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                            .addComponent(defaultSizeCombo, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                            .addComponent(defaultLabel))
                                    .addComponent(defaultItalicCheckBox).addComponent(defaultBoldCheckBox))
                            .addGap(10)
                            .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING)
                                    .addGroup(gl_overlayFontDefaultsPanel
                                            .createParallelGroup(Alignment.BASELINE)
                                            .addComponent(featureFontCombo, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                            .addComponent(featureSizeCombo, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                            .addComponent(featureLabel))
                                    .addComponent(featureItalicCheckBox).addComponent(featureBoldCheckBox))
                            .addPreferredGap(ComponentPlacement.RELATED)
                            .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING)
                                    .addGroup(gl_overlayFontDefaultsPanel.createSequentialGroup()
                                            .addGroup(gl_overlayFontDefaultsPanel
                                                    .createParallelGroup(Alignment.BASELINE)
                                                    .addComponent(buttonSizeCombo, GroupLayout.PREFERRED_SIZE,
                                                            GroupLayout.DEFAULT_SIZE,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(buttonFontCombo, GroupLayout.PREFERRED_SIZE,
                                                            GroupLayout.DEFAULT_SIZE,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(buttonLabel))
                                            .addGap(18)
                                            .addGroup(gl_overlayFontDefaultsPanel
                                                    .createParallelGroup(Alignment.BASELINE)
                                                    .addComponent(sampleTextField, GroupLayout.PREFERRED_SIZE,
                                                            40, GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(lblSample))
                                            .addPreferredGap(ComponentPlacement.RELATED)
                                            .addComponent(chckbxSaveSampleAs))
                                    .addComponent(buttonItalicCheckBox).addComponent(buttonBoldCheckBox))
                            .addContainerGap(16, Short.MAX_VALUE)));
    overlayFontDefaultsPanel.setLayout(gl_overlayFontDefaultsPanel);

    imagePathTextField = new JTextField();
    imagePathTextField.setColumns(10);

    imagePathButton = new JButton("New button");
    GroupLayout gl_imagePathPanel = new GroupLayout(imagePathPanel);
    gl_imagePathPanel.setHorizontalGroup(gl_imagePathPanel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_imagePathPanel.createSequentialGroup().addContainerGap()
                    .addComponent(imagePathTextField, GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(imagePathButton)));
    gl_imagePathPanel.setVerticalGroup(gl_imagePathPanel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_imagePathPanel.createSequentialGroup().addContainerGap()
                    .addGroup(gl_imagePathPanel.createParallelGroup(Alignment.BASELINE)
                            .addComponent(imagePathTextField, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addComponent(imagePathButton))
                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    imagePathPanel.setLayout(gl_imagePathPanel);
    getContentPane().setLayout(groupLayout);
}

From source file:org.opendatakit.briefcase.ui.settings.SettingsPanelForm.java

/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL//w  ww.j  a v a  2  s . c om
 */
private void $$$setupUI$$$() {
    createUIComponents();
    container = new JPanel();
    container.setLayout(new GridBagLayout());
    storageLocationContainer = new JPanel();
    storageLocationContainer.setLayout(new GridBagLayout());
    GridBagConstraints gbc;
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.gridwidth = 5;
    gbc.weightx = 1.0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    container.add(storageLocationContainer, gbc);
    storageLocationLabel = new JLabel();
    storageLocationLabel.setText("Storage Location");
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.anchor = GridBagConstraints.WEST;
    storageLocationContainer.add(storageLocationLabel, gbc);
    storageLocationField = new JTextField();
    storageLocationField.setEditable(false);
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 0;
    gbc.weightx = 1.0;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    storageLocationContainer.add(storageLocationField, gbc);
    storageLocationButtons = new JPanel();
    storageLocationButtons.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
    gbc = new GridBagConstraints();
    gbc.gridx = 3;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.BOTH;
    storageLocationContainer.add(storageLocationButtons, gbc);
    storageLocationClearButton = new JButton();
    storageLocationClearButton.setText("Clear");
    storageLocationClearButton.setVisible(false);
    storageLocationButtons.add(storageLocationClearButton);
    storageLocationChooseButton = new JButton();
    storageLocationChooseButton.setText("Choose...");
    storageLocationButtons.add(storageLocationChooseButton);
    final JPanel spacer1 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    storageLocationContainer.add(spacer1, gbc);
    pullInParallelField = new JCheckBox();
    pullInParallelField.setText("Pull submissions in parallel (experimental)");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 3;
    gbc.gridwidth = 5;
    gbc.anchor = GridBagConstraints.WEST;
    container.add(pullInParallelField, gbc);
    rememberPasswordsField = new JCheckBox();
    rememberPasswordsField.setText("Remember passwords (unencrypted)");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 7;
    gbc.gridwidth = 5;
    gbc.anchor = GridBagConstraints.WEST;
    container.add(rememberPasswordsField, gbc);
    sendUsageDataField = new JCheckBox();
    sendUsageDataField.setText("Send usage data and crash logs to core developers");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 9;
    gbc.gridwidth = 5;
    gbc.anchor = GridBagConstraints.WEST;
    container.add(sendUsageDataField, gbc);
    useHttpProxyField = new JCheckBox();
    useHttpProxyField.setText("Use HTTP Proxy");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 11;
    gbc.gridwidth = 5;
    gbc.anchor = GridBagConstraints.WEST;
    container.add(useHttpProxyField, gbc);
    final JPanel spacer2 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 12;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.insets = new Insets(0, 0, 0, 20);
    container.add(spacer2, gbc);
    httpProxyJostLabel = new JLabel();
    httpProxyJostLabel.setText("Host");
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 12;
    gbc.anchor = GridBagConstraints.WEST;
    container.add(httpProxyJostLabel, gbc);
    httpProxyHostField = new JTextField();
    httpProxyHostField.setPreferredSize(new Dimension(150, 30));
    httpProxyHostField.setText("127.0.0.1");
    gbc = new GridBagConstraints();
    gbc.gridx = 4;
    gbc.gridy = 12;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    container.add(httpProxyHostField, gbc);
    final JPanel spacer3 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 3;
    gbc.gridy = 12;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    container.add(spacer3, gbc);
    httpProxyPortLabel = new JLabel();
    httpProxyPortLabel.setText("Port");
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 13;
    gbc.anchor = GridBagConstraints.WEST;
    container.add(httpProxyPortLabel, gbc);
    final JPanel spacer4 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 5;
    gbc.gridy = 12;
    gbc.weightx = 1.0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    container.add(spacer4, gbc);
    httpProxyPortField.setPreferredSize(new Dimension(150, 30));
    gbc = new GridBagConstraints();
    gbc.gridx = 4;
    gbc.gridy = 13;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    container.add(httpProxyPortField, gbc);
    final JPanel spacer5 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 10;
    gbc.gridwidth = 5;
    gbc.fill = GridBagConstraints.VERTICAL;
    container.add(spacer5, gbc);
    final JPanel spacer6 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 6;
    gbc.gridy = 1;
    gbc.gridheight = 13;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    container.add(spacer6, gbc);
    final JPanel spacer7 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 1;
    gbc.gridheight = 13;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    container.add(spacer7, gbc);
    final JPanel spacer8 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.gridwidth = 5;
    gbc.fill = GridBagConstraints.VERTICAL;
    container.add(spacer8, gbc);
    final JPanel spacer9 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 14;
    gbc.gridwidth = 5;
    gbc.weighty = 1.0;
    gbc.fill = GridBagConstraints.VERTICAL;
    container.add(spacer9, gbc);
    final JPanel spacer10 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 8;
    gbc.gridwidth = 5;
    gbc.fill = GridBagConstraints.VERTICAL;
    container.add(spacer10, gbc);
    final JPanel spacer11 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 4;
    gbc.gridwidth = 5;
    gbc.fill = GridBagConstraints.VERTICAL;
    container.add(spacer11, gbc);
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridBagLayout());
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 15;
    gbc.gridwidth = 5;
    gbc.fill = GridBagConstraints.BOTH;
    container.add(panel1, gbc);
    panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Troubleshooting"));
    reloadCacheButton = new JButton();
    reloadCacheButton.setEnabled(false);
    reloadCacheButton.setText("Reload forms from storage location");
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 8;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(reloadCacheButton, gbc);
    final JPanel spacer12 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 7;
    gbc.fill = GridBagConstraints.VERTICAL;
    panel1.add(spacer12, gbc);
    final JPanel spacer13 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 9;
    gbc.fill = GridBagConstraints.VERTICAL;
    panel1.add(spacer13, gbc);
    final JPanel spacer14 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 3;
    gbc.gridy = 8;
    gbc.weightx = 0.5;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(spacer14, gbc);
    final JPanel spacer15 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 8;
    gbc.weightx = 0.5;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(spacer15, gbc);
    final JLabel label1 = new JLabel();
    label1.setText("The form list in Briefcase can get out of date if files are moved manually.");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 5;
    gbc.gridwidth = 3;
    gbc.anchor = GridBagConstraints.WEST;
    panel1.add(label1, gbc);
    final JLabel label2 = new JLabel();
    label2.setText("This reload is always safe.");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 6;
    gbc.gridwidth = 3;
    gbc.anchor = GridBagConstraints.WEST;
    panel1.add(label2, gbc);
    final JPanel spacer16 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 5;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(spacer16, gbc);
    final JPanel spacer17 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.VERTICAL;
    panel1.add(spacer17, gbc);
    final JPanel spacer18 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 4;
    gbc.gridy = 5;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(spacer18, gbc);
    final JPanel spacer19 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 4;
    gbc.fill = GridBagConstraints.VERTICAL;
    panel1.add(spacer19, gbc);
    cleanAllPullResumePointsButton = new JButton();
    cleanAllPullResumePointsButton.setEnabled(false);
    cleanAllPullResumePointsButton.setText("Clear pull history");
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 3;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(cleanAllPullResumePointsButton, gbc);
    final JLabel label3 = new JLabel();
    label3.setText("Use if you wish to pull every submission, regardless of last submission pulled.");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.gridwidth = 3;
    gbc.anchor = GridBagConstraints.WEST;
    panel1.add(label3, gbc);
    final JPanel spacer20 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 2;
    gbc.fill = GridBagConstraints.VERTICAL;
    panel1.add(spacer20, gbc);
    final JPanel spacer21 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 16;
    gbc.gridwidth = 6;
    gbc.fill = GridBagConstraints.VERTICAL;
    container.add(spacer21, gbc);
    resumeLastPullField = new JCheckBox();
    resumeLastPullField.setText("Start pull from last submission pulled");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 5;
    gbc.gridwidth = 5;
    gbc.anchor = GridBagConstraints.WEST;
    container.add(resumeLastPullField, gbc);
    final JPanel spacer22 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 6;
    gbc.gridwidth = 5;
    gbc.fill = GridBagConstraints.VERTICAL;
    container.add(spacer22, gbc);
}

From source file:net.sf.profiler4j.console.ProjectDialog.java

/**
 * This method initializes beanpropsCheckBox
 * //from  w  w w  . j a  v a2s  . co m
 * @return javax.swing.JCheckBox
 */
private JCheckBox getBeanpropsCheckBox() {
    if (beanpropsCheckBox == null) {
        beanpropsCheckBox = new JCheckBox();
        beanpropsCheckBox.setText("Include getters/setters");
        beanpropsCheckBox.setBounds(new java.awt.Rectangle(16, 64, 137, 23));
    }
    return beanpropsCheckBox;
}