Example usage for java.beans PropertyChangeEvent getSource

List of usage examples for java.beans PropertyChangeEvent getSource

Introduction

In this page you can find the example usage for java.beans PropertyChangeEvent getSource.

Prototype

public Object getSource() 

Source Link

Document

The object on which the Event initially occurred.

Usage

From source file:org.ngrinder.recorder.Recorder.java

/**
 * Initialize global message handlers./*from w ww . j  a  v  a2  s . co m*/
 * 
 * @param tabbedPane
 *            tabbedPane
 */
protected void initMessageHandler(final TabbedPane tabbedPane) {
    final File home = recorderConfig.getHome().getDirectory();
    final MessageBus messageBusInstance = MessageBus.getInstance();
    MessageBusConnection connect = messageBusInstance.connect();
    connect.subscribe(Topics.HOME, new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            Browser browser = cast(evt.getSource());
            browser.navigate(toURL(tempFile).toString());
        }
    });
    connect.subscribe(Topics.APPLICATION_CLOSE, new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            proxy.stopProxy();
            frame.setExtendedState(Frame.NORMAL);
            File frameInfoFile = recorderConfig.getHome().getFile("last_frame");
            try {
                Pair<Dimension, Point> pair = Pair.of(frame.getSize(), frame.getLocation());
                String frameInfo = gson.toJson(pair);
                FileUtils.writeStringToFile(frameInfoFile, frameInfo);
            } catch (Exception e) {
                LOGGER.error("Failed to save the frame info", e);
            }

            messageBusInstance.getPublisher(Topics.PREPARE_TO_CLOSE)
                    .propertyChange(new PropertyChangeEvent(this, "PREPARE_TO_CLOSE", null, home));

            tabbedPane.disposeAllTabs();
            frame.setVisible(false);
            frame.dispose();

            System.exit(0);
        }
    });
    connect.subscribe(Topics.WINDOW_MAXIMIZE, new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            if (frame.getExtendedState() == Frame.MAXIMIZED_BOTH) {
                frame.setExtendedState(Frame.NORMAL);
            } else {
                frame.setExtendedState(Frame.MAXIMIZED_BOTH);
            }
        }
    });

    connect.subscribe(Topics.WINDOW_MINIMIZE, new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            if (frame.getExtendedState() == Frame.ICONIFIED) {
                frame.setExtendedState(Frame.NORMAL);
            } else {
                frame.setExtendedState(Frame.ICONIFIED);
            }
        }
    });

    connect.subscribe(Topics.SHOW_ABOUT_DIALOG, new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            AboutDialog dialog = AboutDialog.getInstance(frame, recorderConfig);
            dialog.setVisible(true);
        }
    });
}

From source file:biz.wolschon.finance.jgnucash.accountProperties.AccountProperties.java

/**
 * @return a panel to edit the settings of this section
 *///from  w w w  .  jav  a 2 s  .co m
private JPanel getMySettingsPanel() {
    if (mySettingsPanel == null) {
        mySettingsPanel = new JPanel();

        mySettingsPanel.setLayout(new BorderLayout());
        myPropertySheet = new PropertySheetPanel();
        myPropertySheet.setToolBarVisible(true);
        myPropertySheet.setSorting(false);
        myPropertySheet.setMode(PropertySheetPanel.VIEW_AS_CATEGORIES);
        myPropertySheet.setDescriptionVisible(true);

        myPropertySheet.addPropertySheetChangeListener(new PropertyChangeListener() {

            @Override
            public void propertyChange(final PropertyChangeEvent aEvt) {
                Object property = aEvt.getSource();
                if (property instanceof DefaultProperty) {
                    DefaultProperty prop = (DefaultProperty) property;
                    try {
                        myAccount.setUserDefinedAttribute(prop.getName(), prop.getValue().toString());
                    } catch (Exception e) {
                        LOGGER.error("error in writing userDefinedAttribute", e);
                    }
                }
            }

        });
        myPropertySheet.getTable().addMouseListener(new MouseAdapter() {

            /** show popup if mouseReleased is a popupTrigger on this platform.
             * @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
             */
            @Override
            public void mouseReleased(final MouseEvent aE) {
                if (aE.isPopupTrigger()) {
                    JPopupMenu menu = getPropertyPopup();
                    menu.show(myPropertySheet, aE.getX(), aE.getY());
                }
                super.mouseClicked(aE);
            }

            /** show popup if mousePressed is a popupTrigger on this platform.
             * @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
             */
            @Override
            public void mousePressed(final MouseEvent aE) {
                if (aE.isPopupTrigger()) {
                    JPopupMenu menu = getPropertyPopup();
                    menu.show(myPropertySheet, aE.getX(), aE.getY());
                }
                super.mouseClicked(aE);
            }

        });
        //
        updateCustomAttributesPanel();
        //        for (ConfigurationSetting setting : getConfigSection().getSettings()) {
        //            MyProperty myProperty = new MyProperty(setting);
        //            myProperty.addPropertyChangeListener(savingPropertyChangeListener);
        //            propertySheet.addProperty(myProperty);
        //        }
        mySettingsPanel.add(new JLabel("custom attributes:"), BorderLayout.NORTH);
        mySettingsPanel.add(myPropertySheet, BorderLayout.CENTER);
        mySettingsPanel.add(getAddCustomAttrPanel(), BorderLayout.SOUTH);

        //        MyPropertyEditorFactory propertyEditorFactory = new MyPropertyEditorFactory();
        //        propertySheet.setEditorFactory(propertyEditorFactory);
        //        propertySheet.setRendererFactory(propertyEditorFactory);

    }
    return mySettingsPanel;
}

From source file:com.qspin.qtaste.ui.MainPanel.java

public void genUI() {
    try {/*from   w w w . j  a va 2s . c o  m*/
        getContentPane().setLayout(new BorderLayout());
        // prepare the top panel that contains the following panes:
        //   - logo
        //   - ConfigInfopanel
        //   - Current Date/time
        JPanel topanel = new JPanel(new BorderLayout());
        JPanel center = new JPanel(new GridBagLayout());
        ImageIcon topLeftLogo = ResourceManager.getInstance().getImageIcon("main/qspin");
        JLabel iconlabel = new JLabel(topLeftLogo);

        mHeaderPanel = new ConfigInfoPanel(this);
        mTestCasePanel = new TestCasePane(this);
        mTestCampaignPanel = new TestCampaignMainPanel(this);

        mHeaderPanel.init();

        GridBagLineAdder centeradder = new GridBagLineAdder(center);
        JLabel sep = new JLabel("  ");
        sep.setFont(ResourceManager.getInstance().getSmallFont());
        sep.setUI(new FillLabelUI(ResourceManager.getInstance().getLightColor()));
        centeradder.setWeight(1.0f, 0.0f);
        centeradder.add(mHeaderPanel);

        // prepare the right panels containg the main information:
        // the right pane is selected through the tabbed pane:
        //    - Test cases: management of test cases and test suites
        //    - Test campaign: management of test campaigns
        //    - Interactive: ability to invoke QTaste verbs one by one

        mRightPanels = new JPanel(new CardLayout());

        mRightPanels.add(mTestCasePanel, "Test Cases");
        mRightPanels.add(mTestCampaignPanel, "Test Campaign");

        final TestCaseInteractivePanel testInterractivePanel = new TestCaseInteractivePanel();
        mRightPanels.add(testInterractivePanel, "Interactive");

        mTreeTabsPanel = new JTabbedPane(JTabbedPane.BOTTOM);
        mTreeTabsPanel.setPreferredSize(new Dimension(TREE_TABS_WIDTH, HEIGHT));

        TestCaseTree tct = new TestCaseTree(mTestCasePanel);
        JScrollPane sp2 = new JScrollPane(tct);
        mTreeTabsPanel.addTab("Test Cases", sp2);

        // add tree view for test campaign definition
        com.qspin.qtaste.ui.testcampaign.TestCaseTree mtct = new com.qspin.qtaste.ui.testcampaign.TestCaseTree(
                mTestCampaignPanel.getTreeTable());
        JScrollPane sp3 = new JScrollPane(mtct);
        mTreeTabsPanel.addTab("Test Campaign", sp3);

        genMenu(tct);

        // add another tab contain used for Interactive mode
        TestAPIDocsTree jInteractive = new TestAPIDocsTree(testInterractivePanel);
        JScrollPane spInter = new JScrollPane(jInteractive);
        mTreeTabsPanel.addTab("Interactive", spInter);

        // init will do the link between the tree view and the pane
        testInterractivePanel.init();

        // Define the listener to display the pane depending on the selected tab
        mTreeTabsPanel.addChangeListener(new ChangeListener() {

            public void stateChanged(ChangeEvent e) {
                String componentName = mTreeTabsPanel.getTitleAt(mTreeTabsPanel.getSelectedIndex());
                CardLayout rcl = (CardLayout) mRightPanels.getLayout();
                rcl.show(mRightPanels, componentName);
            }
        });
        mTestCampaignPanel.addTestCampaignActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                if (e.getID() == TestCampaignMainPanel.RUN_ID) {
                    if (e.getActionCommand().equals(TestCampaignMainPanel.STARTED_CMD)) {
                        // open the tab test cases
                        SwingUtilities.invokeLater(new Runnable() {
                            public void run() {
                                mTreeTabsPanel.setSelectedIndex(0);
                                mTestCasePanel.setSelectedTab(TestCasePane.RESULTS_INDEX);
                            }
                        });

                        // update the buttons
                        mTestCasePanel.setExecutingTestCampaign(true,
                                ((TestCampaignMainPanel) e.getSource()).getExecutionThread());
                        mTestCasePanel.updateButtons(true);
                    } else if (e.getActionCommand().equals(TestCampaignMainPanel.STOPPED_CMD)) {
                        mTestCasePanel.setExecutingTestCampaign(false, null);
                        mTestCasePanel.updateButtons();
                    }
                }
            }
        });

        JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, mTreeTabsPanel, mRightPanels);
        splitPane.setDividerSize(4);
        GUIConfiguration guiConfiguration = GUIConfiguration.getInstance();
        int mainHorizontalSplitDividerLocation = guiConfiguration
                .getInt(MAIN_HORIZONTAL_SPLIT_DIVIDER_LOCATION_PROPERTY, 285);
        splitPane.setDividerLocation(mainHorizontalSplitDividerLocation);

        splitPane.addPropertyChangeListener(new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                if (evt.getPropertyName().equals("dividerLocation")) {
                    GUIConfiguration guiConfiguration = GUIConfiguration.getInstance();
                    if (evt.getSource() instanceof JSplitPane) {
                        JSplitPane splitPane = (JSplitPane) evt.getSource();
                        guiConfiguration.setProperty(MAIN_HORIZONTAL_SPLIT_DIVIDER_LOCATION_PROPERTY,
                                splitPane.getDividerLocation());
                        try {
                            guiConfiguration.save();
                        } catch (ConfigurationException ex) {
                            logger.error("Error while saving GUI configuration: " + ex.getMessage());
                        }
                    }
                }
            }
        });

        topanel.add(iconlabel, BorderLayout.WEST);
        topanel.add(center);

        getContentPane().add(topanel, BorderLayout.NORTH);
        getContentPane().add(splitPane);
        this.pack();

        this.setExtendedState(Frame.MAXIMIZED_BOTH);
        if (mTestSuiteDir != null) {
            DirectoryTestSuite testSuite = DirectoryTestSuite.createDirectoryTestSuite(mTestSuiteDir);
            if (testSuite != null) {
                testSuite.setExecutionLoops(mNumberLoops, mLoopsInHour);
                setTestSuite(testSuite.getName());
                mTestCasePanel.runTestSuite(testSuite, false);
            }
        }
        setVisible(true);
        //treeTabs.setMinimumSize(new Dimension(100, this.HEIGHT));

    } catch (Exception e) {
        logger.fatal(e);
        e.printStackTrace();
        TestEngine.shutdown();
        System.exit(1);
    }

}

From source file:org.openmicroscopy.shoola.agents.metadata.rnd.GraphicsPane.java

/**
 * Reacts to property changes fired by the {@link TwoKnobsSlider}s.
 * @see PropertyChangeListener#propertyChange(PropertyChangeEvent)
 *///from www.j ava2s. co m
public void propertyChange(PropertyChangeEvent evt) {
    String name = evt.getPropertyName();
    Object source = evt.getSource();
    if (!controlsBar.isLiveUpdate()) {
        if (TwoKnobsSlider.KNOB_RELEASED_PROPERTY.equals(name)) {
            paintHorizontal = false;
            paintVertical = false;
            if (source.equals(domainSlider)) {
                controller.setInputInterval(domainSlider.getStartValue(), domainSlider.getEndValue());
                onCurveChange();
            } else if (source.equals(codomainSlider)) {
                int s = codomainSlider.getStartValue();
                int e = codomainSlider.getEndValue();
                controller.setCodomainInterval(s, e);
                onCurveChange();
            }
        } else if (TwoKnobsSlider.LEFT_MOVED_PROPERTY.equals(name)) {
            if (source.equals(domainSlider)) {
                verticalLine = (int) (domainSlider.getStartValue() * domainSlider.getRoundingFactor());
                paintHorizontal = false;
                paintVertical = true;
                onCurveChange();
            } else if (source.equals(codomainSlider)) {
                horizontalLine = codomainSlider.getEndValue();
                paintHorizontal = true;
                paintVertical = false;
                onCurveChange();
            }
        } else if (TwoKnobsSlider.RIGHT_MOVED_PROPERTY.equals(name)) {
            if (source.equals(domainSlider)) {
                verticalLine = (int) (domainSlider.getEndValue() * domainSlider.getRoundingFactor());
                horizontalLine = -1;
                paintHorizontal = false;
                paintVertical = true;
                onCurveChange();
            } else if (source.equals(codomainSlider)) {
                horizontalLine = codomainSlider.getStartValue();
                verticalLine = -1;
                paintHorizontal = true;
                paintVertical = false;
                onCurveChange();
            }
        }
    } else {
        paintHorizontal = false;
        paintVertical = false;
        if (TwoKnobsSlider.LEFT_MOVED_PROPERTY.equals(name)
                || TwoKnobsSlider.RIGHT_MOVED_PROPERTY.equals(name)) {
            if (source.equals(domainSlider)) {
                controller.setInputInterval(domainSlider.getStartValue(), domainSlider.getEndValue());
                onCurveChange();
            } else if (source.equals(codomainSlider)) {
                int s = codomainSlider.getStartValue();
                int e = codomainSlider.getEndValue();
                controller.setCodomainInterval(s, e);
                onCurveChange();
            }
        } else if (TwoKnobsSlider.KNOB_RELEASED_PROPERTY.equals(name)) {
            if (source.equals(domainSlider)) {
                controller.setInputInterval(domainSlider.getStartValue(), domainSlider.getEndValue());
            } else if (source.equals(codomainSlider)) {
                int s = codomainSlider.getStartValue();
                int e = codomainSlider.getEndValue();
                controller.setCodomainInterval(s, e);
                onCurveChange();
            }
        }
    }
}

From source file:org.docx4all.swing.ExternalHyperlinkDialog.java

/** This method reacts to state changes in the option pane. */
public void propertyChange(PropertyChangeEvent e) {
    String prop = e.getPropertyName();

    if (isVisible() && (e.getSource() == this.optionPane)
            && (JOptionPane.VALUE_PROPERTY.equals(prop) || JOptionPane.INPUT_VALUE_PROPERTY.equals(prop))) {
        Object userAnswer = this.optionPane.getValue();

        if (userAnswer == JOptionPane.UNINITIALIZED_VALUE) {
            //ignore reset
            return;
        }//from   w w  w .j  a v a2s .  c o  m

        //Reset the JOptionPane's value.
        //If you don't do this, then if the user
        //presses the same button next time, no
        //property change event will be fired.
        this.optionPane.setValue(JOptionPane.UNINITIALIZED_VALUE);

        setVisible(false);

        if (OK_BUTTON_TEXT.equals(userAnswer)) {
            this.value = OK_BUTTON_TEXT;

            StringBuilder target = new StringBuilder();
            if (isSourceFileDirectory(this.directoryUrlPath)) {
                target.append(this.documentNameField.getText());
            } else {
                target.append(VFSUtils.getFriendlyName(this.directoryUrlPath, false));
                target.append("/");
                target.append(this.documentNameField.getText());
            }
            if (!target.toString().endsWith(".docx")) {
                target.append(".docx");
            }

            if (this.hyperlinkML.canSetTarget()) {
                this.hyperlinkML.setTarget(target.toString());
            } else {
                this.hyperlinkML.setDummyTarget(target.toString());
            }

            if (this.displayTextField.getText().length() == 0) {
                this.hyperlinkML.setDisplayText(target.toString());
            } else {
                this.hyperlinkML.setDisplayText(this.displayTextField.getText());
            }
            this.hyperlinkML.setTooltip(this.tooltipField.getText());

        } else {
            //User closed dialog or clicked cancel
            this.value = CANCEL_BUTTON_TEXT;
        }

        //do not keep a reference to the edited hyperlinkML
        //so that this dialog can be disposed of.
        this.hyperlinkML = null;
    }
}

From source file:DialogDemo.java

/** This method reacts to state changes in the option pane. */
public void propertyChange(PropertyChangeEvent e) {
    String prop = e.getPropertyName();

    if (isVisible() && (e.getSource() == optionPane)
            && (JOptionPane.VALUE_PROPERTY.equals(prop) || JOptionPane.INPUT_VALUE_PROPERTY.equals(prop))) {
        Object value = optionPane.getValue();

        if (value == JOptionPane.UNINITIALIZED_VALUE) {
            // ignore reset
            return;
        }/*from   w w  w.  j a  v  a  2 s  . c o m*/

        // Reset the JOptionPane's value.
        // If you don't do this, then if the user
        // presses the same button next time, no
        // property change event will be fired.
        optionPane.setValue(JOptionPane.UNINITIALIZED_VALUE);

        if (btnString1.equals(value)) {
            typedText = textField.getText();
            String ucText = typedText.toUpperCase();
            if (magicWord.equals(ucText)) {
                // we're done; clear and dismiss the dialog
                clearAndHide();
            } else {
                // text was invalid
                textField.selectAll();
                JOptionPane
                        .showMessageDialog(
                                CustomDialog.this, "Sorry, \"" + typedText + "\" " + "isn't a valid response.\n"
                                        + "Please enter " + magicWord + ".",
                                "Try again", JOptionPane.ERROR_MESSAGE);
                typedText = null;
                textField.requestFocusInWindow();
            }
        } else { // user closed dialog or clicked cancel
            dd.setLabel("It's OK.  " + "We won't force you to type " + magicWord + ".");
            typedText = null;
            clearAndHide();
        }
    }
}

From source file:ru.zinin.redis.session.RedisManager.java

@Override
public void propertyChange(PropertyChangeEvent event) {
    log.trace(String.format("EXEC propertyChange(%s);", event));

    if (!(event.getSource() instanceof Context)) {
        return;//from   w w  w  . jav  a  2  s.  co m
    }

    if (event.getPropertyName().equals("sessionTimeout")) {
        try {
            setMaxInactiveInterval((Integer) event.getNewValue() * 60);
        } catch (NumberFormatException e) {
            log.error(sm.getString("managerBase.sessionTimeout", event.getNewValue()));
        }
    }
}

From source file:ome.formats.importer.gui.ImportDialog.java

/**
 * Dialog explaining metadata limitations when changing the main dialog's naming settings
 * /* www  .  j  a v a 2  s.  c  o m*/
 * @param frame - parent component
 */
public void sendNamingWarning(Component frame) {
    final JOptionPane optionPane = new JOptionPane(
            "\nNOTE: Some file formats do not include the file name in their metadata, "
                    + "\nand disabling this option may result in files being imported without a "
                    + "\nreference to their file name. For example, 'myfile.lsm [image001]' "
                    + "\nwould show up as 'image001' with this optioned turned off.",
            JOptionPane.WARNING_MESSAGE);
    final JDialog warningDialog = new JDialog(this, "Naming Warning!", true);
    warningDialog.setContentPane(optionPane);

    optionPane.addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent e) {
            String prop = e.getPropertyName();

            if (warningDialog.isVisible() && (e.getSource() == optionPane)
                    && (prop.equals(JOptionPane.VALUE_PROPERTY))) {
                warningDialog.dispose();
            }
        }
    });

    warningDialog.toFront();
    warningDialog.pack();
    warningDialog.setLocationRelativeTo(frame);
    warningDialog.setVisible(true);
}

From source file:org.myrobotlab.service.MarySpeech.java

private void showProgressPanel(List<ComponentDescription> comps, boolean install) {
    final ProgressPanel pp = new ProgressPanel(comps, install);
    final JOptionPane optionPane = new JOptionPane(pp, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION,
            null, new String[] { "Abort" }, "Abort");
    // optionPane.setPreferredSize(new Dimension(640,480));
    final JDialog dialog = new JDialog((Frame) null, "Progress", false);
    dialog.setContentPane(optionPane);/*  w  ww .ja va  2s  .c  om*/
    optionPane.addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent e) {
            String prop = e.getPropertyName();

            if (dialog.isVisible() && (e.getSource() == optionPane)
                    && (prop.equals(JOptionPane.VALUE_PROPERTY))) {
                pp.requestExit();
                dialog.setVisible(false);
            }
        }
    });
    dialog.pack();
    dialog.setVisible(true);
    new Thread(pp).start();
}

From source file:com.vgi.mafscaling.Rescale.java

private void createControlPanel(JPanel dataPanel) {
    JPanel cntlPanel = new JPanel();
    GridBagConstraints gbl_ctrlPanel = new GridBagConstraints();
    gbl_ctrlPanel.insets = insets3;//from   www  . ja  v a2s .  c  o  m
    gbl_ctrlPanel.anchor = GridBagConstraints.PAGE_START;
    gbl_ctrlPanel.fill = GridBagConstraints.HORIZONTAL;
    gbl_ctrlPanel.weightx = 1.0;
    gbl_ctrlPanel.gridx = 0;
    gbl_ctrlPanel.gridy = 0;
    dataPanel.add(cntlPanel, gbl_ctrlPanel);

    GridBagLayout gbl_cntlPanel = new GridBagLayout();
    gbl_cntlPanel.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
    gbl_cntlPanel.rowHeights = new int[] { 0, 0 };
    gbl_cntlPanel.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 };
    gbl_cntlPanel.rowWeights = new double[] { 0 };
    cntlPanel.setLayout(gbl_cntlPanel);

    NumberFormat doubleFmt = NumberFormat.getNumberInstance();
    doubleFmt.setGroupingUsed(false);
    doubleFmt.setMaximumIntegerDigits(1);
    doubleFmt.setMinimumIntegerDigits(1);
    doubleFmt.setMaximumFractionDigits(3);
    doubleFmt.setMinimumFractionDigits(1);
    doubleFmt.setRoundingMode(RoundingMode.HALF_UP);

    NumberFormat scaleDoubleFmt = NumberFormat.getNumberInstance();
    scaleDoubleFmt.setGroupingUsed(false);
    scaleDoubleFmt.setMaximumIntegerDigits(1);
    scaleDoubleFmt.setMinimumIntegerDigits(1);
    scaleDoubleFmt.setMaximumFractionDigits(8);
    scaleDoubleFmt.setMinimumFractionDigits(1);
    scaleDoubleFmt.setRoundingMode(RoundingMode.HALF_UP);

    GridBagConstraints gbc_cntlPanelLabel = new GridBagConstraints();
    gbc_cntlPanelLabel.anchor = GridBagConstraints.EAST;
    gbc_cntlPanelLabel.insets = new Insets(2, 3, 2, 1);
    gbc_cntlPanelLabel.gridx = 0;
    gbc_cntlPanelLabel.gridy = 0;

    GridBagConstraints gbc_cntlPanelInput = new GridBagConstraints();
    gbc_cntlPanelInput.anchor = GridBagConstraints.WEST;
    gbc_cntlPanelInput.insets = new Insets(2, 1, 2, 3);
    gbc_cntlPanelInput.gridx = 1;
    gbc_cntlPanelInput.gridy = 0;

    cntlPanel.add(new JLabel("New Max V"), gbc_cntlPanelLabel);

    newMaxVFmtTextBox = new JFormattedTextField(doubleFmt);
    newMaxVFmtTextBox.setColumns(7);
    newMaxVFmtTextBox.addPropertyChangeListener("value", new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent e) {
            Object source = e.getSource();
            if (source == newMaxVFmtTextBox)
                updateNewMafScale();
        }
    });
    cntlPanel.add(newMaxVFmtTextBox, gbc_cntlPanelInput);

    gbc_cntlPanelLabel.gridx += 2;
    cntlPanel.add(new JLabel("Min V"), gbc_cntlPanelLabel);

    minVFmtTextBox = new JFormattedTextField(doubleFmt);
    minVFmtTextBox.setColumns(7);
    minVFmtTextBox.addPropertyChangeListener("value", new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent e) {
            Object source = e.getSource();
            if (source == minVFmtTextBox)
                updateNewMafScale();
        }
    });
    gbc_cntlPanelInput.gridx += 2;
    cntlPanel.add(minVFmtTextBox, gbc_cntlPanelInput);

    gbc_cntlPanelLabel.gridx += 2;
    cntlPanel.add(new JLabel("Max Unchanged"), gbc_cntlPanelLabel);

    maxVUnchangedFmtTextBox = new JFormattedTextField(doubleFmt);
    maxVUnchangedFmtTextBox.setColumns(7);
    maxVUnchangedFmtTextBox.addPropertyChangeListener("value", new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent e) {
            Object source = e.getSource();
            if (source == maxVUnchangedFmtTextBox)
                updateNewMafScale();
        }
    });
    gbc_cntlPanelInput.gridx += 2;
    cntlPanel.add(maxVUnchangedFmtTextBox, gbc_cntlPanelInput);

    gbc_cntlPanelLabel.gridx += 2;
    cntlPanel.add(new JLabel("Mode deltaV"), gbc_cntlPanelLabel);

    modeDeltaVFmtTextBox = new JFormattedTextField(scaleDoubleFmt);
    modeDeltaVFmtTextBox.setColumns(7);
    modeDeltaVFmtTextBox.setEditable(false);
    modeDeltaVFmtTextBox.setBackground(new Color(210, 210, 210));
    gbc_cntlPanelInput.gridx += 2;
    cntlPanel.add(modeDeltaVFmtTextBox, gbc_cntlPanelInput);
}