View Javadoc
1 /*** 2 * MyTreeNode.java 3 * 4 * Project: Dependency Tool 5 * 6 * WHEN WHO WHAT 7 * 06.06.2003 pko initial public release 8 * 16.07.2002 ctr creation 9 * 10 * Copyright 2003 ELCA Informatique SA 11 * Av. de la Harpe 22-24, 1000 Lausanne 13, Switzerland 12 * www.elca.ch 13 * 14 * This library is free software; you can redistribute it and/or 15 * modify it under the terms of the GNU Lesser General Public License 16 * as published by the Free Software Foundation; either version 2.1 of 17 * the License, or (at your option) any later version. 18 * 19 * This library is distributed in the hope that it will be useful, but 20 * WITHOUT ANY WARRANTY; without even the implied warranty of 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22 * Lesser General Public License for more details. 23 * 24 * You should have received a copy of the GNU Lesser General Public 25 * License along with this library; if not, write to the Free Software 26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 27 * USA 28 */ 29 30 package ch.elca.dependency.view; 31 32 import javax.swing.tree.DefaultMutableTreeNode; 33 34 /*** 35 * Adds the icon stuff to the <code>DefaultMutableTreeNode</code>. 36 * 37 * @author Christoph Trutmann 38 * @version 1.0-beta 39 */ 40 public class MyTreeNode extends DefaultMutableTreeNode { 41 42 /*** 43 * Type string for the cycle icon. 44 */ 45 public static final String CYCLE_ICON_TYPE = "cycle"; 46 47 /*** 48 * Type string for the extern package icon. 49 */ 50 public static final String EXTERN_ICON_TYPE = "ext"; 51 52 /*** 53 * String specifying the type of the icon. 54 * This allows to change the icon during runtime. For example if a node 55 * leads to a cycle. 56 */ 57 public String iconType = ""; 58 59 /*** 60 * Creates a tree node that has no parent and no children, but which 61 * allows children. 62 */ 63 public MyTreeNode() { 64 super(); 65 } 66 67 /*** 68 * Creates a tree node with no parent, no children, but which allows 69 * children, and initializes it with the specified user object. 70 * 71 * @param userObject an Object provided by the user that constitutes 72 * the node's data 73 */ 74 public MyTreeNode(Object userObject) { 75 super(userObject); 76 } 77 78 /*** 79 * Creates a tree node with no parent, no children, initialized with 80 * the specified user object, and that allows children only if 81 * specified. 82 * 83 * @param userObject an Object provided by the user that constitutes 84 * the node's data 85 * @param allowsChildren if true, the node is allowed to have child 86 * nodes -- otherwise, it is always a leaf node 87 */ 88 public MyTreeNode(Object userObject, boolean allowsChildren) { 89 super(userObject, allowsChildren); 90 } 91 }

This page was automatically generated by Maven