JHotDraw 7.4.1

org.jhotdraw.gui.fontchooser
Class FontCollectionNode

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

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

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

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

Constructor Summary
FontCollectionNode(java.lang.String name)
           
FontCollectionNode(java.lang.String name, java.util.ArrayList<FontFamilyNode> families)
           
 
Method Summary
 void add(FontFamilyNode newChild)
           
 void addAll(java.util.Collection<FontFamilyNode> c)
           
 java.util.Enumeration children()
           
 FontCollectionNode clone()
           
 int compareTo(FontCollectionNode that)
           
 java.util.List<FontFamilyNode> families()
           
 boolean getAllowsChildren()
           
 FontFamilyNode getChildAt(int childIndex)
           
 int getChildCount()
           
 int getIndex(javax.swing.tree.TreeNode node)
           
 java.lang.String getName()
           
 javax.swing.tree.MutableTreeNode getParent()
           
 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 setEditable(boolean newValue)
           
 void setParent(javax.swing.tree.MutableTreeNode newParent)
           
 void setUserObject(java.lang.Object object)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FontCollectionNode

public FontCollectionNode(java.lang.String name)

FontCollectionNode

public FontCollectionNode(java.lang.String name,
                          java.util.ArrayList<FontFamilyNode> families)
Method Detail

compareTo

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

getName

public java.lang.String getName()

toString

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

clone

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

add

public void add(FontFamilyNode newChild)

addAll

public void addAll(java.util.Collection<FontFamilyNode> c)

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 FontFamilyNode 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.MutableTreeNode 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

families

public java.util.List<FontFamilyNode> families()

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()

setEditable

public void setEditable(boolean newValue)

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.