|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.gui.DefaultUIManager
An sample implementation on how a UIManager could look like.
UIItemEvaluationList| Field Summary | |
UIItemList |
itemList
List of GUIItems which will be used to determine textual representation. |
| Constructor Summary | |
DefaultUIManager()
Creates the UIManager. |
|
| Method Summary | |
void |
apply(javax.swing.AbstractButton button,
java.lang.String idText)
Applies the text from the UIItem identified by the given id to the passed button instance. |
void |
apply(javax.swing.JLabel label,
java.lang.String idText)
Method apply applies a text resource to a JLabel. |
void |
apply(javax.swing.JLabel label,
java.lang.String idText,
java.awt.Component labelFor)
Creates a new JLabel for a given Component by using the UIItems textual information as text for the label. |
void |
applyItem(java.lang.String id,
java.lang.Object cp)
Sets the values from the UIItem with the parameter id from
the internal ItemList to the given Component. |
void |
applyItem(UIItemList guiItems,
java.lang.String guiObjID,
java.awt.Component guiObj)
Invokes applyItem(Component,UIItem,Font,boolean) with the subcomponent flag set to false. |
boolean |
containsKey(java.lang.String key)
Checks if the specified key has a corresponding localized text. |
java.lang.Object |
createIcon(java.lang.Class clazz,
java.lang.String iconURL)
Factory method for creating an Icon. |
java.lang.Object |
createLocalizedIcon(java.lang.Class refClass,
java.lang.String iconURLKey)
Factory method for creating a new icon. |
static UIItem |
getItem(UIItemList listItems,
java.lang.String id)
Returns the UIItem from the UIItemList which matches the given id. |
UIItemList |
getItemList()
Returns the UIItemList field. |
KeyStroke |
getKeyStroke(java.lang.String key)
Factory method for creating a localized Keystroke from a key. |
java.lang.String |
getText(java.lang.String idText)
This method returns the localized text corresponding to the passed id. |
java.lang.String |
getText(java.lang.String key,
java.lang.Object[] objects)
The method returns a String for a specific key in the property files. |
java.lang.String |
getTextWithoutMnemonicCharacter(java.lang.String id)
Returns a string stored in the resources using the given id. |
void |
setLocale(java.util.Locale locale)
Sets the locale for this UIManager. |
void |
setText(java.lang.String id,
java.lang.String text)
Puts a new mapping to the map. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public UIItemList itemList
| Constructor Detail |
public DefaultUIManager()
ArrayList instance will be
created and stored in in itemList.
| Method Detail |
public void applyItem(java.lang.String id,
java.lang.Object cp)
UIManagerid from
the internal ItemList to the given Component. Call this method everytime
when you want to initialize the associated Component instance with the
(new) values from the appropriate UIItem from the UIItemList. Used by
the UIItemEvaluationList.apply() and
UIItemEvaluationList.apply(int).
applyItem in interface UIManagerid - the id to be used for the component.cp - a component to apply the values to. the class of this
parameter is depending on the used ui toolkit and so
it has to be cast to the concrete type by the
corresponding implementationpublic java.lang.String getTextWithoutMnemonicCharacter(java.lang.String id)
id - The id to look for
UIManager.getText(java.lang.String)public java.lang.String getText(java.lang.String idText)
This method returns the localized text corresponding to the passed id.
Whereas
returns the localized text without the accelator indication used to find
mnemonics, this method returns the text with the mnemonic indicator.
getTextWithoutMnemonicCharacter(String)
getText in interface UIManageridText -
public final void setText(java.lang.String id,
java.lang.String text)
setText in interface UIManagerid - id for the mapping.text - text for the mapping.
public void apply(javax.swing.JLabel label,
java.lang.String idText)
apply applies a text resource to a JLabel.
label - the JLabel instance of which you want to apply the new
text to.idText - The id of the UIItem which holds the new text for the
given labelapply(JLabel, String, Component)
public void apply(javax.swing.JLabel label,
java.lang.String idText,
java.awt.Component labelFor)
label - The label you want to set the text and component for.idText - The id of the associated UIItem.labelFor - the Component instance this label is for.
public void apply(javax.swing.AbstractButton button,
java.lang.String idText)
button - The AbstractButton instance you want to apply the new
text to.idText - the id of the UIItem to get the text from.
public static UIItem getItem(UIItemList listItems,
java.lang.String id)
listItems - The UIItemList where to search the element.id - The id which identifies the UIItem.
UIItemList.get(String)
public void applyItem(UIItemList guiItems,
java.lang.String guiObjID,
java.awt.Component guiObj)
guiItems - the UIItemList holding all items.guiObjID - String with the Gui IDguiObj - the Component to apply the gui item to.UIManager.applyItem(String, Object)public UIItemList getItemList()
getItemList in interface UIManagerUIManager.getItemList()public void setLocale(java.util.Locale locale)
UIManager
setLocale in interface UIManagerlocale - The new Locale for the default resources.
public java.lang.Object createIcon(java.lang.Class clazz,
java.lang.String iconURL)
UIManager
createIcon in interface UIManagerclazz - The reference class for loadingiconURL - The url relative to refClass
public java.lang.Object createLocalizedIcon(java.lang.Class refClass,
java.lang.String iconURLKey)
UIManager
createLocalizedIcon in interface UIManagerrefClass - The reference class for loadingiconURLKey - The key of the resource containing the url relative to refClass
public KeyStroke getKeyStroke(java.lang.String key)
getKeyStroke in interface UIManagerkey - the key to use in the ResourceBundle
for getting the localized Text.
KeyStroke.getKeyStroke(java.lang.String)
public java.lang.String getText(java.lang.String key,
java.lang.Object[] objects)
UIManagerobjects parameter will be parsed like
described in
MessageFormat.
getText in interface UIManagerkey - the id of the item of which you want to retrieve the text.objects - An array of objects to be placed as defaults.
MessageFormatpublic boolean containsKey(java.lang.String key)
UIManager
containsKey in interface UIManagerkey -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||