|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--usb.view.USBNode
Models entities, in particular devices, that are displayed using this package's USB tree viewer.
Subclassers will commonly provide support specific to a class
or device device information. If the device wants to present children
(such as hub ports, files of images or audio data, or something else)
then the three relevant methods should be overridden:
getAllowsChildren()
, getChildAt(int)
and
getChildCount()
.
By default, nodes provide textual descriptions using HTML, and
subclasses can add more information by overriding
showClassInfo(java.lang.StringBuffer)
.
If a non-HTML display is needed, override draw(javax.swing.JEditorPane)
.
Field Summary | |
protected Device |
dev
The device node which is associated with this node, or null. |
protected javax.swing.tree.TreeNode |
parent
Swing's tree model requires nodes to know their parents. |
Constructor Summary | |
USBNode(Device device,
javax.swing.tree.TreeNode nodeParent)
Constructs a tree node model. |
Method Summary | |
java.util.Enumeration |
children()
Not implemented. |
void |
draw(javax.swing.JEditorPane editor)
Renders this node in an auxiliary pane. |
boolean |
getAllowsChildren()
Reports that children are not allowed. |
javax.swing.tree.TreeNode |
getChildAt(int n)
Returns null. |
int |
getChildCount()
Returns zero. |
int |
getIndex(javax.swing.tree.TreeNode n)
Not implemented. |
javax.swing.tree.TreeNode |
getParent()
Returns the parent provided to the constructcor. |
boolean |
isLeaf()
Returns true for nodes that don't allow children. |
protected void |
showClassInfo(java.lang.StringBuffer buf)
This method is a hook to provide class-specific data (in HTML) when this node is selected. |
java.lang.String |
toString()
Returns the label to be used displaying this tree node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected final Device dev
protected final javax.swing.tree.TreeNode parent
Constructor Detail |
public USBNode(Device device, javax.swing.tree.TreeNode nodeParent) throws java.io.IOException
Method Detail |
public boolean getAllowsChildren()
getAllowsChildren
in interface javax.swing.tree.TreeNode
public javax.swing.tree.TreeNode getChildAt(int n)
getChildAt
in interface javax.swing.tree.TreeNode
public int getChildCount()
getChildCount
in interface javax.swing.tree.TreeNode
public int getIndex(javax.swing.tree.TreeNode n)
getIndex
in interface javax.swing.tree.TreeNode
public java.util.Enumeration children()
children
in interface javax.swing.tree.TreeNode
public final javax.swing.tree.TreeNode getParent()
getParent
in interface javax.swing.tree.TreeNode
public final boolean isLeaf()
isLeaf
in interface javax.swing.tree.TreeNode
public java.lang.String toString()
toString
in class java.lang.Object
public void draw(javax.swing.JEditorPane editor)
showClassInfo(java.lang.StringBuffer)
)
class-specific. Subclasses may choose to use a non-HTML display,
or a different sort of HTML display,
by overriding this method.protected void showClassInfo(java.lang.StringBuffer buf)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |