|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jv.object.PsObject
|
+--jv.number.PuInteger
Basic integer class with update functionality and panel containing a slider.
This class may always be used when a integer instance variable shall be
modifiable by a slider in the info panel of its parent class. See the class
PjExprOde as a sample application.
Usage demonstrated in a sample class:
public class PjExprOde {
protected PuInteger m_length;
public PjExprOde() {
// Create a new instance of PuInteger and register 'this' as parent
// to receive update events whenever user has modified the slider.
m_length = new PuInteger("Length", this);
init();
}
public void init() {
// Set default value to be assigned when user resets slider
// using a call m_length.init().
m_length.setDefValue(15);
// Set default min/max values and increments of slider.
m_length.setDefBounds(1, 50, 1, 10);
// Reset to default values.
m_length.init();
}
public boolean update(Object event) {
// Catch update events sent whenever user has modifed slider.
if (event == m_length) {
// Do something application depended
solve();
return true;
}
}
public void solve() {
// Access current value
System.out.println("Current value = "+m_length.getValue());
}
}
PuInteger,
PjExprOde, Serialized Form| Fields inherited from class jv.object.PsObject |
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, NUM_TAGS |
| Constructor Summary | |
PuInteger(java.lang.String aName,
PsUpdateIf aParent)
Create new instance with given name and parent. |
|
| Method Summary | |
void |
copy(PuInteger num)
Copy all instance variables of argument source into 'this'. |
int |
getDefLineIncr()
Get the default line increment which are used when slider is reset. |
int |
getDefMaximum()
Get the default maximum value which are used when slider is reset. |
int |
getDefMinimum()
Get the default minimum value which are used when slider is reset. |
int |
getDefPageIncr()
Get the default page increment which are used when slider is reset. |
int |
getLineIncr()
Get line increment of slider. |
int |
getMax()
Get maximal value allowed in slider. |
int |
getMin()
Get minimal value allowed in slider. |
int |
getPageIncr()
Get block increment of slider. |
int |
getValue()
Get current integer value. |
void |
init()
Assign default values, and may be used to reset instance. |
boolean |
isEnabled()
Check whether slider is enabled or disabled. |
void |
setBounds(int aMin,
int aMax)
Set current min/max values and adjust value if current value lies outside the new min/max bounds. |
void |
setBounds(int aMin,
int aMax,
int aLineIncr,
int aPageIncr)
Set current min/max values and slider increments. |
void |
setDefBounds(int aMin,
int aMax,
int aLineIncr,
int aPageIncr)
Set default min/max values and slider increments to be assigned when init() is called as reset.
|
void |
setDefValue(int value)
Set default value to be assigned when init() is called as reset. |
void |
setEnabled(boolean flag)
Enable or disable the slider for interactive use. |
void |
setValue(int aValue)
Set value of integer, and adjust slider if visible. |
boolean |
update(java.lang.Object anObject)
Catch update events sent from info panel. |
| Methods inherited from class jv.object.PsObject |
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, toString, updatePanels |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public PuInteger(java.lang.String aName,
PsUpdateIf aParent)
aParent.update(this).aName - Name of integer to appear as label in slider.aParent - Parent of integer to receive update events.| Method Detail |
public void init()
init in class PsObjectpublic void copy(PuInteger num)
public void setDefValue(int value)
init() is called as reset.setDefBounds(int, int, int, int)public int getDefMinimum()
setDefBounds(int, int, int, int),
setBounds(int, int, int, int)public int getDefMaximum()
setDefBounds(int, int, int, int),
setBounds(int, int, int, int)public int getDefLineIncr()
setDefBounds(int, int, int, int),
setBounds(int, int, int, int)public int getDefPageIncr()
setDefBounds(int, int, int, int),
setBounds(int, int, int, int)
public void setDefBounds(int aMin,
int aMax,
int aLineIncr,
int aPageIncr)
init() is called as reset.
Current value of slider is clipped to lie within [min,max] bounds.public void setValue(int aValue)
public int getValue()
public int getMin()
public int getMax()
public int getLineIncr()
public int getPageIncr()
public void setBounds(int aMin,
int aMax,
int aLineIncr,
int aPageIncr)
init().aMin, - aMax Minimal and maximal values in slider.aLineIncr - Line increment used in slider.aPageIncr - Block increment used in slider.
public void setBounds(int aMin,
int aMax)
init().
Line and block increments of slider are set to default values.aMin, - aMax Minimal and maximal values in slider.public boolean isEnabled()
public void setEnabled(boolean flag)
setValue(integer), and the slider
is always updated.public boolean update(java.lang.Object anObject)
update in class PsObjectjv.object.PsObjectPsObject.setParent(PsUpdateIf),
PsObject.getFather(),
PsObject.addUpdateListener(PsUpdateIf)
|
JavaView® v2.12 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||