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

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

Introduction

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

Prototype

Alignment DEFAULT

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

Click Source Link

Document

Use the column's or row's default alignment.

Usage

From source file:de.dal33t.powerfolder.ui.MainFrame.java

License:Open Source License

private void configureUi() {

    // Display the title pane.
    uiComponent.getRootPane().putClientProperty("Synthetica.titlePane.enabled", Boolean.FALSE);
    uiComponent.getRootPane().updateUI();

    FormLayout layout = new FormLayout("fill:pref:grow, pref, 3dlu, pref", "pref, pref, fill:0:grow");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    CellConstraints cc = new CellConstraints();

    builder.add(logoLabel, cc.xyw(1, 1, 3));

    ButtonBarBuilder b = new ButtonBarBuilder();
    b.addFixed(minusButton);/*from   ww  w.  j  a va  2  s . c o  m*/
    b.addFixed(plusButton);
    b.addFixed(closeButton);
    builder.add(b.getPanel(), cc.xywh(4, 1, 1, 1, "right, top"));

    builder.add(inlineInfoLabel, cc.xy(2, 1, CellConstraints.DEFAULT, CellConstraints.BOTTOM));
    builder.add(inlineInfoCloseButton, cc.xy(4, 1, CellConstraints.DEFAULT, CellConstraints.BOTTOM));

    builder.add(centralPanel, cc.xyw(1, 3, 4));

    builder.add(createMiniPanel(), cc.xyw(1, 2, 4));

    uiComponent.getContentPane().removeAll();
    uiComponent.getContentPane().add(builder.getPanel());
    uiComponent.setResizable(true);

    Controller c = getController();

    // Pack elements and set to default size.
    uiComponent.pack();
    uiComponent.setSize(uiComponent.getWidth(), UIConstants.MAIN_FRAME_DEFAULT_HEIGHT);

    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice[] devices = ge.getScreenDevices();

    int x = (int) ((devices[0].getDisplayMode().getWidth() - uiComponent.getWidth()) / 2.0);
    int y = (int) ((devices[0].getDisplayMode().getHeight() - uiComponent.getHeight()) / 2.0);
    uiComponent.setLocation(x, y);

    configureInlineInfo();
    updateMainStatus(SyncStatusEvent.NOT_STARTED);
    updateNoticesLabel();
}

From source file:de.dal33t.powerfolder.ui.notification.NotificationForm.java

License:Open Source License

/**
 * Create the UI for notification form/*  w w w  . java 2 s  . co m*/
 */
private JPanel createPanel(String titleText, String acceptOptionLabel, Action acceptAction,
        String cancelOptionLabel, Action cancelAction) {

    JPanel panel = new JPanel();
    panel.setBackground(Color.WHITE);
    CellConstraints cc = new CellConstraints();

    FormLayout formLayout;
    int internalWidth;
    if (acceptOptionLabel == null && cancelOptionLabel == null) {
        // No buttons
        formLayout = new FormLayout(
                //     content
                "3dlu, 150dlu:grow, 3dlu", "3dlu, pref, 15dlu, pref, 3dlu");
        //     head         msg
        internalWidth = 1;
    } else if (acceptOptionLabel != null && cancelOptionLabel != null) {
        // Two buttons
        formLayout = new FormLayout(
                //            button             button
                "3dlu, 10dlu, 80dlu:grow, 10dlu, 80dlu:grow, 10dlu, 3dlu",
                "3dlu, pref, 15dlu, pref, 15dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu");
        //     head         msg          hr          cb          btn
        internalWidth = 5;
    } else {
        // One button
        formLayout = new FormLayout(
                //            button
                "3dlu, 45dlu, 80dlu:grow, 45dlu, 3dlu",
                "3dlu, pref, 15dlu, pref, 15dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu");
        //     head         msg          hr          cb          btn
        internalWidth = 3;
    }
    panel.setLayout(formLayout);

    // Heading
    panel.add(createHeaderPanel(titleText), cc.xyw(2, 2, internalWidth));

    // Message
    JTextArea textArea = new JTextArea();
    textArea.setText(messageText);
    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);
    panel.add(textArea,
            new CellConstraints(2, 4, internalWidth, 1, CellConstraints.DEFAULT, CellConstraints.TOP));

    // If there are no buttons, don't show anything else.
    if (acceptOptionLabel != null || cancelOptionLabel != null) {

        // Separator
        panel.add(new JSeparator(), cc.xyw(2, 6, internalWidth));

        neverShowSystemNotificationCB = new JCheckBox(
                Translation.getTranslation("notification_form.never_show_system_notifications"));
        neverShowSystemNotificationCB.addActionListener(new MyActionListener());
        panel.add(neverShowSystemNotificationCB, cc.xyw(2, 8, internalWidth));

        // Buttons
        if (acceptOptionLabel != null && cancelOptionLabel != null) {
            // Two buttons
            JButton acceptButton = new JButton();
            acceptButton.setAction(acceptAction);
            acceptButton.setText(acceptOptionLabel);
            panel.add(acceptButton, cc.xy(3, 10));

            JButton cancelButton = new JButton();
            cancelButton.setAction(cancelAction);
            cancelButton.setText(cancelOptionLabel);
            panel.add(cancelButton, cc.xy(5, 10));
        } else {
            // Single button (accept or cancel)
            if (acceptOptionLabel != null) {
                // Accept
                JButton acceptButton = new JButton();
                acceptButton.setAction(acceptAction);
                acceptButton.setText(acceptOptionLabel);
                panel.add(acceptButton, cc.xy(3, 10));
            } else {
                // Cancel
                JButton cancelButton = new JButton();
                cancelButton.setAction(cancelAction);
                cancelButton.setText(cancelOptionLabel);
                panel.add(cancelButton, cc.xy(3, 10));
            }
        }
    }

    return panel;
}

From source file:de.dal33t.powerfolder.ui.widget.FileFilterTextField.java

License:Open Source License

public JPanel getUIComponent() {
    if (panel == null) {
        initComponents();/*from  w ww  . j a  v  a 2  s  . co m*/
        FormLayout layout = new FormLayout("pref, 1dlu, pref:grow, 15dlu", "pref");
        PanelBuilder builder = new PanelBuilder(layout);
        CellConstraints cc = new CellConstraints();

        builder.add(glassIcon, cc.xy(1, 1));
        builder.add(textField, cc.xy(3, 1));
        builder.add(clearTextJButton, cc.xy(4, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
        builder.setBorder(new EtchedBorder());
        panel = builder.getPanel();
        panel.setBackground(Color.white);
    }
    return panel;
}

From source file:de.dal33t.powerfolder.ui.widget.FilterTextField.java

License:Open Source License

public JPanel getUIComponent() {
    if (panel == null) {
        initComponents();/* ww  w.  ja v  a2  s .  c  o  m*/
        FormLayout layout = new FormLayout("pref, 1dlu, pref:grow, 15dlu", "pref");
        PanelBuilder builder = new PanelBuilder(layout);
        CellConstraints cc = new CellConstraints();

        builder.add(glassIcon, cc.xy(1, 1));
        builder.add(textField, cc.xy(3, 1));
        builder.add(clearTextJButton, cc.xy(4, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
        builder.add(spacerIcon, cc.xy(4, 1));
        builder.setBorder(new EtchedBorder());
        panel = builder.getPanel();
        panel.setBackground(Color.white);
    }
    return panel;
}

From source file:de.dal33t.powerfolder.ui.wizard.MultiFileRestorePanelOld.java

License:Open Source License

protected JComponent buildContent() {
    FormLayout layout = new FormLayout("140dlu, 3dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref:grow",
            "pref, 3dlu, pref, 6dlu, pref, 3dlu, pref, 3dlu, pref");

    PanelBuilder builder = new PanelBuilder(layout);
    CellConstraints cc = new CellConstraints();

    int row = 1;/*from  www  .j a  v a2  s  .  co  m*/
    builder.add(latestVersionButton, cc.xy(1, row));

    row += 2;
    builder.add(dateVersionButton, cc.xy(1, row));
    builder.add(dateChooser, cc.xy(3, row));
    builder.add(hourSpinner, cc.xy(5, row));
    builder.add(minuteSpinner, cc.xy(7, row));

    row += 2;
    builder.add(infoLabel, cc.xy(1, row, CellConstraints.CENTER, CellConstraints.DEFAULT));

    row += 2;

    bar.setIndeterminate(true);

    RestoreFilesTable table = new RestoreFilesTable(tableModel);
    scrollPane = new JScrollPane(table);
    scrollPane.setPreferredSize(new Dimension(400, 200));
    scrollPane.setVisible(false);
    UIUtil.removeBorder(scrollPane);
    UIUtil.setZeroWidth(scrollPane);

    // bar and scrollPane share the same slot.
    builder.add(bar, cc.xy(1, row));
    builder.add(scrollPane, cc.xyw(1, row, 9));

    return builder.getPanel();
}

From source file:de.dal33t.powerfolder.ui.wizard.PFWizardPanel.java

License:Open Source License

/**
 * Builds the ui//from w w  w .  j  av  a 2 s  .  c  o  m
 */
private void buildUI() {

    // init
    initComponents();

    JComponent content = buildContent();
    content.setOpaque(false);
    // content.setBackground(Color.WHITE);

    String title = getTitle();

    Reject.ifBlank(title, "Title is blank");
    Reject.ifNull(content, "Content is null");

    setBorder(Borders.EMPTY_BORDER);

    FormLayout layout = new FormLayout("13px, fill:pref:grow", "pref, 7dlu, pref, 3dlu, fill:pref:grow");
    PanelBuilder pageBuilder = new PanelBuilder(layout, this);
    pageBuilder.setBorder(Borders.createEmptyBorder("7dlu, 20dlu, 0dlu, 20dlu"));
    CellConstraints cc = new CellConstraints();
    int row = 1;

    pageBuilder.add(new JLabel(Icons.getIconById(Icons.LOGO400UI)), cc.xywh(1, row, 2, 1, "left, default"));
    row += 2;

    titleLabel = createTitleLabel(title);
    pageBuilder.add(titleLabel, cc.xy(2, row));
    row += 2;

    pageBuilder.add(content, cc.xy(2, row, CellConstraints.DEFAULT, CellConstraints.TOP));

    // initalized
    initalized = true;
}

From source file:de.dfki.km.text20.diagnosis.gui.panel.templates.ServerPanelTemplate.java

@SuppressWarnings("unqualified-field-access")
private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    this.visualEyeTrackingDataPanel = new JPanel();
    this.eyePositionDisplay = new EyePositionDisplay();
    this.eyeDistanceDisplay = new EyeDistanceDisplay();
    this.pupilSizeDisplay = new PupilSizeDisplay();
    this.tabbedPane = new JTabbedPane();
    this.overallPanel = new JPanel();
    this.eyeTrackingDeviceNameLabel = new JLabel();
    this.eyeTrackingDeviceNameValueLabel = new JLabel();
    this.eyeTrackingDeviceTypeLabel = new JLabel();
    this.eyeTrackingDeviceTypeValueLabel = new JLabel();
    this.eyeTrackingDeviceLocationLabel = new JLabel();
    this.eyeTrackingDeviceLocationValueLabel = new JLabel();
    this.recordingTitle = new JLabel();
    this.recordIndicator = new JStatusIndicator();
    this.recordSwitch = new JXHyperlink();
    this.eyeTrackingEventRateLabel = new JLabel();
    this.eventRateIndicator = new JStatusIndicator();
    this.eventRate = new JLabel();
    this.brainTrackingDeviceNameLabel = new JLabel();
    this.brainTrackingDeviceNameValueLabel = new JLabel();
    this.brainTrackingDeviceLocationLabel = new JLabel();
    this.brainTrackingDeviceLocationValueLabel = new JLabel();
    this.brainTrackerRecordingStatusLabel = new JLabel();
    this.brainRecordIndicator = new JStatusIndicator();
    this.brainTrackingRecordSwitch = new JXHyperlink();
    this.brainTrackingEventRateLabel = new JLabel();
    this.brainTrackingEventRateIndicator = new JStatusIndicator();
    this.brainTrackingEventRateValue = new JLabel();
    this.deviceTrackingSinceLabel = new JLabel();
    this.trackingSince = new JLabel();
    this.brainHistoryLabel = new JLabel();
    this.brainHistoryLink = new JXHyperlink();
    this.gazePositionLabel = new JLabel();
    this.gazePositionHistoryLink = new JXHyperlink();
    this.headPositionLabel = new JLabel();
    this.headPositionIndicator = new JStatusIndicator();
    this.headPositionHistoryLink = new JXHyperlink();
    this.headDistanceLabel = new JLabel();
    this.headDistanceIndicator = new JStatusIndicator();
    this.headDistanceHistoryLink = new JXHyperlink();
    this.pupilSizeLabel = new JLabel();
    this.pupilSizeHistoryLink = new JXHyperlink();
    this.hardwareRecalibrationLabel = new JLabel();
    this.performHardwareRecalibrationLink = new JXHyperlink();
    this.localRecalibrationVerificationLabel = new JLabel();
    this.calibrationIndicator = new JStatusIndicator();
    this.performRecalibrationLink = new JXHyperlink();
    this.qualityLabel = new JLabel();
    this.overallQualityIndicator = new JStatusIndicator();
    this.overallQualityLabel = new JLabel();
    this.panel3 = new JPanel();
    this.scrollPane4 = new JScrollPane();
    this.logText = new JTextPane();
    this.settingsPanel = new JPanel();
    this.bufferSizeEyeTrackerHistoryLabel = new JLabel();
    this.bufferSizeLabel = new JLabel();
    this.bufferSizeSlider = new JSlider();
    this.bufferSizeBrainTrackerHistoryLabel = new JLabel();
    this.bufferSizeBrainTrackerHistoryValueLabel = new JLabel();
    this.bufferSizeBrainTrackerHistorySlider = new JSlider();
    this.transparentLocalRecalibrationLabel2 = new JLabel();
    this.ministatus = new JCheckBox();
    this.transparentLocalRecalibrationLabel = new JLabel();
    this.transparentRecalibration = new JCheckBox();
    this.ChannelPanel = new JPanel();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setLayout(new FormLayout("default:grow", "min, $lgap, 0dlu, $lgap, fill:[200dlu,pref]:grow"));

    //======== visualEyeTrackingDataPanel ========
    {//from  ww  w  .  j  a v  a 2s .  c o  m
        this.visualEyeTrackingDataPanel.setBorder(new TitledBorder(null, "Visual Tracking Data",
                TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION));
        this.visualEyeTrackingDataPanel.setPreferredSize(new Dimension(506, 500));
        this.visualEyeTrackingDataPanel.setOpaque(false);
        this.visualEyeTrackingDataPanel.setRequestFocusEnabled(false);
        this.visualEyeTrackingDataPanel.setVerifyInputWhenFocusTarget(false);
        this.visualEyeTrackingDataPanel.setAlignmentY(1.5F);
        this.visualEyeTrackingDataPanel
                .setLayout(new FormLayout("default:grow, 2*($lcgap, default)", "fill:150dlu"));
        ((FormLayout) this.visualEyeTrackingDataPanel.getLayout()).setColumnGroups(new int[][] { { 3, 5 } });

        //---- eyePositionDisplay ----
        this.eyePositionDisplay.setPreferredSize(new Dimension(300, 200));
        this.eyePositionDisplay.setBorder(new EmptyBorder(5, 5, 5, 5));
        this.eyePositionDisplay.setMinimumSize(new Dimension(1, 200));
        this.eyePositionDisplay.setEyePostionCanvasBackgroundColor(Color.darkGray);
        this.visualEyeTrackingDataPanel.add(this.eyePositionDisplay, cc.xy(1, 1));

        //---- eyeDistanceDisplay ----
        this.eyeDistanceDisplay.setPreferredSize(new Dimension(50, 300));
        this.eyeDistanceDisplay.setMinimumSize(new Dimension(1, 300));
        this.eyeDistanceDisplay.setPaddingVal(4);
        this.eyeDistanceDisplay.setBackground(null);
        this.eyeDistanceDisplay.setForeground(Color.darkGray);
        this.eyeDistanceDisplay.setEyeDistanceCanvasColor(Color.darkGray);
        this.visualEyeTrackingDataPanel.add(this.eyeDistanceDisplay, new CellConstraints(3, 1, 1, 1,
                CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(5, 0, 5, 0)));

        //---- pupilSizeDisplay ----
        this.pupilSizeDisplay.setPreferredSize(new Dimension(60, 300));
        this.pupilSizeDisplay.setMinimumSize(new Dimension(1, 300));
        this.pupilSizeDisplay.setPupilSizeCanvasBackgroundColor(Color.darkGray);
        this.visualEyeTrackingDataPanel.add(this.pupilSizeDisplay, new CellConstraints(5, 1, 1, 1,
                CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(5, 0, 5, 0)));
    }
    add(this.visualEyeTrackingDataPanel, cc.xywh(1, 1, 1, 1, CellConstraints.FILL, CellConstraints.DEFAULT));

    //======== tabbedPane ========
    {

        //======== overallPanel ========
        {
            this.overallPanel.setLayout(new FormLayout("150dlu, $lcgap, default, 6dlu, default:grow",
                    "default, $lgap, fill:default, 22*($lgap, default)"));
            ((FormLayout) this.overallPanel.getLayout()).setRowGroups(new int[][] { { 1, 3, 5, 7, 9, 11, 13, 15,
                    17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 45, 47 } });

            //---- eyeTrackingDeviceNameLabel ----
            this.eyeTrackingDeviceNameLabel.setText("Eye Tracking Device Name");
            this.overallPanel.add(this.eyeTrackingDeviceNameLabel, cc.xy(1, 1));

            //---- eyeTrackingDeviceNameValueLabel ----
            this.eyeTrackingDeviceNameValueLabel.setText("-");
            this.overallPanel.add(this.eyeTrackingDeviceNameValueLabel, cc.xy(5, 1));

            //---- eyeTrackingDeviceTypeLabel ----
            this.eyeTrackingDeviceTypeLabel.setText("Eye Tracking Device Type");
            this.overallPanel.add(this.eyeTrackingDeviceTypeLabel, cc.xy(1, 3));

            //---- eyeTrackingDeviceTypeValueLabel ----
            this.eyeTrackingDeviceTypeValueLabel.setText("-");
            this.overallPanel.add(this.eyeTrackingDeviceTypeValueLabel, cc.xy(5, 3));

            //---- eyeTrackingDeviceLocationLabel ----
            this.eyeTrackingDeviceLocationLabel.setText("Eye Tracking Device Location");
            this.overallPanel.add(this.eyeTrackingDeviceLocationLabel, cc.xy(1, 5));

            //---- eyeTrackingDeviceLocationValueLabel ----
            this.eyeTrackingDeviceLocationValueLabel.setText("-");
            this.overallPanel.add(this.eyeTrackingDeviceLocationValueLabel, cc.xy(5, 5));

            //---- recordingTitle ----
            this.recordingTitle.setText("Eye Tracker Recording Status");
            this.overallPanel.add(this.recordingTitle, cc.xy(1, 7));
            this.overallPanel.add(this.recordIndicator, cc.xy(3, 7));

            //---- recordSwitch ----
            this.recordSwitch.setText("Off");
            this.recordSwitch.setActionCommand("toggleRecording");
            this.overallPanel.add(this.recordSwitch, cc.xy(5, 7));

            //---- eyeTrackingEventRateLabel ----
            this.eyeTrackingEventRateLabel.setText("Eye Tracker Event Rate [events per second]");
            this.overallPanel.add(this.eyeTrackingEventRateLabel, cc.xy(1, 9));
            this.overallPanel.add(this.eventRateIndicator, cc.xy(3, 9));

            //---- eventRate ----
            this.eventRate.setText("0");
            this.overallPanel.add(this.eventRate, cc.xy(5, 9));

            //---- brainTrackingDeviceNameLabel ----
            this.brainTrackingDeviceNameLabel.setText("Brain Tracking Device Name");
            this.overallPanel.add(this.brainTrackingDeviceNameLabel, cc.xy(1, 13));

            //---- brainTrackingDeviceNameValueLabel ----
            this.brainTrackingDeviceNameValueLabel.setText("-");
            this.overallPanel.add(this.brainTrackingDeviceNameValueLabel, cc.xy(5, 13));

            //---- brainTrackingDeviceLocationLabel ----
            this.brainTrackingDeviceLocationLabel.setText("Brain Tracking Device Location");
            this.overallPanel.add(this.brainTrackingDeviceLocationLabel, cc.xy(1, 15));

            //---- brainTrackingDeviceLocationValueLabel ----
            this.brainTrackingDeviceLocationValueLabel.setText("-");
            this.overallPanel.add(this.brainTrackingDeviceLocationValueLabel, cc.xy(5, 15));

            //---- brainTrackerRecordingStatusLabel ----
            this.brainTrackerRecordingStatusLabel.setText("Brain Tracking Recording Status");
            this.overallPanel.add(this.brainTrackerRecordingStatusLabel, cc.xy(1, 17));
            this.overallPanel.add(this.brainRecordIndicator, cc.xy(3, 17));

            //---- brainTrackingRecordSwitch ----
            this.brainTrackingRecordSwitch.setText("Off");
            this.brainTrackingRecordSwitch.setActionCommand("toggleBrainRecording");
            this.overallPanel.add(this.brainTrackingRecordSwitch, cc.xy(5, 17));

            //---- brainTrackingEventRateLabel ----
            this.brainTrackingEventRateLabel.setText("Brain Tracker Event Rate [events per second]");
            this.overallPanel.add(this.brainTrackingEventRateLabel, cc.xy(1, 19));
            this.overallPanel.add(this.brainTrackingEventRateIndicator, cc.xy(3, 19));

            //---- brainTrackingEventRateValue ----
            this.brainTrackingEventRateValue.setText("0");
            this.overallPanel.add(this.brainTrackingEventRateValue, cc.xy(5, 19));

            //---- deviceTrackingSinceLabel ----
            this.deviceTrackingSinceLabel.setText("Device Tracking Since");
            this.overallPanel.add(this.deviceTrackingSinceLabel, cc.xy(1, 23));

            //---- trackingSince ----
            this.trackingSince.setText("Not tracking");
            this.overallPanel.add(this.trackingSince, cc.xy(5, 23));

            //---- brainHistoryLabel ----
            this.brainHistoryLabel.setText("Brain History");
            this.overallPanel.add(this.brainHistoryLabel, cc.xy(1, 27));

            //---- brainHistoryLink ----
            this.brainHistoryLink.setText("Show brain history ...");
            this.brainHistoryLink.setActionCommand("openBrainHistory");
            this.overallPanel.add(this.brainHistoryLink, cc.xy(5, 27));

            //---- gazePositionLabel ----
            this.gazePositionLabel.setText("Gaze Position [normalized]");
            this.overallPanel.add(this.gazePositionLabel, cc.xy(1, 31));

            //---- gazePositionHistoryLink ----
            this.gazePositionHistoryLink.setText("Gaze position history ...");
            this.gazePositionHistoryLink.setActionCommand("openGazePositionHistory");
            this.overallPanel.add(this.gazePositionHistoryLink, cc.xy(5, 31));

            //---- headPositionLabel ----
            this.headPositionLabel.setText("Head Position [normalized]");
            this.overallPanel.add(this.headPositionLabel, cc.xy(1, 33));
            this.overallPanel.add(this.headPositionIndicator, cc.xy(3, 33));

            //---- headPositionHistoryLink ----
            this.headPositionHistoryLink.setText("Head position history ...");
            this.headPositionHistoryLink.setActionCommand("openHeadPositionHistory");
            this.overallPanel.add(this.headPositionHistoryLink, cc.xy(5, 33));

            //---- headDistanceLabel ----
            this.headDistanceLabel.setText("Head Distance [mm]");
            this.overallPanel.add(this.headDistanceLabel, cc.xy(1, 35));
            this.overallPanel.add(this.headDistanceIndicator, cc.xy(3, 35));

            //---- headDistanceHistoryLink ----
            this.headDistanceHistoryLink.setText("Head distance history ...");
            this.headDistanceHistoryLink.setActionCommand("openHeadDistanceHistory");
            this.overallPanel.add(this.headDistanceHistoryLink, cc.xy(5, 35));

            //---- pupilSizeLabel ----
            this.pupilSizeLabel.setText("Pupil Size [mm]");
            this.overallPanel.add(this.pupilSizeLabel, cc.xy(1, 37));

            //---- pupilSizeHistoryLink ----
            this.pupilSizeHistoryLink.setText("Pupilsize history ...");
            this.pupilSizeHistoryLink.setActionCommand("openPupilSizeHistory");
            this.overallPanel.add(this.pupilSizeHistoryLink, cc.xy(5, 37));

            //---- hardwareRecalibrationLabel ----
            this.hardwareRecalibrationLabel.setText("Hardware Calibration");
            this.overallPanel.add(this.hardwareRecalibrationLabel, cc.xy(1, 41));

            //---- performHardwareRecalibrationLink ----
            this.performHardwareRecalibrationLink.setText("Perfom hardware recalibration ...");
            this.performHardwareRecalibrationLink.setActionCommand("performHardwareRecalibration");
            this.overallPanel.add(this.performHardwareRecalibrationLink, cc.xy(5, 41));

            //---- localRecalibrationVerificationLabel ----
            this.localRecalibrationVerificationLabel.setText("Local Recalibration & Verficiation");
            this.overallPanel.add(this.localRecalibrationVerificationLabel, cc.xy(1, 43));
            this.overallPanel.add(this.calibrationIndicator, cc.xy(3, 43));

            //---- performRecalibrationLink ----
            this.performRecalibrationLink.setText("Perfom local recalibration ...");
            this.performRecalibrationLink.setActionCommand("performRecalibration");
            this.overallPanel.add(this.performRecalibrationLink, cc.xy(5, 43));

            //---- qualityLabel ----
            this.qualityLabel.setText("Overall Tracking Quality");
            this.overallPanel.add(this.qualityLabel, cc.xy(1, 47));
            this.overallPanel.add(this.overallQualityIndicator, cc.xy(3, 47));

            //---- overallQualityLabel ----
            this.overallQualityLabel.setText("Unknown");
            this.overallPanel.add(this.overallQualityLabel, cc.xy(5, 47));
        }
        this.tabbedPane.addTab("Overview", this.overallPanel);

        //======== panel3 ========
        {
            this.panel3.setLayout(new FormLayout("default:grow", "fill:default:grow"));

            //======== scrollPane4 ========
            {
                this.scrollPane4.setViewportView(this.logText);
            }
            this.panel3.add(this.scrollPane4, cc.xy(1, 1));
        }
        this.tabbedPane.addTab("Message Log", this.panel3);

        //======== settingsPanel ========
        {
            this.settingsPanel.setLayout(
                    new FormLayout("150dlu, $lcgap, 50dlu, 6dlu, default:grow", "6*(default, $lgap), default"));
            ((FormLayout) this.settingsPanel.getLayout()).setRowGroups(new int[][] { { 1, 3, 5, 7, 9, 11 } });

            //---- bufferSizeEyeTrackerHistoryLabel ----
            this.bufferSizeEyeTrackerHistoryLabel.setText("Eye Tracker Buffer Time");
            this.settingsPanel.add(this.bufferSizeEyeTrackerHistoryLabel, cc.xy(1, 1));

            //---- bufferSizeLabel ----
            this.bufferSizeLabel.setText("30s");
            this.settingsPanel.add(this.bufferSizeLabel,
                    cc.xywh(3, 1, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT));

            //---- bufferSizeSlider ----
            this.bufferSizeSlider.setMinimum(5);
            this.bufferSizeSlider.setMaximum(120);
            this.bufferSizeSlider.setMajorTickSpacing(5);
            this.bufferSizeSlider.setSnapToTicks(true);
            this.bufferSizeSlider.setValue(30);
            this.settingsPanel.add(this.bufferSizeSlider, cc.xy(5, 1));

            //---- bufferSizeBrainTrackerHistoryLabel ----
            this.bufferSizeBrainTrackerHistoryLabel.setText("Brain Tracker Buffer Time");
            this.settingsPanel.add(this.bufferSizeBrainTrackerHistoryLabel, cc.xy(1, 3));

            //---- bufferSizeBrainTrackerHistoryValueLabel ----
            this.bufferSizeBrainTrackerHistoryValueLabel.setText("5s");
            this.settingsPanel.add(this.bufferSizeBrainTrackerHistoryValueLabel,
                    cc.xywh(3, 3, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT));

            //---- bufferSizeBrainTrackerHistorySlider ----
            this.bufferSizeBrainTrackerHistorySlider.setMaximum(30);
            this.bufferSizeBrainTrackerHistorySlider.setMinimum(5);
            this.bufferSizeBrainTrackerHistorySlider.setSnapToTicks(true);
            this.bufferSizeBrainTrackerHistorySlider.setMajorTickSpacing(1);
            this.bufferSizeBrainTrackerHistorySlider.setValue(5);
            this.settingsPanel.add(this.bufferSizeBrainTrackerHistorySlider, cc.xy(5, 3));

            //---- transparentLocalRecalibrationLabel2 ----
            this.transparentLocalRecalibrationLabel2.setText("Display Ministatus");
            this.settingsPanel.add(this.transparentLocalRecalibrationLabel2, cc.xy(1, 7));

            //---- ministatus ----
            this.ministatus.setText("Ministatus");
            this.settingsPanel.add(this.ministatus, cc.xy(5, 7));

            //---- transparentLocalRecalibrationLabel ----
            this.transparentLocalRecalibrationLabel.setText("Transparent Local Recalibration");
            this.settingsPanel.add(this.transparentLocalRecalibrationLabel, cc.xy(1, 11));

            //---- transparentRecalibration ----
            this.transparentRecalibration.setText("Transparent");
            this.settingsPanel.add(this.transparentRecalibration, cc.xy(5, 11));
        }
        this.tabbedPane.addTab("Settings", this.settingsPanel);

        //======== ChannelPanel ========
        {
            this.ChannelPanel.setLayout(new FormLayout("default:grow", "default"));
        }
        this.tabbedPane.addTab("Channels", this.ChannelPanel);

    }
    add(this.tabbedPane, cc.xy(1, 5));
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:de.dfki.km.text20.lightning.gui.ConfigWindow.java

License:Open Source License

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    mainFrame = new JFrame();
    dialogPane = new JPanel();
    contentPanel = new JPanel();
    panel1 = new JPanel();
    labelActionHotkey = new JLabel();
    comboBoxActionHotkey = new JComboBox();
    labelStatusHotkey = new JLabel();
    comboBoxStatusHotkey = new JComboBox();
    labelSound = new JLabel();
    checkBoxSound = new JCheckBox();
    labelDimension = new JLabel();
    spinnerDimension = new JSpinner();
    labelRecalibration = new JLabel();
    checkBoxRecalibration = new JCheckBox();
    buttonClearRecalibration = new JButton();
    panel2 = new JPanel();
    labelEnableMouseWarp = new JLabel();
    checkBoxUseWarp = new JCheckBox();
    labelWarpMethod = new JLabel();
    comboBoxWarpMethod = new JComboBox();
    buttonWarpConfig = new JButton();
    panel3 = new JPanel();
    labelEvaluation = new JLabel();
    checkBoxEvaluation = new JCheckBox();
    labelName = new JLabel();
    textFieldName = new JTextField();
    labelScreenBright = new JLabel();
    comboBoxScreenBright = new JComboBox();
    labelSettingBright = new JLabel();
    comboBoxSettingBright = new JComboBox();
    labelOutputPath = new JLabel();
    buttonSelect = new JButton();
    textFieldOutputPath = new JTextField();
    panel4 = new JPanel();
    labelDetector = new JLabel();
    comboBoxDetector = new JComboBox();
    buttonDetectorConfig = new JButton();
    buttonSubmit = new JButton();
    buttonDefault = new JButton();
    buttonOK = new JButton();
    buttonCancel = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== mainFrame ========
    {//from  w w w .ja v a2s .com
        mainFrame.setTitle("Project Lightning (Desktop)");
        mainFrame.setResizable(false);
        Container mainFrameContentPane = mainFrame.getContentPane();
        mainFrameContentPane.setLayout(new GridLayout());

        //======== dialogPane ========
        {
            dialogPane.setBorder(Borders.DIALOG_BORDER);
            dialogPane.setLayout(new BoxLayout(dialogPane, BoxLayout.X_AXIS));

            //======== contentPanel ========
            {
                contentPanel.setLayout(new FormLayout("3*(20dlu:grow, $lcgap), 20dlu:grow",
                        "top:default, $lgap, top:48dlu, $lgap, default:grow, $lgap, default"));
                ((FormLayout) contentPanel.getLayout()).setColumnGroups(new int[][] { { 1, 3 }, { 5, 7 } });

                //======== panel1 ========
                {
                    panel1.setBorder(new TitledBorder("General Options"));
                    panel1.setLayout(
                            new FormLayout("20dlu:grow, $lcgap, 20dlu:grow", "5*(default, $lgap), default"));

                    //---- labelActionHotkey ----
                    labelActionHotkey.setText("Cursorwarp Key");
                    labelActionHotkey.setIcon(null);
                    panel1.add(labelActionHotkey, cc.xywh(1, 1, 2, 1));

                    //---- comboBoxActionHotkey ----
                    comboBoxActionHotkey.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            comboBoxActionHotkeyActionPerformed(e);
                        }
                    });
                    panel1.add(comboBoxActionHotkey, cc.xy(3, 1));

                    //---- labelStatusHotkey ----
                    labelStatusHotkey.setText("Key to Enable & Disable");
                    panel1.add(labelStatusHotkey, cc.xywh(1, 3, 2, 1));

                    //---- comboBoxStatusHotkey ----
                    comboBoxStatusHotkey.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            comboBoxStatusHotkeyActionPerformed(e);
                        }
                    });
                    panel1.add(comboBoxStatusHotkey, cc.xy(3, 3));

                    //---- labelSound ----
                    labelSound.setText("Play Sounds");
                    panel1.add(labelSound, cc.xy(1, 5));

                    //---- checkBoxSound ----
                    checkBoxSound.setSelectedIcon(null);
                    panel1.add(checkBoxSound, cc.xy(3, 5));

                    //---- labelDimension ----
                    labelDimension.setText("Pixels to Consider");
                    labelDimension.setIcon(null);
                    panel1.add(labelDimension, cc.xywh(1, 7, 2, 1));

                    //---- spinnerDimension ----
                    spinnerDimension.setModel(new SpinnerNumberModel(0, 0, 999, 1));
                    panel1.add(spinnerDimension, cc.xy(3, 7));

                    //---- labelRecalibration ----
                    labelRecalibration.setText("Use Recalibration");
                    panel1.add(labelRecalibration, cc.xywh(1, 9, 1, 3));
                    panel1.add(checkBoxRecalibration, cc.xy(3, 9));

                    //---- buttonClearRecalibration ----
                    buttonClearRecalibration.setText("Clear Recalibration");
                    panel1.add(buttonClearRecalibration, cc.xy(3, 11));
                }
                contentPanel.add(panel1, cc.xywh(1, 1, 3, 3, CellConstraints.FILL, CellConstraints.TOP));

                //======== panel2 ========
                {
                    panel2.setBorder(new TitledBorder("Mouse Warping"));
                    panel2.setLayout(
                            new FormLayout("80dlu:grow, $lcgap, 80dlu:grow", "2*(default, $lgap), default"));

                    //---- labelEnableMouseWarp ----
                    labelEnableMouseWarp.setText("Enable Mouse Warp");
                    panel2.add(labelEnableMouseWarp, cc.xywh(1, 1, 2, 1));

                    //---- checkBoxUseWarp ----
                    checkBoxUseWarp.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            checkBoxUseWarpActionPerformed(e);
                        }
                    });
                    panel2.add(checkBoxUseWarp, cc.xy(3, 1));

                    //---- labelWarpMethod ----
                    labelWarpMethod.setText("Warp Method");
                    panel2.add(labelWarpMethod, cc.xywh(1, 3, 2, 3));
                    panel2.add(comboBoxWarpMethod, cc.xy(3, 3));

                    //---- buttonWarpConfig ----
                    buttonWarpConfig.setText("Configuration");
                    panel2.add(buttonWarpConfig, cc.xy(3, 5));
                }
                contentPanel.add(panel2, cc.xywh(5, 1, 3, 1, CellConstraints.FILL, CellConstraints.TOP));

                //======== panel3 ========
                {
                    panel3.setBorder(new TitledBorder("Evaluation "));
                    panel3.setLayout(
                            new FormLayout("80dlu:grow, $lcgap, 80dlu:grow", "5*(default, $lgap), default"));

                    //---- labelEvaluation ----
                    labelEvaluation.setText("Evaluation Mode");
                    panel3.add(labelEvaluation, cc.xywh(1, 1, 2, 1));

                    //---- checkBoxEvaluation ----
                    checkBoxEvaluation.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            checkBoxTrainingActionPerformed(e);
                        }
                    });
                    panel3.add(checkBoxEvaluation, cc.xy(3, 1));

                    //---- labelName ----
                    labelName.setText("Username");
                    panel3.add(labelName, cc.xywh(1, 3, 2, 1));
                    panel3.add(textFieldName, cc.xy(3, 3));

                    //---- labelScreenBright ----
                    labelScreenBright.setText("Screen Brightness");
                    panel3.add(labelScreenBright, cc.xywh(1, 5, 2, 1));
                    panel3.add(comboBoxScreenBright, cc.xy(3, 5));

                    //---- labelSettingBright ----
                    labelSettingBright.setText("Setting Brightness");
                    panel3.add(labelSettingBright, cc.xywh(1, 7, 2, 1));
                    panel3.add(comboBoxSettingBright, cc.xy(3, 7));

                    //---- labelOutputPath ----
                    labelOutputPath.setText("Output Path");
                    panel3.add(labelOutputPath, cc.xywh(1, 9, 1, 3));

                    //---- buttonSelect ----
                    buttonSelect.setText("Select");
                    panel3.add(buttonSelect, cc.xy(3, 9));
                    panel3.add(textFieldOutputPath, cc.xy(3, 11));
                }
                contentPanel.add(panel3, cc.xywh(5, 3, 3, 3, CellConstraints.FILL, CellConstraints.FILL));

                //======== panel4 ========
                {
                    panel4.setBorder(new TitledBorder("Cursor Warping"));
                    panel4.setLayout(
                            new FormLayout("20dlu:grow, $lcgap, 20dlu:grow", "default, $lgap, default"));

                    //---- labelDetector ----
                    labelDetector.setText("Text Detector / Warping");
                    panel4.add(labelDetector, cc.xywh(1, 1, 2, 3));

                    //---- comboBoxDetector ----
                    comboBoxDetector.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            comboBoxSearchMethodActionPerformed(e);
                        }
                    });
                    panel4.add(comboBoxDetector, cc.xy(3, 1));

                    //---- buttonDetectorConfig ----
                    buttonDetectorConfig.setText("Configuration");
                    panel4.add(buttonDetectorConfig, cc.xy(3, 3));
                }
                contentPanel.add(panel4, cc.xywh(1, 5, 3, 1, CellConstraints.DEFAULT, CellConstraints.FILL));

                //---- buttonSubmit ----
                buttonSubmit.setText("Submit");
                buttonSubmit.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        buttonSubmitActionPerformed(e);
                    }
                });
                contentPanel.add(buttonSubmit, cc.xy(1, 7));

                //---- buttonDefault ----
                buttonDefault.setText("Default");
                buttonDefault.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        buttonDefaultActionPerformed(e);
                    }
                });
                contentPanel.add(buttonDefault, cc.xy(3, 7));

                //---- buttonOK ----
                buttonOK.setText("OK");
                buttonOK.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        buttonOKActionPerformed(e);
                    }
                });
                contentPanel.add(buttonOK, cc.xywh(5, 7, 1, 1, CellConstraints.DEFAULT, CellConstraints.FILL));

                //---- buttonCancel ----
                buttonCancel.setText("Cancel");
                buttonCancel.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        buttonCancelActionPerformed(e);
                    }
                });
                contentPanel.add(buttonCancel, cc.xy(7, 7));
            }
            dialogPane.add(contentPanel);
        }
        mainFrameContentPane.add(dialogPane);
        mainFrame.setSize(570, 370);
        mainFrame.setLocationRelativeTo(mainFrame.getOwner());
    }
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:de.fhwedel.coinflip.gui.UserInterface.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - Mervyn McCreight
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    label1 = compFactory.createLabel("Server IP:");
    ipTextField = new JTextField();
    label2 = compFactory.createLabel("Server Port:");
    portTextField = new JTextField();
    playButton = new JButton();
    protocolProgessBar = new JProgressBar();
    progressLabel = new JLabel();
    separator1 = compFactory.createSeparator("Available Players", SwingConstants.CENTER);
    scrollPane1 = new JScrollPane();
    playerMap = new JTable();
    refreshButton = new JButton();
    CellConstraints cc = new CellConstraints();

    // ======== this ========
    setTitle("SRA CoinFlip Client");
    setResizable(false);/* w  w  w . j a  v a 2 s. co  m*/
    Container contentPane = getContentPane();
    contentPane
            .setLayout(new FormLayout("default, $lcgap, 40dlu, $lcgap, 62dlu, $lcgap, 41dlu, $lcgap, default",
                    "8*(default, $lgap), $lgap, 10dlu, default, $lgap, 64dlu, 2*($lgap, default)"));

    // ---- label1 ----
    label1.setText("Server IP:");
    label1.setLabelFor(ipTextField);
    contentPane.add(label1, cc.xy(3, 3, CellConstraints.LEFT, CellConstraints.DEFAULT));

    // ---- ipTextField ----
    ipTextField.setToolTipText("Enter Server-IP here ...");
    contentPane.add(ipTextField, cc.xywh(5, 3, 3, 1));

    // ---- label2 ----
    label2.setLabelFor(portTextField);
    contentPane.add(label2, cc.xy(3, 5, CellConstraints.LEFT, CellConstraints.DEFAULT));

    // ---- portTextField ----
    portTextField.setToolTipText("Enter Server-Port here...");
    contentPane.add(portTextField, cc.xywh(5, 5, 3, 1));

    // ---- playButton ----
    playButton.setText("Play");
    playButton.setFocusable(false);
    playButton.setFocusPainted(false);
    playButton.addActionListener(this::playButtonOnClick);
    contentPane.add(playButton, cc.xy(5, 9));

    // ---- protocolProgessBar ----
    protocolProgessBar.setMaximum(9);
    protocolProgessBar.setStringPainted(true);
    protocolProgessBar.setFocusable(false);
    contentPane.add(protocolProgessBar, cc.xywh(3, 13, 5, 1));

    // ---- progressLabel ----
    progressLabel.setText("Waiting...");
    progressLabel.setFont(UIManager.getFont("Label.font"));
    progressLabel.setHorizontalAlignment(SwingConstants.CENTER);
    contentPane.add(progressLabel, cc.xywh(3, 15, 6, 1));
    contentPane.add(separator1, cc.xywh(1, 18, 9, 1));

    // ======== scrollPane1 ========
    {

        // ---- playerMap ----
        playerMap.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        playerMap.setShowVerticalLines(false);
        playerMap.setShowHorizontalLines(false);
        scrollPane1.setViewportView(playerMap);
    }
    contentPane.add(scrollPane1, cc.xywh(3, 21, 5, 1));

    // ---- refreshButton ----
    refreshButton.setText("Refresh");
    refreshButton.addActionListener(this::refreshButtonClick);
    contentPane.add(refreshButton, cc.xy(5, 23));
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization //GEN-END:initComponents
}

From source file:de.luschny.apps.factorial.BenchmarkForm.java

License:Open Source License

@SuppressWarnings("unchecked")
private void initComponents() {
    checkBoxArray = new JCheckBox[21];
    JMenuBar menuBar = new JMenuBar();
    JMenu benchMenu = new JMenu();
    recommededMenu = new JMenuItem();
    JMenuItem parallelMenu = new JMenuItem();
    primeMenu = new JMenuItem();
    simpleMenu = new JMenuItem();
    JMenuItem lameMenu = new JMenuItem();
    JMenu ectMenu = new JMenu();
    sanityMenu = new JMenuItem();
    JMenuItem aboutMenu = new JMenuItem();
    JLabel algoLabel = new JLabel();
    logToFileCheckBox = new JCheckBox();
    showValueCheckBox = new JCheckBox();
    verboseCheckBox = new JCheckBox();
    JLabel startLabel = new JLabel();
    startField = new JTextField();
    JLabel stepLabel = new JLabel();
    stepBox = new JComboBox();
    cancelButton = new JButton();
    JLabel lenghtLabel = new JLabel();
    lenghtSpinner = new JSpinner();
    benchmarkButton = new JButton();
    JPanel algoSelection = new JPanel();
    JScrollPane scrollPane = new JScrollPane();
    textArea = new JTextArea();
    infoLabel = new JLabel();
    progressBar = new JProgressBar();
    CellConstraints cc = new CellConstraints();

    // ======== benchForm ========

    setTitle("Factorial Algorithm Benchmark");
    setFont(new Font("Verdana", Font.BOLD, 16));
    Container benchFormContentPane = getContentPane();
    benchFormContentPane.setLayout(new FormLayout(
            "6dlu, $lcgap, 4dlu, $lcgap, 82dlu, 10dlu, 6dlu, center:46dlu, $lcgap, 42dlu, $lcgap, 18dlu, $lcgap, center:58dlu, 6dlu, left:12dlu",
            "2dlu, $lgap, default, $lgap, top:176dlu, $lgap, default, $lgap, 16dlu, $lgap, 18dlu, $lgap, 16dlu, $lgap, 18dlu, $lgap, 4dlu"));
    ((FormLayout) benchFormContentPane.getLayout()).setRowGroups(new int[][] { { 9, 11, 13 } });

    JCheckBox checkBox = new JCheckBox();

    Font font = benchMenu.getFont().deriveFont(benchMenu.getFont().getStyle() | Font.BOLD,
            benchMenu.getFont().getSize() - 1f);
    Font labelFont = algoLabel.getFont().deriveFont(algoLabel.getFont().getStyle() | Font.BOLD,
            algoLabel.getFont().getSize() - 1f);
    Font checkFont = checkBox.getFont().deriveFont(checkBox.getFont().getStyle() | Font.BOLD,
            checkBox.getFont().getSize() - 1f);
    Font buttonFont = cancelButton.getFont().deriveFont(cancelButton.getFont().getStyle() | Font.BOLD);

    // ======== benchMenu ========

    benchMenu.setText("Benchmark");
    benchMenu.setFont(font);/*w  w w  . j a v a  2  s.co m*/

    // ---- recommendedMenu ----
    recommededMenu.setText("Recommended");
    recommededMenu.setFont(font);
    recommededMenu.addActionListener((ActionEvent e) -> toptenMenuActionPerformed(e));

    benchMenu.add(recommededMenu);

    // ---- primeMenu ----
    primeMenu.setText("Prime");
    primeMenu.setFont(font);
    primeMenu.addActionListener((ActionEvent e) -> primeMenuActionPerformed(e));

    benchMenu.add(primeMenu);

    // ---- parallelMenu ----
    parallelMenu.setText("Parallel");
    parallelMenu.setFont(font);
    parallelMenu.addActionListener((ActionEvent e) -> parallelMenuActionPerformed(e));

    benchMenu.add(parallelMenu);

    // ---- simpleMenu ----
    simpleMenu.setText("Simple");
    simpleMenu.setFont(font);
    simpleMenu.addActionListener((ActionEvent e) -> simpleMenuActionPerformed(e));

    benchMenu.add(simpleMenu);

    // ---- lameMenu ----
    lameMenu.setText("Lame");
    lameMenu.setFont(font);
    lameMenu.addActionListener((ActionEvent e) -> lameMenuActionPerformed(e));

    benchMenu.add(lameMenu);

    menuBar.add(benchMenu);

    // ======== ectMenu ========
    ectMenu.setText("Ecetera");
    ectMenu.setFont(font);

    // ---- sanityMenu ----
    sanityMenu.setText("Sanity Check");
    sanityMenu.setFont(font);
    sanityMenu.addActionListener((ActionEvent e) -> sanityMenuActionPerformed(e));

    ectMenu.add(sanityMenu);
    ectMenu.addSeparator();

    // ---- aboutMenu ----
    aboutMenu.setText("About");
    aboutMenu.setFont(font);
    aboutMenu.addActionListener((ActionEvent e) -> aboutMenuActionPerformed(e));

    ectMenu.add(aboutMenu);
    menuBar.add(ectMenu);

    setJMenuBar(menuBar);

    // ---- algoLabel ----
    algoLabel.setText("Algorithm");
    algoLabel.setFont(labelFont);
    benchFormContentPane.add(algoLabel, new CellConstraints(5, 3, 1, 1, CellConstraints.DEFAULT,
            CellConstraints.DEFAULT, new Insets(0, 12, 0, 0)));

    // ---- logToFileCheckBox ----
    logToFileCheckBox.setText("Log To File");
    logToFileCheckBox.setFont(checkFont);
    benchFormContentPane.add(logToFileCheckBox, new CellConstraints(8, 3, 3, 1, CellConstraints.LEFT,
            CellConstraints.DEFAULT, new Insets(0, 8, 0, 0)));

    // ---- showValueCheckBox ----
    showValueCheckBox.setText("Show Value");
    showValueCheckBox.setFont(checkFont);
    benchFormContentPane.add(showValueCheckBox,
            cc.xywh(10, 3, 3, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));

    // ---- verboseCheckBox ----
    verboseCheckBox.setText("Verbose");
    verboseCheckBox.setFont(checkFont);
    benchFormContentPane.add(verboseCheckBox, new CellConstraints(14, 3, 1, 1, CellConstraints.CENTER,
            CellConstraints.DEFAULT, new Insets(0, 4, 0, 0)));

    // ---- startLabel ----
    startLabel.setText("Start");
    startLabel.setFont(labelFont);
    benchFormContentPane.add(startLabel, cc.xywh(8, 9, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));

    // ---- startField ----
    startField.setToolTipText("Enter start value of n");
    startField.setText("8000");
    benchFormContentPane.add(startField, cc.xy(10, 9));

    // ---- stepLabel ----
    stepLabel.setText("Stepfactor");
    stepLabel.setFont(labelFont);
    benchFormContentPane.add(stepLabel, cc.xywh(8, 11, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));

    // ---- stepBox ----
    stepBox.setEditable(true);
    DefaultComboBoxModel dcbm = new DefaultComboBoxModel(new String[] { "1.5", "2.0", "2.5", "3.0" });
    stepBox.setModel(dcbm);
    stepBox.setSelectedIndex(1);
    benchFormContentPane.add(stepBox, cc.xy(10, 11));

    // ---- cancelButton ----
    cancelButton.setText("Cancel");
    cancelButton.setEnabled(false);
    cancelButton.setBackground(SystemColor.activeCaption);
    cancelButton.setForeground(SystemColor.window);
    cancelButton.setFont(buttonFont);
    cancelButton.addActionListener((ActionEvent e) -> cancelButtonActionPerformed(e));

    benchFormContentPane.add(cancelButton,
            cc.xywh(14, 11, 1, 1, CellConstraints.FILL, CellConstraints.DEFAULT));

    // ---- lenghtLabel ----
    lenghtLabel.setText("Length");
    lenghtLabel.setFont(labelFont);
    benchFormContentPane.add(lenghtLabel, cc.xywh(8, 13, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));

    // ---- lenghtSpinner ----
    lenghtSpinner.setModel(new SpinnerListModel(new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9" }));
    benchFormContentPane.add(lenghtSpinner, cc.xy(10, 13));

    // ---- benchmarkButton ----
    benchmarkButton.setText("Benchmark!");
    benchmarkButton.setFont(buttonFont);
    benchmarkButton.addActionListener((ActionEvent e) -> benchmarkButtonActionPerformed(e));
    benchFormContentPane.add(benchmarkButton,
            cc.xywh(14, 13, 1, 1, CellConstraints.FILL, CellConstraints.DEFAULT));

    // ======== AlgoSelection ========

    algoSelection.setPreferredSize(new Dimension(47, 550));
    algoSelection.setBackground(SystemColor.window);
    algoSelection.setLayout(new FormLayout("left:default:grow", "21*(fill:default)"));

    for (int i = 0; i < checkBoxArray.length; i++) {
        checkBox = new JCheckBox();
        checkBox.setText(FactorialTest.getNames()[i]);
        checkBox.setBackground(SystemColor.window);
        checkBox.setMargin(new Insets(3, 4, 1, 0));
        algoSelection.add(checkBox, cc.xy(1, i + 1));
        checkBox.setFont(checkFont);
        checkBoxArray[i] = checkBox;
    }

    benchFormContentPane.add(algoSelection, cc.xywh(3, 5, 3, 9));

    // ---- textArea ----
    textArea.setLineWrap(true);
    textArea.setEditable(false);
    textArea.setDisabledTextColor(SystemColor.windowText);
    textArea.setBackground(SystemColor.window);
    textArea.setFont(new Font("Courier New", Font.PLAIN, 12));

    // ======== scrollPane ========
    scrollPane.setViewportView(textArea);
    benchFormContentPane.add(scrollPane, cc.xywh(7, 5, 9, 3));

    // ---- infoLabel ----
    infoLabel.setText("(c) 2008 Peter Luschny");
    infoLabel.setFont(labelFont);
    benchFormContentPane.add(infoLabel, cc.xywh(3, 15, 3, 1));
    benchFormContentPane.add(progressBar, cc.xywh(7, 15, 9, 1));
    pack();
    setLocationRelativeTo(getOwner());
}