com.melloware.jukes.gui.view.node
Class AbstractTreeNode
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
com.melloware.jukes.gui.view.node.AbstractTreeNode
- All Implemented Interfaces:
- NavigationNode, Serializable, Cloneable, MutableTreeNode, TreeNode
- Direct Known Subclasses:
- ArtistNode, DiscNode, RootNode, TrackNode
public abstract class AbstractTreeNode
- extends DefaultMutableTreeNode
- implements NavigationNode
Abstract tree node class that all tree nodes must extend from. Supports
lazy loading of children to conserve memory and better performance.
Copyright (c) 1999-2007 Melloware, Inc.
- Version:
- 4.0
- Author:
- Emil A. Lefkof III
- See Also:
DefaultMutableTreeNode,
NavigationNode,
Serialized Form
| Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
breadthFirstEnumeration, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildBefore, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject |
BASEFONT
protected static final Font BASEFONT
- Base font used for all children to derive font from.
model
protected final AbstractJukesObject model
childrenLoaded
protected boolean childrenLoaded
loadingChildren
protected boolean loadingChildren
fontColor
protected Color fontColor
font
protected Font font
parent
protected final NavigationNode parent
settings
protected Settings settings
AbstractTreeNode
public AbstractTreeNode(NavigationNode aParent,
AbstractJukesObject aModel)
- Constructor that takes the parent node and the domain model to contain.
- Parameters:
aParent - the parent nodeaModel - the domain model to contain in this node
getName
public abstract String getName()
- Returns this node's name. Subclasses typically implement this method
by returning the model's name or identifier.
- Specified by:
getName in interface NavigationNode
- Returns:
- this node's name
loadChildren
public abstract void loadChildren()
- Loads the node's child objects. This is used for lazy loading and each
subclass should implement this to retrieve its children.
getChildAt
public TreeNode getChildAt(int index)
- Specified by:
getChildAt in interface TreeNode- Overrides:
getChildAt in class DefaultMutableTreeNode
getChildCount
public int getChildCount()
- Specified by:
getChildCount in interface TreeNode- Overrides:
getChildCount in class DefaultMutableTreeNode
getFont
public Font getFont()
- Description copied from interface:
NavigationNode
- Returns this node's Font for the given selection state.
- Specified by:
getFont in interface NavigationNode
- Returns:
- this node's Font for the given selection state
getFontColor
public Color getFontColor()
- Gets the fontColor.
- Specified by:
getFontColor in interface NavigationNode
- Returns:
- Returns the fontColor.
getModel
public AbstractJukesObject getModel()
- Description copied from interface:
NavigationNode
- Returns this node's model.
- Specified by:
getModel in interface NavigationNode
- Returns:
- this node's model
getNodeIcon
public Icon getNodeIcon(boolean selected)
- Returns the icon to represent this node and any overlays that should be
applied.
- Specified by:
getNodeIcon in interface NavigationNode
- Parameters:
selected - true if this node is currently selected
- Returns:
- the Icon to display
getSettings
public Settings getSettings()
- Gets the presentation settings.
- Returns:
- Returns the settings.
getUserObject
public Object getUserObject()
- Overrides:
getUserObject in class DefaultMutableTreeNode
setFont
public void setFont(Font aFont)
- Sets the font for this tree node.
- Parameters:
aFont - The font to set.
setFontColor
public void setFontColor(Color aFontColor)
- Sets the fontColor.
- Parameters:
aFontColor - The fontColor to set.
setSettings
public void setSettings(Settings aSettings)
- Sets the Settings into this node.
- Parameters:
aSettings - The settings to set.
add
public void add(MutableTreeNode aNewChild)
- Overrides:
add in class DefaultMutableTreeNode
children
public Enumeration children()
- Specified by:
children in interface TreeNode- Overrides:
children in class DefaultMutableTreeNode
delete
public void delete()
- Delete this domain object and it's tree node.
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
toString
public String toString()
- Overrides:
toString in class DefaultMutableTreeNode
getMainFrame
protected MainFrame getMainFrame()
- Gets the MainFrame for the application.
- Returns:
- the MainFrame object
getMainModule
protected MainModule getMainModule()
- Gets the MainModule for the application.
- Returns:
- the MainModule object
Copyright © 1999-2010 Melloware Inc. All Rights Reserved.