Package jmri.jmrix.jinput
Class UsbNode
- java.lang.Object
-
- javax.swing.tree.DefaultMutableTreeNode
-
- jmri.jmrix.jinput.UsbNode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,javax.swing.tree.MutableTreeNode
,javax.swing.tree.TreeNode
public class UsbNode extends javax.swing.tree.DefaultMutableTreeNode
UsbNode represents the USB controllers or component.Generally accessed via the TreeModel.
Can be connected to a JMRI Sensor or Memory.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.String
attachedMemory
(package private) java.lang.String
attachedSensor
(package private) net.java.games.input.Component
component
(package private) net.java.games.input.Controller
controller
(package private) java.lang.String
name
(package private) float
val
-
Constructor Summary
Constructors Constructor Description UsbNode(java.lang.String name, net.java.games.input.Controller controller, net.java.games.input.Component component)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object a)
java.lang.String
getAttachedMemory()
java.lang.String
getAttachedSensor()
net.java.games.input.Component
getComponent()
net.java.games.input.Controller
getController()
java.lang.String
getName()
static UsbNode
getNode(java.lang.String name, net.java.games.input.Controller controller, net.java.games.input.Component component)
Get a specific node.float
getValue()
int
hashCode()
void
setAttachedMemory(java.lang.String memory)
void
setAttachedSensor(java.lang.String sensor)
void
setValue(float val)
-
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
-
-
-
-
Field Detail
-
name
java.lang.String name
-
controller
net.java.games.input.Controller controller
-
component
net.java.games.input.Component component
-
val
float val
-
attachedSensor
java.lang.String attachedSensor
-
attachedMemory
java.lang.String attachedMemory
-
-
Constructor Detail
-
UsbNode
UsbNode(java.lang.String name, net.java.games.input.Controller controller, net.java.games.input.Component component)
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getController
public net.java.games.input.Controller getController()
-
getComponent
public net.java.games.input.Component getComponent()
-
equals
public boolean equals(java.lang.Object a)
- Overrides:
equals
in classjava.lang.Object
-
setValue
public void setValue(float val)
-
getValue
public float getValue()
-
setAttachedSensor
public void setAttachedSensor(java.lang.String sensor)
-
getAttachedSensor
public java.lang.String getAttachedSensor()
-
setAttachedMemory
public void setAttachedMemory(java.lang.String memory)
-
getAttachedMemory
public java.lang.String getAttachedMemory()
-
getName
public java.lang.String getName()
-
getNode
public static UsbNode getNode(java.lang.String name, net.java.games.input.Controller controller, net.java.games.input.Component component)
Get a specific node. This is used instead of a constructor to ensure that node objects for a given USB object are unique.- Parameters:
name
- the node namecontroller
- the input controllercomponent
- the input component- Returns:
- the node, either an existing node with the same controller or component, or newly created
-
-