Ignore:
Timestamp:
19/08/10 12:43:30 (21 months ago)
Author:
Stephen Rankin
Message:

Added copyright to files. Added some code for filtering bad nodes. ref#236.

File:
1 edited

Legend:

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

    r1504 r1507  
    1 /* 
    2  * To change this template, choose Tools | Templates 
    3  * and open the template in the editor. 
     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 * TextPaneStyle.java 
     24 * 
    425 */ 
    526package org.nexusformat.nxvalidate; 
     
    1637public class TreeUtils { 
    1738 
     39    public void hideGoodNodes(JTree tree){ 
     40 
     41        if (tree.isSelectionEmpty()) { 
     42            return; 
     43        } 
     44 
     45        NXNodeMapper baseNode = getBaseNode(tree); 
     46        NXNodeMapper node = null; 
     47         
     48        int rows = tree.getRowCount(); 
     49 
     50        for (int i = 0; i < rows; ++i) { 
     51            node = (NXNodeMapper) tree.getPathForRow(i).getLastPathComponent(); 
     52            System.out.println("Node Name: " + node.toString() + ": " + node.getBadNode()); 
     53        } 
     54 
     55    } 
     56 
     57    public void showGoodNodes(JTree tree){ 
     58 
     59        if (tree.isSelectionEmpty()) { 
     60            return; 
     61        } 
     62 
     63        NXNodeMapper baseNode = getBaseNode(tree); 
     64        NXNodeMapper node = null; 
     65 
     66        int rows = tree.getRowCount(); 
     67 
     68        for (int i = 0; i < rows; ++i) { 
     69            node = (NXNodeMapper) tree.getPathForRow(i).getLastPathComponent(); 
     70            System.out.println("Node Name: " + node.toString()); 
     71        } 
     72 
     73    } 
     74 
    1875    public String getTreePath(JTree tree) { 
    1976 
     
    49106    } 
    50107 
    51     public File getNXDCFile(JTree tree) { 
     108    public File getNXDLFile(JTree tree) { 
    52109        if (getNode(tree) != null) { 
    53110            return getNode(tree).getSchematronFile(); 
     
    89146    } 
    90147 
    91     public void setNXDCFile(JTree tree, File file) { 
     148    public void setNXDLFile(JTree tree, File file) { 
    92149        if (getNode(tree) != null) { 
    93150            getNode(tree).setSchematronFile(file); 
     
    142199        return tmpNode; 
    143200    } 
     201 
    144202} 
Note: See TracChangeset for help on using the changeset viewer.