org.jhotdraw.gui.fontchooser
Class FontFamilyNode

java.lang.Object
  extended by org.jhotdraw.gui.fontchooser.FontFamilyNode
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<FontFamilyNode>, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class FontFamilyNode
extends java.lang.Object
implements javax.swing.tree.MutableTreeNode, java.lang.Comparable<FontFamilyNode>, java.lang.Cloneable

A FontFamilyNode is a MutableTreeNode which only allows FontFaceNode as child nodes.

Author:
Werner Randelshofer  @version $Id: FontFamilyNode.java 527 2009-06-07 14:28:19Z rawcoder $

Field Summary
private  java.util.ArrayList<FontFaceNode> children
           
private  java.lang.String name
           
private  FontCollectionNode parent
           
 
Constructor Summary
FontFamilyNode(java.lang.String name)
           
 
Method Summary
 void add(FontFaceNode newChild)
           
 java.util.Enumeration children()
           
 FontFamilyNode clone()
           
 int compareTo(FontFamilyNode that)
           
 boolean equals(java.lang.Object o)
           
 java.util.List<FontFaceNode> faces()
           
 boolean getAllowsChildren()
           
 FontFaceNode getChildAt(int childIndex)
           
 int getChildCount()
           
 int getIndex(javax.swing.tree.TreeNode node)
           
 java.lang.String getName()
           
 javax.swing.tree.TreeNode getParent()
           
 int hashCode()
           
 void insert(javax.swing.tree.MutableTreeNode newChild, int index)
           
 boolean isEditable()
           
 boolean isLeaf()
           
 boolean isNodeChild(javax.swing.tree.TreeNode aNode)
          Returns true if aNode is a child of this node.
 void remove(int childIndex)
           
 void remove(javax.swing.tree.MutableTreeNode aChild)
           
 void removeFromParent()
           
 void setParent(javax.swing.tree.MutableTreeNode newParent)
           
 void setUserObject(java.lang.Object object)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

private FontCollectionNode parent

name

private java.lang.String name

children

private java.util.ArrayList<FontFaceNode> children
Constructor Detail

FontFamilyNode

public FontFamilyNode(java.lang.String name)
Method Detail

compareTo

public int compareTo(FontFamilyNode that)
Specified by:
compareTo in interface java.lang.Comparable<FontFamilyNode>

clone

public FontFamilyNode clone()
Overrides:
clone in class java.lang.Object

getName

public java.lang.String getName()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

add

public void add(FontFaceNode newChild)

insert

public void insert(javax.swing.tree.MutableTreeNode newChild,
                   int index)
Specified by:
insert in interface javax.swing.tree.MutableTreeNode

remove

public void remove(int childIndex)
Specified by:
remove in interface javax.swing.tree.MutableTreeNode

remove

public void remove(javax.swing.tree.MutableTreeNode aChild)
Specified by:
remove in interface javax.swing.tree.MutableTreeNode

setUserObject

public void setUserObject(java.lang.Object object)
Specified by:
setUserObject in interface javax.swing.tree.MutableTreeNode

removeFromParent

public void removeFromParent()
Specified by:
removeFromParent in interface javax.swing.tree.MutableTreeNode

setParent

public void setParent(javax.swing.tree.MutableTreeNode newParent)
Specified by:
setParent in interface javax.swing.tree.MutableTreeNode

getChildAt

public FontFaceNode getChildAt(int childIndex)
Specified by:
getChildAt in interface javax.swing.tree.TreeNode

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface javax.swing.tree.TreeNode

getParent

public javax.swing.tree.TreeNode getParent()
Specified by:
getParent in interface javax.swing.tree.TreeNode

getIndex

public int getIndex(javax.swing.tree.TreeNode node)
Specified by:
getIndex in interface javax.swing.tree.TreeNode

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface javax.swing.tree.TreeNode

children

public java.util.Enumeration children()
Specified by:
children in interface javax.swing.tree.TreeNode

faces

public java.util.List<FontFaceNode> faces()

isNodeChild

public boolean isNodeChild(javax.swing.tree.TreeNode aNode)
Returns true if aNode is a child of this node. If aNode is null, this method returns false.

Returns:
true if aNode is a child of this node; false if aNode is null

isEditable

public boolean isEditable()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object