tnt.gui
Class KeyButtonListModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by javax.swing.DefaultListModel
          extended by tnt.gui.KeyButtonListModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.ListModel

public class KeyButtonListModel
extends javax.swing.DefaultListModel

Provides additional functionality regarding the handling of KeyButton and ModelDefinition objects.

Version:
1.0 - 02/2006
Author:
Steven J. Castellucci
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
KeyButtonListModel()
           
 
Method Summary
 KeyButton[] getKeyButtonArray()
          Returns an array of KeyButton objects, representing the elements in this model.
 void loadFromArray(KeyButton[] array)
          Loads objects from the passed KeyButton array into this list model.
 ModelDefinition saveToModelDefinition(ModelDefinition md)
          Saves key-button definitions and thumb assignments (including the SPACE-key policy) to the passed ModelDefinition object and returns it.
 
Methods inherited from class javax.swing.DefaultListModel
add, addElement, capacity, clear, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, get, getElementAt, getSize, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, removeAllElements, removeElement, removeElementAt, removeRange, set, setElementAt, setSize, size, toArray, toString, trimToSize
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyButtonListModel

public KeyButtonListModel()
Method Detail

getKeyButtonArray

public KeyButton[] getKeyButtonArray()
Returns an array of KeyButton objects, representing the elements in this model. If an element is not an instance of KeyButtton, the corresponding array entry is null.

Returns:
an array of KeyButtton objects.

loadFromArray

public void loadFromArray(KeyButton[] array)
Loads objects from the passed KeyButton array into this list model.

Parameters:
array - the array from which to load the objects.

saveToModelDefinition

public ModelDefinition saveToModelDefinition(ModelDefinition md)
Saves key-button definitions and thumb assignments (including the SPACE-key policy) to the passed ModelDefinition object and returns it. If the passed reference is null, a new ModelDefinition is used.

Returns:
the revised ModelDefinition object.


Copyright © 2006 Steven Castellucci and Scott MacKenzie. All Rights Reserved.