Class 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  
      • Fields inherited from class javax.swing.tree.DefaultMutableTreeNode

        allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
    • 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
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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 class java.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 class java.lang.Object
      • setValue

        public void setValue​(float val)
      • 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 name
        controller - the input controller
        component - the input component
        Returns:
        the node, either an existing node with the same controller or component, or newly created