|
||||||||||
| 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.ShapeFileChooser
public class ShapeFileChooser
File chooser control. Embeds a JPanel with JTextField and JButton.
This object is only available in the AnyLogic Professional
| Field Summary | |
|---|---|
static int |
TYPE_OPEN
|
static int |
TYPE_SAVE
|
java.lang.String |
value
Returns the currently selected file name (or empty string if no file selected) 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 | |
|---|---|
ShapeFileChooser(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 title,
int type,
java.lang.String[][] fileNameFilters)
Creates a persistent list box control. |
|
| Method Summary | |
|---|---|
void |
action()
Executes the action associated with a non-persistent list box. |
void |
actionPerformed(java.awt.event.ActionEvent e)
ActionListener implementation. |
javax.swing.JComponent |
getJComponent()
Returns the embedded JPanel which has JTextField and JButton inside |
java.lang.String |
getValue()
Returns the currently selected file name or empty string if no file selected |
void |
setValue(java.lang.String fileName)
Sets the selected filename to given fileNameDoesn't execute user action code |
void |
setValue(java.lang.String fileName,
boolean callAction)
Sets the selected filename to given fileNameExecutes user action code (if any exists) if callAction
parameter is true |
void |
setValueToDefault()
Sets the selected filename of a non-persistent file chooser 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 static final int TYPE_OPEN
public static final int TYPE_SAVE
public java.lang.String value
getValue() to obtain the currently selected file name
from other places
| Constructor Detail |
|---|
public ShapeFileChooser(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 title,
int type,
java.lang.String[][] fileNameFilters)
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 fonttitle - the title of the file chooser dialogtype - one of
fileNameFilters - the array of pairs {Filter name, Extensions},
e.g.
new String[][] { { "Text file", "*.txt" },
{ "Data source file", "*.mdb, *.xls" } }
| 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 fileName)
fileName
fileName - the file name
public void setValue(java.lang.String fileName,
boolean callAction)
fileNamecallAction
parameter is true
fileName - the file namecallAction - if true user action code (if any exists) will
be executedpublic java.lang.String getValue()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||