Example usage for javax.swing JRadioButton setSelected

List of usage examples for javax.swing JRadioButton setSelected

Introduction

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

Prototype

public void setSelected(boolean b) 

Source Link

Document

Sets the state of the button.

Usage

From source file:org.nuclos.client.ui.OptionGroup.java

/**
 * @param sValue/*from  w w  w  . j av  a2  s  . c  o m*/
 */
public void setValue(String sValue) {
    final Enumeration<AbstractButton> enumElements = bg.getElements();
    while (enumElements.hasMoreElements()) {
        final JRadioButton radiobtn = (JRadioButton) enumElements.nextElement();
        if (sValue == null) {
            // unselect all buttons:
            radiobtn.setSelected(false);
            bg.clearSelection();
        } else {
            // select matching button, if any:
            if (radiobtn.getModel().getActionCommand().equals(sValue)) {
                radiobtn.setSelected(true);
                break;
            }
        }
    }
}

From source file:org.nuclos.client.ui.OptionGroup.java

/**
 *
 *//* w w w. j  a va 2 s.co  m*/
public ActionListener getActionListener() {
    return new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent ev) {
            final Enumeration<AbstractButton> enumeration = bg.getElements();
            while (enumeration.hasMoreElements()) {
                final JRadioButton radiobtn = (JRadioButton) enumeration.nextElement();
                if (radiobtn.getModel().getActionCommand().equals(ev.getActionCommand())) {
                    radiobtn.setSelected(true);
                    break;
                }
            }
        }
    };
}

From source file:org.openmicroscopy.shoola.agents.treeviewer.util.SaveResultsDialog.java

/**
 * Builds and lays out the elements indicating what to save.
 *
 * @return See above.//from www  .  j av  a  2s . c o  m
 */
private JPanel buildContents() {
    JPanel buttons = new JPanel();
    buttons.add(UIUtilities.setTextFont("Save results for"));
    buttons.setLayout(new BoxLayout(buttons, BoxLayout.Y_AXIS));
    ButtonGroup group = new ButtonGroup();
    JRadioButton b = new JRadioButton("Image from current window");
    b.setSelected(activeWindow);
    buttons.add(b);
    group.add(b);
    b.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            activeWindow = (e.getStateChange() == ItemEvent.SELECTED);
        }
    });
    b = new JRadioButton("Images from all image windows");
    b.setSelected(activeWindow);
    buttons.add(b);
    group.add(b);
    buttons.add(Box.createRigidArea(UIUtilities.H_SPACER_SIZE));
    buttons.add(UIUtilities.setTextFont("Save"));
    buttons.add(roi);
    buttons.add(table);
    JPanel row = new JPanel();
    row.setLayout(new FlowLayout(FlowLayout.LEFT));
    JLabel l = new JLabel();
    l.setText("Measurements File Name: ");
    row.add(l);
    row.add(nameField);
    JPanel p = new JPanel();
    p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
    p.add(UIUtilities.buildComponentPanel(buttons));
    p.add(row);
    return p;
}

From source file:org.ut.biolab.medsavant.client.filter.FilterHistoryPanel.java

public FilterHistoryPanel() {

    FilterController.getInstance().addListener(new Listener<FilterEvent>() {
        @Override/*  w w w  . j  ava2 s  .  c om*/
        public void handleEvent(final FilterEvent event) {
            new MedSavantWorker<Void>("FilterHistoryPanel") {

                @Override
                protected void showProgress(double fraction) {
                }

                @Override
                protected void showSuccess(Void result) {
                }

                @Override
                protected Void doInBackground() throws Exception {
                    int numLeft = ResultController.getInstance().getFilteredVariantCount();
                    addFilterSet(event.getFilter(), event.getType(), numLeft);
                    return null;
                }

            }.execute();
        }
    });

    ReferenceController.getInstance().addListener(new Listener<ReferenceEvent>() {
        @Override
        public void handleEvent(ReferenceEvent event) {
            if (event.getType() == ReferenceEvent.Type.CHANGED) {
                reset();
            }
        }

    });

    //this.setBackground(new Color(100,100,100));
    this.setBorder(ViewUtil.getMediumBorder());

    this.setMinimumSize(new Dimension(200, 300));
    this.setPreferredSize(new Dimension(200, 300));
    this.setName("History");
    this.setLayout(new BorderLayout());
    table = new JTable() {
        @Override
        public TableCellRenderer getCellRenderer(int row, int column) {
            if (model.getColumnClass(column).equals(JPanel.class)) {
                return new JPanelRenderer();
            }
            return super.getCellRenderer(row, column);
        }
    };
    model = new ProgressTableModel();
    table.setModel(model);

    JPanel modePanel = ViewUtil.getClearPanel();

    ButtonGroup group = new ButtonGroup();
    JRadioButton globalButton = new JRadioButton("Global");
    ViewUtil.makeSmall(globalButton);
    globalButton.setSelected(true);
    globalButton.setOpaque(false);
    JRadioButton relativeButton = new JRadioButton("Relative to previous change");
    ViewUtil.makeSmall(relativeButton);
    relativeButton.setOpaque(false);
    globalButton.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseReleased(MouseEvent e) {
            changeMode(Mode.GLOBAL);
        }
    });
    relativeButton.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseReleased(MouseEvent e) {
            changeMode(Mode.RELATIVE);
        }
    });
    group.add(globalButton);
    group.add(relativeButton);
    modePanel.add(globalButton);
    modePanel.add(relativeButton);
    this.add(modePanel, BorderLayout.NORTH);

    final JScrollPane scrollPane = new JScrollPane();
    scrollPane.getViewport().add(table);
    this.add(scrollPane, BorderLayout.CENTER);

    reset();

    //FilterController.addFilterListener(this);

}

From source file:org.ut.biolab.medsavant.client.view.manage.ServerLogPage.java

@Override
public JPanel getView() {
    if (view == null) {
        view = new JPanel();
        view.setLayout(new BorderLayout());

        menuPanel = new JPanel();
        ViewUtil.applyHorizontalBoxLayout(menuPanel);

        ButtonGroup bg = new ButtonGroup();

        JRadioButton b1 = new JRadioButton("Client");
        //JRadioButton b2 = new JRadioButton("Server");
        JRadioButton b3 = new JRadioButton("Annotations");

        bg.add(b1);/*from   w  w  w .j  ava2 s  . com*/
        //bg.add(b2);
        bg.add(b3);

        listPanel = new JPanel();
        listPanel.setLayout(new CardLayout());

        listPanel.add(getWaitPanel(), CARDNAME_WAIT);
        listPanel.add(getClientCard(), CARDNAME_CLIENT);
        //listPanel.add(getServerCard(), CARDNAME_SERVER);
        listPanel.add(getAnnotationCard(), CARDNAME_ANNOTATION);

        view.add(menuPanel, BorderLayout.NORTH);
        view.add(listPanel, BorderLayout.CENTER);

        b1.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                changeToCard(CARDNAME_CLIENT);

            }
        });
        /*b2.addActionListener(new ActionListener() {
                
        public void actionPerformed(ActionEvent ae) {
            changeToCard(CARDNAME_SERVER);
        }
        });*/
        b3.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                changeToCard(CARDNAME_ANNOTATION);
            }
        });

        b3.setSelected(true);
        this.changeToCard(CARDNAME_ANNOTATION);

        JButton refreshButton = new JButton("Refresh");
        refreshButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                refreshCurrentCard();
            }
        });

        menuPanel.add(Box.createHorizontalGlue());
        menuPanel.add(b3);
        menuPanel.add(b1);
        //menuPanel.add(b2);
        menuPanel.add(refreshButton);
        menuPanel.add(Box.createHorizontalGlue());
    }
    return view;
}

From source file:satalitelist.EdgeLabelDemo.java

/**
 * create an instance of a simple graph with controls to
 * demo the label positioning features//from  w ww .ja v  a2s  .  c o  m
 *
 */
@SuppressWarnings("serial")
public EdgeLabelDemo(StemAndCycleList al) {
    cities = (ArrayList<INode>) al.list;
    list = al;
    al.score = al.getCycleScore();
    // create a simple graph for the demo
    graph = new SparseMultigraph<Integer, MyEdge>();
    //Integer[] v = createVertices(7);
    fillSevenCitiesWithPrices();
    for (INode n : cities) {
        graph.addVertex(Integer.parseInt(n.toString()));
    }
    createVertices();
    //createEdges(v);

    Layout<Integer, MyEdge> layout = new FRLayout2<Integer, MyEdge>(graph);
    vv = new VisualizationViewer<Integer, MyEdge>(layout, new Dimension(1000, 800));
    vv.setBackground(Color.white);

    vertexLabelRenderer = vv.getRenderContext().getVertexLabelRenderer();
    edgeLabelRenderer = vv.getRenderContext().getEdgeLabelRenderer();

    vv.getRenderContext().setEdgeLabelTransformer(new Transformer<MyEdge, String>() {
        public String transform(MyEdge i) {
            return i.toString();
        }
    });
    vv.getRenderContext().setEdgeDrawPaintTransformer(
            new PickableEdgePaintTransformer<MyEdge>(vv.getPickedEdgeState(), Color.black, Color.cyan));
    vv.getRenderContext().setVertexFillPaintTransformer(
            new PickableVertexPaintTransformer<Integer>(vv.getPickedVertexState(), Color.red, Color.yellow));
    // add my listener for ToolTips

    vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<Integer>());
    vv.getRenderContext().setEdgeStrokeTransformer(new Transformer<MyEdge, Stroke>() {

        public Stroke transform(MyEdge i) {
            switch (i.kind) {
            case NORMAL:
                return new BasicStroke(2, 1, 1, 0, new float[] { 10, 0 }, 0);
            case VIRTUAL:
                return new BasicStroke(2, 1, 1, 0, new float[] { 5 }, 0);
            case INVISIBLE:
                return new BasicStroke(1, 1, 1, 0, new float[] { 1, 10 }, 0);
            }
            throw new RuntimeException("No such a type");
        }
    });

    vv.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR);

    // create a frome to hold the graph
    final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv);
    Container content = getContentPane();
    content.add(panel);

    final DefaultModalGraphMouse<Integer, Number> graphMouse = new DefaultModalGraphMouse<Integer, Number>();
    vv.setGraphMouse(graphMouse);

    JButton plus = new JButton("+");
    plus.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            scaler.scale(vv, 1.1f, vv.getCenter());
        }
    });
    JButton minus = new JButton("-");
    minus.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            scaler.scale(vv, 1 / 1.1f, vv.getCenter());
        }
    });

    ButtonGroup radio = new ButtonGroup();
    JRadioButton lineButton = new JRadioButton("Line");
    lineButton.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.Line<Integer, MyEdge>());
                vv.repaint();
            }
        }
    });

    JRadioButton quadButton = new JRadioButton("QuadCurve");
    quadButton.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.QuadCurve<Integer, MyEdge>());
                vv.repaint();
            }
        }
    });

    JRadioButton cubicButton = new JRadioButton("CubicCurve");
    cubicButton.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                vv.getRenderContext().setEdgeShapeTransformer(new EdgeShape.CubicCurve<Integer, MyEdge>());
                vv.repaint();
            }
        }
    });

    radio.add(quadButton);
    radio.add(cubicButton);
    radio.add(lineButton);

    graphMouse.setMode(ModalGraphMouse.Mode.TRANSFORMING);

    Box controls = Box.createHorizontalBox();

    JPanel zoomPanel = new JPanel(new GridLayout(0, 1));
    zoomPanel.setBorder(BorderFactory.createTitledBorder("Scale"));
    zoomPanel.add(plus);
    zoomPanel.add(minus);

    JPanel edgePanel = new JPanel(new GridLayout(0, 1));
    edgePanel.setBorder(BorderFactory.createTitledBorder("EdgeType Type"));
    edgePanel.add(lineButton);
    edgePanel.add(quadButton);
    edgePanel.add(cubicButton);

    JPanel rotatePanel = new JPanel();
    rotatePanel.setBorder(BorderFactory.createTitledBorder("Alignment"));
    rotatePanel.add(cycleLabel);
    rotatePanel.add(stemLabel);
    rotatePanel.add(otherEndLabel);

    JPanel labelPanel = new JPanel(new BorderLayout());

    labelPanel.add(rotatePanel, BorderLayout.WEST);

    JPanel modePanel = new JPanel(new GridLayout(2, 1));
    modePanel.setBorder(BorderFactory.createTitledBorder("Mouse Mode"));
    modePanel.add(graphMouse.getModeComboBox());

    JPanel movePanel = new JPanel(new GridLayout(2, 1));
    modePanel.setBorder(BorderFactory.createTitledBorder("Make move"));
    JButton button = new JButton("Make move");
    button.addActionListener(new StemAndCycleAl());
    modePanel.add(button);

    controls.add(zoomPanel);
    controls.add(edgePanel);
    controls.add(labelPanel);
    controls.add(modePanel);
    controls.add(movePanel);
    content.add(controls, BorderLayout.SOUTH);
    lineButton.setSelected(true);
}

From source file:tvbrowser.ui.settings.WebbrowserSettingsTab.java

/**
 * Creates the settings panel for this tab.
 *///from w  w  w. ja va  2s.c  om
public JPanel createSettingsPanel() {
    mSettingsPn = new JPanel(new FormLayout("5dlu, 10dlu, pref, 3dlu, pref, 3dlu, pref, fill:3dlu:grow, 3dlu",
            "pref, 5dlu, pref, 5dlu, pref, 5dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref"));
    mSettingsPn.setBorder(Borders.DIALOG_BORDER);

    CellConstraints cc = new CellConstraints();

    mSettingsPn.add(
            DefaultComponentFactory.getInstance().createSeparator(mLocalizer.msg("browser", "Web browser")),
            cc.xyw(1, 1, 9));

    JButton testButton = new LinkButton(mLocalizer.msg("testBrowser", "Test Webbrowser"),
            "http://www.tvbrowser.org", SwingConstants.LEFT, false);
    testButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String buffer = Settings.propUserDefinedWebbrowser.getString();
            String bufferParams = Settings.propUserDefinedWebbrowserParams.getString();
            saveSettings();
            Launch.openURL("http://www.tvbrowser.org");
            Settings.propUserDefinedWebbrowser.setString(buffer);
            Settings.propUserDefinedWebbrowserParams.setString(bufferParams);
        }
    });

    mSettingsPn.add(UiUtilities.createHelpTextArea(mLocalizer.msg("help", "Help Text")), cc.xyw(2, 3, 7));

    mSettingsPn.add(testButton, cc.xyw(2, 5, 7));

    mSettingsPn.add(new JLabel(mLocalizer.msg("whichBrowser", "which browser")), cc.xyw(2, 7, 7));

    JRadioButton useDefault = new JRadioButton(mLocalizer.msg("defaultWebbrowser", "Default Webbrowser"));
    useDefault.setSelected(Settings.propUserDefinedWebbrowser.getString() == null);
    useDefault.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updateInputFields();
        }
    });

    mSettingsPn.add(useDefault, cc.xyw(2, 9, 4));

    mUseWebbrowser = new JRadioButton(mLocalizer.msg("userDefinedWebbrowser", "user defined webbrowser"));
    mUseWebbrowser.setSelected(Settings.propUserDefinedWebbrowser.getString() != null);

    mUseWebbrowser.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updateInputFields();
        }
    });

    ButtonGroup group = new ButtonGroup();
    group.add(useDefault);
    group.add(mUseWebbrowser);

    mSettingsPn.add(mUseWebbrowser, cc.xyw(2, 11, 7));

    mSettingsPn.add(new JLabel(mLocalizer.msg("browserExecutable", "Executable") + ":"), cc.xy(3, 13));

    mFileTextField = new JTextField(30);
    mFileTextField.setText(Settings.propUserDefinedWebbrowser.getString());
    mSettingsPn.add(mFileTextField, cc.xy(5, 13));

    mChooseButton = new JButton(Localizer.getLocalization(Localizer.I18N_SELECT));
    mChooseButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            if (mFileChooser == null) {
                mFileChooser = new JFileChooser();

                if (OperatingSystem.isMacOs()) {
                    mFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
                } else {
                    mFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
                }
            }

            int retVal = mFileChooser.showOpenDialog(mSettingsPn.getParent());
            if (retVal == JFileChooser.APPROVE_OPTION) {
                File f = mFileChooser.getSelectedFile();
                if (f != null) {
                    mFileTextField.setText(f.getAbsolutePath());
                }
            }
        }
    });
    mSettingsPn.add(mChooseButton, cc.xy(7, 13));

    mSettingsPn.add(new JLabel(mLocalizer.msg("browserParameter", "Parameter") + ":"), cc.xy(3, 15));

    mParams = new JTextField();
    mParams.setText(Settings.propUserDefinedWebbrowserParams.getString());
    mSettingsPn.add(mParams, cc.xy(5, 15));

    mSettingsPn.add(new JLabel(mLocalizer.msg("browserParameterHelp", "{0} will be replaced by the url.")),
            cc.xyw(5, 17, 4));

    updateInputFields();

    return mSettingsPn;
}

From source file:uk.nhs.cfh.dsp.srth.desktop.modules.simulator.viewcomponent.DataGenerationPanel.java

/**
 * Inits the components./*from   ww w . j  ava2  s.c  o  m*/
 */
public synchronized void initComponents() {

    while (activeFrame == null) {
        if (applicationService != null && applicationService.getFrameView() != null) {
            activeFrame = applicationService.getFrameView().getActiveFrame();
        }
    }

    JPanel runPanel = new JPanel();
    runPanel.setLayout(new BoxLayout(runPanel, BoxLayout.LINE_AXIS));
    runPanel.setBorder(BorderFactory.createEmptyBorder(paddingSize, paddingSize, paddingSize, paddingSize));
    JXLabel label = new JXLabel();
    label.setLineWrap(true);
    label.setText(
            "<html>This panel allows the creation of clinically plausible data based on a query specification. "
                    + "Please note that you <b>must</b> always specify a data generation source. "
                    + "The rest of the parameters can be left in their default state. When you've configured the parameters "
                    + "click the 'Generate data' button.</html>");
    runPanel.add(label);
    runPanel.add(new JSeparator(SwingConstants.VERTICAL));
    runPanel.add(Box.createHorizontalStrut(paddingSize));
    JideButton runButton = new JideButton(new GenerateDataAction(applicationService, queryService,
            dataGenerationEngine, propertyChangeTrackerService));
    runButton.setButtonStyle(ButtonStyle.HYPERLINK_STYLE);
    runPanel.add(runButton);
    runButton.setIcon(new ImageIcon(DataGenerationPanel.class.getResource("resources/linuxconf.png")));
    runPanel.add(Box.createHorizontalStrut(paddingSize));

    // create radio buttons for choosing source
    JRadioButton queryButton = new JRadioButton("Active Query");
    queryButton.setSelected(true);
    queryButton.addActionListener(this);
    queryButton.setActionCommand("activeQuery");
    JRadioButton fileButton = new JRadioButton("File");
    fileButton.addActionListener(this);
    fileButton.setActionCommand("file");

    JRadioButton folderButton = new JRadioButton("Folder");
    folderButton.addActionListener(this);
    folderButton.setActionCommand("folder");
    ButtonGroup bg = new ButtonGroup();
    bg.add(queryButton);
    bg.add(fileButton);
    bg.add(folderButton);
    JPanel buttonsPanel = new JPanel();
    buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.LINE_AXIS));
    //      buttonsPanel.add(new JLabel("Select data generation source"));
    buttonsPanel.setBorder(BorderFactory.createTitledBorder("Select data generation source"));
    buttonsPanel.add(Box.createHorizontalStrut(paddingSize));
    buttonsPanel.add(queryButton);
    buttonsPanel.add(Box.createHorizontalStrut(paddingSize));
    buttonsPanel.add(fileButton);
    buttonsPanel.add(Box.createHorizontalStrut(paddingSize));
    buttonsPanel.add(folderButton);

    locationField = new JTextField(100);
    JButton loadQueryButton = new JButton("Browse");
    loadQueryButton.addActionListener(this);
    loadQueryButton.setActionCommand("load");
    locationPanel = new JPanel();
    locationPanel.setLayout(new BoxLayout(locationPanel, BoxLayout.LINE_AXIS));
    locationPanel.add(new JLabel("Load file from"));
    locationPanel.add(Box.createHorizontalStrut(paddingSize));
    locationPanel.add(locationField);
    locationPanel.add(Box.createHorizontalStrut(paddingSize));
    locationPanel.add(loadQueryButton);

    JPanel lhsPanel = new JPanel(new GridLayout(0, 2));
    JPanel rhsPanel = new JPanel(new GridLayout(0, 2));

    lhsPanel.add(new JLabel("Max number of patients to generate"));

    SpinnerNumberModel model = new SpinnerNumberModel(initialPatientsNumber, 1, 1000000, 1);
    ptNumberSpinner = new JSpinner(model);
    ptNumberSpinner.addChangeListener(new ChangeListener() {

        public void stateChanged(ChangeEvent event) {
            // get value currently selected in spinner and set in engine
            dataGenerationEngine.setMaxPatientNumber(Long.parseLong(ptNumberSpinner.getValue().toString()));
            //                Object value = ptNumberSpinner.getValue();
            //                if(value instanceof Double)
            //                {
            //                    Double d = (Double) ptNumberSpinner.getValue();
            //                    dataGenerationEngine.setMaxPatientNumber(d.longValue());
            //                }
            //                else
            //                {
            //                    dataGenerationEngine.setMaxPatientNumber(Long.parseLong(ptNumberSpinner.getValue().toString()));
            //                }
            logger.debug("ptNumberSpinner.getValue().getClass() = " + ptNumberSpinner.getValue().getClass());
            logger.debug("Max pt number in engine set to : " + dataGenerationEngine.getMaxPatientNumber());
        }
    });
    lhsPanel.add(ptNumberSpinner);

    lhsPanel.add(new JLabel("Min age of patients to generate"));
    SpinnerNumberModel ageModel = new SpinnerNumberModel(initialMinimumAge, 1, 120, 1);
    minAgeSpinner = new JSpinner(ageModel);
    minAgeSpinner.addChangeListener(new ChangeListener() {

        public void stateChanged(ChangeEvent e) {
            // set min pt age to current value
            dataGenerationEngine.setMinPatientAgeInYears(Integer.parseInt(minAgeSpinner.getValue().toString()));
            logger.debug("Value of engine.getMinPatientAgeInYears() : "
                    + dataGenerationEngine.getMinPatientAgeInYears());
        }
    });
    lhsPanel.add(minAgeSpinner);

    lhsPanel.add(new JLabel("Data generation strategy"));
    generationStrategyBox = new JComboBox(DataGenerationEngine.DataGenerationStrategy.values());
    generationStrategyBox.setSelectedItem(DataGenerationEngine.DataGenerationStrategy.ADD_IF_NOT_EXISTS);
    generationStrategyBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            dataGenerationEngine.setDataGenerationStrategy(
                    (DataGenerationEngine.DataGenerationStrategy) generationStrategyBox.getSelectedItem());
        }
    });
    lhsPanel.add(generationStrategyBox);

    includeExcludedTermsBox = new JCheckBox(new AbstractAction("Include Excluded terms in data") {

        public void actionPerformed(ActionEvent arg0) {
            dataGenerationEngine.setIncludeExcludedTerms(includeExcludedTermsBox.isSelected());
            logger.debug("dataGenerationEngine.isIncludeExcludedTerms() = "
                    + dataGenerationEngine.isIncludeExcludedTerms());
        }
    });
    rhsPanel.add(includeExcludedTermsBox);

    randomiseNumericalValuesBox = new JCheckBox(new AbstractAction("Randomise Numerical values in data") {

        public void actionPerformed(ActionEvent arg0) {
            dataGenerationEngine.setRandomiseNumericalValues(randomiseNumericalValuesBox.isSelected());
            logger.debug("dataGenerationEngine.isRandomiseNumericalValues() = "
                    + dataGenerationEngine.isRandomiseNumericalValues());
        }
    });
    rhsPanel.add(randomiseNumericalValuesBox);

    refineQualifiersCheckBox = new JCheckBox(new AbstractAction("Refine Qualifiers in expression") {
        public void actionPerformed(ActionEvent e) {
            dataGenerationEngine.setRefineQualifiers(refineQualifiersCheckBox.isSelected());
            logger.debug(
                    "dataGenerationEngine.isRefineQualifiers() = " + dataGenerationEngine.isRefineQualifiers());
        }
    });
    rhsPanel.add(refineQualifiersCheckBox);

    includePreCoordinatedDataCheckBox = new JCheckBox(
            new AbstractAction("Include pre-coordinated expressions") {
                public void actionPerformed(ActionEvent e) {
                    dataGenerationEngine
                            .setIncludePrecoordinatedData(includePreCoordinatedDataCheckBox.isSelected());
                    logger.debug("dataGenerationEngine.isIncludePrecoordinatedData() = "
                            + dataGenerationEngine.isIncludePrecoordinatedData());
                }
            });
    rhsPanel.add(includePreCoordinatedDataCheckBox);
    rhsPanel.add(new JLabel("  "));

    /*
    * create panel for parametrising engine
    */
    JPanel parametrisationPanel = new JPanel();
    parametrisationPanel.setLayout(new GridLayout(0, 2));
    parametrisationPanel.setBorder(BorderFactory.createTitledBorder("Engine Parameters"));

    // add panels to parametrisation panel
    parametrisationPanel.add(lhsPanel);
    parametrisationPanel.add(rhsPanel);

    JPanel topPanel = new JPanel();
    topPanel.setLayout(new BoxLayout(topPanel, BoxLayout.LINE_AXIS));
    topPanel.add(runPanel);
    topPanel.add(new JSeparator(SwingConstants.VERTICAL));
    topPanel.add(buttonsPanel);
    // add all panels to this component
    setLayout(new BorderLayout());
    add(topPanel, BorderLayout.NORTH);
    add(parametrisationPanel, BorderLayout.CENTER);

    // initialise values
    populateFields(dataGenerationEngine);
}