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.StringattachedMemory(package private) java.lang.StringattachedSensor(package private) net.java.games.input.Componentcomponent(package private) net.java.games.input.Controllercontroller(package private) java.lang.Stringname(package private) floatval
-
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 booleanequals(java.lang.Object a)java.lang.StringgetAttachedMemory()java.lang.StringgetAttachedSensor()net.java.games.input.ComponentgetComponent()net.java.games.input.ControllergetController()java.lang.StringgetName()static UsbNodegetNode(java.lang.String name, net.java.games.input.Controller controller, net.java.games.input.Component component)Get a specific node.floatgetValue()inthashCode()voidsetAttachedMemory(java.lang.String memory)voidsetAttachedSensor(java.lang.String sensor)voidsetValue(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:
hashCodein 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:
equalsin 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
-
-