@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        grammarSplitPane = new javax.swing.JSplitPane();
        editorWrapperPanel = new javax.swing.JPanel();
        editorWrapperSplitPane = new javax.swing.JSplitPane();
        grammarEditorPanel = new javax.swing.JPanel();
        grammarTextPaneSplitPane = new javax.swing.JScrollPane();
        grammarTextPane = new javax.swing.JTextPane();
        grammarFileTextField = new javax.swing.JTextField();
        grammarFileSelectButton = new javax.swing.JButton();
        grammarSaveButton = new javax.swing.JButton();
        grammarReloadButton = new javax.swing.JButton();
        increaseGrammarFontSizeButton = new javax.swing.JButton();
        decreaseGrammarFontSizeButton = new javax.swing.JButton();
        grammarHelpButton = new javax.swing.JButton();
        initialisationEditorPanel = new javax.swing.JPanel();
        initialisationFileTextField = new javax.swing.JTextField();
        initialisationFileSelectButton = new javax.swing.JButton();
        initialisationEditorSplitPane = new javax.swing.JSplitPane();
        initialisationTextPaneScrollPane = new javax.swing.JScrollPane();
        initialisationTextPane = new javax.swing.JTextPane();
        initialisationOutputScrollPane = new javax.swing.JScrollPane();
        initialisationOutputTextArea = new javax.swing.JTextArea();
        increaseInitialisationFontSizeButton = new javax.swing.JButton();
        decreaseInitialisationFontSizeButton = new javax.swing.JButton();
        initialisationSaveButton = new javax.swing.JButton();
        initialisationReloadButton = new javax.swing.JButton();
        initialisationHelpButton = new javax.swing.JButton();
        visualisationPanel = new javax.swing.JPanel();
        graphPanelWrapper = new javax.swing.JPanel();
        coordinatesLabel = new javax.swing.JLabel();
        coordinates = new javax.swing.JLabel();
        generateButton = new javax.swing.JButton();
        zoomSlider = new javax.swing.JSlider();
        zoomValue = new javax.swing.JLabel();
        loadGraphButton = new javax.swing.JButton();
        saveAndUseButton = new javax.swing.JButton();
        closeButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Graph Generator");
        setLocationByPlatform(true);
        setMinimumSize(new java.awt.Dimension(800, 500));

        grammarSplitPane.setDividerLocation(450);
        grammarSplitPane.setContinuousLayout(true);
        grammarSplitPane.setMinimumSize(new java.awt.Dimension(600, 1));

        editorWrapperSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
        editorWrapperSplitPane.setResizeWeight(0.8);
        editorWrapperSplitPane.setContinuousLayout(true);

        grammarEditorPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Grammar"));

        grammarTextPane.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
        grammarTextPane.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                grammarTextPaneKeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                grammarTextPaneKeyTyped(evt);
            }
        });
        grammarTextPaneSplitPane.setViewportView(grammarTextPane);

        grammarFileTextField.setEditable(false);

        grammarFileSelectButton.setText("Select...");
        grammarFileSelectButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                grammarFileSelectButtonActionPerformed(evt);
            }
        });

        grammarSaveButton.setText("Save");
        grammarSaveButton.setEnabled(false);
        grammarSaveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                grammarSaveButtonActionPerformed(evt);
            }
        });

        grammarReloadButton.setText("Reload");
        grammarReloadButton.setEnabled(false);
        grammarReloadButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                grammarReloadButtonActionPerformed(evt);
            }
        });

        increaseGrammarFontSizeButton.setText("<html><small>A</small>A</html>");
        increaseGrammarFontSizeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                increaseGrammarFontSizeButtonActionPerformed(evt);
            }
        });

        decreaseGrammarFontSizeButton.setText("<html>A<small>A</small></html>");
        decreaseGrammarFontSizeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                decreaseGrammarFontSizeButtonActionPerformed(evt);
            }
        });

        grammarHelpButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ch/zhaw/iamp/rct/ui/help.png"))); // NOI18N
        grammarHelpButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                grammarHelpButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout grammarEditorPanelLayout = new javax.swing.GroupLayout(grammarEditorPanel);
        grammarEditorPanel.setLayout(grammarEditorPanelLayout);
        grammarEditorPanelLayout.setHorizontalGroup(
            grammarEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(grammarEditorPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(grammarEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(grammarTextPaneSplitPane)
                    .addGroup(grammarEditorPanelLayout.createSequentialGroup()
                        .addComponent(grammarFileTextField)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(grammarFileSelectButton))
                    .addGroup(grammarEditorPanelLayout.createSequentialGroup()
                        .addComponent(increaseGrammarFontSizeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(decreaseGrammarFontSizeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(grammarHelpButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 240, Short.MAX_VALUE)
                        .addComponent(grammarSaveButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(grammarReloadButton)))
                .addContainerGap())
        );
        grammarEditorPanelLayout.setVerticalGroup(
            grammarEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(grammarEditorPanelLayout.createSequentialGroup()
                .addGap(6, 6, 6)
                .addGroup(grammarEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(grammarFileTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(grammarFileSelectButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(grammarTextPaneSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(grammarEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(increaseGrammarFontSizeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(decreaseGrammarFontSizeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(grammarReloadButton)
                    .addComponent(grammarSaveButton)
                    .addComponent(grammarHelpButton))
                .addGap(6, 6, 6))
        );

        editorWrapperSplitPane.setLeftComponent(grammarEditorPanel);

        initialisationEditorPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Initialisation"));

        initialisationFileTextField.setEditable(false);

        initialisationFileSelectButton.setText("Select...");
        initialisationFileSelectButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                initialisationFileSelectButtonActionPerformed(evt);
            }
        });

        initialisationEditorSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
        initialisationEditorSplitPane.setResizeWeight(0.3);
        initialisationEditorSplitPane.setContinuousLayout(true);

        initialisationTextPane.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
        initialisationTextPane.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                initialisationTextPaneKeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                initialisationTextPaneKeyTyped(evt);
            }
        });
        initialisationTextPaneScrollPane.setViewportView(initialisationTextPane);

        initialisationEditorSplitPane.setTopComponent(initialisationTextPaneScrollPane);

        initialisationOutputTextArea.setEditable(false);
        initialisationOutputTextArea.setColumns(20);
        initialisationOutputTextArea.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
        initialisationOutputTextArea.setLineWrap(true);
        initialisationOutputScrollPane.setViewportView(initialisationOutputTextArea);

        initialisationEditorSplitPane.setRightComponent(initialisationOutputScrollPane);

        increaseInitialisationFontSizeButton.setText("<html><small>A</small>A</html>");
        increaseInitialisationFontSizeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                increaseInitialisationFontSizeButtonActionPerformed(evt);
            }
        });

        decreaseInitialisationFontSizeButton.setText("<html>A<small>A</small></html>");
        decreaseInitialisationFontSizeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                decreaseInitialisationFontSizeButtonActionPerformed(evt);
            }
        });

        initialisationSaveButton.setText("Save");
        initialisationSaveButton.setEnabled(false);
        initialisationSaveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                initialisationSaveButtonActionPerformed(evt);
            }
        });

        initialisationReloadButton.setText("Reload");
        initialisationReloadButton.setEnabled(false);
        initialisationReloadButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                initialisationReloadButtonActionPerformed(evt);
            }
        });

        initialisationHelpButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ch/zhaw/iamp/rct/ui/help.png"))); // NOI18N
        initialisationHelpButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                initialisationHelpButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout initialisationEditorPanelLayout = new javax.swing.GroupLayout(initialisationEditorPanel);
        initialisationEditorPanel.setLayout(initialisationEditorPanelLayout);
        initialisationEditorPanelLayout.setHorizontalGroup(
            initialisationEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(initialisationEditorPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(initialisationEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(initialisationEditorPanelLayout.createSequentialGroup()
                        .addComponent(initialisationFileTextField)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(initialisationFileSelectButton))
                    .addComponent(initialisationEditorSplitPane)
                    .addGroup(initialisationEditorPanelLayout.createSequentialGroup()
                        .addComponent(increaseInitialisationFontSizeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(decreaseInitialisationFontSizeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(initialisationHelpButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 240, Short.MAX_VALUE)
                        .addComponent(initialisationSaveButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(initialisationReloadButton)))
                .addContainerGap())
        );
        initialisationEditorPanelLayout.setVerticalGroup(
            initialisationEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(initialisationEditorPanelLayout.createSequentialGroup()
                .addGap(6, 6, 6)
                .addGroup(initialisationEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(initialisationFileTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(initialisationFileSelectButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(initialisationEditorSplitPane)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(initialisationEditorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(increaseInitialisationFontSizeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(decreaseInitialisationFontSizeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(initialisationSaveButton)
                    .addComponent(initialisationReloadButton)
                    .addComponent(initialisationHelpButton))
                .addGap(6, 6, 6))
        );

        editorWrapperSplitPane.setBottomComponent(initialisationEditorPanel);

        javax.swing.GroupLayout editorWrapperPanelLayout = new javax.swing.GroupLayout(editorWrapperPanel);
        editorWrapperPanel.setLayout(editorWrapperPanelLayout);
        editorWrapperPanelLayout.setHorizontalGroup(
            editorWrapperPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(editorWrapperSplitPane, javax.swing.GroupLayout.Alignment.TRAILING)
        );
        editorWrapperPanelLayout.setVerticalGroup(
            editorWrapperPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(editorWrapperSplitPane)
        );

        grammarSplitPane.setLeftComponent(editorWrapperPanel);

        visualisationPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Visualisation"));
        visualisationPanel.setMinimumSize(new java.awt.Dimension(100, 0));
        visualisationPanel.setPreferredSize(new java.awt.Dimension(100, 47));

        graphPanelWrapper.setPreferredSize(new java.awt.Dimension(100, 0));
        graphPanelWrapper.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
            public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
                graphPanelWrapperMouseWheelMoved(evt);
            }
        });
        graphPanelWrapper.setLayout(new javax.swing.BoxLayout(graphPanelWrapper, javax.swing.BoxLayout.LINE_AXIS));

        coordinatesLabel.setText("Coordinates (x/y):");

        coordinates.setText("-/-");

        generateButton.setText("Generate");
        generateButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                generateButtonActionPerformed(evt);
            }
        });

        zoomSlider.setMaximum(300);
        zoomSlider.setMinimum(50);
        zoomSlider.setValue(100);
        zoomSlider.setMaximumSize(new java.awt.Dimension(32767, 20));
        zoomSlider.setMinimumSize(new java.awt.Dimension(38, 20));
        zoomSlider.setPreferredSize(new java.awt.Dimension(204, 22));
        zoomSlider.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
            public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
                zoomSliderMouseWheelMoved(evt);
            }
        });
        zoomSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                zoomSliderStateChanged(evt);
            }
        });

        zoomValue.setText("100");

        javax.swing.GroupLayout visualisationPanelLayout = new javax.swing.GroupLayout(visualisationPanel);
        visualisationPanel.setLayout(visualisationPanelLayout);
        visualisationPanelLayout.setHorizontalGroup(
            visualisationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(visualisationPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(visualisationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(visualisationPanelLayout.createSequentialGroup()
                        .addComponent(graphPanelWrapper, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(visualisationPanelLayout.createSequentialGroup()
                        .addComponent(coordinatesLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(coordinates)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(generateButton)
                        .addGap(18, 18, 18)
                        .addComponent(zoomValue)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(zoomSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))))
        );
        visualisationPanelLayout.setVerticalGroup(
            visualisationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(visualisationPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(graphPanelWrapper, javax.swing.GroupLayout.DEFAULT_SIZE, 355, Short.MAX_VALUE)
                .addGap(8, 8, 8)
                .addGroup(visualisationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(visualisationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(coordinatesLabel)
                        .addComponent(coordinates)
                        .addComponent(zoomValue)
                        .addComponent(generateButton))
                    .addComponent(zoomSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        grammarSplitPane.setRightComponent(visualisationPanel);

        loadGraphButton.setText("Load Graph...");
        loadGraphButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                loadGraphButtonActionPerformed(evt);
            }
        });

        saveAndUseButton.setText("Save and Use");
        saveAndUseButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveAndUseButtonActionPerformed(evt);
            }
        });

        closeButton.setText("Close");
        closeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                closeButtonActionPerformed(evt);
            }
        });

        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(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(loadGraphButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(saveAndUseButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(closeButton)
                .addContainerGap())
            .addComponent(grammarSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 968, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(grammarSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(closeButton)
                    .addComponent(saveAndUseButton)
                    .addComponent(loadGraphButton))
                .addContainerGap())
        );

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