com.tensegrity.gui
Class UIItemEvaluationList

java.lang.Object
  extended bycom.tensegrity.gui.UIItemEvaluationList

public class UIItemEvaluationList
extends java.lang.Object

UIItemEvaluationList is a helper class to apply the GUIItem ID's to components. This class holds the list of uiObjects and their id's. It should be used within Components which want to benefit from the dynamic localization. Use an instance of UIItemEvaluationList in your component, initialize it in the installEvList of your Evaluable implementation and fill it with id and Object pairs. In the applyEvList method you simply delegate this call to the apply method of your UIItemEvaluationList instance.

Version:
$Id: UIItemEvaluationList.java,v 1.9 2006/01/05 12:34:34 BurkhardWick Exp $
Author:
Gilles Iachelini

Constructor Summary
UIItemEvaluationList(UIManager uiManager)
          Creates a new UIItemEvaluationList and sets the initial capacity of the internal arrays to zero.
UIItemEvaluationList(UIManager uiManager, int capacity)
          Creates a new UIItemEvaluationList and sets the initial capacity of the internal arrays to the given value capicity.
 
Method Summary
 void add(java.lang.String id, java.awt.Component obj)
          Adds a new id to the id array and a the obj to the object array.
 void apply()
          The apply method invokes for each id-component pair the applyItem method of the internal UIManager.
 void apply(int index)
          This specialized apply method allows you to update the id-component-resource relation for a specific item identified by the given index.
 void clear()
          Clears both internal arrays.
 int getSize()
          Returns the minimum of sizes of the two internal arrays.
 void setAt(int index, java.awt.Component obj)
          Sets a specific Component at the given index in the object array,
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIItemEvaluationList

public UIItemEvaluationList(UIManager uiManager)
Creates a new UIItemEvaluationList and sets the initial capacity of the internal arrays to zero.

Parameters:
uiManager - the UIManager to use during the apply.

UIItemEvaluationList

public UIItemEvaluationList(UIManager uiManager,
                            int capacity)
Creates a new UIItemEvaluationList and sets the initial capacity of the internal arrays to the given value capicity.

Parameters:
uiManager - The UIManager which is used to apply id's to objects.
capacity - the initial capacity of the internal arrays.
Method Detail

getSize

public int getSize()
Returns the minimum of sizes of the two internal arrays.

Returns:
int

add

public void add(java.lang.String id,
                java.awt.Component obj)
Adds a new id to the id array and a the obj to the object array.

Parameters:
id - the id to add to the id array
obj - the obj to add to the object array.

setAt

public void setAt(int index,
                  java.awt.Component obj)
Sets a specific Component at the given index in the object array,

Parameters:
index - the position at which you want the component to be.
obj - the component to set at the given index.

clear

public void clear()
Clears both internal arrays.


apply

public void apply()
The apply method invokes for each id-component pair the applyItem method of the internal UIManager. This call will apply the designated resource to the component. When the application switches between different localized resource files this method should be invoked each time such a switch happens.

See Also:
UIManager.applyItem(String, Object)

apply

public void apply(int index)
This specialized apply method allows you to update the id-component-resource relation for a specific item identified by the given index. If the index is out of bounds no exception is thrown and the method returns.

Parameters:
index - the index in the id- and object array, identifying the element you want to update.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.