jvx.util
Class PuEnum
- java.lang.Object
-
- jv.object.PsObject
-
- jvx.util.PuEnum
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf
public final class PuEnum extends PsObject
Basic enum class with update functionality and panel containing a choice.- See Also:
- Serialized Form
- Author:
- Andreas Haferburg
- Version:
- 27.01.07, 1.00 created (ah)
-
-
Field Summary
-
Fields inherited from class jv.object.PsObject
HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS
-
-
Constructor Summary
Constructors Constructor and Description PuEnum(java.lang.String name)Create new instance with given name.PuEnum(java.lang.String name, PsUpdateIf parent)Create new instance with given name and parent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(java.lang.String item)voidclear()intgetDefIndex()Get the default state which is used when this object is reset.intgetIndex()Get current state.java.lang.StringgetItem(int index)intgetItemCount()voidinit()Assign default state, and may be used to reset instance.voidinsert(java.lang.String item, int index)voidremove(int item)voidremove(java.lang.String item)voidset(int index, java.lang.String item)voidsetDefIndex(int state)Set default state to be assigned wheninit()is called as reset.voidsetIndex(int state)Set the state of the choice.-
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, update, updatePanels
-
-
-
-
Constructor Detail
-
PuEnum
public PuEnum(java.lang.String name)
Create new instance with given name. The name appears as label on the choice.In order to receive update events of this choice one might either assign a parent or register an update listener.
- Parameters:
name- Name of boolean to appear as label in choice.
-
PuEnum
public PuEnum(java.lang.String name, PsUpdateIf parent)Create new instance with given name and parent. The name appears as label on the choice, and the parent is informed whenever the choice has changed usingparent.update(this).- Parameters:
name- Name of boolean to appear as label in choice.parent- Parent of boolean to receive update events.
-
-
Method Detail
-
init
public void init()
Assign default state, and may be used to reset instance.
-
add
public void add(java.lang.String item)
-
remove
public void remove(java.lang.String item)
-
remove
public void remove(int item)
-
clear
public void clear()
-
getItemCount
public int getItemCount()
-
getItem
public java.lang.String getItem(int index)
-
set
public void set(int index, java.lang.String item)
-
insert
public void insert(java.lang.String item, int index)
-
setIndex
public void setIndex(int state)
Set the state of the choice.
-
getIndex
public int getIndex()
Get current state.
-
getDefIndex
public int getDefIndex()
Get the default state which is used when this object is reset.- See Also:
setDefIndex(int),getIndex()
-
setDefIndex
public void setDefIndex(int state)
Set default state to be assigned wheninit()is called as reset.
-
-
"