JSampler
v0.8a

org.jsampler.view
Class DbDirectoryTreeNode

java.lang.Object
  extended by org.jsampler.view.DbDirectoryTreeNode
All Implemented Interfaces:
javax.swing.tree.TreeNode

public class DbDirectoryTreeNode
extends java.lang.Object
implements javax.swing.tree.TreeNode


Constructor Summary
DbDirectoryTreeNode(DbDirectoryInfo info)
          Creates a new instance of DbDirectoryTreeNode.
 
Method Summary
 void addDirectories(DbDirectoryTreeNode[] children)
           
 void addDirectory(DbDirectoryTreeNode child)
           
 void addInstrument(DbInstrumentInfo info)
           
 void addInstruments(DbInstrumentInfo[] infos)
           
 void addInstrumentsDbListener(InstrumentsDbListener l)
          Registers the specified listener for receiving event messages.
 java.util.Enumeration children()
           
 boolean getAllowsChildren()
           
 DbDirectoryTreeNode getChildAt(int index)
           
 int getChildCount()
           
 int getIndex(javax.swing.tree.TreeNode node)
           
 DbDirectoryInfo getInfo()
           
 DbInstrumentInfo getInstrument(java.lang.String instrName)
          Gets the instrument with the specified name.
 DbInstrumentInfo getInstrumentAt(int index)
           
 int getInstrumentCount()
           
 int getInstrumentIndex(DbInstrumentInfo instr)
           
 DbDirectoryTreeNode getParent()
           
 boolean isConnected()
           
 boolean isDetached()
          Determines whether the node is part of a tree or not.
 boolean isLeaf()
           
 void removeAllDirectories()
           
 void removeAllInstruments()
           
 void removeDirectory(int index)
           
 void removeDirectoryByPathName(java.lang.String path)
           
 void removeInstrument(int index)
           
 void removeInstrumentByPathName(java.lang.String path)
           
 void removeInstrumentsDbListener(InstrumentsDbListener l)
          Removes the specified listener.
 void setConnected(boolean b)
           
 void setDetached(boolean b)
          Sets whether the node is part of a tree or not.
 void setInfo(DbDirectoryInfo info)
           
protected  void setName(java.lang.String newName)
          Renames this node.
 void setParent(DbDirectoryTreeNode parent)
           
 java.lang.String toString()
           
 void updateDirectory(DbDirectoryInfo info)
           
protected  void updateDirectoryPaths()
          Invoked when the name of a parent node is changed.
 void updateInstrument(DbInstrumentInfo info)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DbDirectoryTreeNode

public DbDirectoryTreeNode(DbDirectoryInfo info)
Creates a new instance of DbDirectoryTreeNode.

Method Detail

addInstrumentsDbListener

public void addInstrumentsDbListener(InstrumentsDbListener l)
Registers the specified listener for receiving event messages.

Parameters:
l - The InstrumentsDbListener to register.

removeInstrumentsDbListener

public void removeInstrumentsDbListener(InstrumentsDbListener l)
Removes the specified listener.

Parameters:
l - The InstrumentsDbListener to remove.

getInfo

public DbDirectoryInfo getInfo()

setInfo

public void setInfo(DbDirectoryInfo info)

setName

protected void setName(java.lang.String newName)
Renames this node. Also updates the paths of all children.


updateDirectoryPaths

protected void updateDirectoryPaths()
Invoked when the name of a parent node is changed.


getChildAt

public DbDirectoryTreeNode getChildAt(int index)
Specified by:
getChildAt in interface javax.swing.tree.TreeNode

getChildCount

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

getParent

public DbDirectoryTreeNode 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

setParent

public void setParent(DbDirectoryTreeNode parent)

addDirectory

public void addDirectory(DbDirectoryTreeNode child)

addDirectories

public void addDirectories(DbDirectoryTreeNode[] children)

removeDirectory

public void removeDirectory(int index)

removeDirectoryByPathName

public void removeDirectoryByPathName(java.lang.String path)

removeInstrumentByPathName

public void removeInstrumentByPathName(java.lang.String path)

removeAllDirectories

public void removeAllDirectories()

updateDirectory

public void updateDirectory(DbDirectoryInfo info)

addInstrument

public void addInstrument(DbInstrumentInfo info)

addInstruments

public void addInstruments(DbInstrumentInfo[] infos)

removeAllInstruments

public void removeAllInstruments()

updateInstrument

public void updateInstrument(DbInstrumentInfo info)

getInstrumentAt

public DbInstrumentInfo getInstrumentAt(int index)

getInstrumentCount

public int getInstrumentCount()

getInstrumentIndex

public int getInstrumentIndex(DbInstrumentInfo instr)

removeInstrument

public void removeInstrument(int index)

getInstrument

public DbInstrumentInfo getInstrument(java.lang.String instrName)
Gets the instrument with the specified name.

Parameters:
instrName - The name of the instrument to return.
Returns:
The instrument with the specified name or null if there is no instrument with the specified name in this directory.

isConnected

public boolean isConnected()

setConnected

public void setConnected(boolean b)

isDetached

public boolean isDetached()
Determines whether the node is part of a tree or not. The default value is false.


setDetached

public void setDetached(boolean b)
Sets whether the node is part of a tree or not.


toString

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

JSampler
v0.8a

Copyright © 2007 Grigor Iliev. All rights reserved.