/*
 * GUIMain.java
 *
 * Created on 2008. október 29., 20:33
 */
package userinterfaces.gui;

import expressionevaluation.FunctionDrawer;
import expressiontree.*;
import expressiontree.operands.Matrix;
import expressiontree.operators.*;
import java.awt.Color;
import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Locale;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.filechooser.FileFilter;
import javax.swing.text.*;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.stream.XMLStreamException;
import org.apfloat.ApfloatRuntimeException;
import org.xml.sax.SAXException;
import propertyhandler.FileLocations;
import xmlhandling.*;

/**
 *
 * @author  Esta
 */
public class GUIMain extends javax.swing.JFrame {

    private ViewHelper vh;
    private StyledDocument doc;
    private LinkedList<String> langs = new LinkedList<String>();
    private boolean lastDrawFromXML = false;

    private void setHelp(String msg) {
        this.helpArea.setText(java.util.ResourceBundle.getBundle("languages/helpMessages").getString(msg));
    }

    /** Creates new form GUIMain */
    @SuppressWarnings("unchecked")
    public GUIMain() {
        Locale.setDefault(FileLocations.getChoosenLocale());
        initComponents();
        Locale[] locales = Locale.getAvailableLocales();
        this.langComboBox.addItem(new Locale("en").getDisplayLanguage());
        this.langs.add("en");
        for (Locale l : locales) {
            try {
                if (java.util.ResourceBundle.getBundle("languages/operators", l).getString("LANGCHECK").equalsIgnoreCase(l.getLanguage()) && !this.langs.contains(l.getLanguage())) {
                    this.langComboBox.addItem(l.getDisplayLanguage());
                    this.langs.add(l.getLanguage());
                }
            } catch (Exception e) {
            }
        }
        if (!this.langs.contains(Locale.getDefault().getLanguage())) {
            Locale.setDefault(new Locale("en"));
        }
        this.langComboBox.setSelectedItem(Locale.getDefault().getDisplayLanguage());
        vh = new ViewHelper();
        doc = this.inputField.getStyledDocument();
        this.inputField.requestFocus();
        this.eeTabOtherComboBox.addItem(java.util.ResourceBundle.getBundle("languages/operators").getString("SELECT"));
        this.eeTabBinaryComboBox.addItem(java.util.ResourceBundle.getBundle("languages/operators").getString("SELECT"));
        this.eeTabMatrComboBox.addItem(java.util.ResourceBundle.getBundle("languages/operators").getString("SELECT"));
        this.eeTabTrigComboBox.addItem(java.util.ResourceBundle.getBundle("languages/operators").getString("SELECT"));
        this.eeTabNonTrigComboBox.addItem(java.util.ResourceBundle.getBundle("languages/operators").getString("SELECT"));

        LinkedList<Operator> lista;

        lista = new LinkedList<Operator>();
        for (String s : Operator.OTHER) {
            try {
                lista.add(Operator.getMenuItem(s));
            } catch (UnknownOperatorException ex) {
            }
        }
        Collections.sort(lista);
        for (Operator o : lista) {
            this.eeTabOtherComboBox.addItem(o);
        }

        lista = new LinkedList<Operator>();
        for (String s : Operator.BINARY) {
            try {
                lista.add(Operator.getMenuItem(s));
            } catch (UnknownOperatorException ex) {
            }
        }
        Collections.sort(lista);
        for (Operator o : lista) {
            this.eeTabBinaryComboBox.addItem(o);
        }

        lista = new LinkedList<Operator>();
        for (String s : Operator.MATRIX) {
            try {
                lista.add(Operator.getMenuItem(s));
            } catch (UnknownOperatorException ex) {
            }
        }
        Collections.sort(lista);
        for (Operator o : lista) {
            this.eeTabMatrComboBox.addItem(o);
        }

        lista = new LinkedList<Operator>();
        for (String s : Operator.TRIG) {
            try {
                lista.add(Operator.getMenuItem(s));
            } catch (UnknownOperatorException ex) {
            }
        }
        Collections.sort(lista);
        for (Operator o : lista) {
            this.eeTabTrigComboBox.addItem(o);
        }

        lista = new LinkedList<Operator>();
        for (String s : Operator.NON_TRIG_UNARY) {
            try {
                lista.add(Operator.getMenuItem(s));
            } catch (UnknownOperatorException ex) {
            }
        }
        Collections.sort(lista);
        for (Operator o : lista) {
            this.eeTabNonTrigComboBox.addItem(o);
        }

        Style style = inputField.addStyle("Green", null);
        StyleConstants.setBackground(style, Color.green);
        StyleConstants.setBold(style, true);
        StyleConstants.setItalic(style, false);

        style = inputField.addStyle("Red", null);
        StyleConstants.setBackground(style, Color.red);
        StyleConstants.setItalic(style, true);
        StyleConstants.setBold(style, false);

        style = inputField.addStyle("Yellow", null);
        StyleConstants.setBackground(style, Color.yellow);
        StyleConstants.setBold(style, true);
        StyleConstants.setItalic(style, false);

        style = inputField.addStyle("White", null);
        StyleConstants.setBackground(style, Color.white);
        StyleConstants.setBold(style, false);
        StyleConstants.setItalic(style, false);

        style = inputField.addStyle("Operator", null);
        StyleConstants.setForeground(style, Color.darkGray);
        StyleConstants.setItalic(style, false);
        StyleConstants.setBold(style, true);

        style = inputField.addStyle("Unknown", null);
        StyleConstants.setForeground(style, Color.red);
        StyleConstants.setItalic(style, false);
        StyleConstants.setBold(style, true);

        style = inputField.addStyle("Number", null);
        StyleConstants.setForeground(style, Color.blue);
        StyleConstants.setItalic(style, false);
        StyleConstants.setBold(style, false);

        style = inputField.addStyle("Special", null);
        StyleConstants.setForeground(style, Color.gray);
        StyleConstants.setItalic(style, true);
        StyleConstants.setBold(style, false);

        this.inputField.setCaretPosition(1);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        infixPrefixGroup = new javax.swing.ButtonGroup();
        tabsPane = new javax.swing.JTabbedPane();
        expressionEditorTab = new javax.swing.JPanel();
        eeTabInputScrollPane = new javax.swing.JScrollPane();
        inputField = new javax.swing.JTextPane();
        eeTabExprLabel = new javax.swing.JLabel();
        eeTabUnaryPanel = new javax.swing.JPanel();
        eeTabTrigFunctLabel = new javax.swing.JLabel();
        eeTabTrigComboBox = new javax.swing.JComboBox();
        eeTabNonTrigFunctLabel = new javax.swing.JLabel();
        eeTabNonTrigComboBox = new javax.swing.JComboBox();
        eeTabBinaryPanel = new javax.swing.JPanel();
        eeTabMatrFunctLabel = new javax.swing.JLabel();
        eeTabMatrComboBox = new javax.swing.JComboBox();
        eeTabBinaryLabel = new javax.swing.JLabel();
        eeTabBinaryComboBox = new javax.swing.JComboBox();
        eeTabSpecItemsPanel = new javax.swing.JPanel();
        eeTabOtherFunctLabel = new javax.swing.JLabel();
        eeTabOtherComboBox = new javax.swing.JComboBox();
        matrixBuilderLabel = new javax.swing.JLabel();
        rowLabel = new javax.swing.JLabel();
        rowSpinner = new javax.swing.JSpinner();
        colSpinner = new javax.swing.JSpinner();
        colLabel = new javax.swing.JLabel();
        insertMatrix = new javax.swing.JButton();
        eeTabNumPanel = new javax.swing.JPanel();
        numButton1 = new javax.swing.JButton();
        numButton2 = new javax.swing.JButton();
        numButton3 = new javax.swing.JButton();
        numButton4 = new javax.swing.JButton();
        numButton5 = new javax.swing.JButton();
        numButton6 = new javax.swing.JButton();
        numButton7 = new javax.swing.JButton();
        numButton8 = new javax.swing.JButton();
        numButton9 = new javax.swing.JButton();
        numButton0 = new javax.swing.JButton();
        numButtonDot = new javax.swing.JButton();
        numButtonMinus = new javax.swing.JButton();
        prevButton = new javax.swing.JButton();
        nextButton = new javax.swing.JButton();
        clearInputButton = new javax.swing.JButton();
        launchPanel = new javax.swing.JPanel();
        calculateButton = new javax.swing.JButton();
        drawButton = new javax.swing.JButton();
        saveExprButton = new javax.swing.JButton();
        eeTabSpecCharacters = new javax.swing.JPanel();
        piButton = new javax.swing.JButton();
        bracketButton = new javax.swing.JButton();
        matrixRowButton = new javax.swing.JButton();
        matrixButton = new javax.swing.JButton();
        variableButton = new javax.swing.JButton();
        otherBracketButton = new javax.swing.JButton();
        matrixColButton = new javax.swing.JButton();
        functionOutputTab = new javax.swing.JPanel();
        functionScrollPane = new javax.swing.JScrollPane();
        functionImageLabel = new javax.swing.JLabel();
        foTabPictureLabel = new javax.swing.JLabel();
        progressBar = new javax.swing.JProgressBar();
        boundsLabel = new javax.swing.JLabel();
        timeLabel = new javax.swing.JLabel();
        millisLabel = new javax.swing.JLabel();
        precLabel = new javax.swing.JLabel();
        precisionLabel = new javax.swing.JLabel();
        checkPointsLabel = new javax.swing.JLabel();
        cpLabel = new javax.swing.JLabel();
        locMinLabel = new javax.swing.JLabel();
        minValue = new javax.swing.JLabel();
        locMaxLabel = new javax.swing.JLabel();
        maxValue = new javax.swing.JLabel();
        matrixOutputTab = new javax.swing.JPanel();
        resultScrollPane = new javax.swing.JScrollPane();
        resultArea = new javax.swing.JTextArea();
        resultLabel = new javax.swing.JLabel();
        lineWrap = new javax.swing.JCheckBox();
        settingsTab = new javax.swing.JPanel();
        sTabQualityPanel = new javax.swing.JPanel();
        sTabPrecisionSlider = new javax.swing.JSlider();
        sTabPrecisionSpinner = new javax.swing.JSpinner();
        sTabPrecisionLabel = new javax.swing.JLabel();
        infixBoxNote = new javax.swing.JLabel();
        isInfix = new javax.swing.JRadioButton();
        isPrefix = new javax.swing.JRadioButton();
        saveExpressionPanel = new javax.swing.JPanel();
        outputExprLocationField = new javax.swing.JTextField();
        saveExpressionBox = new javax.swing.JCheckBox();
        browseOutputExprButton = new javax.swing.JButton();
        saveResultPanel = new javax.swing.JPanel();
        outputResultLocationField = new javax.swing.JTextField();
        saveResultBox = new javax.swing.JCheckBox();
        browseResultButton = new javax.swing.JButton();
        openExpressionPanel = new javax.swing.JPanel();
        inputExprLocationField = new javax.swing.JTextField();
        browseInputExprButton = new javax.swing.JButton();
        solveXMLButton = new javax.swing.JButton();
        drawXMLButton = new javax.swing.JButton();
        languagePanel = new javax.swing.JPanel();
        langComboBox = new javax.swing.JComboBox();
        setLangButton = new javax.swing.JButton();
        functionSettingsTab = new javax.swing.JPanel();
        fsTabHSizePanel = new javax.swing.JPanel();
        fsTabWidthSlider = new javax.swing.JSlider();
        fsTabWidthSpinner = new javax.swing.JSpinner();
        fsTabHStartLabel = new javax.swing.JLabel();
        fsTabHStartSpinner = new javax.swing.JSpinner();
        fsTabHStartSlider = new javax.swing.JSlider();
        fsTabWidthLabel = new javax.swing.JLabel();
        fsTabHEndSlider = new javax.swing.JSlider();
        fsTabHEndSpinner = new javax.swing.JSpinner();
        fsTabHEndLabel = new javax.swing.JLabel();
        fsTabVSizePanel = new javax.swing.JPanel();
        fsTabHeightSlider = new javax.swing.JSlider();
        fsTabHeightSpinner = new javax.swing.JSpinner();
        fsTabVSizeLabel = new javax.swing.JLabel();
        fsTabVStartSpinner = new javax.swing.JSpinner();
        fsTabVStartSlider = new javax.swing.JSlider();
        fsTabHeightLabel = new javax.swing.JLabel();
        fsTabVEndSlider = new javax.swing.JSlider();
        fsTabVEndSpinner = new javax.swing.JSpinner();
        fsTabVEndLabel = new javax.swing.JLabel();
        fsTabQualityPanel = new javax.swing.JPanel();
        fsTabPrecisionSlider = new javax.swing.JSlider();
        fsTabPrecisionSpinner = new javax.swing.JSpinner();
        fsTabNumberOfPointsLabel = new javax.swing.JLabel();
        fsTabNumberOfPointsSpinner = new javax.swing.JSpinner();
        fsTabNumberOfPointsSlider = new javax.swing.JSlider();
        fsTabPrecisionLabel = new javax.swing.JLabel();
        fsResetButton = new javax.swing.JButton();
        save2PNGPanel = new javax.swing.JPanel();
        pngLocationField = new javax.swing.JTextField();
        savePNGBox = new javax.swing.JCheckBox();
        browsePNGButton = new javax.swing.JButton();
        coordinates = new javax.swing.JCheckBox();
        redraw = new javax.swing.JButton();
        helpPanel = new javax.swing.JPanel();
        helpLabel = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        helpArea = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("XML Calculator Application");
        setBounds(new java.awt.Rectangle(25, 25, 640, 745));
        setMaximizedBounds(new java.awt.Rectangle(0, 0, 650, 745));
        setMinimumSize(new java.awt.Dimension(640, 711));
        setResizable(false);

        tabsPane.setMaximumSize(new java.awt.Dimension(700, 692));
        tabsPane.setPreferredSize(new java.awt.Dimension(700, 692));

        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("languages/tooltips"); // NOI18N
        expressionEditorTab.setToolTipText(bundle.getString("EXPR_EDITOR_TAB")); // NOI18N

        inputField.setText("()");
        inputField.setToolTipText(bundle.getString("INPUT_FIELD")); // NOI18N
        inputField.setMaximumSize(new java.awt.Dimension(500, 500));
        inputField.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                inputFieldMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                inputFieldMouseEntered(evt);
            }
        });
        inputField.addCaretListener(new javax.swing.event.CaretListener() {
            public void caretUpdate(javax.swing.event.CaretEvent evt) {
                inputFieldCaretUpdate(evt);
            }
        });
        inputField.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                inputFieldFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                inputFieldFocusLost(evt);
            }
        });
        inputField.addInputMethodListener(new java.awt.event.InputMethodListener() {
            public void caretPositionChanged(java.awt.event.InputMethodEvent evt) {
            }
            public void inputMethodTextChanged(java.awt.event.InputMethodEvent evt) {
                inputFieldInputMethodTextChanged(evt);
            }
        });
        inputField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                inputFieldKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                inputFieldKeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                inputFieldKeyTyped(evt);
            }
        });
        eeTabInputScrollPane.setViewportView(inputField);

        java.util.ResourceBundle bundle1 = java.util.ResourceBundle.getBundle("languages/gui_languages"); // NOI18N
        eeTabExprLabel.setText(bundle1.getString("EXPRESSION")); // NOI18N

        java.util.ResourceBundle bundle2 = java.util.ResourceBundle.getBundle("languages/operators"); // NOI18N
        eeTabUnaryPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle2.getString("UNARY"))); // NOI18N
        eeTabUnaryPanel.setToolTipText(bundle.getString("UNARY_TIP")); // NOI18N

        eeTabTrigFunctLabel.setText(bundle2.getString("TRIG")); // NOI18N
        eeTabTrigFunctLabel.setToolTipText(bundle.getString("TRIG_TIP")); // NOI18N

        eeTabTrigComboBox.setMaximumRowCount(30);
        eeTabTrigComboBox.setToolTipText(bundle.getString("TRIG_TIP")); // NOI18N
        eeTabTrigComboBox.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                eeTabTrigComboBoxMouseEntered(evt);
            }
        });
        eeTabTrigComboBox.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {
            public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
            }
            public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
                eeTabTrigComboBoxPopupMenuWillBecomeInvisible(evt);
            }
            public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
            }
        });

        eeTabNonTrigFunctLabel.setText(bundle2.getString("OTHER_UNARY")); // NOI18N
        eeTabNonTrigFunctLabel.setToolTipText(bundle.getString("OTHER_UNARY_TIP")); // NOI18N

        eeTabNonTrigComboBox.setMaximumRowCount(30);
        eeTabNonTrigComboBox.setToolTipText(bundle.getString("OTHER_UNARY_TIP")); // NOI18N
        eeTabNonTrigComboBox.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                eeTabNonTrigComboBoxMouseEntered(evt);
            }
        });
        eeTabNonTrigComboBox.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {
            public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
            }
            public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
                eeTabNonTrigComboBoxPopupMenuWillBecomeInvisible(evt);
            }
            public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
            }
        });

        javax.swing.GroupLayout eeTabUnaryPanelLayout = new javax.swing.GroupLayout(eeTabUnaryPanel);
        eeTabUnaryPanel.setLayout(eeTabUnaryPanelLayout);
        eeTabUnaryPanelLayout.setHorizontalGroup(
            eeTabUnaryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, eeTabUnaryPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(eeTabUnaryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(eeTabNonTrigComboBox, javax.swing.GroupLayout.Alignment.LEADING, 0, 320, Short.MAX_VALUE)
                    .addComponent(eeTabTrigComboBox, javax.swing.GroupLayout.Alignment.LEADING, 0, 320, Short.MAX_VALUE)
                    .addComponent(eeTabTrigFunctLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE)
                    .addComponent(eeTabNonTrigFunctLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE))
                .addContainerGap())
        );
        eeTabUnaryPanelLayout.setVerticalGroup(
            eeTabUnaryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(eeTabUnaryPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(eeTabTrigFunctLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(eeTabTrigComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(eeTabNonTrigFunctLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(eeTabNonTrigComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        eeTabBinaryPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle2.getString("BINARY"))); // NOI18N
        eeTabBinaryPanel.setToolTipText(bundle.getString("BINARY_TIP")); // NOI18N

        eeTabMatrFunctLabel.setText(bundle2.getString("MATR_OPERATORS")); // NOI18N
        eeTabMatrFunctLabel.setToolTipText(bundle.getString("MATRIX_TIP")); // NOI18N

        eeTabMatrComboBox.setMaximumRowCount(30);
        eeTabMatrComboBox.setToolTipText(bundle.getString("MATRIX_TIP")); // NOI18N
        eeTabMatrComboBox.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                eeTabMatrComboBoxMouseEntered(evt);
            }
        });
        eeTabMatrComboBox.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {
            public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
            }
            public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
                eeTabMatrComboBoxPopupMenuWillBecomeInvisible(evt);
            }
            public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
            }
        });

        eeTabBinaryLabel.setText(bundle2.getString("ALL_BINARY")); // NOI18N
        eeTabBinaryLabel.setToolTipText(bundle.getString("UNARY_TIP")); // NOI18N

        eeTabBinaryComboBox.setMaximumRowCount(30);
        eeTabBinaryComboBox.setToolTipText(bundle.getString("UNARY_TIP")); // NOI18N
        eeTabBinaryComboBox.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                eeTabBinaryComboBoxMouseEntered(evt);
            }
        });
        eeTabBinaryComboBox.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {
            public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
            }
            public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
                eeTabBinaryComboBoxPopupMenuWillBecomeInvisible(evt);
            }
            public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
            }
        });

        javax.swing.GroupLayout eeTabBinaryPanelLayout = new javax.swing.GroupLayout(eeTabBinaryPanel);
        eeTabBinaryPanel.setLayout(eeTabBinaryPanelLayout);
        eeTabBinaryPanelLayout.setHorizontalGroup(
            eeTabBinaryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(eeTabBinaryPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(eeTabBinaryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(eeTabBinaryPanelLayout.createSequentialGroup()
                        .addComponent(eeTabBinaryLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 284, Short.MAX_VALUE)
                        .addGap(46, 46, 46))
                    .addGroup(eeTabBinaryPanelLayout.createSequentialGroup()
                        .addComponent(eeTabBinaryComboBox, 0, 320, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(eeTabBinaryPanelLayout.createSequentialGroup()
                        .addComponent(eeTabMatrFunctLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(eeTabBinaryPanelLayout.createSequentialGroup()
                        .addComponent(eeTabMatrComboBox, 0, 320, Short.MAX_VALUE)
                        .addContainerGap())))
        );
        eeTabBinaryPanelLayout.setVerticalGroup(
            eeTabBinaryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(eeTabBinaryPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(eeTabBinaryLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(eeTabBinaryComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(eeTabMatrFunctLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(eeTabMatrComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(60, Short.MAX_VALUE))
        );

        eeTabSpecItemsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle2.getString("SPECIAL_ITEMS"))); // NOI18N
        eeTabSpecItemsPanel.setToolTipText(bundle.getString("SPECIAL_TIP")); // NOI18N
        eeTabSpecItemsPanel.setMaximumSize(new java.awt.Dimension(327, 327));

        eeTabOtherFunctLabel.setText(bundle2.getString("OTHER")); // NOI18N
        eeTabOtherFunctLabel.setToolTipText(bundle.getString("SPECIAL_TIP")); // NOI18N

        eeTabOtherComboBox.setMaximumRowCount(30);
        eeTabOtherComboBox.setToolTipText(bundle.getString("SPECIAL_TIP")); // NOI18N
        eeTabOtherComboBox.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                eeTabOtherComboBoxMouseEntered(evt);
            }
        });
        eeTabOtherComboBox.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {
            public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
            }
            public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
                eeTabOtherComboBoxPopupMenuWillBecomeInvisible(evt);
            }
            public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
            }
        });

        matrixBuilderLabel.setText(bundle1.getString("matrixBuilder")); // NOI18N

        rowLabel.setText(bundle1.getString("Rows")); // NOI18N
        rowLabel.setToolTipText(bundle.getString("matrRows")); // NOI18N

        rowSpinner.setToolTipText(bundle.getString("matrRows")); // NOI18N
        rowSpinner.setValue(1);
        rowSpinner.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                rowSpinnerMouseEntered(evt);
            }
        });
        rowSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                rowSpinnerStateChanged(evt);
            }
        });

        colSpinner.setToolTipText(bundle.getString("matrCol")); // NOI18N
        colSpinner.setValue(1);
        colSpinner.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                colSpinnerMouseEntered(evt);
            }
        });
        colSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                colSpinnerStateChanged(evt);
            }
        });

        colLabel.setText(bundle1.getString("Cols")); // NOI18N
        colLabel.setToolTipText(bundle.getString("matrCol")); // NOI18N

        insertMatrix.setText(bundle1.getString("insertMatrix")); // NOI18N
        insertMatrix.setToolTipText(bundle.getString("insertMatrix")); // NOI18N
        insertMatrix.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                insertMatrixMouseEntered(evt);
            }
        });
        insertMatrix.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                insertMatrixActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout eeTabSpecItemsPanelLayout = new javax.swing.GroupLayout(eeTabSpecItemsPanel);
        eeTabSpecItemsPanel.setLayout(eeTabSpecItemsPanelLayout);
        eeTabSpecItemsPanelLayout.setHorizontalGroup(
            eeTabSpecItemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(eeTabSpecItemsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(eeTabSpecItemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(eeTabOtherFunctLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE)
                    .addComponent(eeTabOtherComboBox, 0, 320, Short.MAX_VALUE)
                    .addComponent(matrixBuilderLabel)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, eeTabSpecItemsPanelLayout.createSequentialGroup()
                        .addGroup(eeTabSpecItemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, eeTabSpecItemsPanelLayout.createSequentialGroup()
                                .addComponent(rowLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(rowSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE))
                            .addGroup(eeTabSpecItemsPanelLayout.createSequentialGroup()
                                .addComponent(colLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(colSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(insertMatrix)))
                .addContainerGap())
        );

        eeTabSpecItemsPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {colLabel, rowLabel});

        eeTabSpecItemsPanelLayout.setVerticalGroup(
            eeTabSpecItemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(eeTabSpecItemsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(eeTabOtherFunctLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(eeTabOtherComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(matrixBuilderLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(eeTabSpecItemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rowLabel)
                    .addComponent(rowSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(eeTabSpecItemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(colLabel)
                    .addComponent(colSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(insertMatrix))
                .addContainerGap())
        );

        eeTabNumPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle1.getString("NUMPAD"))); // NOI18N
        eeTabNumPanel.setToolTipText(bundle.getString("NUMERIC_TIP")); // NOI18N
        eeTabNumPanel.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                eeTabNumPanelMouseEntered(evt);
            }
        });

        numButton1.setText("1");
        numButton1.setToolTipText(bundle.getString("NUMBER_TIP")); // NOI18N
        numButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                numButton1ActionPerformed(evt);
            }
        });

        numButton2.setText("2");
        numButton2.setToolTipText(bundle.getString("NUMBER_TIP")); // NOI18N
        numButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                numButton2ActionPerformed(evt);
            }
        });

        numButton3.setText("3");
        numButton3.setToolTipText(bundle.getString("NUMBER_TIP")); // NOI18N
        numButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                numButton3ActionPerformed(evt);
            }
        });

        numButton4.setText("4");
        numButton4.setToolTipText(bundle.getString("NUMBER_TIP")); // NOI18N
        numButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                numButton4ActionPerformed(evt);
            }
        });

        numButton5.setText("5");
        numButton5.setToolTipText(bundle.getString("NUMBER_TIP")); // NOI18N
        numButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                numButton5ActionPerformed(evt);
            }
        });

        numButton6.setText("6");
        numButton6.setToolTipText(bundle.getString("NUMBER_TIP")); // NOI18N
        numButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                numButton6ActionPerformed(evt);
            }
        });

        numButton7.setText("7");
        numButton7.setToolTipText(bundle.getString("NUMBER_TIP")); // NOI18N
        numButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                numButton7ActionPerformed(evt);
            }
        });

        numButton8.setText("8");
        numButton8.setToolTipText(bundle.getString("NUMBER_TIP")); // NOI18N
        numButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                numButton8ActionPerformed(evt);
            }
        });

        numButton9.setText("9");
        numButton9.setToolTipText(bundle.getString("NUMBER_TIP")); // NOI18N
        numButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                numButton9ActionPerformed(evt);
            }
        });

        numButton0.setText("0");
        numButton0.setToolTipText(bundle.getString("NUMBER_TIP")); // NOI18N
        numButton0.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                numButton0ActionPerformed(evt);
            }
        });

        numButtonDot.setText(".");
        numButtonDot.setToolTipText(bundle.getString("DEC_POINT_TIP")); // NOI18N
        numButtonDot.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                numButtonDotActionPerformed(evt);
            }
        });

        numButtonMinus.setText("-");
        numButtonMinus.setToolTipText(bundle.getString("NEGATIVE_TIP")); // NOI18N
        numButtonMinus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                numButtonMinusActionPerformed(evt);
            }
        });

        prevButton.setText(bundle1.getString("PREVIOUS")); // NOI18N
        prevButton.setToolTipText(bundle.getString("PREV_TIP")); // NOI18N
        prevButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                prevButtonActionPerformed(evt);
            }
        });

        nextButton.setText(bundle1.getString("NEXT")); // NOI18N
        nextButton.setToolTipText(bundle.getString("NEXT_TIP")); // NOI18N
        nextButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nextButtonActionPerformed(evt);
            }
        });

        clearInputButton.setText(bundle1.getString("CLEAR")); // NOI18N
        clearInputButton.setToolTipText(bundle.getString("CLEAR_TIP")); // NOI18N
        clearInputButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                clearInputButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout eeTabNumPanelLayout = new javax.swing.GroupLayout(eeTabNumPanel);
        eeTabNumPanel.setLayout(eeTabNumPanelLayout);
        eeTabNumPanelLayout.setHorizontalGroup(
            eeTabNumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(eeTabNumPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(eeTabNumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(clearInputButton, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
                    .addGroup(eeTabNumPanelLayout.createSequentialGroup()
                        .addComponent(prevButton, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)
                        .addGap(6, 6, 6)
                        .addComponent(nextButton, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(eeTabNumPanelLayout.createSequentialGroup()
                        .addComponent(numButton7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(numButton8)
                        .addGap(6, 6, 6)
                        .addComponent(numButton9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(numButton0))
                    .addGroup(eeTabNumPanelLayout.createSequentialGroup()
                        .addComponent(numButton4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(numButton5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(numButton6)
                        .addGap(6, 6, 6)
                        .addComponent(numButtonMinus))
                    .addGroup(eeTabNumPanelLayout.createSequentialGroup()
                        .addComponent(numButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(numButton2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(numButton3)
                        .addGap(6, 6, 6)
                        .addComponent(numButtonDot)))
                .addContainerGap(29, Short.MAX_VALUE))
        );

        eeTabNumPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {numButton0, numButton1, numButton2, numButton3, numButton4, numButton5, numButton6, numButton7, numButton8, numButton9, numButtonDot, numButtonMinus});

        eeTabNumPanelLayout.setVerticalGroup(
            eeTabNumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(eeTabNumPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(eeTabNumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(numButton1)
                    .addComponent(numButton2)
                    .addComponent(numButton3)
                    .addComponent(numButtonDot))
                .addGap(6, 6, 6)
                .addGroup(eeTabNumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(numButton5)
                    .addComponent(numButton6)
                    .addComponent(numButton4)
                    .addComponent(numButtonMinus))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(eeTabNumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(numButton8)
                    .addComponent(numButton9)
                    .addComponent(numButton7)
                    .addComponent(numButton0))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(eeTabNumPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(prevButton)
                    .addComponent(nextButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(clearInputButton)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        eeTabNumPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {numButton0, numButton1, numButton2, numButton3, numButton4, numButton5, numButton6, numButton7, numButton8, numButton9, numButtonDot, numButtonMinus});

        eeTabNumPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {nextButton, prevButton});

        launchPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle1.getString("LAUNCHPAD"))); // NOI18N
        launchPanel.setToolTipText(bundle.getString("LAUNCHPAD_TIP")); // NOI18N
        launchPanel.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                launchPanelMouseEntered(evt);
            }
        });

        calculateButton.setText(bundle1.getString("SOLVE")); // NOI18N
        calculateButton.setToolTipText(bundle.getString("SOLVE_TIP")); // NOI18N
        calculateButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                calculateButtonActionPerformed(evt);
            }
        });

        drawButton.setText(bundle1.getString("DRAW")); // NOI18N
        drawButton.setToolTipText(bundle.getString("DRAW_TIP")); // NOI18N
        drawButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                drawButtonActionPerformed(evt);
            }
        });

        saveExprButton.setText(bundle1.getString("SAVE_EXP_BUTTON")); // NOI18N
        saveExprButton.setToolTipText(bundle.getString("SAVE_TIP")); // NOI18N
        saveExprButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveExprButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout launchPanelLayout = new javax.swing.GroupLayout(launchPanel);
        launchPanel.setLayout(launchPanelLayout);
        launchPanelLayout.setHorizontalGroup(
            launchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(launchPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(launchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(calculateButton, javax.swing.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE)
                    .addComponent(drawButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE)
                    .addComponent(saveExprButton, javax.swing.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE))
                .addContainerGap())
        );
        launchPanelLayout.setVerticalGroup(
            launchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(launchPanelLayout.createSequentialGroup()
                .addComponent(calculateButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(drawButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(saveExprButton)
                .addContainerGap(31, Short.MAX_VALUE))
        );

        eeTabSpecCharacters.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle1.getString("SPECCHARS"))); // NOI18N
        eeTabSpecCharacters.setToolTipText(bundle.getString("SPECCHAR_TIP")); // NOI18N
        eeTabSpecCharacters.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                eeTabSpecCharactersMouseEntered(evt);
            }
        });

        piButton.setText(bundle1.getString("PI")); // NOI18N
        piButton.setToolTipText(bundle.getString("PI_TIP")); // NOI18N
        piButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                piButtonActionPerformed(evt);
            }
        });

        bracketButton.setText(bundle1.getString("BRACKET")); // NOI18N
        bracketButton.setToolTipText(bundle.getString("BRACKET_TIP")); // NOI18N
        bracketButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bracketButtonActionPerformed(evt);
            }
        });

        matrixRowButton.setText(bundle1.getString("M_ROW")); // NOI18N
        matrixRowButton.setToolTipText(bundle.getString("MATRIX_ROW_TIP")); // NOI18N
        matrixRowButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                matrixRowButtonMouseEntered(evt);
            }
        });
        matrixRowButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                matrixRowButtonActionPerformed(evt);
            }
        });

        matrixButton.setText(bundle1.getString("MATRIX")); // NOI18N
        matrixButton.setToolTipText(bundle.getString("MATRIX_BTN_TIP")); // NOI18N
        matrixButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                matrixButtonMouseEntered(evt);
            }
        });
        matrixButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                matrixButtonActionPerformed(evt);
            }
        });

        variableButton.setText(bundle1.getString("VAR")); // NOI18N
        variableButton.setToolTipText(bundle.getString("VARIABLE_TIP")); // NOI18N
        variableButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                variableButtonActionPerformed(evt);
            }
        });

        otherBracketButton.setText(bundle1.getString("OTHER_OPS_OPERANDS")); // NOI18N
        otherBracketButton.setToolTipText(bundle.getString("SPECIAL_BRACKET_TIP")); // NOI18N
        otherBracketButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                otherBracketButtonMouseEntered(evt);
            }
        });
        otherBracketButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                otherBracketButtonActionPerformed(evt);
            }
        });

        matrixColButton.setText(bundle1.getString("M_COL")); // NOI18N
        matrixColButton.setToolTipText(bundle.getString("MATRIX_COL_TIP")); // NOI18N
        matrixColButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                matrixColButtonMouseEntered(evt);
            }
        });
        matrixColButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                matrixColButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout eeTabSpecCharactersLayout = new javax.swing.GroupLayout(eeTabSpecCharacters);
        eeTabSpecCharacters.setLayout(eeTabSpecCharactersLayout);
        eeTabSpecCharactersLayout.setHorizontalGroup(
            eeTabSpecCharactersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(eeTabSpecCharactersLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(eeTabSpecCharactersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(eeTabSpecCharactersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(eeTabSpecCharactersLayout.createSequentialGroup()
                            .addComponent(piButton, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(bracketButton, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(eeTabSpecCharactersLayout.createSequentialGroup()
                            .addComponent(matrixRowButton)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(matrixColButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(eeTabSpecCharactersLayout.createSequentialGroup()
                        .addComponent(matrixButton, javax.swing.GroupLayout.DEFAULT_SIZE, 98, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(variableButton))
                    .addComponent(otherBracketButton, javax.swing.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE))
                .addContainerGap())
        );

        eeTabSpecCharactersLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {bracketButton, matrixButton, matrixColButton, matrixRowButton, piButton, variableButton});

        eeTabSpecCharactersLayout.setVerticalGroup(
            eeTabSpecCharactersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(eeTabSpecCharactersLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(eeTabSpecCharactersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(piButton)
                    .addComponent(bracketButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(eeTabSpecCharactersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(matrixRowButton)
                    .addComponent(matrixColButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(eeTabSpecCharactersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(matrixButton)
                    .addComponent(variableButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(otherBracketButton)
                .addContainerGap(21, Short.MAX_VALUE))
        );

        eeTabSpecCharactersLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {bracketButton, matrixButton, matrixColButton, matrixRowButton, otherBracketButton, piButton, variableButton});

        javax.swing.GroupLayout expressionEditorTabLayout = new javax.swing.GroupLayout(expressionEditorTab);
        expressionEditorTab.setLayout(expressionEditorTabLayout);
        expressionEditorTabLayout.setHorizontalGroup(
            expressionEditorTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(expressionEditorTabLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(expressionEditorTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(eeTabExprLabel)
                    .addGroup(expressionEditorTabLayout.createSequentialGroup()
                        .addGroup(expressionEditorTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(eeTabInputScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 592, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(expressionEditorTabLayout.createSequentialGroup()
                                .addGroup(expressionEditorTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(eeTabSpecItemsPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(eeTabBinaryPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(eeTabUnaryPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(expressionEditorTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(eeTabSpecCharacters, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(eeTabNumPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(launchPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(342, 342, 342)))
                .addContainerGap())
        );

        expressionEditorTabLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {eeTabNumPanel, eeTabSpecCharacters, launchPanel});

        expressionEditorTabLayout.setVerticalGroup(
            expressionEditorTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(expressionEditorTabLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(eeTabExprLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(eeTabInputScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(expressionEditorTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(eeTabUnaryPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(launchPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(expressionEditorTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(eeTabBinaryPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(eeTabNumPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(expressionEditorTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(eeTabSpecItemsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(eeTabSpecCharacters, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(44, Short.MAX_VALUE))
        );

        expressionEditorTabLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {eeTabBinaryPanel, eeTabNumPanel});

        expressionEditorTabLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {eeTabUnaryPanel, launchPanel});

        expressionEditorTabLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {eeTabSpecCharacters, eeTabSpecItemsPanel});

        tabsPane.addTab(bundle1.getString("Expression_Editor"), null, expressionEditorTab, bundle.getString("EXPR_EDITOR_TAB")); // NOI18N

        functionOutputTab.setToolTipText(bundle.getString("FUNCTION_OUTPUT_TIP")); // NOI18N
        functionOutputTab.setMaximumSize(new java.awt.Dimension(700, 800));
        functionOutputTab.setPreferredSize(new java.awt.Dimension(700, 667));
        functionOutputTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                functionOutputTabMouseEntered(evt);
            }
        });

        functionScrollPane.setMaximumSize(new java.awt.Dimension(500, 510));
        functionScrollPane.setMinimumSize(new java.awt.Dimension(300, 300));
        functionScrollPane.setPreferredSize(new java.awt.Dimension(500, 510));

        functionImageLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        functionImageLabel.setMaximumSize(new java.awt.Dimension(500, 500));
        functionImageLabel.setMinimumSize(new java.awt.Dimension(500, 500));
        functionImageLabel.setPreferredSize(new java.awt.Dimension(500, 500));
        functionScrollPane.setViewportView(functionImageLabel);

        foTabPictureLabel.setText(bundle1.getString("PICTURE_LABEL")); // NOI18N

        progressBar.setToolTipText(bundle.getString("PROGRESS_TIP")); // NOI18N
        progressBar.setStringPainted(true);

        boundsLabel.setText("Xmin=?;     Xmax=?;     Ymin=?;     Ymax=?");
        boundsLabel.setToolTipText(bundle.getString("BOUNDS_TIP")); // NOI18N

        timeLabel.setText(bundle1.getString("DRAWTIME")); // NOI18N
        timeLabel.setToolTipText(bundle.getString("TIME_TIP")); // NOI18N

        millisLabel.setText("0ms");
        millisLabel.setToolTipText(bundle.getString("TIME_TIP")); // NOI18N

        precLabel.setText(bundle1.getString("PRECISION")); // NOI18N
        precLabel.setToolTipText(bundle.getString("PREC_TIP")); // NOI18N

        precisionLabel.setText("0");
        precisionLabel.setToolTipText(bundle.getString("PREC_TIP")); // NOI18N

        checkPointsLabel.setText(bundle1.getString("CPLABEL")); // NOI18N
        checkPointsLabel.setToolTipText(bundle.getString("CHECKPOINT_TIP")); // NOI18N

        cpLabel.setText("0/0");
        cpLabel.setToolTipText(bundle.getString("CHECKPOINT_TIP")); // NOI18N

        locMinLabel.setText(bundle1.getString("locMin")); // NOI18N
        locMinLabel.setToolTipText(bundle.getString("locBounds")); // NOI18N

        minValue.setText("0");
        minValue.setToolTipText(bundle.getString("locBounds")); // NOI18N

        locMaxLabel.setText(bundle1.getString("locMax")); // NOI18N
        locMaxLabel.setToolTipText(bundle.getString("locBounds")); // NOI18N

        maxValue.setText("0");
        maxValue.setToolTipText(bundle.getString("locBounds")); // NOI18N

        javax.swing.GroupLayout functionOutputTabLayout = new javax.swing.GroupLayout(functionOutputTab);
        functionOutputTab.setLayout(functionOutputTabLayout);
        functionOutputTabLayout.setHorizontalGroup(
            functionOutputTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(functionOutputTabLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(functionOutputTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(boundsLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 595, Short.MAX_VALUE)
                    .addGroup(functionOutputTabLayout.createSequentialGroup()
                        .addComponent(timeLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(millisLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 510, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, functionOutputTabLayout.createSequentialGroup()
                        .addComponent(foTabPictureLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 329, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(functionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 593, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(functionOutputTabLayout.createSequentialGroup()
                        .addGroup(functionOutputTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, functionOutputTabLayout.createSequentialGroup()
                                .addComponent(locMinLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(minValue, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, functionOutputTabLayout.createSequentialGroup()
                                .addComponent(precLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(precisionLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(functionOutputTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(functionOutputTabLayout.createSequentialGroup()
                                .addComponent(checkPointsLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(cpLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE))
                            .addGroup(functionOutputTabLayout.createSequentialGroup()
                                .addComponent(locMaxLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(maxValue, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE)))))
                .addContainerGap())
        );
        functionOutputTabLayout.setVerticalGroup(
            functionOutputTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(functionOutputTabLayout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(functionOutputTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(foTabPictureLabel)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(functionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 510, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(boundsLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(functionOutputTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(timeLabel)
                    .addComponent(millisLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(functionOutputTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(precLabel)
                    .addComponent(precisionLabel)
                    .addComponent(checkPointsLabel)
                    .addComponent(cpLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(functionOutputTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(locMinLabel)
                    .addComponent(minValue)
                    .addComponent(locMaxLabel)
                    .addComponent(maxValue))
                .addContainerGap(32, Short.MAX_VALUE))
        );

        tabsPane.addTab(bundle1.getString("Function_Output"), null, functionOutputTab, bundle.getString("FUNCTION_OUTPUT_TIP")); // NOI18N

        matrixOutputTab.setToolTipText(bundle.getString("MATRIX_OUTPUT")); // NOI18N
        matrixOutputTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                matrixOutputTabMouseEntered(evt);
            }
        });

        resultArea.setColumns(20);
        resultArea.setEditable(false);
        resultArea.setFont(new java.awt.Font("Courier New", 0, 14));
        resultArea.setLineWrap(this.lineWrap.isSelected());
        resultArea.setRows(5);
        resultArea.setToolTipText(bundle.getString("MATRIX_OUTPUT")); // NOI18N
        resultScrollPane.setViewportView(resultArea);

        resultLabel.setText(bundle1.getString("RESULT")); // NOI18N

        lineWrap.setText(bundle1.getString("lineWrap")); // NOI18N

        org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, resultArea, org.jdesktop.beansbinding.ELProperty.create("${lineWrap}"), lineWrap, org.jdesktop.beansbinding.BeanProperty.create("selected"));
        bindingGroup.addBinding(binding);

        javax.swing.GroupLayout matrixOutputTabLayout = new javax.swing.GroupLayout(matrixOutputTab);
        matrixOutputTab.setLayout(matrixOutputTabLayout);
        matrixOutputTabLayout.setHorizontalGroup(
            matrixOutputTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(matrixOutputTabLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(matrixOutputTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(resultScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 595, Short.MAX_VALUE)
                    .addComponent(resultLabel)
                    .addComponent(lineWrap, javax.swing.GroupLayout.DEFAULT_SIZE, 595, Short.MAX_VALUE))
                .addContainerGap())
        );
        matrixOutputTabLayout.setVerticalGroup(
            matrixOutputTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(matrixOutputTabLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(resultLabel)
                .addGap(7, 7, 7)
                .addComponent(resultScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 603, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lineWrap)
                .addContainerGap())
        );

        tabsPane.addTab(bundle1.getString("Matrix_Output"), null, matrixOutputTab, bundle.getString("MATRIX_OUTPUT")); // NOI18N

        settingsTab.setToolTipText(bundle.getString("SETTINGSTAB")); // NOI18N

        sTabQualityPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle1.getString("CALCULATION_SETTINGS"))); // NOI18N
        sTabQualityPanel.setToolTipText(bundle.getString("GENERAL_SETTINGS")); // NOI18N
        sTabQualityPanel.setMaximumSize(new java.awt.Dimension(505, 166));
        sTabQualityPanel.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                sTabQualityPanelMouseEntered(evt);
            }
        });

        sTabPrecisionSlider.setMajorTickSpacing(10000);
        sTabPrecisionSlider.setMaximum(50000);
        sTabPrecisionSlider.setMinorTickSpacing(2000);
        sTabPrecisionSlider.setPaintLabels(true);
        sTabPrecisionSlider.setPaintTicks(true);
        sTabPrecisionSlider.setToolTipText(bundle.getString("PRECISION")); // NOI18N
        sTabPrecisionSlider.setMinimumSize(new java.awt.Dimension(250, 46));
        sTabPrecisionSlider.setPreferredSize(new java.awt.Dimension(250, 46));
        sTabPrecisionSlider.setValueIsAdjusting(true);

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, sTabPrecisionSpinner, org.jdesktop.beansbinding.ELProperty.create("${value}"), sTabPrecisionSlider, org.jdesktop.beansbinding.BeanProperty.create("value"));
        bindingGroup.addBinding(binding);

        sTabPrecisionSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                sTabPrecisionSliderStateChanged(evt);
            }
        });

        sTabPrecisionSpinner.setToolTipText(bundle.getString("PRECISION")); // NOI18N
        sTabPrecisionSpinner.setMinimumSize(new java.awt.Dimension(50, 18));
        sTabPrecisionSpinner.setPreferredSize(new java.awt.Dimension(50, 18));
        sTabPrecisionSpinner.setValue(15);
        sTabPrecisionSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                sTabPrecisionSpinnerStateChanged(evt);
            }
        });

        sTabPrecisionLabel.setText(bundle1.getString("fs_quality_precision")); // NOI18N
        sTabPrecisionLabel.setToolTipText(bundle.getString("PRECISION")); // NOI18N

        infixBoxNote.setText(bundle1.getString("INFIX_NOTE")); // NOI18N

        infixPrefixGroup.add(isInfix);
        isInfix.setSelected(true);
        isInfix.setText(bundle1.getString("INFIX_CHECKBOX")); // NOI18N
        isInfix.setToolTipText(bundle.getString("INFIX_PREFIX")); // NOI18N
        isInfix.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                isInfixActionPerformed(evt);
            }
        });

        infixPrefixGroup.add(isPrefix);
        isPrefix.setText(bundle1.getString("PREFIX_CHECKBOX")); // NOI18N
        isPrefix.setToolTipText(bundle.getString("INFIX_PREFIX")); // NOI18N
        isPrefix.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                isPrefixActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout sTabQualityPanelLayout = new javax.swing.GroupLayout(sTabQualityPanel);
        sTabQualityPanel.setLayout(sTabQualityPanelLayout);
        sTabQualityPanelLayout.setHorizontalGroup(
            sTabQualityPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(sTabQualityPanelLayout.createSequentialGroup()
                .addGroup(sTabQualityPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(sTabQualityPanelLayout.createSequentialGroup()
                        .addGap(25, 25, 25)
                        .addComponent(infixBoxNote))
                    .addGroup(sTabQualityPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(sTabQualityPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(isInfix)
                            .addGroup(sTabQualityPanelLayout.createSequentialGroup()
                                .addComponent(sTabPrecisionLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(sTabPrecisionSpinner, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(sTabPrecisionSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(isPrefix))))
                .addContainerGap())
        );
        sTabQualityPanelLayout.setVerticalGroup(
            sTabQualityPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(sTabQualityPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(sTabQualityPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(sTabQualityPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(sTabPrecisionLabel)
                        .addComponent(sTabPrecisionSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(sTabPrecisionSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(2, 2, 2)
                .addComponent(isInfix)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(isPrefix)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE)
                .addComponent(infixBoxNote)
                .addContainerGap())
        );

        saveExpressionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle1.getString("EXPR_SAVE_PANEL"))); // NOI18N
        saveExpressionPanel.setToolTipText(bundle.getString("SAVE_EXPR")); // NOI18N
        saveExpressionPanel.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                saveExpressionPanelMouseEntered(evt);
            }
        });

        outputExprLocationField.setEditable(false);
        outputExprLocationField.setText(bundle1.getString("EXP_LOC")); // NOI18N
        outputExprLocationField.setToolTipText(bundle.getString("EXPRESSION_LOC")); // NOI18N

        saveExpressionBox.setText(bundle1.getString("SAVE_EXPR")); // NOI18N
        saveExpressionBox.setToolTipText(bundle.getString("SAVE_EXPRESSION_BOX")); // NOI18N

        browseOutputExprButton.setText(bundle1.getString("BROWSE")); // NOI18N
        browseOutputExprButton.setToolTipText(bundle.getString("CHOOSE_A_FILE")); // NOI18N
        browseOutputExprButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                browseOutputExprButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout saveExpressionPanelLayout = new javax.swing.GroupLayout(saveExpressionPanel);
        saveExpressionPanel.setLayout(saveExpressionPanelLayout);
        saveExpressionPanelLayout.setHorizontalGroup(
            saveExpressionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(saveExpressionPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(saveExpressionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(saveExpressionBox)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, saveExpressionPanelLayout.createSequentialGroup()
                        .addComponent(outputExprLocationField, javax.swing.GroupLayout.DEFAULT_SIZE, 476, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(browseOutputExprButton)))
                .addContainerGap())
        );
        saveExpressionPanelLayout.setVerticalGroup(
            saveExpressionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(saveExpressionPanelLayout.createSequentialGroup()
                .addComponent(saveExpressionBox)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(saveExpressionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(outputExprLocationField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(browseOutputExprButton))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        saveResultPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle1.getString("RES_SAVE_PANEL"))); // NOI18N
        saveResultPanel.setToolTipText(bundle.getString("SAVE_RES")); // NOI18N
        saveResultPanel.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                saveResultPanelMouseEntered(evt);
            }
        });

        outputResultLocationField.setEditable(false);
        outputResultLocationField.setText(bundle1.getString("RES_LOC")); // NOI18N
        outputResultLocationField.setToolTipText(bundle.getString("EXPRESSION_LOC")); // NOI18N

        saveResultBox.setText(bundle1.getString("SAVE_RES")); // NOI18N
        saveResultBox.setToolTipText(bundle.getString("SAVE_RESULT_BOX")); // NOI18N

        browseResultButton.setText(bundle1.getString("BROWSE")); // NOI18N
        browseResultButton.setToolTipText(bundle.getString("CHOOSE_A_FILE")); // NOI18N
        browseResultButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                browseResultButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout saveResultPanelLayout = new javax.swing.GroupLayout(saveResultPanel);
        saveResultPanel.setLayout(saveResultPanelLayout);
        saveResultPanelLayout.setHorizontalGroup(
            saveResultPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(saveResultPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(saveResultPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(saveResultBox)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, saveResultPanelLayout.createSequentialGroup()
                        .addComponent(outputResultLocationField, javax.swing.GroupLayout.DEFAULT_SIZE, 476, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(browseResultButton)))
                .addContainerGap())
        );
        saveResultPanelLayout.setVerticalGroup(
            saveResultPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(saveResultPanelLayout.createSequentialGroup()
                .addComponent(saveResultBox)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(saveResultPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(outputResultLocationField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(browseResultButton))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        openExpressionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle1.getString("OPEN_XML_PANEL"))); // NOI18N
        openExpressionPanel.setToolTipText(bundle.getString("LOAD_EXPR")); // NOI18N
        openExpressionPanel.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                openExpressionPanelMouseEntered(evt);
            }
        });

        inputExprLocationField.setEditable(false);
        inputExprLocationField.setText(bundle1.getString("EXP_LOC")); // NOI18N
        inputExprLocationField.setToolTipText(bundle.getString("INPUT_LOC")); // NOI18N

        browseInputExprButton.setText(bundle1.getString("BROWSE")); // NOI18N
        browseInputExprButton.setToolTipText(bundle.getString("CHOOSE_A_FILE")); // NOI18N
        browseInputExprButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                browseInputExprButtonActionPerformed(evt);
            }
        });

        solveXMLButton.setText(bundle1.getString("SOLVE")); // NOI18N
        solveXMLButton.setToolTipText(bundle.getString("SOLVE_XML")); // NOI18N
        solveXMLButton.setEnabled(false);
        solveXMLButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                solveXMLButtonActionPerformed(evt);
            }
        });

        drawXMLButton.setText(bundle1.getString("DRAW")); // NOI18N
        drawXMLButton.setToolTipText(bundle.getString("DRAW_XML")); // NOI18N
        drawXMLButton.setEnabled(false);
        drawXMLButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                drawXMLButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout openExpressionPanelLayout = new javax.swing.GroupLayout(openExpressionPanel);
        openExpressionPanel.setLayout(openExpressionPanelLayout);
        openExpressionPanelLayout.setHorizontalGroup(
            openExpressionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(openExpressionPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(openExpressionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(openExpressionPanelLayout.createSequentialGroup()
                        .addComponent(inputExprLocationField, javax.swing.GroupLayout.DEFAULT_SIZE, 476, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(browseInputExprButton))
                    .addGroup(openExpressionPanelLayout.createSequentialGroup()
                        .addComponent(solveXMLButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(drawXMLButton)))
                .addContainerGap())
        );

        openExpressionPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {browseInputExprButton, drawXMLButton, solveXMLButton});

        openExpressionPanelLayout.setVerticalGroup(
            openExpressionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(openExpressionPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(openExpressionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(inputExprLocationField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(browseInputExprButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(openExpressionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(solveXMLButton)
                    .addComponent(drawXMLButton))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        languagePanel.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle1.getString("LANGUAGE_PANEL"))); // NOI18N
        languagePanel.setToolTipText(bundle.getString("LANG_SETTINGS")); // NOI18N
        languagePanel.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                languagePanelMouseEntered(evt);
            }
        });

        langComboBox.setToolTipText(bundle.getString("LANG_SETTINGS")); // NOI18N

        setLangButton.setText(bundle1.getString("SET_LANG")); // NOI18N
        setLangButton.setToolTipText(bundle.getString("SAVE_LANG")); // NOI18N
        setLangButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                setLangButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout languagePanelLayout = new javax.swing.GroupLayout(languagePanel);
        languagePanel.setLayout(languagePanelLayout);
        languagePanelLayout.setHorizontalGroup(
            languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(languagePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(langComboBox, 0, 476, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(setLangButton, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        languagePanelLayout.setVerticalGroup(
            languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(languagePanelLayout.createSequentialGroup()
                .addGroup(languagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(langComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(setLangButton))
                .addContainerGap(31, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout settingsTabLayout = new javax.swing.GroupLayout(settingsTab);
        settingsTab.setLayout(settingsTabLayout);
        settingsTabLayout.setHorizontalGroup(
            settingsTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, settingsTabLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(settingsTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(sTabQualityPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(openExpressionPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(saveResultPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(saveExpressionPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(languagePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        settingsTabLayout.setVerticalGroup(
            settingsTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(settingsTabLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(sTabQualityPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(saveExpressionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(saveResultPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(openExpressionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(languagePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(105, Short.MAX_VALUE))
        );

        tabsPane.addTab(bundle1.getString("Settings"), null, settingsTab, bundle.getString("SETTINGSTAB")); // NOI18N

        functionSettingsTab.setToolTipText(bundle.getString("FDSETTINGS_TIP")); // NOI18N
        functionSettingsTab.setMaximumSize(new java.awt.Dimension(600, 633));
        functionSettingsTab.setPreferredSize(new java.awt.Dimension(600, 633));
        functionSettingsTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                functionSettingsTabMouseEntered(evt);
            }
        });

        fsTabHSizePanel.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle1.getString("fs_horizontal_size_panel"))); // NOI18N
        fsTabHSizePanel.setToolTipText(bundle.getString("horizontal_tip")); // NOI18N
        fsTabHSizePanel.setMaximumSize(new java.awt.Dimension(505, 166));
        fsTabHSizePanel.setMinimumSize(new java.awt.Dimension(546, 198));
        fsTabHSizePanel.setPreferredSize(new java.awt.Dimension(546, 198));

        fsTabWidthSlider.setMajorTickSpacing(500);
        fsTabWidthSlider.setMaximum(2000);
        fsTabWidthSlider.setMinorTickSpacing(50);
        fsTabWidthSlider.setPaintLabels(true);
        fsTabWidthSlider.setPaintTicks(true);
        fsTabWidthSlider.setToolTipText(bundle.getString("horizontal_tip")); // NOI18N
        fsTabWidthSlider.setValue(10);
        fsTabWidthSlider.setMinimumSize(new java.awt.Dimension(250, 46));
        fsTabWidthSlider.setPreferredSize(new java.awt.Dimension(250, 46));
        fsTabWidthSlider.setValueIsAdjusting(true);
        fsTabWidthSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fsTabWidthSliderStateChanged(evt);
            }
        });

        fsTabWidthSpinner.setToolTipText(bundle.getString("horizontal_tip")); // NOI18N
        fsTabWidthSpinner.setMinimumSize(new java.awt.Dimension(50, 18));
        fsTabWidthSpinner.setPreferredSize(new java.awt.Dimension(55, 18));

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, fsTabWidthSlider, org.jdesktop.beansbinding.ELProperty.create("${value}"), fsTabWidthSpinner, org.jdesktop.beansbinding.BeanProperty.create("value"));
        bindingGroup.addBinding(binding);

        fsTabWidthSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fsTabWidthSpinnerStateChanged(evt);
            }
        });

        fsTabHStartLabel.setText(bundle1.getString("fs_horizontal_interval_start_value")); // NOI18N
        fsTabHStartLabel.setToolTipText(bundle.getString("horizontal_tip")); // NOI18N
        fsTabHStartLabel.setMaximumSize(new java.awt.Dimension(113, 14));
        fsTabHStartLabel.setMinimumSize(new java.awt.Dimension(113, 14));
        fsTabHStartLabel.setPreferredSize(new java.awt.Dimension(113, 14));

        fsTabHStartSpinner.setToolTipText(bundle.getString("horizontal_tip")); // NOI18N

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, fsTabHStartSlider, org.jdesktop.beansbinding.ELProperty.create("${value}"), fsTabHStartSpinner, org.jdesktop.beansbinding.BeanProperty.create("value"));
        bindingGroup.addBinding(binding);

        fsTabHStartSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fsTabHStartSpinnerStateChanged(evt);
            }
        });

        fsTabHStartSlider.setMajorTickSpacing(500);
        fsTabHStartSlider.setMaximum(1000);
        fsTabHStartSlider.setMinimum(-1000);
        fsTabHStartSlider.setMinorTickSpacing(100);
        fsTabHStartSlider.setPaintLabels(true);
        fsTabHStartSlider.setPaintTicks(true);
        fsTabHStartSlider.setToolTipText(bundle.getString("horizontal_tip")); // NOI18N
        fsTabHStartSlider.setValue(-5);
        fsTabHStartSlider.setMinimumSize(new java.awt.Dimension(250, 46));
        fsTabHStartSlider.setPreferredSize(new java.awt.Dimension(250, 46));
        fsTabHStartSlider.setValueIsAdjusting(true);

        fsTabWidthLabel.setText(bundle1.getString("fs_horizontal_interval_width")); // NOI18N
        fsTabWidthLabel.setToolTipText(bundle.getString("horizontal_tip")); // NOI18N
        fsTabWidthLabel.setMaximumSize(new java.awt.Dimension(113, 14));
        fsTabWidthLabel.setMinimumSize(new java.awt.Dimension(113, 14));
        fsTabWidthLabel.setPreferredSize(new java.awt.Dimension(113, 14));

        fsTabHEndSlider.setMajorTickSpacing(500);
        fsTabHEndSlider.setMaximum(1000);
        fsTabHEndSlider.setMinimum(-1000);
        fsTabHEndSlider.setMinorTickSpacing(100);
        fsTabHEndSlider.setPaintLabels(true);
        fsTabHEndSlider.setPaintTicks(true);
        fsTabHEndSlider.setToolTipText(bundle.getString("horizontal_tip")); // NOI18N
        fsTabHEndSlider.setValue(5);
        fsTabHEndSlider.setMinimumSize(new java.awt.Dimension(250, 46));
        fsTabHEndSlider.setPreferredSize(new java.awt.Dimension(250, 46));
        fsTabHEndSlider.setValueIsAdjusting(true);
        fsTabHEndSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fsTabHEndSliderStateChanged(evt);
            }
        });

        fsTabHEndSpinner.setToolTipText(bundle.getString("horizontal_tip")); // NOI18N

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, fsTabHEndSlider, org.jdesktop.beansbinding.ELProperty.create("${value}"), fsTabHEndSpinner, org.jdesktop.beansbinding.BeanProperty.create("value"));
        bindingGroup.addBinding(binding);

        fsTabHEndSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fsTabHEndSpinnerStateChanged(evt);
            }
        });

        fsTabHEndLabel.setText(bundle1.getString("fs_horizontal_interval_end_value")); // NOI18N
        fsTabHEndLabel.setToolTipText(bundle.getString("horizontal_tip")); // NOI18N
        fsTabHEndLabel.setMaximumSize(new java.awt.Dimension(113, 14));
        fsTabHEndLabel.setMinimumSize(new java.awt.Dimension(113, 14));
        fsTabHEndLabel.setPreferredSize(new java.awt.Dimension(113, 14));

        javax.swing.GroupLayout fsTabHSizePanelLayout = new javax.swing.GroupLayout(fsTabHSizePanel);
        fsTabHSizePanel.setLayout(fsTabHSizePanelLayout);
        fsTabHSizePanelLayout.setHorizontalGroup(
            fsTabHSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(fsTabHSizePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(fsTabHSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(fsTabHStartLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
                    .addComponent(fsTabHEndLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
                    .addComponent(fsTabWidthLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(fsTabHSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(fsTabHStartSpinner, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fsTabWidthSpinner, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fsTabHEndSpinner, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(fsTabHSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(fsTabHStartSlider, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fsTabWidthSlider, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fsTabHEndSlider, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        fsTabHSizePanelLayout.setVerticalGroup(
            fsTabHSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(fsTabHSizePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(fsTabHSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(fsTabHSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(fsTabHStartLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(fsTabHStartSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(fsTabHStartSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(fsTabHSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(fsTabHEndLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fsTabHEndSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fsTabHEndSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(fsTabHSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(fsTabWidthSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fsTabWidthLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fsTabWidthSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        fsTabHSizePanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {fsTabHStartLabel, fsTabHStartSlider, fsTabWidthLabel});

        fsTabVSizePanel.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle1.getString("fs_vertical_size_panel"))); // NOI18N
        fsTabVSizePanel.setToolTipText(bundle.getString("vertical_tip")); // NOI18N
        fsTabVSizePanel.setMaximumSize(new java.awt.Dimension(505, 166));
        fsTabVSizePanel.setPreferredSize(new java.awt.Dimension(505, 166));

        fsTabHeightSlider.setMajorTickSpacing(500);
        fsTabHeightSlider.setMaximum(2000);
        fsTabHeightSlider.setMinorTickSpacing(50);
        fsTabHeightSlider.setPaintLabels(true);
        fsTabHeightSlider.setPaintTicks(true);
        fsTabHeightSlider.setToolTipText(bundle.getString("vertical_tip")); // NOI18N
        fsTabHeightSlider.setValue(10);
        fsTabHeightSlider.setMinimumSize(new java.awt.Dimension(250, 46));
        fsTabHeightSlider.setPreferredSize(new java.awt.Dimension(250, 46));
        fsTabHeightSlider.setValueIsAdjusting(true);
        fsTabHeightSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fsTabHeightSliderStateChanged(evt);
            }
        });

        fsTabHeightSpinner.setToolTipText(bundle.getString("vertical_tip")); // NOI18N
        fsTabHeightSpinner.setMinimumSize(new java.awt.Dimension(50, 18));
        fsTabHeightSpinner.setPreferredSize(new java.awt.Dimension(50, 18));

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, fsTabHeightSlider, org.jdesktop.beansbinding.ELProperty.create("${value}"), fsTabHeightSpinner, org.jdesktop.beansbinding.BeanProperty.create("value"));
        bindingGroup.addBinding(binding);

        fsTabHeightSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fsTabHeightSpinnerStateChanged(evt);
            }
        });

        fsTabVSizeLabel.setText(bundle1.getString("fs_vertical_interval_start_value")); // NOI18N
        fsTabVSizeLabel.setToolTipText(bundle.getString("vertical_tip")); // NOI18N
        fsTabVSizeLabel.setMaximumSize(new java.awt.Dimension(113, 14));
        fsTabVSizeLabel.setMinimumSize(new java.awt.Dimension(113, 14));
        fsTabVSizeLabel.setPreferredSize(new java.awt.Dimension(113, 14));

        fsTabVStartSpinner.setToolTipText(bundle.getString("vertical_tip")); // NOI18N

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, fsTabVStartSlider, org.jdesktop.beansbinding.ELProperty.create("${value}"), fsTabVStartSpinner, org.jdesktop.beansbinding.BeanProperty.create("value"));
        bindingGroup.addBinding(binding);

        fsTabVStartSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fsTabVStartSpinnerStateChanged(evt);
            }
        });

        fsTabVStartSlider.setMajorTickSpacing(500);
        fsTabVStartSlider.setMaximum(1000);
        fsTabVStartSlider.setMinimum(-1000);
        fsTabVStartSlider.setMinorTickSpacing(100);
        fsTabVStartSlider.setPaintLabels(true);
        fsTabVStartSlider.setPaintTicks(true);
        fsTabVStartSlider.setToolTipText(bundle.getString("vertical_tip")); // NOI18N
        fsTabVStartSlider.setValue(-5);
        fsTabVStartSlider.setMinimumSize(new java.awt.Dimension(250, 46));
        fsTabVStartSlider.setPreferredSize(new java.awt.Dimension(250, 46));
        fsTabVStartSlider.setValueIsAdjusting(true);
        fsTabVStartSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fsTabVStartSliderStateChanged(evt);
            }
        });

        fsTabHeightLabel.setText(bundle1.getString("fs_vertical_interval_height")); // NOI18N
        fsTabHeightLabel.setToolTipText(bundle.getString("vertical_tip")); // NOI18N
        fsTabHeightLabel.setMaximumSize(new java.awt.Dimension(113, 14));
        fsTabHeightLabel.setMinimumSize(new java.awt.Dimension(113, 14));
        fsTabHeightLabel.setPreferredSize(new java.awt.Dimension(113, 14));

        fsTabVEndSlider.setMajorTickSpacing(500);
        fsTabVEndSlider.setMaximum(1000);
        fsTabVEndSlider.setMinimum(-1000);
        fsTabVEndSlider.setMinorTickSpacing(100);
        fsTabVEndSlider.setPaintLabels(true);
        fsTabVEndSlider.setPaintTicks(true);
        fsTabVEndSlider.setToolTipText(bundle.getString("vertical_tip")); // NOI18N
        fsTabVEndSlider.setValue(5);
        fsTabVEndSlider.setMinimumSize(new java.awt.Dimension(250, 46));
        fsTabVEndSlider.setPreferredSize(new java.awt.Dimension(250, 46));
        fsTabVEndSlider.setValueIsAdjusting(true);
        fsTabVEndSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fsTabVEndSliderStateChanged(evt);
            }
        });

        fsTabVEndSpinner.setToolTipText(bundle.getString("vertical_tip")); // NOI18N

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, fsTabVEndSlider, org.jdesktop.beansbinding.ELProperty.create("${value}"), fsTabVEndSpinner, org.jdesktop.beansbinding.BeanProperty.create("value"));
        bindingGroup.addBinding(binding);

        fsTabVEndSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fsTabVEndSpinnerStateChanged(evt);
            }
        });

        fsTabVEndLabel.setText(bundle1.getString("fs_vertical_interval_end_value")); // NOI18N
        fsTabVEndLabel.setToolTipText(bundle.getString("vertical_tip")); // NOI18N
        fsTabVEndLabel.setMaximumSize(new java.awt.Dimension(113, 14));
        fsTabVEndLabel.setMinimumSize(new java.awt.Dimension(113, 14));
        fsTabVEndLabel.setPreferredSize(new java.awt.Dimension(113, 14));

        javax.swing.GroupLayout fsTabVSizePanelLayout = new javax.swing.GroupLayout(fsTabVSizePanel);
        fsTabVSizePanel.setLayout(fsTabVSizePanelLayout);
        fsTabVSizePanelLayout.setHorizontalGroup(
            fsTabVSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(fsTabVSizePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(fsTabVSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(fsTabVSizePanelLayout.createSequentialGroup()
                        .addComponent(fsTabHeightLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(fsTabHeightSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(fsTabHeightSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, fsTabVSizePanelLayout.createSequentialGroup()
                        .addGroup(fsTabVSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(fsTabVEndLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
                            .addComponent(fsTabVSizeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(fsTabVSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, fsTabVSizePanelLayout.createSequentialGroup()
                                .addComponent(fsTabVStartSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(fsTabVStartSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, fsTabVSizePanelLayout.createSequentialGroup()
                                .addComponent(fsTabVEndSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(fsTabVEndSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap())
        );
        fsTabVSizePanelLayout.setVerticalGroup(
            fsTabVSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(fsTabVSizePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(fsTabVSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(fsTabVStartSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fsTabVStartSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fsTabVSizeLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(fsTabVSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(fsTabVEndSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fsTabVEndSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fsTabVEndLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(fsTabVSizePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(fsTabHeightSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fsTabHeightSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(fsTabHeightLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        fsTabVSizePanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {fsTabHeightLabel, fsTabHeightSlider, fsTabVSizeLabel, fsTabVStartSlider});

        fsTabQualityPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle1.getString("fs_drawing_quality_panel"))); // NOI18N
        fsTabQualityPanel.setToolTipText(bundle.getString("drawing_tip")); // NOI18N
        fsTabQualityPanel.setMaximumSize(new java.awt.Dimension(505, 166));

        fsTabPrecisionSlider.setMajorTickSpacing(45);
        fsTabPrecisionSlider.setMaximum(95);
        fsTabPrecisionSlider.setMinimum(5);
        fsTabPrecisionSlider.setMinorTickSpacing(5);
        fsTabPrecisionSlider.setPaintLabels(true);
        fsTabPrecisionSlider.setPaintTicks(true);
        fsTabPrecisionSlider.setToolTipText(bundle.getString("PREC_TIP")); // NOI18N
        fsTabPrecisionSlider.setValue(10);
        fsTabPrecisionSlider.setMinimumSize(new java.awt.Dimension(250, 46));
        fsTabPrecisionSlider.setPreferredSize(new java.awt.Dimension(250, 46));
        fsTabPrecisionSlider.setValueIsAdjusting(true);
        fsTabPrecisionSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fsTabPrecisionSliderStateChanged(evt);
            }
        });

        fsTabPrecisionSpinner.setToolTipText(bundle.getString("PREC_TIP")); // NOI18N
        fsTabPrecisionSpinner.setMinimumSize(new java.awt.Dimension(50, 18));
        fsTabPrecisionSpinner.setPreferredSize(new java.awt.Dimension(50, 18));

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, fsTabPrecisionSlider, org.jdesktop.beansbinding.ELProperty.create("${value}"), fsTabPrecisionSpinner, org.jdesktop.beansbinding.BeanProperty.create("value"));
        bindingGroup.addBinding(binding);

        fsTabPrecisionSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fsTabPrecisionSpinnerStateChanged(evt);
            }
        });

        fsTabNumberOfPointsLabel.setText(bundle1.getString("fs_quality_points")); // NOI18N
        fsTabNumberOfPointsLabel.setToolTipText(bundle.getString("CHECKPOINT_TIP")); // NOI18N

        fsTabNumberOfPointsSpinner.setToolTipText(bundle.getString("CHECKPOINT_TIP")); // NOI18N

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, fsTabNumberOfPointsSlider, org.jdesktop.beansbinding.ELProperty.create("${value}"), fsTabNumberOfPointsSpinner, org.jdesktop.beansbinding.BeanProperty.create("value"));
        bindingGroup.addBinding(binding);

        fsTabNumberOfPointsSpinner.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fsTabNumberOfPointsSpinnerStateChanged(evt);
            }
        });

        fsTabNumberOfPointsSlider.setMajorTickSpacing(2500);
        fsTabNumberOfPointsSlider.setMaximum(10000);
        fsTabNumberOfPointsSlider.setMinorTickSpacing(500);
        fsTabNumberOfPointsSlider.setPaintLabels(true);
        fsTabNumberOfPointsSlider.setPaintTicks(true);
        fsTabNumberOfPointsSlider.setToolTipText(bundle.getString("CHECKPOINT_TIP")); // NOI18N
        fsTabNumberOfPointsSlider.setValue(500);
        fsTabNumberOfPointsSlider.setMinimumSize(new java.awt.Dimension(250, 46));
        fsTabNumberOfPointsSlider.setPreferredSize(new java.awt.Dimension(250, 46));
        fsTabNumberOfPointsSlider.setValueIsAdjusting(true);
        fsTabNumberOfPointsSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fsTabNumberOfPointsSliderStateChanged(evt);
            }
        });

        fsTabPrecisionLabel.setText(bundle1.getString("fs_quality_precision")); // NOI18N
        fsTabPrecisionLabel.setToolTipText(bundle.getString("PREC_TIP")); // NOI18N

        javax.swing.GroupLayout fsTabQualityPanelLayout = new javax.swing.GroupLayout(fsTabQualityPanel);
        fsTabQualityPanel.setLayout(fsTabQualityPanelLayout);
        fsTabQualityPanelLayout.setHorizontalGroup(
            fsTabQualityPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(fsTabQualityPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(fsTabQualityPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(fsTabPrecisionLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
                    .addComponent(fsTabNumberOfPointsLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(fsTabQualityPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, fsTabQualityPanelLayout.createSequentialGroup()
                        .addComponent(fsTabNumberOfPointsSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(fsTabNumberOfPointsSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, fsTabQualityPanelLayout.createSequentialGroup()
                        .addComponent(fsTabPrecisionSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(fsTabPrecisionSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        fsTabQualityPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {fsTabNumberOfPointsSlider, fsTabPrecisionSlider});

        fsTabQualityPanelLayout.setVerticalGroup(
            fsTabQualityPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(fsTabQualityPanelLayout.createSequentialGroup()
                .addGroup(fsTabQualityPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(fsTabQualityPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(fsTabNumberOfPointsLabel)
                        .addComponent(fsTabNumberOfPointsSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(fsTabNumberOfPointsSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(fsTabQualityPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(fsTabQualityPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(fsTabPrecisionLabel)
                        .addComponent(fsTabPrecisionSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(fsTabPrecisionSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(43, 43, 43))
        );

        fsTabQualityPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {fsTabNumberOfPointsLabel, fsTabNumberOfPointsSlider, fsTabPrecisionLabel, fsTabPrecisionSlider});

        fsResetButton.setText(bundle1.getString("fs_reset_to_default")); // NOI18N
        fsResetButton.setToolTipText(bundle.getString("fs_reset_to_default_tip")); // NOI18N
        fsResetButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fsResetButtonActionPerformed(evt);
            }
        });

        save2PNGPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle1.getString("PNG_PANEL"))); // NOI18N
        save2PNGPanel.setToolTipText(bundle.getString("SAVE_PNG_PANE")); // NOI18N

        pngLocationField.setEditable(false);
        pngLocationField.setText(bundle1.getString("PNG_LOC")); // NOI18N
        pngLocationField.setToolTipText(bundle.getString("PNG_LOC")); // NOI18N

        savePNGBox.setText(bundle1.getString("SAVE_PNG")); // NOI18N
        savePNGBox.setToolTipText(bundle.getString("SAVE_PNG")); // NOI18N
        savePNGBox.setEnabled(false);

        browsePNGButton.setText(bundle1.getString("BROWSE")); // NOI18N
        browsePNGButton.setToolTipText(bundle.getString("CHOOSE_A_FILE")); // NOI18N
        browsePNGButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                browsePNGButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout save2PNGPanelLayout = new javax.swing.GroupLayout(save2PNGPanel);
        save2PNGPanel.setLayout(save2PNGPanelLayout);
        save2PNGPanelLayout.setHorizontalGroup(
            save2PNGPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(save2PNGPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(save2PNGPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(savePNGBox)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, save2PNGPanelLayout.createSequentialGroup()
                        .addComponent(pngLocationField, javax.swing.GroupLayout.DEFAULT_SIZE, 218, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(browsePNGButton)))
                .addContainerGap())
        );
        save2PNGPanelLayout.setVerticalGroup(
            save2PNGPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(save2PNGPanelLayout.createSequentialGroup()
                .addComponent(savePNGBox)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(save2PNGPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(pngLocationField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(browsePNGButton))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        coordinates.setSelected(true);
        coordinates.setText(bundle1.getString("coordinates")); // NOI18N
        coordinates.setToolTipText(bundle.getString("SHOW_INT_POINTS")); // NOI18N

        redraw.setText(bundle1.getString("REDRAW")); // NOI18N
        redraw.setToolTipText(bundle.getString("redraw")); // NOI18N
        redraw.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                redrawActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout functionSettingsTabLayout = new javax.swing.GroupLayout(functionSettingsTab);
        functionSettingsTab.setLayout(functionSettingsTabLayout);
        functionSettingsTabLayout.setHorizontalGroup(
            functionSettingsTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(functionSettingsTabLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(functionSettingsTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(fsTabQualityPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, functionSettingsTabLayout.createSequentialGroup()
                        .addComponent(save2PNGPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(functionSettingsTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(redraw, javax.swing.GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE)
                            .addComponent(fsResetButton, javax.swing.GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE)
                            .addComponent(coordinates, javax.swing.GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE)))
                    .addComponent(fsTabHSizePanel, javax.swing.GroupLayout.Alignment.LEADING, 0, 584, Short.MAX_VALUE)
                    .addComponent(fsTabVSizePanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 584, Short.MAX_VALUE))
                .addContainerGap(21, Short.MAX_VALUE))
        );
        functionSettingsTabLayout.setVerticalGroup(
            functionSettingsTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, functionSettingsTabLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(fsTabHSizePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(fsTabVSizePanel, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(fsTabQualityPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(functionSettingsTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(functionSettingsTabLayout.createSequentialGroup()
                        .addComponent(fsResetButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(coordinates)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(redraw))
                    .addComponent(save2PNGPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        tabsPane.addTab(bundle1.getString("function_drawer_settings"), null, functionSettingsTab, bundle.getString("FDSETTINGS_TIP")); // NOI18N

        helpPanel.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        helpPanel.setToolTipText(bundle.getString("helparea")); // NOI18N

        helpLabel.setText(bundle1.getString("helpLabel")); // NOI18N

        helpArea.setColumns(20);
        helpArea.setEditable(false);
        helpArea.setLineWrap(true);
        helpArea.setRows(5);
        java.util.ResourceBundle bundle3 = java.util.ResourceBundle.getBundle("languages/helpMessages"); // NOI18N
        helpArea.setText(bundle3.getString("expr_editor")); // NOI18N
        helpArea.setToolTipText(bundle.getString("helparea")); // NOI18N
        helpArea.setWrapStyleWord(true);
        helpArea.setAutoscrolls(false);
        jScrollPane1.setViewportView(helpArea);

        javax.swing.GroupLayout helpPanelLayout = new javax.swing.GroupLayout(helpPanel);
        helpPanel.setLayout(helpPanelLayout);
        helpPanelLayout.setHorizontalGroup(
            helpPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(helpPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(helpPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 314, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(helpLabel))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        helpPanelLayout.setVerticalGroup(
            helpPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(helpPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(helpLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 646, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(tabsPane, javax.swing.GroupLayout.PREFERRED_SIZE, 620, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(helpPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(tabsPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 692, Short.MAX_VALUE)
                    .addComponent(helpPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {helpPanel, tabsPane});

        bindingGroup.bind();

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void fsTabHStartSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fsTabHStartSpinnerStateChanged
    if (Integer.parseInt(this.fsTabHStartSpinner.getValue().toString()) > this.fsTabHStartSlider.getMaximum()) {
        this.fsTabHStartSpinner.setValue(this.fsTabHStartSlider.getValue());
    } else if (Integer.parseInt(this.fsTabHStartSpinner.getValue().toString()) < this.fsTabHStartSlider.getMinimum()) {
        this.fsTabHStartSpinner.setValue(this.fsTabHStartSlider.getValue());
    } else {
        this.fsTabHStartSlider.setValue(Integer.parseInt(this.fsTabHStartSpinner.getValue().toString()));
    }
    if (this.fsTabHEndSlider.getValue() - this.fsTabHStartSlider.getValue() > 0) {
        this.fsTabWidthSpinner.setValue(this.fsTabHEndSlider.getValue() - this.fsTabHStartSlider.getValue());
    } else {
        this.fsTabHEndSlider.setValue(this.fsTabHStartSlider.getValue());
        this.fsTabHEndSpinner.setValue(this.fsTabHStartSlider.getValue());
        this.fsTabWidthSpinner.setValue(this.fsTabHEndSlider.getValue() - this.fsTabHStartSlider.getValue());
    }
}//GEN-LAST:event_fsTabHStartSpinnerStateChanged

private void fsTabWidthSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fsTabWidthSliderStateChanged
    this.fsTabWidthSlider.setValue(Integer.parseInt(this.fsTabWidthSpinner.getValue().toString()));
}//GEN-LAST:event_fsTabWidthSliderStateChanged

private void fsTabWidthSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fsTabWidthSpinnerStateChanged
    if (Integer.parseInt(this.fsTabWidthSpinner.getValue().toString()) > this.fsTabWidthSlider.getMaximum()) {
        this.fsTabWidthSpinner.setValue(this.fsTabWidthSlider.getValue());
    } else if (Integer.parseInt(this.fsTabWidthSpinner.getValue().toString()) < this.fsTabWidthSlider.getMinimum()) {
        this.fsTabWidthSpinner.setValue(this.fsTabWidthSlider.getValue());
    } else {
        this.fsTabWidthSlider.setValue(Integer.parseInt(this.fsTabWidthSpinner.getValue().toString()));
    }
    if (this.fsTabHStartSlider.getMaximum() - this.fsTabHStartSlider.getValue() < this.fsTabWidthSlider.getValue()) {
        this.fsTabHEndSlider.setValue(this.fsTabHEndSlider.getMaximum());
        this.fsTabHStartSpinner.setValue(this.fsTabHEndSlider.getMaximum() - this.fsTabWidthSlider.getValue());
        this.fsTabHStartSlider.setValue(this.fsTabHEndSlider.getMaximum() - this.fsTabWidthSlider.getValue());
    } else {
        this.fsTabHEndSlider.setValue(this.fsTabHStartSlider.getValue() + this.fsTabWidthSlider.getValue());
    }
}//GEN-LAST:event_fsTabWidthSpinnerStateChanged

private void fsTabHeightSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fsTabHeightSliderStateChanged
}//GEN-LAST:event_fsTabHeightSliderStateChanged

private void fsTabHeightSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fsTabHeightSpinnerStateChanged
    if (Integer.parseInt(this.fsTabHeightSpinner.getValue().toString()) > this.fsTabHeightSlider.getMaximum()) {
        this.fsTabHeightSpinner.setValue(this.fsTabHeightSlider.getValue());
    } else if (Integer.parseInt(this.fsTabHeightSpinner.getValue().toString()) < this.fsTabHeightSlider.getMinimum()) {
        this.fsTabHeightSpinner.setValue(this.fsTabHeightSlider.getValue());
    } else {
        this.fsTabHeightSlider.setValue(Integer.parseInt(this.fsTabHeightSpinner.getValue().toString()));
    }
    if (this.fsTabVStartSlider.getMaximum() - this.fsTabVStartSlider.getValue() < this.fsTabHeightSlider.getValue()) {
        this.fsTabVEndSlider.setValue(this.fsTabVEndSlider.getMaximum());
        this.fsTabVStartSpinner.setValue(this.fsTabVEndSlider.getMaximum() - this.fsTabHeightSlider.getValue());
        this.fsTabVStartSlider.setValue(this.fsTabVEndSlider.getMaximum() - this.fsTabHeightSlider.getValue());
    } else {
        this.fsTabVEndSlider.setValue(this.fsTabVStartSlider.getValue() + this.fsTabHeightSlider.getValue());
    }
}//GEN-LAST:event_fsTabHeightSpinnerStateChanged

private void fsTabVStartSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fsTabVStartSpinnerStateChanged
    if (Integer.parseInt(this.fsTabVStartSpinner.getValue().toString()) > this.fsTabVStartSlider.getMaximum()) {
        this.fsTabVStartSpinner.setValue(this.fsTabVStartSlider.getValue());
    } else if (Integer.parseInt(this.fsTabVStartSpinner.getValue().toString()) < this.fsTabVStartSlider.getMinimum()) {
        this.fsTabVStartSpinner.setValue(this.fsTabVStartSlider.getValue());
    } else {
        this.fsTabVStartSlider.setValue(Integer.parseInt(this.fsTabVStartSpinner.getValue().toString()));
    }
    if (this.fsTabVEndSlider.getValue() - this.fsTabVStartSlider.getValue() > 0) {
        this.fsTabHeightSpinner.setValue(this.fsTabVEndSlider.getValue() - this.fsTabVStartSlider.getValue());
    } else {
        this.fsTabVEndSlider.setValue(this.fsTabVStartSlider.getValue());
        this.fsTabVEndSpinner.setValue(this.fsTabVStartSlider.getValue());
        this.fsTabHeightSpinner.setValue(this.fsTabVEndSlider.getValue() - this.fsTabVStartSlider.getValue());
    }
}//GEN-LAST:event_fsTabVStartSpinnerStateChanged

private void fsTabVStartSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fsTabVStartSliderStateChanged
}//GEN-LAST:event_fsTabVStartSliderStateChanged

private void fsTabPrecisionSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fsTabPrecisionSliderStateChanged
}//GEN-LAST:event_fsTabPrecisionSliderStateChanged

private void fsTabPrecisionSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fsTabPrecisionSpinnerStateChanged
    if (Integer.parseInt(this.fsTabPrecisionSpinner.getValue().toString()) > this.fsTabPrecisionSlider.getMaximum()) {
        this.fsTabPrecisionSpinner.setValue(this.fsTabPrecisionSlider.getValue());
    } else if (Integer.parseInt(this.fsTabPrecisionSpinner.getValue().toString()) < this.fsTabPrecisionSlider.getMinimum()) {
        this.fsTabPrecisionSpinner.setValue(this.fsTabPrecisionSlider.getValue());
    } else {
        this.fsTabPrecisionSlider.setValue(Integer.parseInt(this.fsTabPrecisionSpinner.getValue().toString()));
    }
}//GEN-LAST:event_fsTabPrecisionSpinnerStateChanged

private void fsTabNumberOfPointsSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fsTabNumberOfPointsSpinnerStateChanged
    if (Integer.parseInt(this.fsTabNumberOfPointsSpinner.getValue().toString()) > this.fsTabNumberOfPointsSlider.getMaximum()) {
        this.fsTabNumberOfPointsSpinner.setValue(this.fsTabNumberOfPointsSlider.getValue());
    } else if (Integer.parseInt(this.fsTabNumberOfPointsSpinner.getValue().toString()) < this.fsTabNumberOfPointsSlider.getMinimum()) {
        this.fsTabNumberOfPointsSpinner.setValue(this.fsTabNumberOfPointsSlider.getValue());
    } else {
        this.fsTabNumberOfPointsSlider.setValue(Integer.parseInt(this.fsTabNumberOfPointsSpinner.getValue().toString()));
    }
}//GEN-LAST:event_fsTabNumberOfPointsSpinnerStateChanged

private void fsTabNumberOfPointsSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fsTabNumberOfPointsSliderStateChanged
}//GEN-LAST:event_fsTabNumberOfPointsSliderStateChanged

private void fsResetButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fsResetButtonActionPerformed
    this.fsTabHStartSlider.setValue(-5);
    this.fsTabVStartSlider.setValue(-5);
    this.fsTabHEndSlider.setValue(5);
    this.fsTabVEndSlider.setValue(5);
    this.fsTabWidthSlider.setValue(10);
    this.fsTabHeightSlider.setValue(10);
    this.fsTabNumberOfPointsSlider.setValue(500);
    this.fsTabPrecisionSlider.setValue(10);
}//GEN-LAST:event_fsResetButtonActionPerformed

private void inputFieldCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_inputFieldCaretUpdate
    String s = this.inputField.getText();
    Caret cursor = this.inputField.getCaret();
    cursor.setVisible(true);
    cursor.setBlinkRate(500);
    try {
        doc.setCharacterAttributes(0, s.length(), inputField.getStyle("White"), true);
        int pos = this.inputField.getCaret().getDot();
        vh.highlight(doc, this.inputField);
        int[] loc = vh.findPairOfBracket(s, pos);
        if (loc[0] < 0) {
            doc.setCharacterAttributes(0 - loc[0], 1, inputField.getStyle("Red"), true);
        } else if (loc[0] != loc[1]) {
            doc.setCharacterAttributes(loc[0], 1, inputField.getStyle("Green"), true);
            doc.setCharacterAttributes(loc[1], 1, inputField.getStyle("Green"), true);
        }
    } catch (IllegalStateException e) {
    }
}//GEN-LAST:event_inputFieldCaretUpdate

private void inputFieldInputMethodTextChanged(java.awt.event.InputMethodEvent evt) {//GEN-FIRST:event_inputFieldInputMethodTextChanged
    String s = this.inputField.getText();
    try {
        doc.setCharacterAttributes(0, s.length(), inputField.getStyle("White"), true);
    } catch (IllegalStateException e) {
    }
}//GEN-LAST:event_inputFieldInputMethodTextChanged

private void inputFieldKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_inputFieldKeyReleased
    String s = this.inputField.getText();
    Caret cursor = this.inputField.getCaret();
    cursor.setVisible(true);
    cursor.setBlinkRate(500);
    try {
        doc.setCharacterAttributes(0, s.length(), inputField.getStyle("White"), true);
        int pos = this.inputField.getCaret().getDot();
        vh.highlight(doc, this.inputField);
        int[] loc = vh.findPairOfBracket(s, pos);
        if (loc[0] < 0) {
            doc.setCharacterAttributes(0 - loc[0], 1, inputField.getStyle("Red"), true);
        } else if (loc[0] != loc[1]) {
            doc.setCharacterAttributes(loc[0], 1, inputField.getStyle("Green"), true);
            doc.setCharacterAttributes(loc[1], 1, inputField.getStyle("Green"), true);
        }
    } catch (IllegalStateException e) {
    }
}//GEN-LAST:event_inputFieldKeyReleased

private void inputFieldFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_inputFieldFocusLost
    String s = this.inputField.getText();
    try {
        Caret cursor = this.inputField.getCaret();
        cursor.setVisible(true);
        cursor.setBlinkRate(0);
        doc.setCharacterAttributes(0, s.length(), inputField.getStyle("White"), true);
        int pos = this.inputField.getCaret().getDot();
        vh.highlight(doc, this.inputField);
        int[] loc = vh.findPairOfBracket(s, pos);
        if (loc[0] != loc[1]) {
            doc.setCharacterAttributes(loc[0], 1, inputField.getStyle("Yellow"), true);
            doc.setCharacterAttributes(loc[1], 1, inputField.getStyle("Yellow"), true);
        }
    } catch (IllegalStateException e) {
    }
}//GEN-LAST:event_inputFieldFocusLost

private void inputFieldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_inputFieldMouseClicked
    Caret cursor = this.inputField.getCaret();
    cursor.setVisible(true);
    cursor.setBlinkRate(500);
}//GEN-LAST:event_inputFieldMouseClicked

private void inputFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_inputFieldFocusGained
    try {
        vh.highlight(doc, this.inputField);
    } catch (IllegalStateException e) {
    }
}//GEN-LAST:event_inputFieldFocusGained

private void inputFieldMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_inputFieldMouseEntered
    this.inputField.requestFocusInWindow();
    String s = this.inputField.getText();
    Caret cursor = this.inputField.getCaret();
    cursor.setVisible(true);
    cursor.setBlinkRate(500);
    this.setHelp("expr_editor");
    try {
        doc.setCharacterAttributes(0, s.length(), inputField.getStyle("White"), true);
        int pos = this.inputField.getCaret().getDot();
        vh.highlight(doc, this.inputField);
        int[] loc = vh.findPairOfBracket(s, pos);
        if (loc[0] < 0) {
            doc.setCharacterAttributes(0 - loc[0], 1, inputField.getStyle("Red"), true);
        } else if (loc[0] != loc[1]) {
            doc.setCharacterAttributes(loc[0], 1, inputField.getStyle("Green"), true);
            doc.setCharacterAttributes(loc[1], 1, inputField.getStyle("Green"), true);
        }
    } catch (IllegalStateException e) {
    }
}//GEN-LAST:event_inputFieldMouseEntered

private void inputFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_inputFieldKeyTyped
    char c = evt.getKeyChar();
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    sb.replace(this.inputField.getSelectionStart(), this.inputField.getSelectionEnd(), "");
    int pos = this.inputField.getCaretPosition();
    if (pos >= this.inputField.getSelectionEnd()) {
        pos -= (this.inputField.getSelectionEnd() - this.inputField.getSelectionStart());
    }
    if (c == '(' && evt.isControlDown()) {
        pos = pos + 0;
    } else if (c == '(' && !evt.isControlDown()) {
        sb.insert(pos, ')');
        this.inputField.setText(sb.toString());
        this.inputField.setCaretPosition(pos);
    } else if (c == ' ' && this.isInfix.isSelected()) {
        if (!evt.isControlDown()) {
            if (this.isInfix.isSelected()) {
                if (sb.length() > pos && sb.charAt(pos) == ')') {
                    sb.insert(pos + 1, " )");
                    this.inputField.setText(sb.toString());
                    this.inputField.setCaretPosition(pos + 2);
                } else {
                    sb.insert(pos, " )");
                    this.inputField.setText(sb.toString());
                    this.inputField.setCaretPosition(pos + 1);
                }
                evt.setKeyChar('(');
            }
        }
    } else if (c == '|') {
        if (!evt.isControlDown()) {
            if (this.isInfix.isSelected()) {
                if (sb.length() > pos && sb.charAt(pos) == ')') {
                    sb.insert(pos + 1, " | )");
                    this.inputField.setText(sb.toString());
                    this.inputField.setCaretPosition(pos + 4);
                } else {
                    sb.insert(pos, " | )");
                    this.inputField.setText(sb.toString());
                    this.inputField.setCaretPosition(pos + 3);
                }
                evt.setKeyChar('(');
            } else if (this.isPrefix.isSelected()) {
                sb.insert(pos, " |");
                this.inputField.setText(sb.toString());
                this.inputField.setCaretPosition(pos + 2);
                evt.setKeyChar(' ');
            }
        }
    } else if (c == ')') {
        if (sb.length() > pos && sb.charAt(pos) == c) {
            sb.deleteCharAt(pos);
            this.inputField.setText(sb.toString());
            this.inputField.setCaretPosition(pos);
        }
    } else if (c == '[') {
        if (this.isInfix.isSelected()) {
            sb.insert(pos, "[)]");
            this.inputField.setText(sb.toString());
            this.inputField.setCaretPosition(pos + 1);
            evt.setKeyChar('(');
        } else if (this.isPrefix.isSelected()) {
            sb.insert(pos, "[]");
            this.inputField.setText(sb.toString());
            this.inputField.setCaretPosition(pos + 1);
            evt.setKeyChar(' ');
        }
    } else if (c == ']') {
        if (sb.length() > pos && sb.charAt(pos) == c) {
            sb.deleteCharAt(pos);
            this.inputField.setText(sb.toString());
            this.inputField.setCaretPosition(pos);
        }
    } else if (c == '{') {
        sb.insert(pos, '}');
        this.inputField.setText(sb.toString());
        this.inputField.setCaretPosition(pos);
    } else if (c == '}') {
        if (sb.length() > pos && sb.charAt(pos) == c) {
            sb.deleteCharAt(pos);
            this.inputField.setText(sb.toString());
            this.inputField.setCaretPosition(pos);
        }
    }
}//GEN-LAST:event_inputFieldKeyTyped

private void eeTabTrigComboBoxPopupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {//GEN-FIRST:event_eeTabTrigComboBoxPopupMenuWillBecomeInvisible
    if (this.eeTabTrigComboBox.getSelectedIndex() != 0) {
        StringBuilder sb = new StringBuilder(this.inputField.getText());
        int pos = this.inputField.getCaretPosition();
        Operator o = (Operator) this.eeTabTrigComboBox.getSelectedItem();
        sb.insert(pos, o.toText(this.isInfix.isSelected()));
        this.inputField.setText(sb.toString());
        this.inputField.setCaretPosition(pos + o.operandOffset(this.isInfix.isSelected()));
        this.inputFieldFocusLost(null);
        this.eeTabTrigComboBox.requestFocus();
        this.eeTabTrigComboBox.setSelectedIndex(0);
    }
}//GEN-LAST:event_eeTabTrigComboBoxPopupMenuWillBecomeInvisible

private void eeTabBinaryComboBoxPopupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {//GEN-FIRST:event_eeTabBinaryComboBoxPopupMenuWillBecomeInvisible
    if (this.eeTabBinaryComboBox.getSelectedIndex() != 0) {
        StringBuilder sb = new StringBuilder(this.inputField.getText());
        int pos = this.inputField.getCaretPosition();
        Operator o = (Operator) this.eeTabBinaryComboBox.getSelectedItem();
        sb.insert(pos, o.toText(this.isInfix.isSelected()));
        this.inputField.setText(sb.toString());
        this.inputField.setCaretPosition(pos + o.operandOffset(this.isInfix.isSelected()));
        this.inputFieldFocusLost(null);
        this.eeTabBinaryComboBox.requestFocus();
        this.eeTabBinaryComboBox.setSelectedIndex(0);
    }
}//GEN-LAST:event_eeTabBinaryComboBoxPopupMenuWillBecomeInvisible

private void eeTabMatrComboBoxPopupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {//GEN-FIRST:event_eeTabMatrComboBoxPopupMenuWillBecomeInvisible
    if (this.eeTabMatrComboBox.getSelectedIndex() != 0) {
        StringBuilder sb = new StringBuilder(this.inputField.getText());
        int pos = this.inputField.getCaretPosition();
        Operator o = (Operator) this.eeTabMatrComboBox.getSelectedItem();
        sb.insert(pos, o.toText(this.isInfix.isSelected()));
        this.inputField.setText(sb.toString());
        this.inputField.setCaretPosition(pos + o.operandOffset(this.isInfix.isSelected()));
        this.inputFieldFocusLost(null);
        this.eeTabMatrComboBox.requestFocus();
        this.eeTabMatrComboBox.setSelectedIndex(0);
    }
}//GEN-LAST:event_eeTabMatrComboBoxPopupMenuWillBecomeInvisible

private void eeTabNonTrigComboBoxPopupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {//GEN-FIRST:event_eeTabNonTrigComboBoxPopupMenuWillBecomeInvisible
    if (this.eeTabNonTrigComboBox.getSelectedIndex() != 0) {
        StringBuilder sb = new StringBuilder(this.inputField.getText());
        int pos = this.inputField.getCaretPosition();
        Operator o = (Operator) this.eeTabNonTrigComboBox.getSelectedItem();
        sb.insert(pos, o.toText(this.isInfix.isSelected()));
        this.inputField.setText(sb.toString());
        this.inputField.setCaretPosition(pos + o.operandOffset(this.isInfix.isSelected()));
        this.inputFieldFocusLost(null);
        this.eeTabNonTrigComboBox.requestFocus();
        this.eeTabNonTrigComboBox.setSelectedIndex(0);
    }
}//GEN-LAST:event_eeTabNonTrigComboBoxPopupMenuWillBecomeInvisible

private void eeTabOtherComboBoxPopupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {//GEN-FIRST:event_eeTabOtherComboBoxPopupMenuWillBecomeInvisible
    if (this.eeTabOtherComboBox.getSelectedIndex() != 0) {
        StringBuilder sb = new StringBuilder(this.inputField.getText());
        int pos = this.inputField.getCaretPosition();
        Operator o = (Operator) this.eeTabOtherComboBox.getSelectedItem();
        sb.insert(pos, o.toText(this.isInfix.isSelected()));
        this.inputField.setText(sb.toString());
        this.inputField.setCaretPosition(pos + o.operandOffset(this.isInfix.isSelected()));
        this.inputFieldFocusLost(null);
        this.eeTabOtherComboBox.requestFocus();
        this.eeTabOtherComboBox.setSelectedIndex(0);
    }
}//GEN-LAST:event_eeTabOtherComboBoxPopupMenuWillBecomeInvisible

private void numButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numButton4ActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    sb.insert(pos, "4");
    this.inputField.setText(sb.toString());
    this.inputField.setCaretPosition(pos + 1);
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_numButton4ActionPerformed

private void numButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numButton7ActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    sb.insert(pos, "7");
    this.inputField.setText(sb.toString());
    this.inputField.setCaretPosition(pos + 1);
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_numButton7ActionPerformed

private void numButton0ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numButton0ActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    sb.insert(pos, "0");
    this.inputField.setText(sb.toString());
    this.inputField.setCaretPosition(pos + 1);
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_numButton0ActionPerformed

private void numButtonDotActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numButtonDotActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    sb.insert(pos, ".");
    this.inputField.setText(sb.toString());
    this.inputField.setCaretPosition(pos + 1);
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_numButtonDotActionPerformed

private void numButtonMinusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numButtonMinusActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    sb.insert(pos, "-");
    this.inputField.setText(sb.toString());
    this.inputField.setCaretPosition(pos + 1);
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_numButtonMinusActionPerformed

private void matrixRowButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_matrixRowButtonActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    if (this.isInfix.isSelected()) {
        if (sb.length() > pos && sb.charAt(pos) == ')') {
            sb.insert(pos + 1, " | ()");
            this.inputField.setText(sb.toString());
            this.inputField.setCaretPosition(pos + 5);
        } else {
            sb.insert(pos, " | ()");
            this.inputField.setText(sb.toString());
            this.inputField.setCaretPosition(pos + 4);
        }
    } else if (this.isPrefix.isSelected()) {
        sb.insert(pos, " | ");
        this.inputField.setText(sb.toString());
        this.inputField.setCaretPosition(pos + 3);
    }
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_matrixRowButtonActionPerformed

private void matrixButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_matrixButtonActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    if (this.isInfix.isSelected()) {
        sb.insert(pos, "[()]");
        this.inputField.setText(sb.toString());
        this.inputField.setCaretPosition(pos + 2);
    } else if (this.isPrefix.isSelected()) {
        sb.insert(pos, "[]");
        this.inputField.setText(sb.toString());
        this.inputField.setCaretPosition(pos + 1);
    }
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_matrixButtonActionPerformed

private void otherBracketButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_otherBracketButtonActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    if (this.isInfix.isSelected()) {
        sb.insert(pos, "{()}");
        this.inputField.setText(sb.toString());
        this.inputField.setCaretPosition(pos + 2);
    } else if (this.isPrefix.isSelected()) {
        sb.insert(pos, "{}");
        this.inputField.setText(sb.toString());
        this.inputField.setCaretPosition(pos + 1);
    }
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_otherBracketButtonActionPerformed

private void matrixColButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_matrixColButtonActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    if (this.isInfix.isSelected()) {
        if (sb.length() > pos && sb.charAt(pos) == ')') {
            sb.insert(pos + 1, " ()");
            this.inputField.setText(sb.toString());
            this.inputField.setCaretPosition(pos + 3);
        } else {
            sb.insert(pos, " ()");
            this.inputField.setText(sb.toString());
            this.inputField.setCaretPosition(pos + 2);
        }
    } else if (this.isPrefix.isSelected()) {
        sb.insert(pos, " ");
        this.inputField.setText(sb.toString());
        this.inputField.setCaretPosition(pos + 1);
    }
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_matrixColButtonActionPerformed

private void numButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numButton1ActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    sb.insert(pos, "1");
    this.inputField.setText(sb.toString());
    this.inputField.setCaretPosition(pos + 1);
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_numButton1ActionPerformed

private void numButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numButton2ActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    sb.insert(pos, "2");
    this.inputField.setText(sb.toString());
    this.inputField.setCaretPosition(pos + 1);
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_numButton2ActionPerformed

private void numButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numButton3ActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    sb.insert(pos, "3");
    this.inputField.setText(sb.toString());
    this.inputField.setCaretPosition(pos + 1);
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_numButton3ActionPerformed

private void numButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numButton5ActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    sb.insert(pos, "5");
    this.inputField.setText(sb.toString());
    this.inputField.setCaretPosition(pos + 1);
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_numButton5ActionPerformed

private void numButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numButton6ActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    sb.insert(pos, "6");
    this.inputField.setText(sb.toString());
    this.inputField.setCaretPosition(pos + 1);
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_numButton6ActionPerformed

private void numButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numButton8ActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    sb.insert(pos, "8");
    this.inputField.setText(sb.toString());
    this.inputField.setCaretPosition(pos + 1);
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_numButton8ActionPerformed

private void numButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numButton9ActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    sb.insert(pos, "9");
    this.inputField.setText(sb.toString());
    this.inputField.setCaretPosition(pos + 1);
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_numButton9ActionPerformed

private void piButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_piButtonActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    sb.insert(pos, "pi");
    this.inputField.setText(sb.toString());
    this.inputField.setCaretPosition(pos + 2);
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_piButtonActionPerformed

private void variableButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_variableButtonActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    sb.insert(pos, "VAR");
    this.inputField.setText(sb.toString());
    this.inputField.setCaretPosition(pos + 3);
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_variableButtonActionPerformed

private void bracketButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bracketButtonActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    int pos = this.inputField.getCaretPosition();
    sb.insert(pos, "()");
    this.inputField.setText(sb.toString());
    this.inputField.setCaretPosition(pos + 1);
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_bracketButtonActionPerformed

private void prevButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_prevButtonActionPerformed
    int pos = this.inputField.getCaretPosition();
    String s = this.inputField.getText();
    if (this.isInfix.isSelected()) {
        if (s.length() >= pos) {
            int i = s.substring(0, pos - 1).lastIndexOf("(");
            if (i > -1) {
                this.inputField.setCaretPosition(i + 1);
            }
        }
    } else {
        if (s.length() >= pos) {
            int i = s.substring(0, pos - 1).lastIndexOf(" ");
            if (i > -1) {
                this.inputField.setCaretPosition(i + 1);
            }
        }
    }
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_prevButtonActionPerformed

private void nextButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nextButtonActionPerformed
    int pos = this.inputField.getCaretPosition();
    String s = this.inputField.getText();
    if (this.isInfix.isSelected()) {
        if (s.length() >= pos) {
            int i = s.substring(pos).indexOf("(") + pos;
            if (i > -1) {
                this.inputField.setCaretPosition(i + 1);
            }
        }
    } else {
        if (s.length() >= pos) {
            int i = s.substring(pos).indexOf(" ") + pos;
            if (i > -1) {
                this.inputField.setCaretPosition(i + 1);
            }
        }
    }
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_nextButtonActionPerformed

private void browsePNGButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browsePNGButtonActionPerformed
    JFileChooser fc = new JFileChooser();
    fc.setFileFilter(new FileFilter() {

        @Override
        public boolean accept(File f) {
            return f.getName().toLowerCase().endsWith(".png") || f.isDirectory();
        }

        @Override
        public String getDescription() {
            return "PNG Images (*.png)";
        }
    });
    fc.showSaveDialog(this);
    File pngFile = fc.getSelectedFile();
    if (pngFile == null) {
        /*this.pngLocationField.setText(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("PNG_LOC"));
        this.savePNGBox.setSelected(false);
        this.savePNGBox.setEnabled(false);*/
    } else {
        if (!pngFile.getName().toLowerCase().endsWith(".png")) {
            this.pngLocationField.setText(pngFile.getAbsolutePath() + ".png");
            this.savePNGBox.setSelected(true);
            this.savePNGBox.setEnabled(true);
        } else {
            this.pngLocationField.setText(pngFile.getAbsolutePath());
            this.savePNGBox.setSelected(true);
            this.savePNGBox.setEnabled(true);
        }
    }
}//GEN-LAST:event_browsePNGButtonActionPerformed

private void drawButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_drawButtonActionPerformed
    XMLBuilder builder = null;
    this.lastDrawFromXML = false;
    try {
        try {
            if (this.saveExpressionBox.isSelected()) {
                if (this.outputExprLocationField.getText().equalsIgnoreCase(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("EXP_LOC"))) {
                    throw new FileNotFoundException("EXPR_LOC_NOT_SET");
                }
                File out2 = new File(this.outputExprLocationField.getText());
                if (this.isInfix.isSelected()) {
                    builder = new XMLBuilderFromInfixText(out2);
                } else {
                    builder = new XMLBuilderFromPrefixText(out2);
                }
                builder.setOverwrite(true);
                builder.setExpression(this.inputField.getText());
                builder.setPrecision(Integer.parseInt(this.sTabPrecisionSpinner.getValue().toString()));
                builder.convertToXML(true);
                TreeBuilderFromXML tb = new TreeBuilderFromXML(out2.getAbsolutePath(), true);
                ExpressionTreeElement gy = tb.build();
                long start = System.currentTimeMillis();
                this.tabsPane.setSelectedIndex(1);
                FunctionDrawer drawer = new FunctionDrawer(Integer.parseInt(this.fsTabHStartSpinner.getValue().toString()),
                        Integer.parseInt(this.fsTabVStartSpinner.getValue().toString()),
                        Integer.parseInt(this.fsTabHStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabWidthSpinner.getValue().toString()),
                        Integer.parseInt(this.fsTabVStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabHeightSpinner.getValue().toString()),
                        this.fsTabNumberOfPointsSlider.getValue());
                drawer.setXML(out2.getAbsolutePath());
                drawer.setPrecision(this.fsTabPrecisionSlider.getValue());
                drawer.setBar(this.progressBar);
                this.boundsLabel.setText("Xmin=" + this.fsTabHStartSpinner.getValue().toString() +
                        ";     Xmax=" + (Integer.parseInt(this.fsTabHStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabWidthSpinner.getValue().toString())) +
                        ";     Ymin=" + this.fsTabVStartSpinner.getValue().toString() +
                        ";     Ymax=" + (Integer.parseInt(this.fsTabVStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabHeightSpinner.getValue().toString())));
                this.precisionLabel.setText(this.fsTabPrecisionSpinner.getValue().toString() + " " + java.util.ResourceBundle.getBundle("languages/gui_languages").getString("DIGITS"));
                BufferedImage image = drawer.draw(this.coordinates.isSelected());
//!!!!!!!!!!!!!!!!!!!!!!!!!!!
                if (drawer.visibleCheckpoints == 0) {
                    this.tabsPane.setSelectedIndex(4);
                    this.fsTabVStartSpinner.setValue((int) java.lang.Math.round(drawer.minValue - 1));
                    this.fsTabVEndSpinner.setValue((int) java.lang.Math.round(drawer.maxValue + 1));
                    JOptionPane oP = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("SET_BOUNDS"), JOptionPane.INFORMATION_MESSAGE);
                    JDialog d = oP.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                    d.setVisible(true);
                }
                this.minValue.setText("" + drawer.minValue);
                this.maxValue.setText("" + drawer.maxValue);
                this.functionImageLabel.setIcon(new ImageIcon(image));
                this.functionImageLabel.paintImmediately(0, 0, 500, 500);
                this.millisLabel.setText((System.currentTimeMillis() - start) + "ms");
                this.cpLabel.setText(drawer.visibleCheckpoints + "/" + this.fsTabNumberOfPointsSpinner.getValue().toString());
                if (this.savePNGBox.isSelected()) {
                    try {
                        File out = new File(this.pngLocationField.getText());
                        if (!out.exists()) {
                            out.createNewFile();
                        }
                        if (out.canWrite()) {
                            ImageIO.write(image, "PNG", out);
                        }
                    } catch (IOException ex) {
                        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
                        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                        dialog.setVisible(true);
                    }
                }
            } else {
                long start = System.currentTimeMillis();
                this.tabsPane.setSelectedIndex(1);
                FunctionDrawer drawer = new FunctionDrawer(Integer.parseInt(this.fsTabHStartSpinner.getValue().toString()),
                        Integer.parseInt(this.fsTabVStartSpinner.getValue().toString()),
                        Integer.parseInt(this.fsTabHStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabWidthSpinner.getValue().toString()),
                        Integer.parseInt(this.fsTabVStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabHeightSpinner.getValue().toString()),
                        this.fsTabNumberOfPointsSlider.getValue());
                drawer.setExpression(this.inputField.getText(), this.isInfix.isSelected());
                drawer.setPrecision(this.fsTabPrecisionSlider.getValue());
                drawer.setBar(this.progressBar);
                this.boundsLabel.setText("Xmin=" + this.fsTabHStartSpinner.getValue().toString() +
                        ";     Xmax=" + (Integer.parseInt(this.fsTabHStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabWidthSpinner.getValue().toString())) +
                        ";     Ymin=" + this.fsTabVStartSpinner.getValue().toString() +
                        ";     Ymax=" + (Integer.parseInt(this.fsTabVStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabHeightSpinner.getValue().toString())));
                this.precisionLabel.setText(this.fsTabPrecisionSpinner.getValue().toString() + " " + java.util.ResourceBundle.getBundle("languages/gui_languages").getString("DIGITS"));
                BufferedImage image = drawer.draw(this.coordinates.isSelected());
//!!!!!!!!!!!!!!!!!!!!!!!!!!!
                if (drawer.visibleCheckpoints == 0) {
                    this.tabsPane.setSelectedIndex(4);
                    this.fsTabVStartSpinner.setValue((int) java.lang.Math.round(drawer.minValue - 1));
                    this.fsTabVEndSpinner.setValue((int) java.lang.Math.round(drawer.maxValue + 1));
                    JOptionPane oP = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("SET_BOUNDS"), JOptionPane.INFORMATION_MESSAGE);
                    JDialog d = oP.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                    d.setVisible(true);
                }
                this.minValue.setText("" + drawer.minValue);
                this.maxValue.setText("" + drawer.maxValue);
                this.functionImageLabel.setIcon(new ImageIcon(image));
                this.functionImageLabel.paintImmediately(0, 0, 500, 500);
                this.millisLabel.setText((System.currentTimeMillis() - start) + "ms");
                this.cpLabel.setText(drawer.visibleCheckpoints + "/" + this.fsTabNumberOfPointsSpinner.getValue().toString());
                if (this.savePNGBox.isSelected()) {
                    try {
                        File out = new File(this.pngLocationField.getText());
                        if (!out.exists()) {
                            out.createNewFile();
                        }
                        if (out.canWrite()) {
                            ImageIO.write(image, "PNG", out);
                        }
                    } catch (IOException ex) {
                        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
                        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                        dialog.setVisible(true);
                    }
                }
            }
        } catch (FileNotFoundException ex) {
            /*JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
            JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
            dialog.setVisible(true);*/
            if (ex.getMessage().equalsIgnoreCase("OVERWRITE_XML")) {
                JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.QUESTION_MESSAGE);
                Object[] options = {java.util.ResourceBundle.getBundle("languages/gui_languages").getString("YES"),
                    java.util.ResourceBundle.getBundle("languages/gui_languages").getString("NO")};
                optionPane.setOptions(options);
                JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                dialog.setVisible(true);
                if (optionPane.getValue().toString().equalsIgnoreCase(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("YES"))) {
                    if (this.saveExpressionBox.isSelected()) {
                        if (this.outputExprLocationField.getText().equalsIgnoreCase(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("EXP_LOC"))) {
                            throw new FileNotFoundException("EXPR_LOC_NOT_SET");
                        }
                        long start = System.currentTimeMillis();
                        this.tabsPane.setSelectedIndex(1);
                        FunctionDrawer drawer = new FunctionDrawer(Integer.parseInt(this.fsTabHStartSpinner.getValue().toString()),
                                Integer.parseInt(this.fsTabVStartSpinner.getValue().toString()),
                                Integer.parseInt(this.fsTabHStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabWidthSpinner.getValue().toString()),
                                Integer.parseInt(this.fsTabVStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabHeightSpinner.getValue().toString()),
                                this.fsTabNumberOfPointsSlider.getValue());
                        drawer.setExpression(this.inputField.getText(), this.isInfix.isSelected());
                        drawer.setPrecision(this.fsTabPrecisionSlider.getValue());
                        drawer.setBar(this.progressBar);
                        this.boundsLabel.setText("Xmin=" + this.fsTabHStartSpinner.getValue().toString() +
                                ";     Xmax=" + (Integer.parseInt(this.fsTabHStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabWidthSpinner.getValue().toString())) +
                                ";     Ymin=" + this.fsTabVStartSpinner.getValue().toString() +
                                ";     Ymax=" + (Integer.parseInt(this.fsTabVStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabHeightSpinner.getValue().toString())));
                        this.precisionLabel.setText(this.fsTabPrecisionSpinner.getValue().toString() + " " + java.util.ResourceBundle.getBundle("languages/gui_languages").getString("DIGITS"));
                        BufferedImage image = drawer.draw(this.coordinates.isSelected());
//!!!!!!!!!!!!!!!!!!!!!!!!!!!
                        if (drawer.visibleCheckpoints == 0) {
                            this.tabsPane.setSelectedIndex(4);
                            this.fsTabVStartSpinner.setValue((int) java.lang.Math.round(drawer.minValue - 1));
                            this.fsTabVEndSpinner.setValue((int) java.lang.Math.round(drawer.maxValue + 1));
                            JOptionPane oP = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("SET_BOUNDS"), JOptionPane.INFORMATION_MESSAGE);
                            JDialog d = oP.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                            d.setVisible(true);
                        }
                        this.minValue.setText("" + drawer.minValue);
                        this.maxValue.setText("" + drawer.maxValue);
                        this.functionImageLabel.setIcon(new ImageIcon(image));
                        this.functionImageLabel.paintImmediately(0, 0, 500, 500);
                        this.millisLabel.setText((System.currentTimeMillis() - start) + "ms");
                        this.cpLabel.setText(drawer.visibleCheckpoints + "/" + this.fsTabNumberOfPointsSpinner.getValue().toString());
                        if (this.savePNGBox.isSelected()) {
                            try {
                                File out = new File(this.pngLocationField.getText());
                                if (!out.exists()) {
                                    out.createNewFile();
                                }
                                if (out.canWrite()) {
                                    ImageIO.write(image, "PNG", out);
                                }
                            } catch (IOException ex3) {
                                JOptionPane optionPane3 = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex3.getMessage()), JOptionPane.OK_OPTION);
                                JDialog dialog3 = optionPane3.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                                dialog3.setVisible(true);
                            }
                        }
                    }
                    JOptionPane optionPane2 = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("SAVE_SUCCESSFUL"), JOptionPane.INFORMATION_MESSAGE);
                    JDialog dialog2 = optionPane2.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                    dialog2.setVisible(true);
                } else {
                    JOptionPane optionPane2 = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("ERROR_SAVE_NOT_CHECKED"), JOptionPane.WARNING_MESSAGE);
                    JDialog dialog2 = optionPane2.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("ERROR"));
                    dialog2.setVisible(true);
                }
            } else {
                throw ex;
            }
        }
    } catch (UnknownOperatorException ex) {
        String s = this.inputField.getText();
        try {
            int from = this.inputField.getText().indexOf("(" + ex.getMessage() + " ") + 1;
            if (from == 0) {
                from = this.inputField.getText().indexOf("(" + ex.getMessage() + "(") + 1;
            }
            if (from == 0) {
                from = this.inputField.getText().indexOf("(" + ex.getMessage() + ")") + 1;
            }
            if (from == 0) {
                from = this.inputField.getText().indexOf(")" + ex.getMessage() + "(") + 1;
            }
            if (from == 0) {
                from = this.inputField.getText().indexOf(")" + ex.getMessage() + ")") + 1;
            }
            if (from == 0) {
                from = this.inputField.getText().indexOf(")" + ex.getMessage() + " ") + 1;
            }
            if (from == 0) {
                from = this.inputField.getText().indexOf(" " + ex.getMessage() + ")") + 1;
            }
            if (from == 0) {
                from = this.inputField.getText().indexOf(" " + ex.getMessage() + " ") + 1;
            }
            if (from == 0) {
                from = this.inputField.getText().indexOf(" " + ex.getMessage() + "(") + 1;
            }
            doc.setCharacterAttributes(from, ex.getMessage().length(), inputField.getStyle("Red"), true);
            System.out.println("" + from + ":" + ex.getMessage());
        } catch (IllegalStateException e) {
            JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(e.getMessage()), JOptionPane.OK_OPTION);
            JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
            dialog.setVisible(true);
        }
    } catch (ParserConfigurationException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (XMLStreamException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (ExpressionLogicalException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (SAXException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("DOC_NOT_VALID") + ex.getMessage(), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (FileNotFoundException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (IOException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (PrecisionIsTooLowException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (IncompatibleNumberFormatException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (ApfloatRuntimeException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("apfloat"), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    }
}//GEN-LAST:event_drawButtonActionPerformed

private void calculateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_calculateButtonActionPerformed
    if (this.inputField.getText().contains("VAR")) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("VAR_FOUND"), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } else {
        XMLBuilder builder = null;
        try {
            try {
                if (this.saveExpressionBox.isSelected()) {
                    if (this.outputExprLocationField.getText().equalsIgnoreCase(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("EXP_LOC"))) {
                        throw new FileNotFoundException("EXPR_LOC_NOT_SET");
                    }

                    File out = new File(this.outputExprLocationField.getText());
                    if (this.isInfix.isSelected()) {
                        builder = new XMLBuilderFromInfixText(out);
                    } else {
                        builder = new XMLBuilderFromPrefixText(out);
                    }

                    builder.setExpression(this.inputField.getText());
                    builder.setPrecision(Integer.parseInt(this.sTabPrecisionSpinner.getValue().toString()));
                    builder.convertToXML(true);
                    TreeBuilderFromXML tb = new TreeBuilderFromXML(out.getAbsolutePath(), true);
                    ExpressionTreeElement gy = tb.build();
                    ExpressionTreeElement value = gy.getValue();
                    this.resultArea.setText(value.toString(true));
                    try {
                        if (this.saveResultBox.isSelected()) {
                            if (this.outputResultLocationField.getText().equalsIgnoreCase(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("RES_LOC"))) {
                                throw new FileNotFoundException("EXPR_LOC_NOT_SET");
                            } else {
                                Matrix m = (Matrix) value;
                                m.saveToXML(new File(this.outputResultLocationField.getText()));
                            }
                        }
                    } catch (FileNotFoundException ex) {
                        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
                        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                        dialog.setVisible(true);
                    }
                    this.tabsPane.setSelectedIndex(2);
                } else {
                    if (this.isInfix.isSelected()) {
                        builder = new XMLBuilderFromInfixText(new File(FileLocations.getDefaultTempXML()));
                    } else {
                        builder = new XMLBuilderFromPrefixText(new File(FileLocations.getDefaultTempXML()));
                    }

                    builder.setExpression(this.inputField.getText());
                    builder.setPrecision(Integer.parseInt(this.sTabPrecisionSpinner.getValue().toString()));
                    builder.convertToXML(false);
                    TreeBuilderFromXML tb = new TreeBuilderFromXML(FileLocations.getDefaultTempXML(), true);
                    ExpressionTreeElement gy = tb.build();
                    ExpressionTreeElement value = gy.getValue();
                    this.resultArea.setText(value.toString(true));
                    try {
                        if (this.saveResultBox.isSelected()) {
                            if (this.outputResultLocationField.getText().equalsIgnoreCase(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("RES_LOC"))) {
                                throw new FileNotFoundException("EXPR_LOC_NOT_SET");
                            } else {
                                Matrix m = (Matrix) value;
                                m.saveToXML(new File(this.outputResultLocationField.getText()));
                            }
                        }
                    } catch (FileNotFoundException ex) {
                        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
                        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                        dialog.setVisible(true);
                    }
                    this.tabsPane.setSelectedIndex(2);
                }

            } catch (FileNotFoundException ex) {
                if (ex.getMessage().equalsIgnoreCase("OVERWRITE_XML")) {
                    JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.QUESTION_MESSAGE);
                    Object[] options = {java.util.ResourceBundle.getBundle("languages/gui_languages").getString("YES"),
                        java.util.ResourceBundle.getBundle("languages/gui_languages").getString("NO")};
                    optionPane.setOptions(options);
                    JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                    dialog.setVisible(true);
                    if (optionPane.getValue().toString().equalsIgnoreCase(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("YES"))) {
                        if (this.saveExpressionBox.isSelected()) {
                            if (this.outputExprLocationField.getText().equalsIgnoreCase(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("EXP_LOC"))) {
                                throw new FileNotFoundException("EXPR_LOC_NOT_SET");
                            }

                            File out = new File(this.outputExprLocationField.getText());
                            if (this.isInfix.isSelected()) {
                                builder = new XMLBuilderFromInfixText(out);
                            } else {
                                builder = new XMLBuilderFromPrefixText(out);
                            }

                            builder.setOverwrite(true);
                            builder.setExpression(this.inputField.getText());
                            builder.setPrecision(Integer.parseInt(this.sTabPrecisionSpinner.getValue().toString()));
                            builder.convertToXML(true);
                            TreeBuilderFromXML tb = new TreeBuilderFromXML(out.getAbsolutePath(), true);
                            ExpressionTreeElement gy = tb.build();
                            ExpressionTreeElement value = gy.getValue();
                            this.resultArea.setText(value.toString(true));
                            try {
                                if (this.saveResultBox.isSelected()) {
                                    if (this.outputResultLocationField.getText().equalsIgnoreCase(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("RES_LOC"))) {
                                        throw new FileNotFoundException("EXPR_LOC_NOT_SET");
                                    } else {
                                        Matrix m = (Matrix) value;
                                        m.saveToXML(new File(this.outputResultLocationField.getText()));
                                    }
                                }
                            } catch (FileNotFoundException ex3) {
                                JOptionPane optionPane3 = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
                                JDialog dialog3 = optionPane3.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                                dialog3.setVisible(true);
                            }
                            this.tabsPane.setSelectedIndex(2);
                            JOptionPane optionPane2 = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("SAVE_SUCCESSFUL"), JOptionPane.INFORMATION_MESSAGE);
                            JDialog dialog2 = optionPane2.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                            dialog2.setVisible(true);
                        } else {
                            JOptionPane optionPane2 = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("ERROR_SAVE_NOT_CHECKED"), JOptionPane.WARNING_MESSAGE);
                            JDialog dialog2 = optionPane2.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("ERROR"));
                            dialog2.setVisible(true);
                        }

                    }
                } else {
                    throw ex;
                }

            }
        } catch (ArithmeticException ex) {
            JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
            JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
            dialog.setVisible(true);
        } catch (IncompatibleNumberFormatException ex) {
            JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
            JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
            dialog.setVisible(true);
        } catch (SAXException ex) {
            JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("DOC_NOT_VALID") + ex.getMessage(), JOptionPane.OK_OPTION);
            JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
            dialog.setVisible(true);
        } catch (PrecisionIsTooLowException ex) {
            JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
            JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
            dialog.setVisible(true);
        } catch (UnknownOperatorException ex) {
            JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("UNKNOWN_OPERATOR") + ex.getMessage(), JOptionPane.OK_OPTION);
            JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
            dialog.setVisible(true);
        } catch (FileNotFoundException ex) {
            try {
                JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
                JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                dialog.setVisible(true);
            } catch (Exception Exception) {
                JOptionPane optionPane = new JOptionPane(/*java.util.ResourceBundle.getBundle("languages/messages").getString(*/ex.getMessage()/*)*/, JOptionPane.OK_OPTION);
                JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                dialog.setVisible(true);
            }
        } catch (IOException ex) {
//!!!   ex.printStackTrace();
            JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
            JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
            dialog.setVisible(true);
        } catch (ParserConfigurationException ex) {
            JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
            JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
            dialog.setVisible(true);
        } catch (XMLStreamException ex) {
            JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
            JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
            dialog.setVisible(true);
        } catch (ExpressionLogicalException ex) {
            JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
            JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
            dialog.setVisible(true);
        } catch (ApfloatRuntimeException ex) {
            JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("apfloat"), JOptionPane.OK_OPTION);
            JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
            dialog.setVisible(true);
        }
    }
}//GEN-LAST:event_calculateButtonActionPerformed

private void sTabPrecisionSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_sTabPrecisionSliderStateChanged
    // TODO add your handling code here:
}//GEN-LAST:event_sTabPrecisionSliderStateChanged

private void sTabPrecisionSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_sTabPrecisionSpinnerStateChanged
    if (Integer.parseInt(this.sTabPrecisionSpinner.getValue().toString()) > this.sTabPrecisionSlider.getMaximum()) {
        this.sTabPrecisionSpinner.setValue(this.sTabPrecisionSlider.getValue());
    } else if (Integer.parseInt(this.sTabPrecisionSpinner.getValue().toString()) < 5/*this.sTabPrecisionSlider.getMinimum()*/) {
        this.sTabPrecisionSpinner.setValue(5/*this.sTabPrecisionSlider.getValue()*/);
        this.sTabPrecisionSlider.setValue(5);
    } else {
        this.sTabPrecisionSlider.setValue(Integer.parseInt(this.sTabPrecisionSpinner.getValue().toString()));
    }
}//GEN-LAST:event_sTabPrecisionSpinnerStateChanged

private void browseOutputExprButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseOutputExprButtonActionPerformed
    JFileChooser fc = new JFileChooser();
    fc.setFileFilter(new FileFilter() {

        @Override
        public boolean accept(File f) {
            return f.getName().toLowerCase().endsWith(".xml") || f.isDirectory();
        }

        @Override
        public String getDescription() {
            return "XMLCalculator Expression (*.xml)";
        }
    });
    fc.showSaveDialog(this);
    File outFile = fc.getSelectedFile();
    if (outFile == null) {
        this.outputExprLocationField.setText(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("EXP_LOC"));
    } else {
        if (!outFile.getName().toLowerCase().endsWith(".xml")) {
            this.outputExprLocationField.setText(outFile.getAbsolutePath() + ".xml");
        } else {
            this.outputExprLocationField.setText(outFile.getAbsolutePath());
        }

        this.saveExpressionBox.setSelected(true);
    }
}//GEN-LAST:event_browseOutputExprButtonActionPerformed

private void saveExprButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveExprButtonActionPerformed
    XMLBuilder builder = null;
    try {
        try {
            if (this.saveExpressionBox.isSelected()) {
                if (this.outputExprLocationField.getText().equalsIgnoreCase(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("EXP_LOC"))) {
                    throw new FileNotFoundException("EXPR_LOC_NOT_SET");
                }
                File out = new File(this.outputExprLocationField.getText());
                if (this.isInfix.isSelected()) {
                    builder = new XMLBuilderFromInfixText(out);
                } else {
                    builder = new XMLBuilderFromPrefixText(out);
                }

                builder.setExpression(this.inputField.getText());
                builder.setPrecision(Integer.parseInt(this.sTabPrecisionSpinner.getValue().toString()));
                builder.convertToXML(true);
                JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("SAVE_SUCCESSFUL"), JOptionPane.INFORMATION_MESSAGE);
                JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                dialog.setVisible(true);
            } else {
                JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("ERROR_SAVE_NOT_CHECKED"), JOptionPane.WARNING_MESSAGE);
                JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("ERROR"));
                dialog.setVisible(true);
            }

        } catch (FileNotFoundException ex) {
            if (ex.getMessage().equalsIgnoreCase("OVERWRITE_XML")) {
                JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.QUESTION_MESSAGE);
                Object[] options = {java.util.ResourceBundle.getBundle("languages/gui_languages").getString("YES"),
                    java.util.ResourceBundle.getBundle("languages/gui_languages").getString("NO")};
                optionPane.setOptions(options);
                JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                dialog.setVisible(true);
                if (optionPane.getValue().toString().equalsIgnoreCase(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("YES"))) {
                    if (this.saveExpressionBox.isSelected()) {
                        if (this.outputExprLocationField.getText().equalsIgnoreCase(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("EXP_LOC"))) {
                            throw new FileNotFoundException("EXPR_LOC_NOT_SET");
                        }
                        File out = new File(this.outputExprLocationField.getText());
                        if (this.isInfix.isSelected()) {
                            builder = new XMLBuilderFromInfixText(out);
                        } else {
                            builder = new XMLBuilderFromPrefixText(out);
                        }

                        builder.setOverwrite(true);
                        builder.setExpression(this.inputField.getText());
                        builder.setPrecision(Integer.parseInt(this.sTabPrecisionSpinner.getValue().toString()));
                        builder.convertToXML(true);
                        JOptionPane optionPane2 = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("SAVE_SUCCESSFUL"), JOptionPane.INFORMATION_MESSAGE);
                        JDialog dialog2 = optionPane2.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                        dialog2.setVisible(true);
                    } else {
                        JOptionPane optionPane2 = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("ERROR_SAVE_NOT_CHECKED"), JOptionPane.WARNING_MESSAGE);
                        JDialog dialog2 = optionPane2.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("ERROR"));
                        dialog2.setVisible(true);
                    }

                }
            } else {
                throw ex;
            }

        }
    } catch (ArithmeticException ex) {
        //this.resultArea.setText(ex.getMessage());
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (UnknownOperatorException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("UNKNOWN_OPERATOR") + ex.getMessage(), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (FileNotFoundException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("ERROR"));
        dialog.setVisible(true);
    } catch (IOException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("ERROR"));
        dialog.setVisible(true);
    } catch (ParserConfigurationException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("ERROR"));
        dialog.setVisible(true);
    } catch (XMLStreamException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("ERROR"));
        dialog.setVisible(true);
    } catch (ExpressionLogicalException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (ApfloatRuntimeException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("apfloat"), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    }
}//GEN-LAST:event_saveExprButtonActionPerformed

private void clearInputButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearInputButtonActionPerformed
    if (this.isInfix.isSelected()) {
        this.inputField.setText("()");
        this.inputField.setCaretPosition(1);
        this.inputFieldFocusLost(null);
    } else {
        this.inputField.setText("");
        this.inputFieldFocusLost(null);
    }
}//GEN-LAST:event_clearInputButtonActionPerformed

private void fsTabHEndSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fsTabHEndSpinnerStateChanged
    if (Integer.parseInt(this.fsTabHEndSpinner.getValue().toString()) > this.fsTabHEndSlider.getMaximum()) {
        this.fsTabHEndSpinner.setValue(this.fsTabHEndSlider.getValue());
    } else if (Integer.parseInt(this.fsTabHEndSpinner.getValue().toString()) < this.fsTabHEndSlider.getMinimum()) {
        this.fsTabHEndSpinner.setValue(this.fsTabHEndSlider.getValue());
    } else {
        this.fsTabHEndSlider.setValue(Integer.parseInt(this.fsTabHEndSpinner.getValue().toString()));
    }

    if (this.fsTabHEndSlider.getValue() - this.fsTabHStartSlider.getValue() > 0) {
        this.fsTabWidthSpinner.setValue(this.fsTabHEndSlider.getValue() - this.fsTabHStartSlider.getValue());
    } else {
        this.fsTabHStartSlider.setValue(this.fsTabHEndSlider.getValue());
        this.fsTabHStartSpinner.setValue(this.fsTabHEndSlider.getValue());
        this.fsTabWidthSpinner.setValue(this.fsTabHEndSlider.getValue() - this.fsTabHStartSlider.getValue());
    }
}//GEN-LAST:event_fsTabHEndSpinnerStateChanged

private void fsTabHEndSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fsTabHEndSliderStateChanged
    this.fsTabHEndSlider.setValue(Integer.parseInt(this.fsTabHEndSpinner.getValue().toString()));
}//GEN-LAST:event_fsTabHEndSliderStateChanged

private void fsTabVEndSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fsTabVEndSliderStateChanged
    // TODO add your handling code here:
}//GEN-LAST:event_fsTabVEndSliderStateChanged

private void fsTabVEndSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fsTabVEndSpinnerStateChanged
    if (Integer.parseInt(this.fsTabVEndSpinner.getValue().toString()) > this.fsTabVEndSlider.getMaximum()) {
        this.fsTabVEndSpinner.setValue(this.fsTabVEndSlider.getValue());
    } else if (Integer.parseInt(this.fsTabVEndSpinner.getValue().toString()) < this.fsTabHEndSlider.getMinimum()) {
        this.fsTabVEndSpinner.setValue(this.fsTabVEndSlider.getValue());
    } else {
        this.fsTabVEndSlider.setValue(Integer.parseInt(this.fsTabVEndSpinner.getValue().toString()));
    }

    if (this.fsTabVEndSlider.getValue() - this.fsTabVStartSlider.getValue() > 0) {
        this.fsTabHeightSpinner.setValue(this.fsTabVEndSlider.getValue() - this.fsTabVStartSlider.getValue());
    } else {
        this.fsTabVStartSlider.setValue(this.fsTabVEndSlider.getValue());
        this.fsTabVStartSpinner.setValue(this.fsTabVEndSlider.getValue());
        this.fsTabHeightSpinner.setValue(this.fsTabVEndSlider.getValue() - this.fsTabVStartSlider.getValue());
    }
}//GEN-LAST:event_fsTabVEndSpinnerStateChanged

private void browseResultButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseResultButtonActionPerformed
    JFileChooser fc = new JFileChooser();
    fc.setFileFilter(new FileFilter() {

        @Override
        public boolean accept(File f) {
            return f.getName().toLowerCase().endsWith(".xml") || f.isDirectory();
        }

        @Override
        public String getDescription() {
            return "XMLCalculator Result (*.xml)";
        }
    });
    fc.showSaveDialog(this);
    File outFile = fc.getSelectedFile();
    if (outFile == null) {
        this.outputResultLocationField.setText(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("RES_LOC"));
    } else {
        if (!outFile.getName().toLowerCase().endsWith(".xml")) {
            this.outputResultLocationField.setText(outFile.getAbsolutePath() + ".xml");
        } else {
            this.outputResultLocationField.setText(outFile.getAbsolutePath());
        }

        this.saveResultBox.setSelected(true);
    }
}//GEN-LAST:event_browseResultButtonActionPerformed

private void browseInputExprButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseInputExprButtonActionPerformed
    JFileChooser fc = new JFileChooser();
    fc.setFileFilter(new FileFilter() {

        @Override
        public boolean accept(File f) {
            return f.getName().toLowerCase().endsWith(".xml") || f.isDirectory();
        }

        @Override
        public String getDescription() {
            return "XMLCalculator Expression (*.xml)";
        }
    });
    fc.showOpenDialog(this);
    File outFile = fc.getSelectedFile();
    if (outFile == null) {
        this.inputExprLocationField.setText(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("EXP_LOC"));
        this.solveXMLButton.setEnabled(false);
        this.drawXMLButton.setEnabled(false);

    } else {
        if (!outFile.getName().toLowerCase().endsWith(".xml")) {
            this.inputExprLocationField.setText(outFile.getAbsolutePath() + ".xml");
        } else {
            this.inputExprLocationField.setText(outFile.getAbsolutePath());
        }
        this.solveXMLButton.setEnabled(true);
        this.drawXMLButton.setEnabled(true);
    }
}//GEN-LAST:event_browseInputExprButtonActionPerformed

private void drawXMLButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_drawXMLButtonActionPerformed
    try {
        this.lastDrawFromXML = true;
        if (this.inputExprLocationField.getText().equalsIgnoreCase(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("EXP_LOC"))) {
            throw new FileNotFoundException("EXPR_LOC_NOT_SET");
        }
        File out2 = new File(this.inputExprLocationField.getText());
        long start = System.currentTimeMillis();
        this.tabsPane.setSelectedIndex(1);
        FunctionDrawer drawer = new FunctionDrawer(Integer.parseInt(this.fsTabHStartSpinner.getValue().toString()),
                Integer.parseInt(this.fsTabVStartSpinner.getValue().toString()),
                Integer.parseInt(this.fsTabHStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabWidthSpinner.getValue().toString()),
                Integer.parseInt(this.fsTabVStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabHeightSpinner.getValue().toString()),
                this.fsTabNumberOfPointsSlider.getValue());
        drawer.setXML(out2.getAbsolutePath());
        drawer.setPrecision(this.fsTabPrecisionSlider.getValue());
        drawer.setBar(this.progressBar);
        this.boundsLabel.setText("Xmin=" + this.fsTabHStartSpinner.getValue().toString() +
                ";     Xmax=" + (Integer.parseInt(this.fsTabHStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabWidthSpinner.getValue().toString())) +
                ";     Ymin=" + this.fsTabVStartSpinner.getValue().toString() +
                ";     Ymax=" + (Integer.parseInt(this.fsTabVStartSpinner.getValue().toString()) + Integer.parseInt(this.fsTabHeightSpinner.getValue().toString())));
        this.precisionLabel.setText(this.fsTabPrecisionSpinner.getValue().toString() + " " + java.util.ResourceBundle.getBundle("languages/gui_languages").getString("DIGITS"));
        BufferedImage image = drawer.draw(this.coordinates.isSelected());
//!!!!!!!!!!!!!!!!!!!!!!!!!!!
        if (drawer.visibleCheckpoints == 0) {
            this.tabsPane.setSelectedIndex(4);
            this.fsTabVStartSpinner.setValue((int) java.lang.Math.round(drawer.minValue - 1));
            this.fsTabVEndSpinner.setValue((int) java.lang.Math.round(drawer.maxValue + 1));
            JOptionPane oP = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("SET_BOUNDS"), JOptionPane.INFORMATION_MESSAGE);
            JDialog d = oP.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
            d.setVisible(true);
        }
        this.minValue.setText("" + drawer.minValue);
        this.maxValue.setText("" + drawer.maxValue);
        this.functionImageLabel.setIcon(new ImageIcon(image));
        this.functionImageLabel.paintImmediately(0, 0, 500, 500);
        this.millisLabel.setText((System.currentTimeMillis() - start) + "ms");
        this.cpLabel.setText(drawer.visibleCheckpoints + "/" + this.fsTabNumberOfPointsSpinner.getValue().toString());
        if (this.savePNGBox.isSelected()) {
            try {
                File out = new File(this.pngLocationField.getText());
                if (!out.exists()) {
                    out.createNewFile();
                }
                if (out.canWrite()) {
                    ImageIO.write(image, "PNG", out);
                }
            } catch (IOException ex) {
                JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
                JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                dialog.setVisible(true);
            }
        }
    } catch (UnknownOperatorException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("UNKNOWN_OPERATOR") + ex.getMessage(), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (ParserConfigurationException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (XMLStreamException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (ExpressionLogicalException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (SAXException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("DOC_NOT_VALID") + ex.getMessage(), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (FileNotFoundException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (IOException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (PrecisionIsTooLowException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (IncompatibleNumberFormatException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (ApfloatRuntimeException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("apfloat"), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    }
}//GEN-LAST:event_drawXMLButtonActionPerformed

private void solveXMLButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_solveXMLButtonActionPerformed
    XMLBuilder builder = null;
    try {
        File in = new File(this.inputExprLocationField.getText());
        TreeBuilderFromXML tb = new TreeBuilderFromXML(in.getAbsolutePath(), true);
        ExpressionTreeElement gy = tb.build();
        ExpressionTreeElement value = gy.getValue();
        this.resultArea.setText(value.toString(true));
        try {
            if (this.saveResultBox.isSelected()) {
                if (this.outputResultLocationField.getText().equalsIgnoreCase(java.util.ResourceBundle.getBundle("languages/gui_languages").getString("RES_LOC"))) {
                    throw new FileNotFoundException("EXPR_LOC_NOT_SET");
                } else {
                    Matrix m = (Matrix) value;
                    m.saveToXML(new File(this.outputResultLocationField.getText()));
                }
            }
        } catch (FileNotFoundException ex) {
            JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
            JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
            dialog.setVisible(true);
        }
        this.tabsPane.setSelectedIndex(2);
    } catch (ArithmeticException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (IncompatibleNumberFormatException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (SAXException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("DOC_NOT_VALID") + ex.getMessage(), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (PrecisionIsTooLowException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (UnknownOperatorException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("UNKNOWN_OPERATOR") + ex.getMessage(), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (FileNotFoundException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (IOException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (ParserConfigurationException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (XMLStreamException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (ExpressionLogicalException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    } catch (ApfloatRuntimeException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("apfloat"), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    }
}//GEN-LAST:event_solveXMLButtonActionPerformed

private void setLangButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_setLangButtonActionPerformed
    String lang = this.langComboBox.getSelectedItem().toString();
    try {
        for (String s : langs) {

            if (new Locale(s).getDisplayLanguage().equalsIgnoreCase(lang)) {
                FileLocations.setChoosenLocale(new Locale(s));
                JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString("SAVE_RESTART"), JOptionPane.INFORMATION_MESSAGE);
                JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
                dialog.setVisible(true);
                break;
            }
        }
    } catch (IOException ex) {
        JOptionPane optionPane = new JOptionPane(java.util.ResourceBundle.getBundle("languages/messages").getString(ex.getMessage()), JOptionPane.OK_OPTION);
        JDialog dialog = optionPane.createDialog(java.util.ResourceBundle.getBundle("languages/messages").getString("INFO"));
        dialog.setVisible(true);
    }
}//GEN-LAST:event_setLangButtonActionPerformed

private void rowSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_rowSpinnerStateChanged
    int value = Integer.parseInt(this.rowSpinner.getValue().toString());
    if (value < 1) {
        this.rowSpinner.setValue(1);
    }
}//GEN-LAST:event_rowSpinnerStateChanged

private void colSpinnerStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_colSpinnerStateChanged
    int value = Integer.parseInt(this.colSpinner.getValue().toString());
    if (value < 1) {
        this.colSpinner.setValue(1);
    }
}//GEN-LAST:event_colSpinnerStateChanged

private void insertMatrixActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_insertMatrixActionPerformed
    StringBuilder sb = new StringBuilder(this.inputField.getText());
    StringBuilder s = new StringBuilder();
    int pos = this.inputField.getCaretPosition();
    if (this.isInfix.isSelected()) {
        s.append("[");
        for (int i = 1; i < Integer.parseInt(this.rowSpinner.getValue().toString()); i++) {
            for (int j = 0; j < Integer.parseInt(this.colSpinner.getValue().toString()); j++) {
                s.append("() ");
            }
            s.append("| ");
        }
        for (int j = 1; j < Integer.parseInt(this.colSpinner.getValue().toString()); j++) {
            s.append("() ");
        }
        s.append("()]");
        sb.insert(pos, s.toString());
        this.inputField.setText(sb.toString());
        this.inputField.setCaretPosition(pos + 2);
    } else if (this.isPrefix.isSelected()) {
        s.append("[");
        for (int i = 1; i < Integer.parseInt(this.rowSpinner.getValue().toString()); i++) {
            for (int j = 1; j < Integer.parseInt(this.colSpinner.getValue().toString()); j++) {
                s.append(" ");
            }
            s.append("|");
        }
        for (int j = 1; j < Integer.parseInt(this.colSpinner.getValue().toString()); j++) {
            s.append(" ");
        }
        s.append(" ]");
        sb.insert(pos, s.toString());
        this.inputField.setText(sb.toString());
        this.inputField.setCaretPosition(pos + 1);
    }
    this.inputFieldFocusLost(null);
}//GEN-LAST:event_insertMatrixActionPerformed

private void inputFieldKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_inputFieldKeyPressed
    if (evt.isControlDown()) {
        String code = KeyEvent.getKeyText(evt.getKeyCode());
        if (code.equalsIgnoreCase("ENTER")) {
            evt.setKeyCode(0);
            this.calculateButtonActionPerformed(null);
        } else if (code.equalsIgnoreCase("Left")) {
            evt.setKeyCode(0);
            this.prevButtonActionPerformed(null);
        } else if (code.equalsIgnoreCase("Right")) {
            evt.setKeyCode(0);
            this.nextButtonActionPerformed(null);
        } else if (code.equalsIgnoreCase("Delete")) {
            evt.setKeyCode(0);
            this.clearInputButtonActionPerformed(null);
        } else if (code.equalsIgnoreCase("Space")) {
            evt.setKeyCode(0);
            StringBuilder sb = new StringBuilder(this.inputField.getText());
            int pos = this.inputField.getCaretPosition();
            sb.insert(pos, " ");
            this.inputField.setText(sb.toString());
            this.inputField.setCaretPosition(pos + 1);
        } else if (code.equalsIgnoreCase("8")) {
            evt.setKeyCode(0);
            StringBuilder sb = new StringBuilder(this.inputField.getText());
            int pos = this.inputField.getCaretPosition();
            sb.insert(pos, "(");
            this.inputField.setText(sb.toString());
            this.inputField.setCaretPosition(pos + 1);
        } else if (code.equalsIgnoreCase("W") && !evt.isAltGraphDown() && !evt.isAltDown()) {
            evt.setKeyCode(0);
            StringBuilder sb = new StringBuilder(this.inputField.getText());
            int pos = this.inputField.getCaretPosition();
            sb.insert(pos, "|");
            this.inputField.setText(sb.toString());
            this.inputField.setCaretPosition(pos + 1);
        }
    }
}//GEN-LAST:event_inputFieldKeyPressed

private void redrawActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_redrawActionPerformed
    if (this.lastDrawFromXML) {
        this.drawXMLButtonActionPerformed(evt);
    } else {
        this.drawButtonActionPerformed(evt);
    }
}//GEN-LAST:event_redrawActionPerformed

private void isPrefixActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_isPrefixActionPerformed
    this.clearInputButtonActionPerformed(null);
}//GEN-LAST:event_isPrefixActionPerformed

private void isInfixActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_isInfixActionPerformed
    this.clearInputButtonActionPerformed(null);
}//GEN-LAST:event_isInfixActionPerformed

private void eeTabTrigComboBoxMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_eeTabTrigComboBoxMouseEntered
    this.setHelp("trig");
}//GEN-LAST:event_eeTabTrigComboBoxMouseEntered

private void eeTabNonTrigComboBoxMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_eeTabNonTrigComboBoxMouseEntered
    this.setHelp("unary");
}//GEN-LAST:event_eeTabNonTrigComboBoxMouseEntered

private void eeTabNumPanelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_eeTabNumPanelMouseEntered
    this.setHelp("expr");
}//GEN-LAST:event_eeTabNumPanelMouseEntered

private void eeTabBinaryComboBoxMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_eeTabBinaryComboBoxMouseEntered
    this.setHelp("binary");
}//GEN-LAST:event_eeTabBinaryComboBoxMouseEntered

private void eeTabMatrComboBoxMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_eeTabMatrComboBoxMouseEntered
    this.setHelp("matrix");
}//GEN-LAST:event_eeTabMatrComboBoxMouseEntered

private void rowSpinnerMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_rowSpinnerMouseEntered
    this.setHelp("matrix");
}//GEN-LAST:event_rowSpinnerMouseEntered

private void colSpinnerMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_colSpinnerMouseEntered
    this.setHelp("matrix");
}//GEN-LAST:event_colSpinnerMouseEntered

private void insertMatrixMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_insertMatrixMouseEntered
    this.setHelp("matrix");
}//GEN-LAST:event_insertMatrixMouseEntered

private void matrixButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_matrixButtonMouseEntered
    this.setHelp("matrix");
}//GEN-LAST:event_matrixButtonMouseEntered

private void matrixColButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_matrixColButtonMouseEntered
    this.setHelp("matrix");
}//GEN-LAST:event_matrixColButtonMouseEntered

private void matrixRowButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_matrixRowButtonMouseEntered
    this.setHelp("matrix");
}//GEN-LAST:event_matrixRowButtonMouseEntered

private void eeTabSpecCharactersMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_eeTabSpecCharactersMouseEntered
    this.setHelp("specchars");
}//GEN-LAST:event_eeTabSpecCharactersMouseEntered

private void otherBracketButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_otherBracketButtonMouseEntered
    this.setHelp("specops");
}//GEN-LAST:event_otherBracketButtonMouseEntered

private void eeTabOtherComboBoxMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_eeTabOtherComboBoxMouseEntered
    this.setHelp("specops");
}//GEN-LAST:event_eeTabOtherComboBoxMouseEntered

private void launchPanelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_launchPanelMouseEntered
    this.setHelp("launch");
}//GEN-LAST:event_launchPanelMouseEntered

private void functionOutputTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_functionOutputTabMouseEntered
    this.setHelp("plot");
}//GEN-LAST:event_functionOutputTabMouseEntered

private void matrixOutputTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_matrixOutputTabMouseEntered
    this.setHelp("result");
}//GEN-LAST:event_matrixOutputTabMouseEntered

private void sTabQualityPanelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_sTabQualityPanelMouseEntered
    this.setHelp("precision");
}//GEN-LAST:event_sTabQualityPanelMouseEntered

private void saveExpressionPanelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_saveExpressionPanelMouseEntered
    this.setHelp("expression");
}//GEN-LAST:event_saveExpressionPanelMouseEntered

private void saveResultPanelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_saveResultPanelMouseEntered
    this.setHelp("resultsave");
}//GEN-LAST:event_saveResultPanelMouseEntered

private void openExpressionPanelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_openExpressionPanelMouseEntered
    this.setHelp("open");
}//GEN-LAST:event_openExpressionPanelMouseEntered

private void languagePanelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_languagePanelMouseEntered
    this.setHelp("lang");
}//GEN-LAST:event_languagePanelMouseEntered

private void functionSettingsTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_functionSettingsTabMouseEntered
    this.setHelp("draw");
}//GEN-LAST:event_functionSettingsTabMouseEntered

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new GUIMain().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel boundsLabel;
    private javax.swing.JButton bracketButton;
    private javax.swing.JButton browseInputExprButton;
    private javax.swing.JButton browseOutputExprButton;
    private javax.swing.JButton browsePNGButton;
    private javax.swing.JButton browseResultButton;
    private javax.swing.JButton calculateButton;
    private javax.swing.JLabel checkPointsLabel;
    private javax.swing.JButton clearInputButton;
    private javax.swing.JLabel colLabel;
    private javax.swing.JSpinner colSpinner;
    private javax.swing.JCheckBox coordinates;
    private javax.swing.JLabel cpLabel;
    private javax.swing.JButton drawButton;
    private javax.swing.JButton drawXMLButton;
    private javax.swing.JComboBox eeTabBinaryComboBox;
    private javax.swing.JLabel eeTabBinaryLabel;
    private javax.swing.JPanel eeTabBinaryPanel;
    private javax.swing.JLabel eeTabExprLabel;
    private javax.swing.JScrollPane eeTabInputScrollPane;
    private javax.swing.JComboBox eeTabMatrComboBox;
    private javax.swing.JLabel eeTabMatrFunctLabel;
    private javax.swing.JComboBox eeTabNonTrigComboBox;
    private javax.swing.JLabel eeTabNonTrigFunctLabel;
    private javax.swing.JPanel eeTabNumPanel;
    private javax.swing.JComboBox eeTabOtherComboBox;
    private javax.swing.JLabel eeTabOtherFunctLabel;
    private javax.swing.JPanel eeTabSpecCharacters;
    private javax.swing.JPanel eeTabSpecItemsPanel;
    private javax.swing.JComboBox eeTabTrigComboBox;
    private javax.swing.JLabel eeTabTrigFunctLabel;
    private javax.swing.JPanel eeTabUnaryPanel;
    private javax.swing.JPanel expressionEditorTab;
    private javax.swing.JLabel foTabPictureLabel;
    private javax.swing.JButton fsResetButton;
    private javax.swing.JLabel fsTabHEndLabel;
    private javax.swing.JSlider fsTabHEndSlider;
    private javax.swing.JSpinner fsTabHEndSpinner;
    private javax.swing.JPanel fsTabHSizePanel;
    private javax.swing.JLabel fsTabHStartLabel;
    private javax.swing.JSlider fsTabHStartSlider;
    private javax.swing.JSpinner fsTabHStartSpinner;
    private javax.swing.JLabel fsTabHeightLabel;
    private javax.swing.JSlider fsTabHeightSlider;
    private javax.swing.JSpinner fsTabHeightSpinner;
    private javax.swing.JLabel fsTabNumberOfPointsLabel;
    private javax.swing.JSlider fsTabNumberOfPointsSlider;
    private javax.swing.JSpinner fsTabNumberOfPointsSpinner;
    private javax.swing.JLabel fsTabPrecisionLabel;
    private javax.swing.JSlider fsTabPrecisionSlider;
    private javax.swing.JSpinner fsTabPrecisionSpinner;
    private javax.swing.JPanel fsTabQualityPanel;
    private javax.swing.JLabel fsTabVEndLabel;
    private javax.swing.JSlider fsTabVEndSlider;
    private javax.swing.JSpinner fsTabVEndSpinner;
    private javax.swing.JLabel fsTabVSizeLabel;
    private javax.swing.JPanel fsTabVSizePanel;
    private javax.swing.JSlider fsTabVStartSlider;
    private javax.swing.JSpinner fsTabVStartSpinner;
    private javax.swing.JLabel fsTabWidthLabel;
    private javax.swing.JSlider fsTabWidthSlider;
    private javax.swing.JSpinner fsTabWidthSpinner;
    private javax.swing.JLabel functionImageLabel;
    private javax.swing.JPanel functionOutputTab;
    private javax.swing.JScrollPane functionScrollPane;
    private javax.swing.JPanel functionSettingsTab;
    private javax.swing.JTextArea helpArea;
    private javax.swing.JLabel helpLabel;
    private javax.swing.JPanel helpPanel;
    private javax.swing.JLabel infixBoxNote;
    private javax.swing.ButtonGroup infixPrefixGroup;
    private javax.swing.JTextField inputExprLocationField;
    private javax.swing.JTextPane inputField;
    private javax.swing.JButton insertMatrix;
    private javax.swing.JRadioButton isInfix;
    private javax.swing.JRadioButton isPrefix;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JComboBox langComboBox;
    private javax.swing.JPanel languagePanel;
    private javax.swing.JPanel launchPanel;
    private javax.swing.JCheckBox lineWrap;
    private javax.swing.JLabel locMaxLabel;
    private javax.swing.JLabel locMinLabel;
    private javax.swing.JLabel matrixBuilderLabel;
    private javax.swing.JButton matrixButton;
    private javax.swing.JButton matrixColButton;
    private javax.swing.JPanel matrixOutputTab;
    private javax.swing.JButton matrixRowButton;
    private javax.swing.JLabel maxValue;
    private javax.swing.JLabel millisLabel;
    private javax.swing.JLabel minValue;
    private javax.swing.JButton nextButton;
    private javax.swing.JButton numButton0;
    private javax.swing.JButton numButton1;
    private javax.swing.JButton numButton2;
    private javax.swing.JButton numButton3;
    private javax.swing.JButton numButton4;
    private javax.swing.JButton numButton5;
    private javax.swing.JButton numButton6;
    private javax.swing.JButton numButton7;
    private javax.swing.JButton numButton8;
    private javax.swing.JButton numButton9;
    private javax.swing.JButton numButtonDot;
    private javax.swing.JButton numButtonMinus;
    private javax.swing.JPanel openExpressionPanel;
    private javax.swing.JButton otherBracketButton;
    private javax.swing.JTextField outputExprLocationField;
    private javax.swing.JTextField outputResultLocationField;
    private javax.swing.JButton piButton;
    private javax.swing.JTextField pngLocationField;
    private javax.swing.JLabel precLabel;
    private javax.swing.JLabel precisionLabel;
    private javax.swing.JButton prevButton;
    private javax.swing.JProgressBar progressBar;
    private javax.swing.JButton redraw;
    private javax.swing.JTextArea resultArea;
    private javax.swing.JLabel resultLabel;
    private javax.swing.JScrollPane resultScrollPane;
    private javax.swing.JLabel rowLabel;
    private javax.swing.JSpinner rowSpinner;
    private javax.swing.JLabel sTabPrecisionLabel;
    private javax.swing.JSlider sTabPrecisionSlider;
    private javax.swing.JSpinner sTabPrecisionSpinner;
    private javax.swing.JPanel sTabQualityPanel;
    private javax.swing.JPanel save2PNGPanel;
    private javax.swing.JButton saveExprButton;
    private javax.swing.JCheckBox saveExpressionBox;
    private javax.swing.JPanel saveExpressionPanel;
    private javax.swing.JCheckBox savePNGBox;
    private javax.swing.JCheckBox saveResultBox;
    private javax.swing.JPanel saveResultPanel;
    private javax.swing.JButton setLangButton;
    private javax.swing.JPanel settingsTab;
    private javax.swing.JButton solveXMLButton;
    private javax.swing.JTabbedPane tabsPane;
    private javax.swing.JLabel timeLabel;
    private javax.swing.JButton variableButton;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables
}
