From 31a248662bd0ae5689806569edf07e6eeaf4573b Mon Sep 17 00:00:00 2001 From: Waverunner Date: Fri, 12 Sep 2014 10:10:42 -0400 Subject: [PATCH] Fixed persistence issues when restarting the program, Improved the compile wizard allowing indent settings and comment settings, Fixed end conversations not being generated properly. --- ConversationCompiler/build.xml | 8 - ConversationCompiler/manifest.mf | 5 - ConversationCompiler/nbproject/build-impl.xml | 45 ---- .../nbproject/genfiles.properties | 8 - .../nbproject/project.properties | 5 - ConversationCompiler/nbproject/project.xml | 69 ------- .../nbproject/suite.properties | 1 - .../tools/csc/compiler/Bundle.properties | 1 - .../csc/compiler/wizard/Bundle.properties | 9 - .../compiler/wizard/CompileVisualPanel1.form | 158 -------------- .../compiler/wizard/CompileVisualPanel1.java | 155 -------------- .../compiler/wizard/CompileWizardAction.java | 72 ------- .../compiler/wizard/CompileWizardPanel1.java | 63 ------ .../csc/compiler/wizard/csc_wizard_bg.png | Bin 31994 -> 0 bytes .../csc/conversationeditor}/Compiler.java | 95 ++++++--- .../EditorTopComponent.java | 29 ++- .../csc/conversationeditor/SceneSaver.java | 1 - .../csc/conversationeditor/SceneView.java | 13 +- .../actions/NewConversation.java | 4 +- .../actions/OpenConversation.java | 10 +- .../actions/SaveConversation.java | 2 +- .../tools/csc/conversationeditor/layer.xml | 17 +- .../wizard/Bundle.properties | 15 ++ .../wizard/CompileVisualPanel1.form | 112 ++++++++++ .../wizard/CompileVisualPanel1.java | 152 ++++++++++++++ .../wizard/CompileVisualPanel2.form | 188 +++++++++++++++++ .../wizard/CompileVisualPanel2.java | 193 ++++++++++++++++++ .../wizard/CompileWizardAction.java | 98 +++++++++ .../wizard/CompileWizardPanel1.java | 132 ++++++++++++ .../wizard/CompileWizardPanel2.java | 154 ++++++++++++++ nbproject/project.properties | 4 +- 31 files changed, 1159 insertions(+), 659 deletions(-) delete mode 100644 ConversationCompiler/build.xml delete mode 100644 ConversationCompiler/manifest.mf delete mode 100644 ConversationCompiler/nbproject/build-impl.xml delete mode 100644 ConversationCompiler/nbproject/genfiles.properties delete mode 100644 ConversationCompiler/nbproject/project.properties delete mode 100644 ConversationCompiler/nbproject/project.xml delete mode 100644 ConversationCompiler/nbproject/suite.properties delete mode 100644 ConversationCompiler/src/com/projectswg/tools/csc/compiler/Bundle.properties delete mode 100644 ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/Bundle.properties delete mode 100644 ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileVisualPanel1.form delete mode 100644 ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileVisualPanel1.java delete mode 100644 ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileWizardAction.java delete mode 100644 ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileWizardPanel1.java delete mode 100644 ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/csc_wizard_bg.png rename {ConversationCompiler/src/com/projectswg/tools/csc/compiler => ConversationEditor/src/com/projectswg/tools/csc/conversationeditor}/Compiler.java (61%) create mode 100644 ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/Bundle.properties create mode 100644 ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel1.form create mode 100644 ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel1.java create mode 100644 ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel2.form create mode 100644 ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel2.java create mode 100644 ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileWizardAction.java create mode 100644 ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileWizardPanel1.java create mode 100644 ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileWizardPanel2.java diff --git a/ConversationCompiler/build.xml b/ConversationCompiler/build.xml deleted file mode 100644 index ea549b7..0000000 --- a/ConversationCompiler/build.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - Builds, tests, and runs the project com.projectswg.tools.csc.compiler. - - diff --git a/ConversationCompiler/manifest.mf b/ConversationCompiler/manifest.mf deleted file mode 100644 index c928f8f..0000000 --- a/ConversationCompiler/manifest.mf +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -OpenIDE-Module: com.projectswg.tools.csc.compiler -OpenIDE-Module-Localizing-Bundle: com/projectswg/tools/csc/compiler/Bundle.properties -OpenIDE-Module-Specification-Version: 1.0 - diff --git a/ConversationCompiler/nbproject/build-impl.xml b/ConversationCompiler/nbproject/build-impl.xml deleted file mode 100644 index 6e6aa5e..0000000 --- a/ConversationCompiler/nbproject/build-impl.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - You must set 'suite.dir' to point to your containing module suite - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ConversationCompiler/nbproject/genfiles.properties b/ConversationCompiler/nbproject/genfiles.properties deleted file mode 100644 index 29e95dc..0000000 --- a/ConversationCompiler/nbproject/genfiles.properties +++ /dev/null @@ -1,8 +0,0 @@ -build.xml.data.CRC32=beb6af21 -build.xml.script.CRC32=16594606 -build.xml.stylesheet.CRC32=a56c6a5b@2.66.1 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=beb6af21 -nbproject/build-impl.xml.script.CRC32=bd99f65f -nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.66.1 diff --git a/ConversationCompiler/nbproject/project.properties b/ConversationCompiler/nbproject/project.properties deleted file mode 100644 index 8377ca3..0000000 --- a/ConversationCompiler/nbproject/project.properties +++ /dev/null @@ -1,5 +0,0 @@ -javac.source=1.7 -javac.compilerargs=-Xlint -Xlint:-serial -license.file=../LICENSE -nbm.homepage=http://www.projectswg.com -nbm.module.author=Waverunner diff --git a/ConversationCompiler/nbproject/project.xml b/ConversationCompiler/nbproject/project.xml deleted file mode 100644 index b082702..0000000 --- a/ConversationCompiler/nbproject/project.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - org.netbeans.modules.apisupport.project - - - com.projectswg.tools.csc.compiler - - - - com.projectswg.tools.csc.conversationeditor - - - - 1.0 - - - - org.netbeans.api.visual - - - - 2.42.1 - - - - org.openide.awt - - - - 7.61.2 - - - - org.openide.dialogs - - - - 7.36.1 - - - - org.openide.nodes - - - - 7.38.1 - - - - org.openide.util - - - - 8.37.1 - - - - org.openide.windows - - - - 6.70.1 - - - - - - - diff --git a/ConversationCompiler/nbproject/suite.properties b/ConversationCompiler/nbproject/suite.properties deleted file mode 100644 index 29d7cc9..0000000 --- a/ConversationCompiler/nbproject/suite.properties +++ /dev/null @@ -1 +0,0 @@ -suite.dir=${basedir}/.. diff --git a/ConversationCompiler/src/com/projectswg/tools/csc/compiler/Bundle.properties b/ConversationCompiler/src/com/projectswg/tools/csc/compiler/Bundle.properties deleted file mode 100644 index 99a6c2f..0000000 --- a/ConversationCompiler/src/com/projectswg/tools/csc/compiler/Bundle.properties +++ /dev/null @@ -1 +0,0 @@ -OpenIDE-Module-Name=Conversation Compiler diff --git a/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/Bundle.properties b/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/Bundle.properties deleted file mode 100644 index 21a26e1..0000000 --- a/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/Bundle.properties +++ /dev/null @@ -1,9 +0,0 @@ -CompileVisualPanel1.jLabel1.text=Location -CompileVisualPanel1.jLabel2.text=Please select the location where you wish to build the script to. -CompileVisualPanel1.btnBrowse.text=Browse -CompileVisualPanel1.txtLocation.text= -CompileVisualPanel1.jLabel3.text=Script Name -CompileVisualPanel1.txtName.text=conversation_script -CompileVisualPanel1.jLabel4.text=Enter a name for the compiled script. This should not include any extensions (ex: .py) -CompileVisualPanel1.jLabel5.text=Script will be built to: -CompileVisualPanel1.txtBuildLoc.text= diff --git a/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileVisualPanel1.form b/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileVisualPanel1.form deleted file mode 100644 index b8e3267..0000000 --- a/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileVisualPanel1.form +++ /dev/null @@ -1,158 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileVisualPanel1.java b/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileVisualPanel1.java deleted file mode 100644 index 27c3692..0000000 --- a/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileVisualPanel1.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.projectswg.tools.csc.compiler.wizard; - -import javax.swing.JFileChooser; -import javax.swing.JPanel; - -public final class CompileVisualPanel1 extends JPanel { - - /** - * Creates new form CompileVisualPanel1 - */ - public CompileVisualPanel1() { - initComponents(); - } - - @Override - public String getName() { - return "Select Location"; - } - - /** - * 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. - */ - // //GEN-BEGIN:initComponents - private void initComponents() { - - jLabel1 = new javax.swing.JLabel(); - txtLocation = new javax.swing.JTextField(); - btnBrowse = new javax.swing.JButton(); - jLabel2 = new javax.swing.JLabel(); - jLabel3 = new javax.swing.JLabel(); - txtName = new javax.swing.JTextField(); - jLabel4 = new javax.swing.JLabel(); - jLabel5 = new javax.swing.JLabel(); - txtBuildLoc = new javax.swing.JTextField(); - - org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(CompileVisualPanel1.class, "CompileVisualPanel1.jLabel1.text")); // NOI18N - - txtLocation.setEditable(false); - txtLocation.setText(org.openide.util.NbBundle.getMessage(CompileVisualPanel1.class, "CompileVisualPanel1.txtLocation.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(btnBrowse, org.openide.util.NbBundle.getMessage(CompileVisualPanel1.class, "CompileVisualPanel1.btnBrowse.text")); // NOI18N - btnBrowse.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnBrowseActionPerformed(evt); - } - }); - - jLabel2.setLabelFor(txtLocation); - org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(CompileVisualPanel1.class, "CompileVisualPanel1.jLabel2.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(CompileVisualPanel1.class, "CompileVisualPanel1.jLabel3.text")); // NOI18N - - txtName.setText(org.openide.util.NbBundle.getMessage(CompileVisualPanel1.class, "CompileVisualPanel1.txtName.text")); // NOI18N - txtName.addKeyListener(new java.awt.event.KeyAdapter() { - public void keyTyped(java.awt.event.KeyEvent evt) { - txtNameKeyTyped(evt); - } - }); - - jLabel4.setLabelFor(txtName); - org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(CompileVisualPanel1.class, "CompileVisualPanel1.jLabel4.text")); // NOI18N - - org.openide.awt.Mnemonics.setLocalizedText(jLabel5, org.openide.util.NbBundle.getMessage(CompileVisualPanel1.class, "CompileVisualPanel1.jLabel5.text")); // NOI18N - - txtBuildLoc.setEditable(false); - txtBuildLoc.setText(org.openide.util.NbBundle.getMessage(CompileVisualPanel1.class, "CompileVisualPanel1.txtBuildLoc.text")); // NOI18N - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(jLabel3) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(txtName)) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(jLabel5) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(txtBuildLoc)) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(jLabel1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(txtLocation, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(btnBrowse, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(jLabel2) - .addComponent(jLabel4)) - .addGap(0, 0, Short.MAX_VALUE)))) - .addContainerGap()) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel2) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(btnBrowse) - .addComponent(txtLocation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel1)) - .addGap(14, 14, 14) - .addComponent(jLabel4) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel3) - .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(48, 48, 48) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel5) - .addComponent(txtBuildLoc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(124, Short.MAX_VALUE)) - ); - }// //GEN-END:initComponents - - private void btnBrowseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBrowseActionPerformed - JFileChooser chooser = new JFileChooser(); - chooser.setDialogTitle("Select Location"); - chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - int returnVal = chooser.showDialog(this, "Select"); - if (returnVal == JFileChooser.APPROVE_OPTION) { - txtLocation.setText(chooser.getSelectedFile().getPath()); - txtBuildLoc.setText(txtLocation.getText() + "\\" + txtName.getText() + ".py"); - } - }//GEN-LAST:event_btnBrowseActionPerformed - - private void txtNameKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtNameKeyTyped - txtBuildLoc.setText(txtLocation.getText() + "\\" + txtName.getText() + ".py"); - }//GEN-LAST:event_txtNameKeyTyped - - public String getBuildLocation() { - return txtBuildLoc.getText(); - } - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton btnBrowse; - private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel2; - private javax.swing.JLabel jLabel3; - private javax.swing.JLabel jLabel4; - private javax.swing.JLabel jLabel5; - private javax.swing.JTextField txtBuildLoc; - private javax.swing.JTextField txtLocation; - private javax.swing.JTextField txtName; - // End of variables declaration//GEN-END:variables -} diff --git a/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileWizardAction.java b/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileWizardAction.java deleted file mode 100644 index 9ee66cc..0000000 --- a/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileWizardAction.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.projectswg.tools.csc.compiler.wizard; - -import com.projectswg.tools.csc.compiler.Compiler; -import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; -import java.io.IOException; -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.List; -import javax.swing.JComponent; -import org.openide.DialogDisplayer; -import org.openide.NotifyDescriptor; -import org.openide.WizardDescriptor; -import org.openide.awt.ActionID; -import org.openide.awt.ActionReference; -import org.openide.awt.ActionRegistration; -import org.openide.util.Exceptions; -import org.openide.util.ImageUtilities; - -@ActionID(category="...", id="com.projectswg.tools.csc.compiler.wizard.CompileWizardAction") -@ActionRegistration(displayName="Create Script") -@ActionReference(path="Menu/File") -public final class CompileWizardAction implements ActionListener { - - @Override - public void actionPerformed(ActionEvent e) { - List> panels = new ArrayList<>(); - CompileWizardPanel1 compilePanel = new CompileWizardPanel1(); - panels.add(compilePanel); - String[] steps = new String[panels.size()]; - for (int i = 0; i < panels.size(); i++) { - Component c = panels.get(i).getComponent(); - // Default step name to component name of panel. - steps[i] = c.getName(); - if (c instanceof JComponent) { // assume Swing components - JComponent jc = (JComponent) c; - jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i); - jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); - jc.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, true); - jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, true); - jc.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, true); - } - } - WizardDescriptor wiz = new WizardDescriptor(new WizardDescriptor.ArrayIterator<>(panels)); - // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName() - wiz.setTitleFormat(new MessageFormat("{0}")); - wiz.setTitle("Compile Conversation Script"); - wiz.putProperty(WizardDescriptor.PROP_IMAGE, ImageUtilities.loadImage("com/projectswg/tools/csc/compiler/wizard/csc_wizard_bg.png")); - - if (DialogDisplayer.getDefault().notify(wiz) == WizardDescriptor.FINISH_OPTION) { - File file = new File(compilePanel.getComponent().getBuildLocation()); - - if (file.exists()) { - DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message("Script already exists: " + file.getAbsolutePath(), NotifyDescriptor.ERROR_MESSAGE)); - } else { - Compiler compiler = new Compiler(file); - try { - compiler.compile(); - } catch (IOException ex) { - Exceptions.printStackTrace(ex); - } - } - } - } -} \ No newline at end of file diff --git a/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileWizardPanel1.java b/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileWizardPanel1.java deleted file mode 100644 index f755e24..0000000 --- a/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/CompileWizardPanel1.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.projectswg.tools.csc.compiler.wizard; - -import javax.swing.event.ChangeListener; -import org.openide.WizardDescriptor; -import org.openide.util.HelpCtx; - -public class CompileWizardPanel1 implements WizardDescriptor.Panel { - - private CompileVisualPanel1 component; - - // Get the visual component for the panel. In this template, the component - // is kept separate. This can be more efficient: if the wizard is created - // but never displayed, or not all panels are displayed, it is better to - // create only those which really need to be visible. - @Override - public CompileVisualPanel1 getComponent() { - if (component == null) { - component = new CompileVisualPanel1(); - } - return component; - } - - @Override - public HelpCtx getHelp() { - // Show no Help button for this panel: - return HelpCtx.DEFAULT_HELP; - // If you have context help: - // return new HelpCtx("help.key.here"); - } - - @Override - public boolean isValid() { - // If it is always OK to press Next or Finish, then: - return true; - // If it depends on some condition (form filled out...) and - // this condition changes (last form field filled in...) then - // use ChangeSupport to implement add/removeChangeListener below. - // WizardDescriptor.ERROR/WARNING/INFORMATION_MESSAGE will also be useful. - } - - @Override - public void addChangeListener(ChangeListener l) { - } - - @Override - public void removeChangeListener(ChangeListener l) { - } - - @Override - public void readSettings(WizardDescriptor wiz) { - // use wiz.getProperty to retrieve previous panel state - } - - @Override - public void storeSettings(WizardDescriptor wiz) { - // use wiz.putProperty to remember current panel state - } -} diff --git a/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/csc_wizard_bg.png b/ConversationCompiler/src/com/projectswg/tools/csc/compiler/wizard/csc_wizard_bg.png deleted file mode 100644 index 75c76d6bd8e1a8f5b97fd247f8cbf9386777ec4e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 31994 zcmeIb1z1(v7U;j|?go+W+MDi91tbMTh0SIYA`Mc~ZGfnB3KAj$A`;ReAsr&!CEXow zb3C5o;hxL8@7?$RzkA;Y--j^QSYymNe{;;S<`~Ow6RM%Ego8<|&in6>G03aa2 zzqim);a5ZymG8lSVAv@eI066`(b+cw5SKs>0GKx{<>WLpENq=@9W89_XjSCoXzd(q z%`ET30Kj!HQQKTc`#Y(`?&y~6^$?$z*KM^(&}p?~ANvqTFtgKP;9m=&do@6!Swo

hZ7!YR(<8Wvu!6Ize&#JY$kr_K&wW_ zj#B2+6!5`*BYTx#+`qBDVPcwF+82}24!}qMU`pqB%zyywd5Md2&{v~X0tl`>Sm;2t zT6{I=O7JP(f^6(<1fKweYNrU{>*zkjfV6vkRYAOprNP?IS@g9|Wb z@t*Agd=mF!JrDrHmvkfuDG>lI5iCR=un+@sI&MBv0Q5lsvDx){5ul$70IBGiDFgY% zKy^DlRsn#H4S+O50@(m$55TyIfx#6Bhy{ohH}u5UIdbvm*x{sN3&cwqMHGAu(Yfr= z^z^u|vbL*`aS#ha5Fv5W+_i486uiFtc;lO`0FV+v0-x>Xv1>bSZhO06SP`xf*FqKQ zDZPow)X7Z8TRUk0m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r%7D!6Ut+(aCk}fE_7`)!p|&kn%m>^E@=f<`DzhOdn&Dk0+o#q}J`jk7-?siL4RpDSzZ_dfuU Ci^t9Y diff --git a/ConversationCompiler/src/com/projectswg/tools/csc/compiler/Compiler.java b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/Compiler.java similarity index 61% rename from ConversationCompiler/src/com/projectswg/tools/csc/compiler/Compiler.java rename to ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/Compiler.java index 68a4f02..a067f1f 100644 --- a/ConversationCompiler/src/com/projectswg/tools/csc/compiler/Compiler.java +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/Compiler.java @@ -1,4 +1,4 @@ -package com.projectswg.tools.csc.compiler; +package com.projectswg.tools.csc.conversationeditor; import com.projectswg.tools.csc.conversationeditor.ConversationNode; import com.projectswg.tools.csc.conversationeditor.EditorTopComponent; @@ -16,16 +16,22 @@ import org.openide.windows.TopComponent; public class Compiler { private final File file; + private boolean comments = true; + private boolean tabs = true; + private String header = ""; - public Compiler(File file) { + public Compiler(File file, boolean comments, String header, boolean tabs) { this.file = file; + this.comments = comments; + this.header = header; + this.tabs = tabs; } - public void compile() throws IOException { + public boolean compile() throws IOException { TopComponent component = TopComponent.getRegistry().getActivated(); if (component == null || !(component instanceof EditorTopComponent)) - return; + return false; EditorTopComponent editor = (EditorTopComponent) component; SceneView scene = editor.getScene(); @@ -33,7 +39,7 @@ public class Compiler { if (scene == null) { JOptionPane.showMessageDialog(null, "The scene was null! You must restart the editor in order to compile :(", "Conversation Script Creator", JOptionPane.ERROR_MESSAGE); - return; + return false; } try (BufferedWriter bw = new BufferedWriter(new FileWriter(file.getAbsolutePath()))) { @@ -42,20 +48,17 @@ public class Compiler { LinkedHashMap> conversationLinks = scene.getConversationLinks(); for (Map.Entry> entry : conversationLinks.entrySet()) { - /*System.out.println("Handling for node " + entry.getKey().getStf()); - for (ConversationNode node : entry.getValue()) { - System.out.println("Node: " + node.getStf()); - }*/ if (entry.getKey().isStartNode()) { createOptionsAndHandler(bw, entry.getKey(), entry.getValue(), 1, conversationLinks); break; } } } + return true; } private void createBaseFile(BufferedWriter bw) throws IOException { - bw.write("# Base file generated using Conversation Script Creator for ProjectSWG\n"); + if (comments && !header.isEmpty()) bw.write("#" + header + "\n"); bw.write("from resources.common import ConversationOption\n" + "from resources.common import OutOfBand\n" + @@ -71,36 +74,47 @@ public class Compiler { LinkedHashMap> conversationLinks) throws IOException { LinkedHashMap> handleFuncs = new LinkedHashMap<>(); - + bw.write("def handleOptionScreen" + handleNum + "(core, actor, npc, selection):\n"); bw.newLine(); + String indent4 = getIndent(4); + String indent8 = getIndent(8); + int count = handleNum + 1; for (ConversationNode selectedOption : options) { - bw.write(" " + (options.indexOf(selectedOption) > 0 ? "elif" : "if") + " selection == " + options.indexOf(selectedOption) + ":\n"); + bw.write(indent4 + (options.indexOf(selectedOption) > 0 ? "elif" : "if") + " selection == " + options.indexOf(selectedOption) + ":\n"); if (conversationLinks.containsKey(selectedOption)) { - bw.write(" #Handler for Option Node " + selectedOption.getId() + "\n"); + if (comments) bw.write(indent8 + "# " + (selectedOption.getDisplayText().equals("") ? selectedOption.getStf() : selectedOption.getDisplayText()) + "\n"); for (ConversationNode handleNode : conversationLinks.get(selectedOption)) { - if (!handleNode.isOption()) { + if (!handleNode.isOption() && !handleNode.isEndNode()) { if (conversationLinks.get(handleNode) == null) { - bw.write(" core.conversationService.sendStopConversation(actor, npc, 'conversation/c_newbie_secondchance', 's_136')\n"); + bw.write(indent8 + "# NULL Error printing out handle for " + handleNode.getStf()); } else { - createOptions(bw, conversationLinks.get(handleNode), count++, " "); - bw.write(" core.conversationService.sendConversationMessage(actor, npc, OutOfBand.ProsePackage('@conversation/" + createOptions(bw, conversationLinks.get(handleNode), count++, indent8); + bw.write(indent8 + "core.conversationService.sendConversationMessage(actor, npc, OutOfBand.ProsePackage('@conversation/" + handleNode.getStf() + "')\n"); handleFuncs.put(handleNode, conversationLinks.get(handleNode)); // Put these nodes in list so we can create the handlers later. } + } else if (handleNode.isEndNode()) { + if (handleNode.getStf().contains(":")) { + String[] split = handleNode.getStf().split(":"); + bw.write(indent8 + "core.conversationService.sendStopConversation(actor, npc, 'conversation/" + split[0] + "', '" + split[1] + "')\n"); + } else { + bw.write(indent8 + "# Couldn't write end response because of bad format!"); + } } } } - bw.write(" return\n"); + bw.write(indent8 + "return\n"); bw.newLine(); } - bw.write(" return\n"); + bw.write(indent4 + "return\n"); bw.newLine(); int currentHandler = handleNum + 1; for (Map.Entry> handleNode : handleFuncs.entrySet()) { + bw.write("# Handle Response for " + handleNode.getKey().getStf()); createResponseHandler(bw, handleNode.getValue(), currentHandler++, conversationLinks); } } @@ -108,26 +122,26 @@ public class Compiler { private void createOptionsAndHandler(BufferedWriter bw, ConversationNode response, ArrayList options, int handleScreenNum, LinkedHashMap> conversationLinks) throws IOException { - bw.write(" options = new Vector()\n"); + String indent4 = getIndent(4); + + bw.write(indent4 + "options = new Vector()\n"); if (options.size() > 1) { - ArrayList orderedOptions = new ArrayList<>(); - for (ConversationNode unOrdered : options) { - orderedOptions.add(unOrdered.getOptionId(), unOrdered); + for (ConversationNode option : options) { + bw.write(indent4 + "options.add(ConversationOption(OutOfBand.ProsePackage('@conversation/" + option.getStf() +"'), " + + String.valueOf(option.getOptionId()) + ")\n"); } - for (ConversationNode option : orderedOptions) { - bw.write(" options.add(ConversationOption(OutOfBand.ProsePackage('@conversation/" + option.getStf() +"'), " + options.indexOf(option) + ")\n"); - } } else { for (ConversationNode option : options) { - bw.write(" options.add(ConversationOption(OutOfBand.ProsePackage('@conversation/" + option.getStf() +"'), " + options.indexOf(option) + ")\n"); + bw.write(indent4 + "options.add(ConversationOption(OutOfBand.ProsePackage('@conversation/" + option.getStf() +"'), " + options.indexOf(option) + ")\n"); } } - bw.write(" core.conversationService.sendConversationOptions(actor, npc, handleOptionScreen" + String.valueOf(handleScreenNum) + ")\n"); - bw.write(" core.conversationService.sendConversationMessage(actor, npc, OutOfBand.ProsePackage('@conversation/" + response.getStf() + "'))\n"); - bw.write(" return\n"); + bw.write(indent4 + "core.conversationService.sendConversationOptions(actor, npc, handleOptionScreen" + String.valueOf(handleScreenNum) + ")\n"); + bw.write(indent4 + "core.conversationService.sendConversationMessage(actor, npc, OutOfBand.ProsePackage('@conversation/" + response.getStf() + "'))\n"); + bw.write(indent4 + "return\n"); bw.newLine(); + bw.write("# Handle Response for " + response.getStf()); createResponseHandler(bw, options, handleScreenNum, conversationLinks); } @@ -149,4 +163,25 @@ public class Compiler { } bw.write(space + "core.conversationService.sendConversationOptions(actor, npc, handleOptionScreen" + String.valueOf(handleScreenNum) + ")\n"); } + + private String getIndent(int length) { + String rtn = ""; + + if (!tabs) { + int i = 0; + while (i < length) { + rtn = rtn + " "; + } + } else { + switch(length) { + case 4: + rtn = "\t"; + break; + case 8: + rtn = "\t\t"; + break; + } + } + return rtn; + } } diff --git a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/EditorTopComponent.java b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/EditorTopComponent.java index fcf0cb9..243ad3e 100644 --- a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/EditorTopComponent.java +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/EditorTopComponent.java @@ -38,7 +38,6 @@ public final class EditorTopComponent extends TopComponent implements ExplorerMa private final SceneView scene; private String activePath = ""; - // New Conversation public EditorTopComponent() { initComponents(); @@ -47,8 +46,9 @@ public final class EditorTopComponent extends TopComponent implements ExplorerMa this.scene = new SceneView(mgr); scrollPane.setViewportView(scene.createView()); - associateLookup(ExplorerUtils.createLookup(mgr, getActionMap())); + associateLookup(ExplorerUtils.createLookup(mgr, getActionMap())); + //SystemAction.get(CompileWizardAction.class).setEnabled(true); } /** @@ -79,21 +79,22 @@ public final class EditorTopComponent extends TopComponent implements ExplorerMa @Override public void componentOpened() { - if (activePath.equals("")) { - // blankSlate(); - // scene.validate(); + if (activePath.isEmpty() && scene.getScenePath().isEmpty()) { + blankSlate(); return; } - File file = new File(activePath); + if (!scene.isLoaded()) { + File file = new File(activePath); - if (!file.exists()) { - JOptionPane.showMessageDialog(null, "Couldn't open conversation file " + file.getAbsolutePath() - + " because it no longer exists.", "Conversation Script Editor", JOptionPane.INFORMATION_MESSAGE); - blankSlate(); - scene.validate(); - } else { - OpenConversation.open(file, this); + if (!file.exists()) { + JOptionPane.showMessageDialog(null, "Couldn't open conversation file " + file.getAbsolutePath() + + " because it no longer exists.", "Conversation Script Editor", JOptionPane.INFORMATION_MESSAGE); + blankSlate(); + scene.validate(); + } else { + OpenConversation.open(file, this); + } } } @@ -103,12 +104,10 @@ public final class EditorTopComponent extends TopComponent implements ExplorerMa } void writeProperties(java.util.Properties p) { - //p.setProperty("version", "1.0"); p.setProperty("activePath", scene.getScenePath()); } void readProperties(java.util.Properties p) { - //String version = p.getProperty("version"); this.activePath = p.getProperty("activePath"); } diff --git a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/SceneSaver.java b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/SceneSaver.java index 9bb751a..f007a3b 100644 --- a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/SceneSaver.java +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/SceneSaver.java @@ -105,7 +105,6 @@ public class SceneSaver { @Override public void run() { deserializeNodeDataVersion1(scene, sceneXMLNode); - scene.validate (); } }); diff --git a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/SceneView.java b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/SceneView.java index 1fd2609..87c504a 100644 --- a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/SceneView.java +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/SceneView.java @@ -23,6 +23,7 @@ public class SceneView extends GraphScene{ private String name = ""; private String scenePath = ""; + private boolean loaded = false; private int id = 1; @@ -35,11 +36,11 @@ public class SceneView extends GraphScene{ mainLayer = new LayerWidget(this); addChild(mainLayer); - getActions().addAction(ActionFactory.createZoomAction()); - getActions().addAction(ActionFactory.createWheelPanAction()); connectionLayer = new LayerWidget(this); addChild(connectionLayer); + getActions().addAction(ActionFactory.createZoomAction()); + getActions().addAction(ActionFactory.createWheelPanAction()); this.mgr = mgr; } @@ -130,6 +131,14 @@ public class SceneView extends GraphScene{ this.id = id; } + public void setLoaded(boolean loaded) { + this.loaded = loaded; + } + + public boolean isLoaded() { + return loaded; + } + public LinkedHashMap> getConversationLinks() { List connectedNodes = connectionLayer.getChildren(); LinkedHashMap> conversationLinks = new LinkedHashMap<>(); diff --git a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/actions/NewConversation.java b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/actions/NewConversation.java index 120a717..032b8af 100644 --- a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/actions/NewConversation.java +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/actions/NewConversation.java @@ -23,7 +23,7 @@ import org.openide.util.NbBundle.Messages; displayName = "New Conversation" ) @ActionReferences({ - @ActionReference(path = "Menu/File", position = -115), + @ActionReference(path = "Menu/File", position = 2), @ActionReference(path = "Toolbars/File", position = 400), @ActionReference(path = "Shortcuts", name = "D-N") }) @@ -33,8 +33,6 @@ public final class NewConversation implements ActionListener { @Override public void actionPerformed(ActionEvent e) { EditorTopComponent newEditor = new EditorTopComponent(); - newEditor.blankSlate(); - newEditor.getScene().validate(); newEditor.open(); newEditor.requestActive(); } diff --git a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/actions/OpenConversation.java b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/actions/OpenConversation.java index 98504d9..f401a06 100644 --- a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/actions/OpenConversation.java +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/actions/OpenConversation.java @@ -3,6 +3,7 @@ package com.projectswg.tools.csc.conversationeditor.actions; import com.projectswg.tools.csc.conversationeditor.EditorTopComponent; import com.projectswg.tools.csc.conversationeditor.SceneSaver; import com.projectswg.tools.csc.conversationeditor.SceneView; +import com.projectswg.tools.csc.conversationeditor.wizard.CompileWizardAction; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; @@ -17,9 +18,9 @@ import org.openide.awt.ActionRegistration; import org.openide.filesystems.FileChooserBuilder; import org.openide.util.Exceptions; import org.openide.util.NbBundle.Messages; +import org.openide.util.actions.SystemAction; import org.w3c.dom.Document; import org.w3c.dom.Node; -import org.w3c.dom.NodeList; import org.xml.sax.SAXException; @ActionID(category = "File", id = "org.mycore.OpenFileAction") @@ -44,10 +45,14 @@ public final class OpenConversation implements ActionListener { open(toAdd, editor); editor.open(); editor.requestActive(); + } } public static void open(File openFile, EditorTopComponent editor) { + if (editor.getScene().isLoaded()) + return; + try { if (!openFile.getName().endsWith(".xml")) { System.out.println("Not a valid Conversation Editor file!"); @@ -78,10 +83,11 @@ public final class OpenConversation implements ActionListener { } scene.setSceneName(openFile.getName().split(".xml")[0]); scene.setScenePath(openFile.getAbsolutePath()); - + saver.deserializeData(scene, sceneNode); editor.setName(scene.getSceneName()); + scene.setLoaded(true); } catch (ParserConfigurationException | SAXException | IOException ex) { Exceptions.printStackTrace(ex); } diff --git a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/actions/SaveConversation.java b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/actions/SaveConversation.java index ce96d27..26d2450 100644 --- a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/actions/SaveConversation.java +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/actions/SaveConversation.java @@ -46,7 +46,7 @@ import org.xml.sax.SAXException; displayName = "Save" ) @ActionReferences({ - @ActionReference(path = "Menu/File", position = -90, separatorBefore = -140), + @ActionReference(path = "Menu/File", position = 3, separatorBefore = -140), @ActionReference(path = "Toolbars/File", position = 500), @ActionReference(path = "Shortcuts", name = "D-S") }) diff --git a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/layer.xml b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/layer.xml index 18b4b7f..bcb685c 100644 --- a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/layer.xml +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/layer.xml @@ -9,11 +9,22 @@ - + + + + + + + + + + + + + + - - diff --git a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/Bundle.properties b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/Bundle.properties new file mode 100644 index 0000000..b7d1519 --- /dev/null +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/Bundle.properties @@ -0,0 +1,15 @@ +CompileVisualPanel1.jLabel1.text=Select the directory to export to. If this is your first time running the wizard, you'll have to select the location of the scripts/conversation folder +CompileVisualPanel1.jLabel2.text=Export Directory: +CompileVisualPanel1.tbExportDirectory.text=None Selected +CompileVisualPanel1.btnChngScriptsLoc.text=Change Scripts Location +CompileVisualPanel1.btnChngScriptsLoc.toolTipText= +CompileVisualPanel2.jLabel1.text=Select any additional options for compiling the script. +CompileVisualPanel2.jLabel2.text=Indentation type: +CompileVisualPanel2.radioSpaces.text=Spaces +CompileVisualPanel2.radioTabs.text=Tabs +CompileVisualPanel2.chkbxComments.text=Generate Comments +CompileVisualPanel2.jLabel4.text=Script name +CompileVisualPanel2.tbScriptName.text= +CompileVisualPanel2.jLabel3.text=Header: +CompileVisualPanel2.txtAreaHeader.text=Base file generated using Conversation Script Creator for ProjectSWG +CompileVisualPanel2.jLabel5.text=Note: Must end in .py! diff --git a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel1.form b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel1.form new file mode 100644 index 0000000..a05f06c --- /dev/null +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel1.form @@ -0,0 +1,112 @@ + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel1.java b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel1.java new file mode 100644 index 0000000..e74ed75 --- /dev/null +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel1.java @@ -0,0 +1,152 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.projectswg.tools.csc.conversationeditor.wizard; + +import java.io.File; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTree; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; +import org.openide.filesystems.FileChooserBuilder; + +public final class CompileVisualPanel1 extends JPanel { + + public CompileVisualPanel1() { + initComponents(); + } + + @Override + public String getName() { + return "Location"; + } + + /** + * 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. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + jScrollPane1 = new javax.swing.JScrollPane(); + scriptsTree = new javax.swing.JTree(); + btnChngScriptsLoc = new javax.swing.JButton(); + jLabel2 = new javax.swing.JLabel(); + tbExportDirectory = new javax.swing.JTextField(); + + org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(CompileVisualPanel1.class, "CompileVisualPanel1.jLabel1.text")); // NOI18N + + javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("scripts/conversation"); + scriptsTree.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1)); + jScrollPane1.setViewportView(scriptsTree); + + org.openide.awt.Mnemonics.setLocalizedText(btnChngScriptsLoc, org.openide.util.NbBundle.getMessage(CompileVisualPanel1.class, "CompileVisualPanel1.btnChngScriptsLoc.text")); // NOI18N + btnChngScriptsLoc.setToolTipText(org.openide.util.NbBundle.getMessage(CompileVisualPanel1.class, "CompileVisualPanel1.btnChngScriptsLoc.toolTipText")); // NOI18N + btnChngScriptsLoc.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnChngScriptsLocActionPerformed(evt); + } + }); + + org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(CompileVisualPanel1.class, "CompileVisualPanel1.jLabel2.text")); // NOI18N + + tbExportDirectory.setEditable(false); + tbExportDirectory.setText(org.openide.util.NbBundle.getMessage(CompileVisualPanel1.class, "CompileVisualPanel1.tbExportDirectory.text")); // NOI18N + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(tbExportDirectory)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addComponent(btnChngScriptsLoc)) + .addGap(0, 0, Short.MAX_VALUE))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(tbExportDirectory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 286, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnChngScriptsLoc) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + + private void btnChngScriptsLocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnChngScriptsLocActionPerformed + File home = new File(System.getProperty("user.home")); + + File selection = new FileChooserBuilder("user-dir").setTitle("Select Directory"). + setDefaultWorkingDirectory(home).setApproveText("Select").setDirectoriesOnly(true).showOpenDialog(); + + if (selection != null) { + String path = selection.getAbsolutePath(); + + if (!path.endsWith("scripts\\conversation")) { + JOptionPane.showConfirmDialog(null, path + " is not a valid scripts/conversation directory", "Error", JOptionPane.OK_CANCEL_OPTION, JOptionPane.ERROR_MESSAGE); + return; + } + populateScriptsTree(selection); + } + }//GEN-LAST:event_btnChngScriptsLocActionPerformed + + public void populateScriptsTree(File base) { + DefaultMutableTreeNode root = new DefaultMutableTreeNode("scripts/conversation"); + + populateTree(root, base); + + scriptsTree.setModel(new DefaultTreeModel(root)); + + tbExportDirectory.setText(base.getAbsolutePath()); + } + + private void populateTree(DefaultMutableTreeNode root, File dir) { + for (File f : dir.listFiles()) { + if (f.isDirectory()) { + DefaultMutableTreeNode dirNode = new DefaultMutableTreeNode(f.getName()); + populateTree(dirNode, f); + root.add(dirNode); + } + } + } + + public javax.swing.JTextField getExportDirectory() { + return tbExportDirectory; + } + + public javax.swing.JTree getScriptFolderTree() { + return scriptsTree; + } + + public void setScriptsTree(JTree scriptsTree) { + this.scriptsTree = scriptsTree; + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnChngScriptsLoc; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTree scriptsTree; + private javax.swing.JTextField tbExportDirectory; + // End of variables declaration//GEN-END:variables +} diff --git a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel2.form b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel2.form new file mode 100644 index 0000000..629ed05 --- /dev/null +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel2.form @@ -0,0 +1,188 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel2.java b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel2.java new file mode 100644 index 0000000..1c98707 --- /dev/null +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileVisualPanel2.java @@ -0,0 +1,193 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.projectswg.tools.csc.conversationeditor.wizard; + +import java.awt.event.ItemEvent; +import javax.swing.ButtonGroup; +import javax.swing.JCheckBox; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JTextArea; +import javax.swing.JTextField; + +public final class CompileVisualPanel2 extends JPanel { + + /** + * Creates new form CompileVisualPanel2 + */ + public CompileVisualPanel2() { + initComponents(); + } + + @Override + public String getName() { + return "Set Options"; + } + + /** + * 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. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + radialIndentation = new javax.swing.ButtonGroup(); + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + radioSpaces = new javax.swing.JRadioButton(); + radioTabs = new javax.swing.JRadioButton(); + chkbxComments = new javax.swing.JCheckBox(); + jScrollPane1 = new javax.swing.JScrollPane(); + txtAreaHeader = new javax.swing.JTextArea(); + jLabel3 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + tbScriptName = new javax.swing.JTextField(); + jLabel5 = new javax.swing.JLabel(); + + org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(CompileVisualPanel2.class, "CompileVisualPanel2.jLabel1.text")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(CompileVisualPanel2.class, "CompileVisualPanel2.jLabel2.text")); // NOI18N + + radialIndentation.add(radioSpaces); + org.openide.awt.Mnemonics.setLocalizedText(radioSpaces, org.openide.util.NbBundle.getMessage(CompileVisualPanel2.class, "CompileVisualPanel2.radioSpaces.text")); // NOI18N + + radialIndentation.add(radioTabs); + radioTabs.setSelected(true); + org.openide.awt.Mnemonics.setLocalizedText(radioTabs, org.openide.util.NbBundle.getMessage(CompileVisualPanel2.class, "CompileVisualPanel2.radioTabs.text")); // NOI18N + + chkbxComments.setSelected(true); + org.openide.awt.Mnemonics.setLocalizedText(chkbxComments, org.openide.util.NbBundle.getMessage(CompileVisualPanel2.class, "CompileVisualPanel2.chkbxComments.text")); // NOI18N + chkbxComments.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + chkbxCommentsItemStateChanged(evt); + } + }); + + txtAreaHeader.setColumns(20); + txtAreaHeader.setRows(5); + txtAreaHeader.setText(org.openide.util.NbBundle.getMessage(CompileVisualPanel2.class, "CompileVisualPanel2.txtAreaHeader.text")); // NOI18N + jScrollPane1.setViewportView(txtAreaHeader); + + org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(CompileVisualPanel2.class, "CompileVisualPanel2.jLabel3.text")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(CompileVisualPanel2.class, "CompileVisualPanel2.jLabel4.text")); // NOI18N + + tbScriptName.setText(org.openide.util.NbBundle.getMessage(CompileVisualPanel2.class, "CompileVisualPanel2.tbScriptName.text")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(jLabel5, org.openide.util.NbBundle.getMessage(CompileVisualPanel2.class, "CompileVisualPanel2.jLabel5.text")); // NOI18N + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addComponent(jLabel2))) + .addGroup(layout.createSequentialGroup() + .addGap(36, 36, 36) + .addComponent(radioSpaces) + .addGap(18, 18, 18) + .addComponent(radioTabs)) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(chkbxComments)) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel3))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(tbScriptName, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel5) + .addGap(0, 144, Short.MAX_VALUE)))) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addGap(31, 31, 31) + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(radioSpaces) + .addComponent(radioTabs)) + .addGap(18, 18, 18) + .addComponent(chkbxComments) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel4) + .addComponent(tbScriptName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel5)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); + }// //GEN-END:initComponents + + private void chkbxCommentsItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_chkbxCommentsItemStateChanged + switch(evt.getStateChange()) { + case ItemEvent.DESELECTED: + txtAreaHeader.setEditable(false); + txtAreaHeader.setEnabled(false); + break; + case ItemEvent.SELECTED: + txtAreaHeader.setEditable(true); + txtAreaHeader.setEnabled(true); + break; + } + }//GEN-LAST:event_chkbxCommentsItemStateChanged + + public JRadioButton getRadioSpaces() { + return radioSpaces; + } + + public JRadioButton getRadioTabs() { + return radioTabs; + } + + public JCheckBox getChkbxComments() { + return chkbxComments; + } + + public ButtonGroup getRadioGroupIndentation() { + return radialIndentation; + } + + public JTextArea getTxtAreaHeader() { + return txtAreaHeader; + } + + public JTextField getTbScriptName() { + return tbScriptName; + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox chkbxComments; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.ButtonGroup radialIndentation; + private javax.swing.JRadioButton radioSpaces; + private javax.swing.JRadioButton radioTabs; + private javax.swing.JTextField tbScriptName; + private javax.swing.JTextArea txtAreaHeader; + // End of variables declaration//GEN-END:variables +} diff --git a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileWizardAction.java b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileWizardAction.java new file mode 100644 index 0000000..2e456f7 --- /dev/null +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileWizardAction.java @@ -0,0 +1,98 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.projectswg.tools.csc.conversationeditor.wizard; + +import com.projectswg.tools.csc.conversationeditor.Compiler; +import com.projectswg.tools.csc.conversationeditor.EditorTopComponent; +import java.awt.Component; +import java.awt.Desktop; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.io.IOException; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.List; +import javax.swing.JComponent; +import javax.swing.JOptionPane; +import org.openide.DialogDisplayer; +import org.openide.WizardDescriptor; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionRegistration; +import org.openide.util.Exceptions; +import org.openide.windows.TopComponent; + +// An example action demonstrating how the wizard could be called from within +// your code. You can move the code below wherever you need, or register an action: +@ActionID(category="File", id="com.projectswg.tools.csc.conversationeditor.wizard.CompileWizardAction") +@ActionRegistration(displayName="Compile Script") +@ActionReference(path="Menu/File", position=0, separatorAfter=1) +public final class CompileWizardAction implements ActionListener { + + @Override + public void actionPerformed(ActionEvent e) { + TopComponent component = TopComponent.getRegistry().getActivated(); + if (component == null || !(component instanceof EditorTopComponent)) { + JOptionPane.showConfirmDialog(component, "No active scene to compile!", "Conversation Script Creator", JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE); + return; + } + + List> panels = new ArrayList<>(); + panels.add(new CompileWizardPanel1()); + panels.add(new CompileWizardPanel2()); + String[] steps = new String[panels.size()]; + for (int i = 0; i < panels.size(); i++) { + Component c = panels.get(i).getComponent(); + // Default step name to component name of panel. + steps[i] = c.getName(); + if (c instanceof JComponent) { // assume Swing components + JComponent jc = (JComponent) c; + jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i); + jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); + jc.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, true); + jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, true); + jc.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, true); + } + } + WizardDescriptor wiz = new WizardDescriptor(new WizardDescriptor.ArrayIterator<>(panels)); + // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName() + wiz.setTitleFormat(new MessageFormat("{0}")); + wiz.setTitle("Compile Wizard"); + + if (DialogDisplayer.getDefault().notify(wiz) == WizardDescriptor.FINISH_OPTION) { + String directory = (String) wiz.getProperty("directory"); + boolean comments = (Boolean) wiz.getProperty("comments"); + String header = (String) wiz.getProperty("header"); + boolean tabs = (((String) wiz.getProperty("indent")).equals("tabs")); + String script = (String) wiz.getProperty("script"); + + File file = new File(directory + "\\" + script); + if (file.exists()) { + JOptionPane.showConfirmDialog(null, "The directory " + file.getAbsolutePath() + + " already exists!", "Conversation Script Creator", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); + return; + } + Compiler compiler = new Compiler(file, comments, header, tabs); + try { + if (compiler.compile()) { + if (JOptionPane.showConfirmDialog(null, "Script created at " + file.getAbsolutePath() + " successfully. Would you like to open it?", + "Conversation Script Creator", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.YES_OPTION) { + Desktop dt = Desktop.getDesktop(); + if (dt != null) + dt.open(file); + } + } else { + JOptionPane.showConfirmDialog(null, "Failed to create script at " + file.getAbsolutePath() + + " !", "Conversation Script Creator", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); + } + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + + } +} diff --git a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileWizardPanel1.java b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileWizardPanel1.java new file mode 100644 index 0000000..3deb593 --- /dev/null +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileWizardPanel1.java @@ -0,0 +1,132 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.projectswg.tools.csc.conversationeditor.wizard; + +import java.io.File; +import java.util.HashSet; +import java.util.Set; +import javax.swing.JTree; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; +import org.openide.WizardDescriptor; +import org.openide.util.HelpCtx; +import org.openide.util.NbPreferences; + +public class CompileWizardPanel1 implements WizardDescriptor.Panel, TreeSelectionListener { + + private CompileVisualPanel1 component; + + private boolean valid = true; + + private final Set listeners = new HashSet<>(1); + + public CompileWizardPanel1() { + valid = false; + } + + @Override + public CompileVisualPanel1 getComponent() { + if (component == null) { + component = new CompileVisualPanel1(); + component.getScriptFolderTree().addTreeSelectionListener(this); + } + return component; + } + + @Override + public HelpCtx getHelp() { + // Show no Help button for this panel: + return HelpCtx.DEFAULT_HELP; + // If you have context help: + // return new HelpCtx("help.key.here"); + } + + @Override + public boolean isValid() { + System.out.println("dafd" + valid); + return valid; + } + + private void setValid(boolean val) { + if (val == valid) + return; + + valid = val; + fireChangeEvent(); + } + + @Override + public void addChangeListener(ChangeListener l) { + listeners.add(l); + } + + @Override + public void removeChangeListener(ChangeListener l) { + listeners.remove(l); + } + + protected final void fireChangeEvent() { + ChangeEvent event = new ChangeEvent(this); + + for (ChangeListener l : listeners) { + l.stateChanged(event); + } + } + + @Override + public void readSettings(WizardDescriptor wiz) { + Object tree = wiz.getProperty("tree"); + + if (tree != null) { + component.setScriptsTree((JTree) tree); + } else { + + Object scripts = wiz.getProperty("directory"); + + if (scripts == null) { + scripts = NbPreferences.forModule(CompileWizardPanel1.class).get("directory", ""); + + if (scripts == "") { + return; + } + } + + File dir = new File(scripts.toString().split("conversation")[0] + "\\conversation"); + if (!dir.exists()) { + return; + } + + component.populateScriptsTree(dir); + } + } + + @Override + public void storeSettings(WizardDescriptor wiz) { + wiz.putProperty("directory", component.getExportDirectory().getText()); + NbPreferences.forModule(CompileWizardPanel1.class).put("directory", component.getExportDirectory().getText()); // persist across reloads + + wiz.putProperty("tree", component.getScriptFolderTree()); + } + + @Override + public void valueChanged(TreeSelectionEvent e) { + if (e.getNewLeadSelectionPath() == null) + return; + + Object[] path = e.getNewLeadSelectionPath().getPath(); + String dir = component.getExportDirectory().getText().split("conversation")[0] + "conversation"; + + for (Object p : path) { + if (!p.toString().equals("scripts/conversation") && !dir.contains(p.toString())) + dir += "\\" +p.toString(); + } + component.getExportDirectory().setText(dir); + + setValid(true); + } +} diff --git a/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileWizardPanel2.java b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileWizardPanel2.java new file mode 100644 index 0000000..8523dbf --- /dev/null +++ b/ConversationEditor/src/com/projectswg/tools/csc/conversationeditor/wizard/CompileWizardPanel2.java @@ -0,0 +1,154 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.projectswg.tools.csc.conversationeditor.wizard; + +import java.util.HashSet; +import java.util.Set; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import org.openide.WizardDescriptor; +import org.openide.WizardValidationException; +import org.openide.util.HelpCtx; + +public class CompileWizardPanel2 implements WizardDescriptor.ValidatingPanel, DocumentListener { + + /** + * The visual component that displays this panel. If you need to access the component from this class, just use getComponent(). + */ + private CompileVisualPanel2 component; + private boolean valid = false; + private final Set listeners = new HashSet<>(1); + + // Get the visual component for the panel. In this template, the component + // is kept separate. This can be more efficient: if the wizard is created + // but never displayed, or not all panels are displayed, it is better to + // create only those which really need to be visible. + @Override + public CompileVisualPanel2 getComponent() { + if (component == null) { + component = new CompileVisualPanel2(); + component.getTbScriptName().getDocument().addDocumentListener(this); + } + return component; + } + + @Override + public HelpCtx getHelp() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + public boolean isValid() { + System.out.println(valid); + return valid; + } + + public void setValid(boolean val) { + + if (valid == val) + return; + + this.valid = val; + fireChangeEvent(); + } + + protected final void fireChangeEvent() { + ChangeEvent event = new ChangeEvent(this); + + for (ChangeListener l : listeners) { + l.stateChanged(event); + } + } + + @Override + public void addChangeListener(ChangeListener l) { + listeners.add(l); + } + + @Override + public void removeChangeListener(ChangeListener l) { + listeners.remove(l); + } + + @Override + public void readSettings(WizardDescriptor wiz) { + Object indents = wiz.getProperty("indent"); + if (indents == null || indents.toString().equals("tabs")) + component.getRadioTabs().setSelected(true); + else + component.getRadioSpaces().setSelected(true); + + Object comments = wiz.getProperty("comments"); + if (comments == null) { + + } else { + component.getChkbxComments().setSelected(Boolean.valueOf(comments.toString())); + } + + Object header = wiz.getProperty("header"); + if (header == null) { + + } else { + component.getTxtAreaHeader().setText(header.toString()); + } + + Object sName = wiz.getProperty("script"); + + if (sName == null) { + // TODO: Use scene name + } else { + component.getTbScriptName().setText(sName.toString()); + valid = true; + } + } + + @Override + public void storeSettings(WizardDescriptor wiz) { + + if (component.getRadioTabs().isSelected()) + wiz.putProperty("indent", "tabs"); + else + wiz.putProperty("indent", "spaces"); + + wiz.putProperty("comments", component.getChkbxComments().isSelected()); + wiz.putProperty("header", component.getTxtAreaHeader().getText()); + wiz.putProperty("script", component.getTbScriptName().getText()); + } + + private void checkText() { + if (!component.getTbScriptName().getText().endsWith(".py")) { + setValid(false); + } else { + setValid(true); + } + } + + @Override + public void insertUpdate(DocumentEvent e) { + checkText(); + } + + @Override + public void removeUpdate(DocumentEvent e) { + checkText(); + } + + @Override + public void changedUpdate(DocumentEvent e) { + checkText(); + } + + @Override + public void validate() throws WizardValidationException { + if (!component.getTbScriptName().getText().endsWith(".py")) { + valid = false; + throw new WizardValidationException(null, "The script name must end with the .py extension.", null); + } + } + +} diff --git a/nbproject/project.properties b/nbproject/project.properties index bf83641..782fb1d 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -9,7 +9,5 @@ auxiliary.org-netbeans-modules-apisupport-installer.os-windows=true auxiliary.org-netbeans-modules-apisupport-installer.pack200-enabled=false auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml modules=\ - ${project.com.projectswg.tools.csc.conversationeditor}:\ - ${project.com.projectswg.tools.csc.compiler} -project.com.projectswg.tools.csc.compiler=ConversationCompiler + ${project.com.projectswg.tools.csc.conversationeditor} project.com.projectswg.tools.csc.conversationeditor=ConversationEditor