Java JTree Node isReflectanceType(TreeNode productTypeNode, String type)

Here you can find the source of isReflectanceType(TreeNode productTypeNode, String type)

Description

is Reflectance Type

License

Open Source License

Declaration

private static boolean isReflectanceType(TreeNode productTypeNode,
            String type) 

Method Source Code

//package com.java2s;
//License from project: GNU General Public License 

import javax.swing.tree.TreeNode;

public class Main {
    private static boolean isReflectanceType(TreeNode productTypeNode,
            String type) {//from www  .  j a v a 2  s  . co  m
        for (int i = 0; i < productTypeNode.getChildCount(); i++) {
            // we have: 'GEOMETRY', 'NDVI', 'QUALITY', 'RADIOMETRY', 'TIME'
            final TreeNode productTypeChildNode = productTypeNode
                    .getChildAt(i);
            final String productTypeChildNodeName = productTypeChildNode
                    .toString();

            if (productTypeChildNodeName.equals("RADIOMETRY")) {
                // children are BLUE, RED, NIR, SWIR
                final TreeNode radiometryChildNode = productTypeChildNode
                        .getChildAt(0);
                return radiometryChildNode.getChildAt(0).toString()
                        .equals(type);
            }
        }
        return false;
    }
}

Related

  1. isAncestor(final TreeNode node, final TreeNode parent)
  2. isChildNode(DefaultMutableTreeNode parent, DefaultMutableTreeNode child)
  3. isMovingUp(DefaultMutableTreeNode ntarget, DefaultMutableTreeNode nsource)
  4. isNodeAsStrChild(DefaultMutableTreeNode parent, String child)
  5. isNodeOrChildSelected(JTree tree, DefaultMutableTreeNode node)
  6. listTree(TreeNode node, String prefix, String lineSeparator)
  7. printTree(final DefaultMutableTreeNode tree, final String indent)
  8. recursiveTreeNode(DefaultMutableTreeNode node)
  9. refreshNode(final JTree tree, final TreeNode node)