/* * Copyright (c) 2012 Sam Harwell, Tunnel Vision Laboratories LLC * All rights reserved. * * The source code of this document is proprietary work, and is not licensed for * distribution. For information about licensing, contact Sam Harwell at: * sam@tunnelvisionlabs.com */ package org.antlr.works.editor.grammar.codegen; import javax.swing.JPanel; public final class CodeGeneratorVisualPanel3 extends JPanel { private final CodeGeneratorWizardPanel3 _wizardPanel; /** * Creates new form CodeGeneratorVisualPanel3 */ public CodeGeneratorVisualPanel3() { this(null); } public CodeGeneratorVisualPanel3(CodeGeneratorWizardPanel3 wizardPanel) { initComponents(); _wizardPanel = wizardPanel; if (wizardPanel != null) { setGenerateATNDiagrams(wizardPanel.isGenerateATNDiagrams()); setDebugST(wizardPanel.isDebugST()); setForceATN(wizardPanel.isForceATN()); setTreatWarningsAsErrors(wizardPanel.isTreatWarningsAsErrors()); } } public boolean isGenerateATNDiagrams() { return chkATNDiagrams.isSelected(); } public void setGenerateATNDiagrams(boolean value) { chkATNDiagrams.setSelected(value); } public boolean isDebugST() { return chkDebugST.isSelected(); } public void setDebugST(boolean value) { chkDebugST.setSelected(value); } public boolean isForceATN() { return chkForceATN.isSelected(); } public void setForceATN(boolean value) { chkForceATN.setSelected(value); } public boolean isTreatWarningsAsErrors() { return chkTreatWarningsAsErrors.isSelected(); } public void setTreatWarningsAsErrors(boolean value) { chkTreatWarningsAsErrors.setSelected(value); } @Override public String getName() { return "Advanced"; } private void fireChange() { if (_wizardPanel != null) { _wizardPanel.getChangeSupport().fireChange(); } } /** * 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() { javax.swing.JPanel jPanel1 = new javax.swing.JPanel(); chkForceATN = new javax.swing.JCheckBox(); chkTreatWarningsAsErrors = new javax.swing.JCheckBox(); javax.swing.JPanel jPanel2 = new javax.swing.JPanel(); chkATNDiagrams = new javax.swing.JCheckBox(); chkDebugST = new javax.swing.JCheckBox(); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(CodeGeneratorVisualPanel3.class, "CodeGeneratorVisualPanel3.jPanel1.border.title"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(chkForceATN, org.openide.util.NbBundle.getMessage(CodeGeneratorVisualPanel3.class, "CodeGeneratorVisualPanel3.chkForceATN.text")); // NOI18N chkForceATN.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { chkForceATNActionPerformed(evt); } }); org.openide.awt.Mnemonics.setLocalizedText(chkTreatWarningsAsErrors, org.openide.util.NbBundle.getMessage(CodeGeneratorVisualPanel3.class, "CodeGeneratorVisualPanel3.chkTreatWarningsAsErrors.text")); // NOI18N chkTreatWarningsAsErrors.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { chkTreatWarningsAsErrorsActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(chkForceATN) .addComponent(chkTreatWarningsAsErrors)) .addGap(0, 0, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(chkForceATN) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(chkTreatWarningsAsErrors) .addGap(0, 0, Short.MAX_VALUE)) ); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(CodeGeneratorVisualPanel3.class, "CodeGeneratorVisualPanel3.jPanel2.border.title"))); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(chkATNDiagrams, org.openide.util.NbBundle.getMessage(CodeGeneratorVisualPanel3.class, "CodeGeneratorVisualPanel3.chkATNDiagrams.text")); // NOI18N chkATNDiagrams.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { chkATNDiagramsActionPerformed(evt); } }); org.openide.awt.Mnemonics.setLocalizedText(chkDebugST, org.openide.util.NbBundle.getMessage(CodeGeneratorVisualPanel3.class, "CodeGeneratorVisualPanel3.chkDebugST.text")); // NOI18N chkDebugST.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { chkDebugSTActionPerformed(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(chkATNDiagrams) .addComponent(chkDebugST)) .addGap(0, 0, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(chkATNDiagrams) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(chkDebugST) .addGap(0, 0, Short.MAX_VALUE)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(48, Short.MAX_VALUE)) ); }// </editor-fold>//GEN-END:initComponents private void chkForceATNActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkForceATNActionPerformed fireChange(); }//GEN-LAST:event_chkForceATNActionPerformed private void chkTreatWarningsAsErrorsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkTreatWarningsAsErrorsActionPerformed fireChange(); }//GEN-LAST:event_chkTreatWarningsAsErrorsActionPerformed private void chkATNDiagramsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkATNDiagramsActionPerformed fireChange(); }//GEN-LAST:event_chkATNDiagramsActionPerformed private void chkDebugSTActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkDebugSTActionPerformed fireChange(); }//GEN-LAST:event_chkDebugSTActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JCheckBox chkATNDiagrams; private javax.swing.JCheckBox chkDebugST; private javax.swing.JCheckBox chkForceATN; private javax.swing.JCheckBox chkTreatWarningsAsErrors; // End of variables declaration//GEN-END:variables }