jmri.jmrix.jinput
Class TreeModel

java.lang.Object
  extended by javax.swing.tree.DefaultTreeModel
      extended by jmri.jmrix.jinput.TreeModel
All Implemented Interfaces:
Serializable, TreeModel

public final class TreeModel
extends DefaultTreeModel

TreeModel represents the USB controllers and components

Accessed via the instance() member, as we expect to have only one of these models talking to the USB subsystem.

The tree has three levels below the uninteresting root:

  1. USB controller
  2. Components (input, axis)

jinput requires that there be only one of these for a given USB system in a given JVM so we use a pseudo-singlet "instance" approach Class is final because it starts a survey thread, which runs while constructor is still active.

Author:
Bob Jacobsen Copyright 2008, 2010
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
           
 net.java.games.input.Controller[] controllers()
           
static TreeModel instance()
          Provide access to the model.
 void removePropertyChangeListener(PropertyChangeListener l)
           
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static TreeModel instance()
Provide access to the model. There's only one, because access to the USB subsystem is required


controllers

public net.java.games.input.Controller[] controllers()

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads