Ignore:
Timestamp:
13/08/10 16:34:17 (22 months ago)
Author:
Stephen Rankin
Message:

Bulk Load working but not really tested. Fixed various bugs fixed, but single file validation is not working now! Close all files function added. Check for NEXUS/HDF files added. Added threads for file loading actions. Some refactoring of code. refs #236.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/applications/NXconvertpy/src/org/nexusformat/nxvalidate/NXvalidateFrame.java

    r1503 r1504  
    1 /* 
    2  * To change this template, choose Tools | Templates 
    3  * and open the template in the editor. 
    4  */ 
    5  
    6 /* 
    7  * NXvalidateFrame.java 
    8  * 
    9  * Created on 02-Jun-2010, 14:17:04 
    10  */ 
     1 /* NeXus - Neutron & X-ray Common Data Format 
     2  * 
     3  * NeXus file validation GUI tool. 
     4  * 
     5  * Copyright (C) 2010 Stephen Rankin 
     6  * 
     7  * This library is free software; you can redistribute it and/or 
     8  * modify it under the terms of the GNU Lesser General Public 
     9  * License as published by the Free Software Foundation; either 
     10  * version 2 of the License, or (at your option) any later version. 
     11  * 
     12  * This library is distributed in the hope that it will be useful, 
     13  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     15  * Lesser General Public License for more details. 
     16  * 
     17  * You should have received a copy of the GNU Lesser General Public 
     18  * License along with this library; if not, write to the Free Software 
     19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
     20  * 
     21  * For further information, see <http://www.neutron.anl.gov/NeXus/> 
     22  * 
     23  * NXvalidateFrame.java 
     24  * 
     25  * Created on 02-Jun-2010, 14:17:04 
     26  */ 
     27 
    1128package org.nexusformat.nxvalidate; 
    1229 
    13 import java.awt.Color; 
    1430import java.awt.Dialog.ModalityType; 
    1531import java.awt.event.MouseListener; 
     
    2137import java.util.logging.Level; 
    2238import java.util.logging.Logger; 
     39import javax.swing.JOptionPane; 
    2340import javax.swing.JTextArea; 
    24 import javax.swing.text.BadLocationException; 
    25 import javax.swing.text.Style; 
    26 import javax.swing.text.StyleConstants; 
    27 import javax.swing.text.StyleContext; 
    28 import javax.swing.text.StyledDocument; 
    2941import javax.swing.tree.MutableTreeNode; 
     42import javax.swing.tree.TreePath; 
    3043import javax.xml.parsers.DocumentBuilder; 
    3144import javax.xml.parsers.DocumentBuilderFactory; 
    3245import javax.xml.parsers.ParserConfigurationException; 
    33 import org.nexusformat.nxvalidate.exceptions.NXConvertpyException; 
    3446import org.w3c.dom.Document; 
    35 import org.xml.sax.SAXException; 
    3647 
    3748/** 
     
    4556    private NXReducedToTree domTree = null; 
    4657    private NXNodeMapper root = null; 
    47     private ValidatorUtils validator = null; 
    4858    private ResourceBundle bundle = null; 
    4959    private File nxsFile = null; 
    50     private File nxdcFile = null; 
     60    private File nxdlFile = null; 
    5161    private File reducedFile = null; 
    5262    private File resultsFile = null; 
    5363    private TreeUtils treeUtils = null; 
    54     private ArrayList<Report> reports; 
    5564    private UserSettings settings = null; 
    5665    private File nxconvertFile = null; 
    5766    private boolean foundNXconvert = false; 
    5867    private MouseListener popupListener = null; 
     68    private TextPaneStyle txtStyle = null; 
     69    private FileLoadingActions fileLoadingActions = null; 
     70 
    5971    /** Creates new form NXvalidateFrame */ 
    6072    public NXvalidateFrame() { 
     
    96108            nxconvertFile = settings.getNXconvert(); 
    97109 
    98             if(!settings.foundNXconvert()){ 
     110            if (!settings.foundNXconvert()) { 
    99111                displayErrorMessage( 
    100                             bundle.getString("nxconvertMissingError")); 
     112                        bundle.getString("nxconvertMissingError")); 
    101113                foundNXconvert = false; 
    102             } 
    103             else{ 
     114            } else { 
    104115                foundNXconvert = true; 
    105116            } 
     
    117128        jTree1.addMouseListener(popupListener); 
    118129 
    119          
     130        txtStyle = new TextPaneStyle(jTextPane1); 
     131 
     132        fileLoadingActions = new FileLoadingActions(this, jTree1, builder, domTree, root); 
     133 
    120134    } 
    121135 
     
    139153        jTextPane1 = new javax.swing.JTextPane(); 
    140154        jMenuBar1 = new javax.swing.JMenuBar(); 
    141         jMenu1 = new javax.swing.JMenu(); 
     155        fileMenu = new javax.swing.JMenu(); 
    142156        openFilesMenuItem = new javax.swing.JMenuItem(); 
    143         jMenu2 = new javax.swing.JMenu(); 
     157        jSeparator4 = new javax.swing.JPopupMenu.Separator(); 
     158        closeAllMenuItem = new javax.swing.JMenuItem(); 
     159        jSeparator5 = new javax.swing.JPopupMenu.Separator(); 
     160        exitAppMenuItem = new javax.swing.JMenuItem(); 
     161        toolsMenu = new javax.swing.JMenu(); 
    144162        validateSelectedMenuItem = new javax.swing.JMenuItem(); 
    145163        jSeparator2 = new javax.swing.JPopupMenu.Separator(); 
     
    149167        jSeparator3 = new javax.swing.JPopupMenu.Separator(); 
    150168        settingsMenuItem = new javax.swing.JMenuItem(); 
     169        helpMenu = new javax.swing.JMenu(); 
     170        helpMenuItem = new javax.swing.JMenuItem(); 
     171        jSeparator6 = new javax.swing.JPopupMenu.Separator(); 
     172        aboutMenuItem = new javax.swing.JMenuItem(); 
    151173 
    152174        closeFileMenuItem.setText("Close File"); 
     
    197219        getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER); 
    198220 
    199         jMenu1.setText(bundle.getString("fileMenuItem")); // NOI18N 
     221        fileMenu.setText(bundle.getString("fileMenuItem")); // NOI18N 
    200222 
    201223        openFilesMenuItem.setText("Open Files"); 
     
    205227            } 
    206228        }); 
    207         jMenu1.add(openFilesMenuItem); 
    208  
    209         jMenuBar1.add(jMenu1); 
    210  
    211         jMenu2.setText("Tools"); 
     229        fileMenu.add(openFilesMenuItem); 
     230        fileMenu.add(jSeparator4); 
     231 
     232        closeAllMenuItem.setText("Close All Files"); 
     233        closeAllMenuItem.addActionListener(new java.awt.event.ActionListener() { 
     234            public void actionPerformed(java.awt.event.ActionEvent evt) { 
     235                closeAllMenuItemActionPerformed(evt); 
     236            } 
     237        }); 
     238        fileMenu.add(closeAllMenuItem); 
     239        fileMenu.add(jSeparator5); 
     240 
     241        exitAppMenuItem.setText("Exit"); 
     242        exitAppMenuItem.addActionListener(new java.awt.event.ActionListener() { 
     243            public void actionPerformed(java.awt.event.ActionEvent evt) { 
     244                exitAppMenuItemActionPerformed(evt); 
     245            } 
     246        }); 
     247        fileMenu.add(exitAppMenuItem); 
     248 
     249        jMenuBar1.add(fileMenu); 
     250 
     251        toolsMenu.setText("Tools"); 
    212252 
    213253        validateSelectedMenuItem.setText("Validate Selected"); 
     
    217257            } 
    218258        }); 
    219         jMenu2.add(validateSelectedMenuItem); 
    220         jMenu2.add(jSeparator2); 
     259        toolsMenu.add(validateSelectedMenuItem); 
     260        toolsMenu.add(jSeparator2); 
    221261 
    222262        filterMenuItem.setText("Filter Good Values"); 
    223         jMenu2.add(filterMenuItem); 
    224         jMenu2.add(jSeparator1); 
     263        toolsMenu.add(filterMenuItem); 
     264        toolsMenu.add(jSeparator1); 
    225265 
    226266        bulkMenuItem.setText("Bulk Validation"); 
    227         jMenu2.add(bulkMenuItem); 
    228         jMenu2.add(jSeparator3); 
     267        bulkMenuItem.addActionListener(new java.awt.event.ActionListener() { 
     268            public void actionPerformed(java.awt.event.ActionEvent evt) { 
     269                bulkMenuItemActionPerformed(evt); 
     270            } 
     271        }); 
     272        toolsMenu.add(bulkMenuItem); 
     273        toolsMenu.add(jSeparator3); 
    229274 
    230275        settingsMenuItem.setText("Settings"); 
     
    234279            } 
    235280        }); 
    236         jMenu2.add(settingsMenuItem); 
    237  
    238         jMenuBar1.add(jMenu2); 
     281        toolsMenu.add(settingsMenuItem); 
     282 
     283        jMenuBar1.add(toolsMenu); 
     284 
     285        helpMenu.setText("Help"); 
     286 
     287        helpMenuItem.setText("Help Content"); 
     288        helpMenu.add(helpMenuItem); 
     289        helpMenu.add(jSeparator6); 
     290 
     291        aboutMenuItem.setText("About"); 
     292        helpMenu.add(aboutMenuItem); 
     293 
     294        jMenuBar1.add(helpMenu); 
    239295 
    240296        setJMenuBar(jMenuBar1); 
     
    252308        dialogReportProblem.showMessageDialog(this, ta); 
    253309 
    254    } 
    255  
    256  
    257     private void loadFiles() { 
    258         try { 
    259  
    260             //Reduce the file with NXConvert. 
    261             NXconvert convert = new NXconvert(nxsFile, true, nxconvertFile); 
    262             File reducedFile = convert.convert(); 
    263  
    264             //Display reduced file 
    265             Document document = builder.parse(reducedFile); 
    266             NXNodeMapper node = new NXNodeMapper( 
    267                     document, true, nxsFile); 
    268             node.setReducedDoc(document); 
    269             if (nxdcFile != null) { 
    270                 node.setSchematronFile(nxdcFile); 
    271             } 
    272             node.setReducedFile(reducedFile); 
    273             node.setRoot(root); 
    274             root.insert(node); 
    275             domTree.updateTree(); 
    276             nxsFile = null; 
    277             nxdcFile = null; 
    278  
    279         } catch (InterruptedException ex) { 
    280             Logger.getLogger( 
    281                     NXvalidateFrame.class.getName()).log(Level.SEVERE, 
    282                     null, ex); 
    283         } catch (SAXException ex) { 
    284             Logger.getLogger( 
    285                     NXvalidateFrame.class.getName()).log(Level.SEVERE, 
    286                     null, ex); 
    287         } catch (IOException ex) { 
    288             Logger.getLogger( 
    289                     NXvalidateFrame.class.getName()).log(Level.SEVERE, 
    290                     null, ex); 
    291         } 
    292310    } 
    293311 
     
    298316        loadFile.setVisible(true); 
    299317        nxsFile = loadFile.getNXSFile(); 
    300         nxdcFile = loadFile.getNXDCFile(); 
     318        nxdlFile = loadFile.getNXDLFile(); 
    301319        return loadFile.OKButtonUsed(); 
    302320 
     
    307325        NXValidateDialog loadValidate = new NXValidateDialog(this, true); 
    308326        loadValidate.setModalityType(ModalityType.APPLICATION_MODAL); 
    309         if (nxdcFile != null) { 
    310             loadValidate.setNXDCFile(nxdcFile); 
     327        if (nxdlFile != null) { 
     328            loadValidate.setNXDLFile(nxdlFile); 
    311329        } 
    312330        loadValidate.setVisible(true); 
    313         nxdcFile = loadValidate.getNXDCFile(); 
     331        nxdlFile = loadValidate.getNXDLFile(); 
    314332        return loadValidate.OKButtonUsed(); 
    315333 
     
    333351        if (evt.getSource() == openFilesMenuItem) { 
    334352 
    335             if(!foundNXconvert){ 
     353            if (!foundNXconvert) { 
    336354                displayErrorMessage( 
    337                             bundle.getString("nxconvertMissingError")); 
     355                        bundle.getString("nxconvertMissingError")); 
    338356                return; 
    339357            } 
     
    343361            if (result) { 
    344362                if (nxsFile != null) { 
    345                     loadFiles(); 
     363                    fileLoadingActions.setWhich(1); 
     364                    fileLoadingActions.setNXSFile(nxsFile); 
     365                    fileLoadingActions.setNXConvertFile(nxconvertFile); 
     366                    fileLoadingActions.setNXDLFile(nxdlFile); 
     367                    (new Thread(fileLoadingActions)).start(); 
    346368                } else { 
    347369                    dialogReportProblem.showMessageDialog(this, 
     
    359381                NXNodeMapper node = 
    360382                        (NXNodeMapper) jTree1.getSelectionPath().getLastPathComponent(); 
    361                 updateTextPane(node); 
    362  
     383                txtStyle.updateTextPane(node); 
    363384            } 
    364385        } 
     
    370391        if (evt.getSource() == validateSelectedMenuItem) { 
    371392 
    372             if(!foundNXconvert){ 
     393            //Nothing selected in tree 
     394            if (jTree1.isSelectionEmpty()) { 
     395                return; 
     396            } 
     397 
     398            //Root node selected in tree 
     399            TreePath selected = jTree1.getSelectionPath(); 
     400            int size = selected.getPath().length; 
     401            NXNodeMapper endNode = (NXNodeMapper) selected.getPath()[size - 1]; 
     402            if (endNode.isRoot()) { 
     403                return; 
     404            } 
     405 
     406            //No nxconvert binary found. 
     407            if (!foundNXconvert) { 
    373408                displayErrorMessage( 
    374                             bundle.getString("nxconvertMissingError")); 
     409                        bundle.getString("nxconvertMissingError")); 
    375410                return; 
    376411            } 
     
    383418            //current selected tree. 
    384419            if (treeUtils.getNXDCFile(jTree1) != null) { 
    385                 nxdcFile = treeUtils.getNXDCFile(jTree1); 
     420                nxdlFile = treeUtils.getNXDCFile(jTree1); 
    386421            } 
    387422 
     
    400435 
    401436            if (result) { 
    402                 if (nxdcFile != null) { 
    403  
    404                     try { 
    405  
    406                         //Validation has already been done so we reset the tree 
    407                         //before doing the validation again. 
    408                         if (resultsDoc != null) { 
    409                             SVRLNodeFilter filter = new SVRLNodeFilter(); 
    410                             filter.setFilterDocument(resultsDoc); 
    411                             filter.setDocument(reducedDoc); 
    412                             filter.resetBadNodes(); 
    413                         } 
    414  
    415                         //Do the validation. 
    416                         if(nxconvertFile!=null){ 
    417                             validator = new ValidatorUtils(nxconvertFile); 
    418                         } 
    419                         else{ 
    420                              displayErrorMessage( 
    421                             bundle.getString("nxconvertMissingError")); 
    422                             return; 
    423                         } 
    424                         validator.setSchematron(nxdcFile); 
    425                         validator.setReduced(reducedFile); 
    426                         resultsFile = validator.validate(); 
    427  
    428                         SVRLNodeFilter filter = new SVRLNodeFilter(); 
    429  
    430                         resultsDoc = builder.parse(resultsFile); 
    431                         filter.setFilterDocument(resultsDoc); 
    432                         filter.setDocument(reducedDoc); 
    433                         filter.getBadNodeList(); 
    434  
    435                         treeUtils.setResultsDoc(jTree1, resultsDoc); 
    436                         treeUtils.setResultsFile(jTree1, resultsFile); 
    437  
    438                         domTree.updateTree(); 
    439                         Logger.getLogger(NXvalidateFrame.class.getName()).log( 
    440                                 Level.INFO, "Finished Validating."); 
    441                         dialogReportProblem.showMessageDialog( 
    442                                 this, 
    443                                 bundle.getString("validationCompleteMessage")); 
    444  
    445  
    446                     } catch (NXConvertpyException ex) { 
    447                         Logger.getLogger(NXvalidateFrame.class.getName()).log( 
    448                                 Level.SEVERE, null, ex); 
    449                     } catch (SAXException ex) { 
    450                         Logger.getLogger(NXvalidateFrame.class.getName()).log( 
    451                                 Level.SEVERE, null, ex); 
    452                     } catch (IOException ex) { 
    453                         Logger.getLogger(NXvalidateFrame.class.getName()).log( 
    454                                 Level.SEVERE, null, ex); 
    455                     } 
     437                if (nxdlFile != null) { 
     438 
     439                    fileLoadingActions.setWhich(2); 
     440                    fileLoadingActions.setNXSFile(nxsFile); 
     441                    fileLoadingActions.setNXConvertFile(nxconvertFile); 
     442                    fileLoadingActions.setNXDLFile(nxdlFile); 
     443                    fileLoadingActions.setReducedFile(reducedFile); 
     444                    fileLoadingActions.setReducedDoc(reducedDoc); 
     445                    fileLoadingActions.setResultsDoc(resultsDoc); 
     446 
     447                    Thread thread = new Thread(fileLoadingActions); 
     448 
     449                    thread.start(); 
    456450 
    457451                } else { 
     
    459453                            bundle.getString("openSchemaFileMessage")); 
    460454 
     455                     
    461456                } 
    462457            } 
     
    479474            } 
    480475 
    481             if(!foundNXconvert){ 
     476            if (!foundNXconvert) { 
    482477                displayErrorMessage( 
    483                             bundle.getString("nxconvertMissingError")); 
     478                        bundle.getString("nxconvertMissingError")); 
    484479                return; 
    485480            } 
     
    490485 
    491486    private void closeFileMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeFileMenuItemActionPerformed 
    492          
     487 
    493488        if (evt.getSource() == closeFileMenuItem) { 
    494489 
    495490            NXNodeMapper node = treeUtils.getBaseNode(jTree1); 
    496             if(node!=null){ 
    497                 if(!node.isRoot()){ 
     491            if (node != null) { 
     492                if (!node.isRoot()) { 
    498493                    root.removeNode(node); 
    499                     domTree.removeNodeFromParent((MutableTreeNode)node); 
     494                    domTree.removeNodeFromParent((MutableTreeNode) node); 
    500495                    domTree.updateTree(); 
    501496                } 
    502497            } 
    503              
    504498 
    505499        } 
    506500    }//GEN-LAST:event_closeFileMenuItemActionPerformed 
    507501 
    508     private void updateTextPane(NXNodeMapper node) { 
    509  
    510         String newline = "\n"; 
    511         String[] initString = { 
    512             "another ", //italic 
    513             "styled ", //bold 
    514             "text ", //small 
    515             "component, ", //large 
    516             "which supports embedded components..." + newline,//regular 
    517             " " + newline, //button 
    518             "...and embedded icons..." + newline, //regular 
    519             " ", //icon 
    520             newline + "JTextPane is a subclass of JEditorPane that " 
    521             + "uses a StyledEditorKit and StyledDocument, and provides " 
    522             + "cover methods for interacting with those objects." 
    523         }; 
    524  
    525         String[] initStyles = {"regular", "italic", "bold", "small", "large", 
    526             "regular", "button", "regular", "icon", 
    527             "regular" 
    528         }; 
    529  
    530  
    531         StyledDocument doc = jTextPane1.getStyledDocument(); 
    532  
    533         addStylesToDocument( 
    534                 doc); 
    535         String[] atts = node.getAttributeList(); 
    536  
    537  
    538  
    539         try { 
    540             doc.remove(0, doc.getLength()); 
    541  
    542             doc.insertString(0, node.toString() 
    543                     + newline + newline, doc.getStyle("title")); 
    544  
    545             doc.insertString(doc.getLength(), "Attributes:" 
    546                     + newline + newline, doc.getStyle("heading")); 
    547  
    548  
    549  
    550             for (int i = 0; i 
    551                     < atts.length; i++) { 
    552                 doc.insertString(doc.getLength(), 
    553                         "@ " + atts[i] + newline, doc.getStyle("bold")); 
    554  
    555  
    556             } 
    557  
    558             doc.insertString(doc.getLength(), newline + newline, 
    559                     doc.getStyle("heading")); 
    560  
    561             doc.insertString(doc.getLength(), "Node Value:" 
    562                     + newline + newline, doc.getStyle("heading")); 
    563  
    564             doc.insertString(doc.getLength(), 
    565                     node.getValue(), doc.getStyle("bold")); 
    566  
    567             doc.insertString(doc.getLength(), newline + newline, 
    568                     doc.getStyle("heading")); 
    569  
    570             doc.insertString(doc.getLength(), "Validation Tests:" 
    571                     + newline + newline, doc.getStyle("heading")); 
    572  
    573  
    574  
    575             if (node.getNodeTests() != null) { 
    576  
    577                 for (int i = 0; i 
    578                         < node.getNodeTests().size(); 
    579                         ++i) { 
    580                     doc.insertString(doc.getLength(), 
    581                             node.getNodeTests().get(i), doc.getStyle("bold")); 
    582  
    583                     doc.insertString(doc.getLength(), newline + newline, 
    584                             doc.getStyle("heading")); 
    585  
    586  
     502    private void exitAppMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitAppMenuItemActionPerformed 
     503        if (evt.getSource() == exitAppMenuItem) { 
     504 
     505            this.dispose(); 
     506 
     507        } 
     508    }//GEN-LAST:event_exitAppMenuItemActionPerformed 
     509 
     510    private void closeAllMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeAllMenuItemActionPerformed 
     511        if (evt.getSource() == closeAllMenuItem) { 
     512 
     513            int result = dialogReportProblem.showConfirmDialog(this, 
     514                    bundle.getString("closeAllWarningMessage"), null, 
     515                    JOptionPane.OK_CANCEL_OPTION); 
     516 
     517            if (result == 0) { 
     518                ArrayList<NXNodeMapper> nodes = root.getOpenNodes(); 
     519                for (int i = 0; i < nodes.size(); ++i) { 
     520                    domTree.removeNodeFromParent((MutableTreeNode) nodes.get(i)); 
    587521                } 
    588  
    589             } 
    590  
    591             doc.insertString(doc.getLength(), "Validation Errors:" 
    592                     + newline + newline, doc.getStyle("errorheading")); 
    593  
    594             if (node.getNodeTexts() != null) { 
    595  
    596                 for (int i = 0; i 
    597                         < node.getNodeTexts().size(); 
    598                         ++i) { 
    599                     doc.insertString(doc.getLength(), 
    600                             node.getNodeTexts().get(i), doc.getStyle("error")); 
    601  
    602                     doc.insertString(doc.getLength(), newline + newline, 
    603                             doc.getStyle("heading")); 
    604  
    605  
    606                 } 
    607  
    608             } 
    609  
    610             doc.insertString(doc.getLength(), "Diagnostic Errors:" 
    611                     + newline + newline, doc.getStyle("errorheading")); 
    612  
    613             if (node.getNodeDiags() != null) { 
    614  
    615                 for (int i = 0; i 
    616                         < node.getNodeDiags().size(); 
    617                         ++i) { 
    618                     doc.insertString(doc.getLength(), 
    619                             node.getNodeDiags().get(i), doc.getStyle("error")); 
    620  
    621                     doc.insertString(doc.getLength(), newline + newline, 
    622                             doc.getStyle("heading")); 
    623  
    624                 } 
    625  
    626             } 
    627  
    628         } catch (BadLocationException ex) { 
    629             Logger.getLogger(NXvalidateFrame.class.getName()).log(Level.SEVERE, 
    630                     null, ex); 
    631         } 
    632  
    633     } 
    634  
    635     protected void addStylesToDocument(StyledDocument doc) { 
    636  
    637         //Initialize some styles. 
    638         Style def = StyleContext.getDefaultStyleContext(). 
    639                 getStyle(StyleContext.DEFAULT_STYLE); 
    640  
    641         Style regular = doc.addStyle("regular", def); 
    642         StyleConstants.setFontFamily(def, "SansSerif"); 
    643  
    644         Style s = doc.addStyle("italic", regular); 
    645         StyleConstants.setItalic(s, true); 
    646  
    647         s = doc.addStyle("bold", regular); 
    648         StyleConstants.setBold(s, true); 
    649  
    650         s = doc.addStyle("small", regular); 
    651         StyleConstants.setFontSize(s, 10); 
    652  
    653         s = doc.addStyle("large", regular); 
    654         StyleConstants.setFontSize(s, 16); 
    655  
    656         s = doc.addStyle("heading", regular); 
    657         StyleConstants.setFontSize(s, 16); 
    658         StyleConstants.setBold(s, true); 
    659  
    660         s = doc.addStyle("title", regular); 
    661         StyleConstants.setFontSize(s, 24); 
    662         StyleConstants.setBold(s, true); 
    663  
    664         s = doc.addStyle("errorheading", regular); 
    665         StyleConstants.setFontSize(s, 16); 
    666         StyleConstants.setBold(s, true); 
    667         StyleConstants.setForeground(s, Color.red); 
    668  
    669         s = doc.addStyle("error", regular); 
    670         StyleConstants.setBold(s, true); 
    671         StyleConstants.setForeground(s, Color.red); 
    672  
    673     } 
     522                root.removeAllNodes(); 
     523                domTree.updateTree(); 
     524            } 
     525        } 
     526    }//GEN-LAST:event_closeAllMenuItemActionPerformed 
     527 
     528    private void bulkMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bulkMenuItemActionPerformed 
     529 
     530        if (evt.getSource() == bulkMenuItem) { 
     531 
     532            fileLoadingActions.setNXConvertFile(nxconvertFile); 
     533            BulkLoadFilesFrame bulk = new BulkLoadFilesFrame(fileLoadingActions); 
     534            bulk.setVisible(true); 
     535 
     536        } 
     537 
     538    }//GEN-LAST:event_bulkMenuItemActionPerformed 
    674539 
    675540    /** 
     
    687552    } 
    688553    // Variables declaration - do not modify//GEN-BEGIN:variables 
     554    private javax.swing.JMenuItem aboutMenuItem; 
    689555    private javax.swing.JMenuItem bulkMenuItem; 
     556    private javax.swing.JMenuItem closeAllMenuItem; 
    690557    private javax.swing.JMenuItem closeFileMenuItem; 
    691558    private javax.swing.JOptionPane dialogReportProblem; 
     559    private javax.swing.JMenuItem exitAppMenuItem; 
     560    private javax.swing.JMenu fileMenu; 
    692561    private javax.swing.JMenuItem filterMenuItem; 
    693     private javax.swing.JMenu jMenu1; 
    694     private javax.swing.JMenu jMenu2; 
     562    private javax.swing.JMenu helpMenu; 
     563    private javax.swing.JMenuItem helpMenuItem; 
    695564    private javax.swing.JMenuBar jMenuBar1; 
    696565    private javax.swing.JPanel jPanel2; 
     
    700569    private javax.swing.JPopupMenu.Separator jSeparator2; 
    701570    private javax.swing.JPopupMenu.Separator jSeparator3; 
     571    private javax.swing.JPopupMenu.Separator jSeparator4; 
     572    private javax.swing.JPopupMenu.Separator jSeparator5; 
     573    private javax.swing.JPopupMenu.Separator jSeparator6; 
    702574    private javax.swing.JSplitPane jSplitPane1; 
    703575    private javax.swing.JTextPane jTextPane1; 
     
    705577    private javax.swing.JMenuItem openFilesMenuItem; 
    706578    private javax.swing.JMenuItem settingsMenuItem; 
     579    private javax.swing.JMenu toolsMenu; 
    707580    private javax.swing.JPopupMenu treePopupMenu; 
    708581    private javax.swing.JMenuItem validateSelectedMenuItem; 
Note: See TracChangeset for help on using the changeset viewer.