package de.unisiegen.gtitool.ui.netbeans; import javax.swing.JDialog; import javax.swing.JFrame; import de.unisiegen.gtitool.ui.logic.ProductionDialog; import de.unisiegen.gtitool.ui.netbeans.interfaces.GUIClass; /** * The production dialog form. * * @author Benjamin Mies * @author Christian Fehler * @version $Id$ */ @SuppressWarnings({ "all" }) public class ProductionDialogForm extends JDialog implements GUIClass <ProductionDialog> { /** * The serial version uid. */ private static final long serialVersionUID = 8316002721568381761L; /** * The {@link ProductionDialog}. */ private ProductionDialog logic; /** * Allocates a new {@link ProductionDialogForm}. * * @param logic The {@link ProductionDialog}. * @param parent The parent {@link JFrame}. */ public ProductionDialogForm(ProductionDialog logic, JFrame parent) { super(parent, true); this.logic = logic; initComponents(); } /** * {@inheritDoc} * * @see GUIClass#getLogic() */ public final ProductionDialog getLogic () { return this.logic; } /** 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. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; jGTILabelNonterminalSymbol = new de.unisiegen.gtitool.ui.swing.JGTILabel(); jGTIScrollPaneAlphabet = new de.unisiegen.gtitool.ui.swing.JGTIScrollPane(); jGTIList = new de.unisiegen.gtitool.ui.swing.JGTIList(); jGTIPanelAlphabets = new de.unisiegen.gtitool.ui.swing.JGTIPanel(); jGTILabelNonterminalAlphabet = new de.unisiegen.gtitool.ui.swing.JGTILabel(); jGTILabelTerminalAlphabet = new de.unisiegen.gtitool.ui.swing.JGTILabel(); styledNonterminalSymbolSetParserPanel = new de.unisiegen.gtitool.ui.style.StyledNonterminalSymbolSetParserPanel(); styledTerminalSymbolSetParserPanel = new de.unisiegen.gtitool.ui.style.StyledTerminalSymbolSetParserPanel(); jGTILabelProductionWord = new de.unisiegen.gtitool.ui.swing.JGTILabel(); styledProductionWordParserPanel = new de.unisiegen.gtitool.ui.style.StyledProductionWordParserPanel(); jGTILabelResultingProduction = new de.unisiegen.gtitool.ui.swing.JGTILabel(); styledProductionParserPanel = new de.unisiegen.gtitool.ui.style.StyledProductionParserPanel(); jGTIPanelButtons = new de.unisiegen.gtitool.ui.swing.JGTIPanel(); jGTIButtonOk = new de.unisiegen.gtitool.ui.swing.JGTIButton(); jGTIButtonCancel = new de.unisiegen.gtitool.ui.swing.JGTIButton(); jGTIColumn0 = new de.unisiegen.gtitool.ui.swing.JGTIPanel(); jGTIColumn1 = new de.unisiegen.gtitool.ui.swing.JGTIPanel(); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("de/unisiegen/gtitool/ui/i18n/messages"); // NOI18N setTitle(bundle.getString("ProductionDialog.Title")); // NOI18N setResizable(false); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } }); getContentPane().setLayout(new java.awt.GridBagLayout()); jGTILabelNonterminalSymbol.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jGTILabelNonterminalSymbol.setText(bundle.getString("ProductionDialog.NonTerminalSymbol")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(16, 16, 5, 16); getContentPane().add(jGTILabelNonterminalSymbol, gridBagConstraints); jGTIList.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent evt) { handleSelectionChange(evt); } }); jGTIScrollPaneAlphabet.setViewportView(jGTIList); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 16, 5, 16); getContentPane().add(jGTIScrollPaneAlphabet, gridBagConstraints); jGTILabelNonterminalAlphabet.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jGTILabelNonterminalAlphabet.setText(bundle.getString("ProductionDialog.NonTerminalAlphabet")); // NOI18N jGTILabelNonterminalAlphabet.setMinimumSize(new java.awt.Dimension(150, 15)); jGTILabelNonterminalAlphabet.setPreferredSize(new java.awt.Dimension(150, 15)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 16); jGTIPanelAlphabets.add(jGTILabelNonterminalAlphabet, gridBagConstraints); jGTILabelTerminalAlphabet.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jGTILabelTerminalAlphabet.setText(bundle.getString("ProductionDialog.TerminalAlphabet")); // NOI18N jGTILabelTerminalAlphabet.setMinimumSize(new java.awt.Dimension(150, 15)); jGTILabelTerminalAlphabet.setPreferredSize(new java.awt.Dimension(150, 15)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 16, 0, 0); jGTIPanelAlphabets.add(jGTILabelTerminalAlphabet, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 16, 5, 16); getContentPane().add(jGTIPanelAlphabets, gridBagConstraints); styledNonterminalSymbolSetParserPanel.setCopyable(true); styledNonterminalSymbolSetParserPanel.setEditable(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 0.25; gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 16); getContentPane().add(styledNonterminalSymbolSetParserPanel, gridBagConstraints); styledTerminalSymbolSetParserPanel.setCopyable(true); styledTerminalSymbolSetParserPanel.setEditable(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 0.25; gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 16); getContentPane().add(styledTerminalSymbolSetParserPanel, gridBagConstraints); jGTILabelProductionWord.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jGTILabelProductionWord.setText(bundle.getString("ProductionDialog.ProductionWord")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 16, 5, 16); getContentPane().add(jGTILabelProductionWord, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 5; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 16); getContentPane().add(styledProductionWordParserPanel, gridBagConstraints); jGTILabelResultingProduction.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jGTILabelResultingProduction.setText(bundle.getString("ProductionDialog.ResultingProduction")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 6; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 16, 5, 16); getContentPane().add(jGTILabelResultingProduction, gridBagConstraints); styledProductionParserPanel.setEditable(false); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 7; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 0.25; gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 16); getContentPane().add(styledProductionParserPanel, gridBagConstraints); jGTIButtonOk.setMnemonic(java.util.ResourceBundle.getBundle("de/unisiegen/gtitool/ui/i18n/messages").getString("ProductionDialog.OkMnemonic").charAt(0)); jGTIButtonOk.setText(bundle.getString("ProductionDialog.Ok")); // NOI18N jGTIButtonOk.setToolTipText(bundle.getString("ProductionDialog.OkToolTip")); // NOI18N jGTIButtonOk.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jGTIButtonOkActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 8; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5); jGTIPanelButtons.add(jGTIButtonOk, gridBagConstraints); jGTIButtonCancel.setMnemonic(java.util.ResourceBundle.getBundle("de/unisiegen/gtitool/ui/i18n/messages").getString("ProductionDialog.CancelMnemonic").charAt(0)); jGTIButtonCancel.setText(bundle.getString("ProductionDialog.Cancel")); // NOI18N jGTIButtonCancel.setToolTipText(bundle.getString("ProductionDialog.CancelToolTip")); // NOI18N jGTIButtonCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jGTIButtonCancelActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 8; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0); jGTIPanelButtons.add(jGTIButtonCancel, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 8; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 16, 0, 16); getContentPane().add(jGTIPanelButtons, gridBagConstraints); jGTIColumn0.setMinimumSize(new java.awt.Dimension(200, 16)); jGTIColumn0.setPreferredSize(new java.awt.Dimension(200, 16)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 9; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; getContentPane().add(jGTIColumn0, gridBagConstraints); jGTIColumn1.setMinimumSize(new java.awt.Dimension(200, 16)); jGTIColumn1.setPreferredSize(new java.awt.Dimension(200, 16)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 9; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; getContentPane().add(jGTIColumn1, gridBagConstraints); java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); setBounds((screenSize.width-400)/2, (screenSize.height-500)/2, 400, 500); }// </editor-fold>//GEN-END:initComponents private void handleSelectionChange(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_handleSelectionChange this.logic.handleListSelectionChanged(); }//GEN-LAST:event_handleSelectionChange private void jGTIButtonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jGTIButtonCancelActionPerformed this.logic.handleCancel(); }//GEN-LAST:event_jGTIButtonCancelActionPerformed private void jGTIButtonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jGTIButtonOkActionPerformed this.logic.handleOk(); }//GEN-LAST:event_jGTIButtonOkActionPerformed private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing this.logic.handleCancel(); }//GEN-LAST:event_formWindowClosing // Variables declaration - do not modify//GEN-BEGIN:variables public de.unisiegen.gtitool.ui.swing.JGTIButton jGTIButtonCancel; public de.unisiegen.gtitool.ui.swing.JGTIButton jGTIButtonOk; public de.unisiegen.gtitool.ui.swing.JGTIPanel jGTIColumn0; public de.unisiegen.gtitool.ui.swing.JGTIPanel jGTIColumn1; public de.unisiegen.gtitool.ui.swing.JGTILabel jGTILabelNonterminalAlphabet; public de.unisiegen.gtitool.ui.swing.JGTILabel jGTILabelNonterminalSymbol; public de.unisiegen.gtitool.ui.swing.JGTILabel jGTILabelProductionWord; public de.unisiegen.gtitool.ui.swing.JGTILabel jGTILabelResultingProduction; public de.unisiegen.gtitool.ui.swing.JGTILabel jGTILabelTerminalAlphabet; public de.unisiegen.gtitool.ui.swing.JGTIList jGTIList; public de.unisiegen.gtitool.ui.swing.JGTIPanel jGTIPanelAlphabets; public de.unisiegen.gtitool.ui.swing.JGTIPanel jGTIPanelButtons; public de.unisiegen.gtitool.ui.swing.JGTIScrollPane jGTIScrollPaneAlphabet; public de.unisiegen.gtitool.ui.style.StyledNonterminalSymbolSetParserPanel styledNonterminalSymbolSetParserPanel; public de.unisiegen.gtitool.ui.style.StyledProductionParserPanel styledProductionParserPanel; public de.unisiegen.gtitool.ui.style.StyledProductionWordParserPanel styledProductionWordParserPanel; public de.unisiegen.gtitool.ui.style.StyledTerminalSymbolSetParserPanel styledTerminalSymbolSetParserPanel; // End of variables declaration//GEN-END:variables }