/**Short-hand for the four-argument <code>buildTreePath</code> method. * Calls <code>buildTreePath(source,label,<strong>null</strong>,topNode)</code>. * @see buildTreePath(String,String,String,DefaultMutableTreeNode). * */ private void buildTreePath(String source, String label, DefaultMutableTreeNode topNode) { buildTreePath(source, label, null, topNode); }
/**Short-hand for the four-argument <code>buildTreePath</code> method. * Calls <code>buildTreePath(source,label,<strong>null</strong>,topNode)</code>. * @see buildTreePath(String,String,String,DefaultMutableTreeNode). * */ private void buildTreePath(String source, String label, DefaultMutableTreeNode topNode) { buildTreePath(source, label, null, topNode); }
/**Populates the <code>node</code> argument with items retrieved from the two String[] arguments. * Delegates indirectly to {@link buildTreePath(String.String,String,DefaultMutableTreeNode)} to do the job. * If either arguments are empty (i.e., length=0) or have different sizes, the method does nothing. * @param items String array where each element is the source of a tree path (see {@see buildTreePath(String, String, DefaultMutableTreeNode)} * and {@see buildTreePath(String,String,String,DefaultMutableTreeNode)}. * @param labels String array where each element is the label of the root of the tree path * @param node The TreeNode to be populated */ private void populateNode(String[] items, String[] labels, DefaultMutableTreeNode node) { if (items.length==0 || items.length!=labels.length) return; String label=null; for (int i=0; i<items.length; i++) { if(labels!=null && i<labels.length) label = labels[i]; buildTreePath(items[i], label, node); } }
/**Populates the <code>node</code> argument with items retrieved from the two String[] arguments. * Delegates indirectly to {@link buildTreePath(String.String,String,DefaultMutableTreeNode)} to do the job. * If either arguments are empty (i.e., length=0) or have different sizes, the method does nothing. * @param items String array where each element is the source of a tree path (see {@see buildTreePath(String, String, DefaultMutableTreeNode)} * and {@see buildTreePath(String,String,String,DefaultMutableTreeNode)}. * @param labels String array where each element is the label of the root of the tree path * @param node The TreeNode to be populated */ private void populateNode(String[] items, String[] labels, DefaultMutableTreeNode node) { if (items.length==0 || items.length!=labels.length) return; String label=null; for (int i=0; i<items.length; i++) { if(labels!=null && i<labels.length) label = labels[i]; buildTreePath(items[i], label, node); } }