VRJConfig UI API
v2.0


org.vrjuggler.vrjconfig.commoneditors.devicegraph
Class UnitInfo

java.lang.Object
  extended by org.vrjuggler.vrjconfig.commoneditors.devicegraph.UnitInfo
All Implemented Interfaces:
UnitConstants

public class UnitInfo
extends Object
implements UnitConstants

A holder for information about input sources (units) on some input device. An input source in a given device is identified uniquely by its type and its number. This class makes the input source type immutable but allows the number to be changed to account for changes in how the device is configured.


Field Summary
 
Fields inherited from interface org.vrjuggler.vrjconfig.commoneditors.devicegraph.UnitConstants
ANALOG, COMMAND, DIGITAL, GLOVE, KEYBOARD_MOUSE, POSITION, STRING
 
Constructor Summary
UnitInfo(Integer unitType, int unitNumber)
          Creates a new input source (unit) representation with the given type and number.
UnitInfo(Integer unitType, Integer unitNumber)
          Creates a new input source (unit) representation with the given type and number.
 
Method Summary
 void addUnitInfoListener(UnitInfoListener l)
          Adds a listener for events fired by this object.
 void decrementUnitNumber()
          Decrements this unit's number (index) by 1.
 void decrementUnitNumber(int amount)
          Decrements this unit's number (index) by the given value.
 boolean equals(Object obj)
          Equality overload to ensure that units can be compared easily and correctly.
protected  void fireUnitNumberChanged(Integer oldValue)
          Fires a UnitInfoEvent for a change in this object's unit number.
 Integer getUnitNumber()
          Returns the unit number (index) of this input source.
 Integer getUnitType()
          Returns the type of this input source as specified by UnitConstants.
 int hashCode()
           
 void incrementUnitNumber()
          Increments this unit's number (index) by 1.
 void incrementUnitNumber(int amount)
          Increments this unit's number (index) by the given value.
 void removeUnitInfoListener(UnitInfoListener l)
          Removes the given object as a listener for events fired by this object.
 void setUnitNumber(int unitNumber)
          Changes the unit number (index) of this input source to the given value.
 void setUnitNumber(Integer unitNumber)
          Changes the unit number (index) of this input source to the given value.
 String toString()
          Strig-ifies this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnitInfo

public UnitInfo(Integer unitType,
                int unitNumber)
Creates a new input source (unit) representation with the given type and number.

Parameters:
unitType - the type of the unit (as specified in UnitConstants) associated with this object
unitNumber - the number (index) of the unit associated with this object
See Also:
UnitConstants

UnitInfo

public UnitInfo(Integer unitType,
                Integer unitNumber)
Creates a new input source (unit) representation with the given type and number.

Parameters:
unitType - the type of the unit (as specified in UnitConstants) associated with this object
unitNumber - the number (index) of the unit associated with this object
See Also:
UnitConstants
Method Detail

getUnitType

public Integer getUnitType()
Returns the type of this input source as specified by UnitConstants.

See Also:
UnitConstants

getUnitNumber

public Integer getUnitNumber()
Returns the unit number (index) of this input source.


setUnitNumber

public void setUnitNumber(int unitNumber)
Changes the unit number (index) of this input source to the given value.


setUnitNumber

public void setUnitNumber(Integer unitNumber)
Changes the unit number (index) of this input source to the given value.


decrementUnitNumber

public void decrementUnitNumber()
Decrements this unit's number (index) by 1.


decrementUnitNumber

public void decrementUnitNumber(int amount)
Decrements this unit's number (index) by the given value.

Parameters:
amount - the amount to decrement the unit number

incrementUnitNumber

public void incrementUnitNumber()
Increments this unit's number (index) by 1.


incrementUnitNumber

public void incrementUnitNumber(int amount)
Increments this unit's number (index) by the given value.

Parameters:
amount - the amount to increment the unit number

equals

public boolean equals(Object obj)
Equality overload to ensure that units can be compared easily and correctly.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

addUnitInfoListener

public void addUnitInfoListener(UnitInfoListener l)
Adds a listener for events fired by this object.


removeUnitInfoListener

public void removeUnitInfoListener(UnitInfoListener l)
Removes the given object as a listener for events fired by this object.


toString

public String toString()
Strig-ifies this object.

Overrides:
toString in class Object

fireUnitNumberChanged

protected void fireUnitNumberChanged(Integer oldValue)
Fires a UnitInfoEvent for a change in this object's unit number.


VRJConfig UI API
v2.0


Copyright © 1998–2005 Iowa State University. All rights reserved.