public class ShapeFileChooser extends ShapeInputControl
Modifier and Type | Class and Description |
---|---|
static class |
ShapeFileChooser.Type
File chooser type constants
|
ShapeControl.ValueType
Modifier and Type | Field and Description |
---|---|
static ShapeFileChooser.Type |
TYPE_DOWNLOAD |
static ShapeFileChooser.Type |
TYPE_UPLOAD |
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.
|
TYPE_DOUBLE, TYPE_INT, TYPE_STRING
UNKNOWN_NAME
Constructor and Description |
---|
ShapeFileChooser(Presentable p,
boolean ispublic,
double x,
double y,
double width,
double height,
java.awt.Color backgroundColor,
java.awt.Color textColor,
boolean enabled,
java.awt.Font font,
java.lang.String title,
ShapeFileChooser.Type type,
java.lang.String fileTypes,
java.lang.String value)
Creates a file chooser control.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
executeUserAction(java.lang.String value)
This method is internal and shouldn't be called by user.
|
java.lang.String |
getTitle()
Returns the title of the file chooser - the string always displayed in Download case
and displayed before the file has been uploaded in Upload case.
|
java.lang.String |
getValue()
Returns the currently selected file name or empty string if no file
selected
|
void |
resetSVGState()
This method is internal and shouldn't be called by user.
|
void |
setTitle(java.lang.String title)
Sets the new title of the file chooser - the string always displayed in Download case
and displayed before the file has been uploaded in Upload case.
|
void |
setValue(java.lang.String fileName)
Sets the selected filename to given
fileName Doesn't execute user action code |
void |
setValue(java.lang.String fileName,
boolean callAction)
Sets the selected filename to given
fileName Executes user action code (if any exists) if callAction
parameter is true |
SVGElement |
updateSVGProperties(java.util.List<SVGCommand> output,
ShapeDrawMode drawMode,
boolean publicOnly,
SVGElement owner,
SVGElement elbehind)
This method is internal and shouldn't be called by user.
|
postSVGShapeSpecificAttributes
action, clone, contains, executeAction, getHeight, getPresentable, getWidth, isEnabled, randomPointInside, restoreOwner, setEnabled, setHeight, setValueToDefault, setWidth
canHandleClick, findSVGElement, getDrawMode, getGroup, getLevel, getName, getRotation, getScaleX, getScaleY, getSVGId, getX, getY, isJava2DSwingPresentation, isPublic_xjal, isSVGPresentation, isVisible, onAggregatorVisibilityChanged, onClick, randomPointInside, removeSVGFromOwner, removeSVGImage, setLevel, setPos, setPos, setPublic_xjal, setRotation, setScale, setScale, setScaleX, setScaleY, setVisible, setX, setY, updateDynamicProperties, updateDynamicPropertiesStructural
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeInternal, postInitialize
public static final ShapeFileChooser.Type TYPE_UPLOAD
public static final ShapeFileChooser.Type TYPE_DOWNLOAD
@AnyLogicInternalAPI public volatile java.lang.String value
getValue()
to obtain the currently selected file name
from other placespublic ShapeFileChooser(Presentable p, boolean ispublic, double x, double y, double width, double height, java.awt.Color backgroundColor, java.awt.Color textColor, boolean enabled, java.awt.Font font, java.lang.String title, ShapeFileChooser.Type type, java.lang.String fileTypes, java.lang.String value)
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 colorenabled
- the initial enabled statefont
- the text fonttitle
- the title of the file chooser dialogtype
- one of
#TYPE_OPEN
#TYPE_SAVE
fileTypes
- file types acceptable by file chooser in the TYPE_UPLOAD
mode. Examples: ".xls, .xlsx", ".png, .jpg", "image/png", "image/*".value
- public java.lang.String getTitle()
public void setTitle(java.lang.String title)
title
- the new titlepublic void setValue(java.lang.String fileName)
fileName
fileName
- the file namepublic void setValue(java.lang.String fileName, boolean callAction)
fileName
callAction
parameter is true
fileName
- the file namecallAction
- if true
user action code (if any exists) will
be executedpublic java.lang.String getValue()
public void destroy()
public void resetSVGState()
SVGElement
resetSVGState
in interface SVGElement
resetSVGState
in class Shape
public SVGElement updateSVGProperties(java.util.List<SVGCommand> output, ShapeDrawMode drawMode, boolean publicOnly, SVGElement owner, SVGElement elbehind)
SVGElement
updateSVGProperties
in interface SVGElement
updateSVGProperties
in class Shape
output
- the list of commands to add todrawMode
- TODOpublicOnly
- drawing context: if true, only shapes that are marked as public only are updatedowner
- the SVG element that serves as a container for this elementelbehind
- the SVG element behind this one, or null if none or if order is irrelevantnull
if element
is not drawn (e.g. drawing of this element is not needed because of public only settings,
permanently not needed or not supported - hence SVG id is not set). The actual owner may differ
from the given owner
when the svg element is added to a different place (e.g. GIS map).@AnyLogicInternalAPI public void executeUserAction(java.lang.String value)
SVGElement
executeUserAction
in interface SVGElement
executeUserAction
in class Shape
Copyright © AnyLogic North America, LLC. All Rights Reserved.