KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jdepend > swingui > AfferentNode


1 package jdepend.swingui;
2
3 import java.util.*;
4
5 import jdepend.framework.*;
6
7 /**
8  * The <code>AfferentNode</code> class is a <code>PackageNode</code> for an
9  * afferent Java package and its afferent packages.
10  *
11  * @author <b>Mike Clark</b>
12  * @author Clarkware Consulting, Inc.
13  */

14
15 public class AfferentNode extends PackageNode {
16
17     /**
18      * Constructs an <code>AfferentNode</code> with the specified parent node
19      * and afferent Java package.
20      *
21      * @param parent Parent package node.
22      * @param jPackage Afferent Java package.
23      */

24     public AfferentNode(PackageNode parent, JavaPackage jPackage) {
25         super(parent, jPackage);
26     }
27
28     /**
29      * Creates and returns a <code>PackageNode</code> with the specified
30      * parent node and Java package.
31      *
32      * @param parent Parent package node.
33      * @param jPackage Java package.
34      * @return A non-null <code>PackageNode</code.
35      */

36     protected PackageNode makeNode(PackageNode parent, JavaPackage jPackage) {
37         return new AfferentNode(parent, jPackage);
38     }
39
40     /**
41      * Returns the collection of Java packages coupled to the package
42      * represented in this node.
43      *
44      * @return Collection of coupled packages.
45      */

46     protected Collection getCoupledPackages() {
47         return getPackage().getAfferents();
48     }
49
50     /**
51      * Returns the string representation of this node in it's current tree
52      * context.
53      *
54      * @return Node label.
55      */

56     public String JavaDoc toString() {
57         if (getParent() == null) {
58             return "Used By - Afferent Dependencies" + " ("
59                     + getChildren().size() + " Packages)";
60         }
61
62         return super.toString();
63     }
64 }
65
66
Popular Tags