|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xj.anylogic.engine.presentation.Shape
com.xj.anylogic.engine.presentation.ShapeControl
com.xj.anylogic.engine.presentation.ShapeComboBox
public class ShapeComboBox
Combo box control. Embeds a JComboBox component.
This object is only available in the AnyLogic Professional
| Field Summary | |
|---|---|
java.lang.String |
value
The currently selected item of the combo box that can be accessed in the overridden action() method. |
| Fields inherited from class com.xj.anylogic.engine.presentation.ShapeControl |
|---|
TYPE_DOUBLE, TYPE_INT, TYPE_STRING |
| Fields inherited from class com.xj.anylogic.engine.presentation.Shape |
|---|
UNKNOWN_NAME |
| Constructor Summary | |
|---|---|
ShapeComboBox(Presentable p,
boolean ispublic,
int x,
int y,
int width,
int height,
java.awt.Color backgroundColor,
java.awt.Color textColor,
java.awt.Font font,
java.lang.String[] items,
boolean editable)
Deprecated. use ShapeComboBox(Presentable, boolean, int, int, int, int, Color, Color, Font, String[], boolean, int) |
|
ShapeComboBox(Presentable p,
boolean ispublic,
int x,
int y,
int width,
int height,
java.awt.Color backgroundColor,
java.awt.Color textColor,
java.awt.Font font,
java.lang.String[] items,
boolean editable,
int valueType)
Creates a persistent combo box control. |
|
| Method Summary | |
|---|---|
void |
action()
Executes the action associated with a non-persistent combo box. |
void |
actionPerformed(java.awt.event.ActionEvent event)
ActionListener implementation. |
double |
getDoubleValue()
Returns the current double value of the combo box. |
int |
getIntValue()
Returns the current int value of the combo box. |
java.lang.String[] |
getItems()
Returns array of String items currently used in the combo box drop-down list The returned array should not be changed by user |
javax.swing.JComponent |
getJComponent()
Returns the embedded JComboBox. |
java.lang.String |
getValue()
Returns the currently selected text item. |
void |
setItems(java.lang.String[] items)
Sets new items for this combo box This method preserves current combo box value: if it is editable if it is not-editable and current value is contained in new texts
This method doesn't execute user action code (even if current selection changes)This method throws an exception if this combo box has numeric value-type ( ShapeControl.TYPE_DOUBLE or ShapeControl.TYPE_INT) and
some item(s) can't be parsed as a number. |
void |
setItems(java.lang.String[] items,
boolean callAction)
Sets new items for this combo box This method preserves current combo box value: if it is editable if it is not-editable and current value is contained in new texts
|
void |
setValue(double value)
Sets the numeric value of the combo box with value type ShapeControl.TYPE_DOUBLE or ShapeControl.TYPE_INT. |
void |
setValue(double value,
boolean callAction)
Sets the numeric value of the combo box with value type ShapeControl.TYPE_DOUBLE or ShapeControl.TYPE_INT. |
void |
setValue(java.lang.String text)
Sets the selected text item of the combo box. |
void |
setValue(java.lang.String text,
boolean callAction)
Sets the selected text item of the combo box. |
void |
setValueToDefault()
Sets the text of a non-persistent combo box to what was provided as the default one. |
| Methods inherited from class com.xj.anylogic.engine.presentation.ShapeControl |
|---|
clone, contains, draw, getHeight, getPresentable, getWidth, isEnabled, onClickAt, restoreOwner, setEnabled, setHeight, setWidth, update |
| Methods inherited from class com.xj.anylogic.engine.presentation.Shape |
|---|
canHandleClick, getGroup, getName, getRotation, getScaleX, getScaleY, getX, getY, isVisible, onClick, setPos, setRotation, setScale, setScale, setScaleX, setScaleY, setVisible, setX, setY |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.lang.String value
getValue() to obtain the currently selected item
from other places
| Constructor Detail |
|---|
@Deprecated
public ShapeComboBox(Presentable p,
boolean ispublic,
int x,
int y,
int width,
int height,
java.awt.Color backgroundColor,
java.awt.Color textColor,
java.awt.Font font,
java.lang.String[] items,
boolean editable)
ShapeComboBox(Presentable, boolean, int, int, int, int, Color, Color, Font, String[], boolean, int)
public ShapeComboBox(Presentable p,
boolean ispublic,
int x,
int y,
int width,
int height,
java.awt.Color backgroundColor,
java.awt.Color textColor,
java.awt.Font font,
java.lang.String[] items,
boolean editable,
int valueType)
p - the presentable object owning this controlispublic - if true, the control is visible on container's presentationx - the x coordinatey - the y coordinatewidth - the widthheight - the heightbackgroundColor - the background colortextColor - the text colorfont - the text fontitems - the array of text labels of the combo boxvalueType - the type of the value edited in the combo box, supported types:
ShapeControl.TYPE_STRING, ShapeControl.TYPE_DOUBLE, ShapeControl.TYPE_INT| Method Detail |
|---|
public void action()
action in class ShapeControlpublic javax.swing.JComponent getJComponent()
getJComponent in class ShapeControlpublic void setValueToDefault()
setValueToDefault in class ShapeControlpublic void setValue(java.lang.String text)
text - the new selected text item
public void setValue(java.lang.String text,
boolean callAction)
callAction
parameter is true.text isn't
a valid number, nothing will be changed
text - the new selected text itemcallAction - if true user action code
(if any exists) will be executedpublic void setValue(double value)
ShapeControl.TYPE_DOUBLE or ShapeControl.TYPE_INT.
value - the new value (double or int)
public void setValue(double value,
boolean callAction)
ShapeControl.TYPE_DOUBLE or ShapeControl.TYPE_INT.callAction
parameter is true
value - the new value (double or int)callAction - if true user action code
(if any exists) will be executedpublic java.lang.String getValue()
public int getIntValue()
int value of the combo box.
int value of the combo boxpublic double getDoubleValue()
double value of the combo box.
double value of the combo boxpublic java.lang.String[] getItems()
public void setItems(java.lang.String[] items)
texts
ShapeControl.TYPE_DOUBLE or ShapeControl.TYPE_INT) and
some item(s) can't be parsed as a number.
items - the array of String items to be placed in the combo box drop-down list
public void setItems(java.lang.String[] items,
boolean callAction)
texts
items - the array of String items to be placed in the combo box drop-down listcallAction - if true and selection changes, user action code
(if any exists) will be executedpublic void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed in interface java.awt.event.ActionListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||