public class ScriptObject extends X3DConcreteNode implements Script
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COMPONENT
String constant COMPONENT defines X3D component for the Script element: Scripting
|
static java.lang.String |
containerField_DEFAULT_VALUE
containerField describes typical field relationship of a node to its parent.
|
static boolean |
DIRECTOUTPUT_DEFAULT_VALUE
SFBool field named directOutput has default value false (Java syntax) or false (XML syntax).
|
static java.lang.String |
fromField_METADATA
fromField ROUTE name for SFNode field named metadata.
|
static java.lang.String |
fromField_URL
fromField ROUTE name for MFString field named url.
|
static int |
LEVEL
Integer constant LEVEL provides default X3D Scripting component level for this element: 1
|
static boolean |
MUSTEVALUATE_DEFAULT_VALUE
SFBool field named mustEvaluate has default value false (Java syntax) or false (XML syntax).
|
static java.lang.String |
NAME
String constant NAME provides name of this element: Script.
|
static java.lang.String |
toField_METADATA
toField ROUTE name for SFNode field named metadata.
|
static java.lang.String |
toField_URL
toField ROUTE name for MFString field named url.
|
static java.util.ArrayList<java.lang.String> |
URL_DEFAULT_VALUE
MFString field named url has default value equal to an empty list.
|
CLASS_DEFAULT_VALUE, containerField_ALTERNATE_VALUES, DEF_DEFAULT_VALUE, USE_DEFAULT_VALUEvalidationResult| Constructor and Description |
|---|
ScriptObject()
Constructor for ScriptObject to initialize member variables with default values.
|
ScriptObject(java.lang.String DEFlabel)
Utility constructor that assigns DEF label after initializing member variables with default values.
|
| Modifier and Type | Method and Description |
|---|---|
ScriptObject |
addComments(CommentsBlock newCommentsBlock)
Add CommentsBlock to contained commentsList.
|
ScriptObject |
addComments(java.lang.String newComment)
Add comment as String to contained commentsList.
|
ScriptObject |
addComments(java.lang.String[] newComments)
Add comments as String[] array to contained commentsList.
|
ScriptObject |
addField(fieldObject newField)
Add field to fieldList for this ScriptObject
|
ScriptObject |
addUrl(SFStringObject newValue)
Add singleton SFStringObject value to MFString url field.
|
ScriptObject |
addUrl(java.lang.String newValue)
Add singleton String value to MFString url field.
|
ScriptObject |
appendSourceCode(java.lang.String newSourceText)
Append source code (for example, JavaScript)
|
ScriptObject |
appendSourceCode(java.lang.StringBuilder newSourceText)
Append source code (for example, JavaScript)
|
void |
clearFields()
Clear all fields
|
ScriptObject |
clearMetadata()
Utility method to clear SFNode value of metadata field.
|
ScriptObject |
clearSource()
Clear all contained CDATA source code.
|
ScriptObject |
clearUrl()
Utility method to clear MFString value of url field.
|
X3DConcreteElement |
findElementByNameValue(java.lang.String nameValue)
Recursive method to provide object reference to node or statement by name attribute, if found as part of this element or in a contained element.
|
X3DConcreteElement |
findElementByNameValue(java.lang.String nameValue,
java.lang.String elementName)
Recursive method to provide object reference to node or statement by name attribute, if found as part of this element or in a contained element.
|
fieldObject |
findFieldByName(java.lang.String fieldName)
Find contained field statement by name, if present.
|
X3DConcreteNode |
findNodeByDEF(java.lang.String DEFvalue)
Recursive method to provide object reference to node by DEF, if found as this node or in a contained node.
|
java.lang.String |
getAccessType(java.lang.String fieldName)
Indicate accessType corresponding to given fieldName.
|
java.lang.String |
getComponent()
Defines X3D component for the Script element: Scripting
|
int |
getComponentLevel()
Provides default X3D component level for this element: 1
|
java.lang.String |
getContainerFieldDefault()
containerField describes typical field relationship of a node to its parent.
|
boolean |
getDirectOutput()
Provide boolean value from initializeOnly SFBool field named directOutput.
|
java.lang.String |
getElementName()
Provides name of this element: Script
|
java.util.ArrayList<fieldObject> |
getFieldList()
Provide list of fields.
|
java.lang.String |
getFieldType(java.lang.String fieldName)
Indicate type corresponding to given fieldName.
|
ISObject |
getIS()
Provide field named IS for establishing IS/connect field connections between ProtoInterface fields and internal ProtoBody nodes.
|
X3DMetadataObject |
getMetadata()
Provide X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.
|
boolean |
getMustEvaluate()
Provide boolean value from initializeOnly SFBool field named mustEvaluate.
|
java.lang.String[] |
getUrl()
Provide array of String results from inputOutput MFString field named url.
|
java.util.ArrayList<java.lang.String> |
getUrlList()
Utility method to get ArrayList value of MFString url field, similar to
getUrl(). |
boolean |
hasElementByNameValue(java.lang.String nameValue,
java.lang.String elementName)
Recursive method to determine whether node or statement with given name attribute is found, meaning both objects are attached to same scene graph.
|
boolean |
hasField()
Determine whether field(s) are available
|
boolean |
hasField(java.lang.String fieldName)
Determine if field statement is present.
|
boolean |
hasMetadata()
Indicate whether an object is available for inputOutput SFNode field metadata.
|
boolean |
hasNodeByDEF(java.lang.String DEFvalue)
Recursive method to determine whether node with DEFvalue is found, meaning both objects are attached to same scene graph.
|
void |
initialize()
Initialize all member variables to default values.
|
boolean |
removeField(fieldObject fieldToRemove)
Remove a field from contained fieldList
|
boolean |
removeField(java.lang.String fieldName)
Remove a field by name from contained fieldList
|
ScriptObject |
setCssClass(SFStringObject newValue)
Assign typed object value to SFString cssClass field, similar to
setCssClass(String). |
ScriptObject |
setCssClass(java.lang.String newValue)
Assign String value to inputOutput SFString field named class.
|
ScriptObject |
setDEF(SFStringObject newValue)
Assign typed object value to SFString DEF field, similar to
setDEF(String). |
ScriptObject |
setDEF(java.lang.String newValue)
Assign String value to inputOutput SFString field named DEF.
|
ScriptObject |
setDirectOutput(boolean newValue)
Assign boolean value to initializeOnly SFBool field named directOutput.
|
ScriptObject |
setDirectOutput(SFBoolObject newValue)
Assign typed object value to SFBool directOutput field, similar to
setDirectOutput(boolean). |
ScriptObject |
setIS(ISObject newValue)
Assign field named IS for establishing IS/connect field connections between ProtoInterface fields and internal ProtoBody nodes.
|
ScriptObject |
setMetadata(ProtoInstanceObject newValue)
Assign ProtoInstance (using a properly typed node) to inputOutput SFNode field metadata.
|
ScriptObject |
setMetadata(X3DMetadataObject newValue)
Assign X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.
|
ScriptObject |
setMustEvaluate(boolean newValue)
Assign boolean value to initializeOnly SFBool field named mustEvaluate.
|
ScriptObject |
setMustEvaluate(SFBoolObject newValue)
Assign typed object value to SFBool mustEvaluate field, similar to
setMustEvaluate(boolean). |
ScriptObject |
setSourceCode(java.lang.String newSourceText)
Set new source code (for example, JavaScript).
|
ScriptObject |
setSourceCode(java.lang.String[] newSourceText)
Set new source code (for example, JavaScript).
|
ScriptObject |
setSourceCode(java.lang.StringBuilder newSourceText)
Set new source code (for example, JavaScript).
|
ScriptObject |
setUrl(java.util.ArrayList<java.lang.String> newValue)
Assign ArrayList value of MFString url field, similar to
setUrl(String[]). |
ScriptObject |
setUrl(MFStringObject newValue)
Assign typed object value to MFString url field, similar to
setUrl(String[]). |
ScriptObject |
setUrl(SFStringObject newValue)
Assign single SFString object value to MFString url field, similar to
setUrl(String[]). |
ScriptObject |
setUrl(java.lang.String newValue)
Assign singleton String value to MFString url field, similar to
setUrl(String[]). |
ScriptObject |
setUrl(java.lang.String[] newValue)
Assign String array to inputOutput MFString field named url.
|
ScriptObject |
setUSE(ScriptObject DEFnode)
Assign a USE reference to another DEF node of same node type, similar to
setUSE(String). |
ScriptObject |
setUSE(SFStringObject newValue)
Assign typed object value to SFString USE field, similar to
setUSE(String). |
ScriptObject |
setUSE(java.lang.String newValue)
Assign String value to inputOutput SFString field named USE.
|
java.lang.String |
toStringClassicVRML(int indentLevel)
Recursive method to provide ClassicVRML string serialization.
|
java.lang.String |
toStringVRML97(int indentLevel)
Recursive method to provide VRML97 string serialization.
|
java.lang.String |
toStringX3D(int indentLevel)
Recursive method to provide X3D string serialization of this model subgraph, utilizing XML encoding and conforming to X3D Canonical Form.
|
java.lang.String |
validate()
Recursive method to validate this element plus all contained nodes and statements,
using both datatype-specification value checks and regular expression (regex) checking of corresponding string values.
|
getContainerFieldAlternateValues, getContainerFieldOverride, getCssClass, getDEF, getUSE, isNode, isStatement, isUSE, resetContainerFieldOverride, setConcreteCssClass, setConcreteDEF, setConcreteUSE, setContainerFieldOverrideclearParentObject, findAncestorElementByName, findAncestorProtoBody, findAncestorSceneObject, findAncestorX3DObject, getPackageName, getParentObject, getValidationResult, hasAncestorElementByName, hasAncestorProtoBody, hasAncestorSceneObject, hasAncestorX3DObject, setParentObject, toStringClassicVRML, toStringVRML97, toStringX3Dpublic static final java.lang.String NAME
public static final java.lang.String COMPONENT
public static final int LEVEL
public static final boolean DIRECTOUTPUT_DEFAULT_VALUE
public static final boolean MUSTEVALUATE_DEFAULT_VALUE
public static final java.util.ArrayList<java.lang.String> URL_DEFAULT_VALUE
public static final java.lang.String containerField_DEFAULT_VALUE
public static final java.lang.String fromField_METADATA
public static final java.lang.String toField_METADATA
public static final java.lang.String fromField_URL
public static final java.lang.String toField_URL
public ScriptObject()
public ScriptObject(java.lang.String DEFlabel)
DEFlabel - unique DEF name for this X3D nodepublic final java.lang.String getElementName()
getElementName in class X3DConcreteElementpublic final java.lang.String getComponent()
getComponent in class X3DConcreteElementpublic final int getComponentLevel()
getComponentLevel in class X3DConcreteElementpublic java.lang.String getFieldType(java.lang.String fieldName)
getFieldType in class X3DConcreteElementfieldName - name of field in this X3D nodeConfigurationProperties.ERROR_UNKNOWN_FIELD_TYPEpublic java.lang.String getAccessType(java.lang.String fieldName)
getAccessType in class X3DConcreteElementfieldName - name of field in this X3D nodeConfigurationProperties.ERROR_UNKNOWN_FIELD_ACCESSTYPEpublic final java.lang.String getContainerFieldDefault()
getContainerFieldDefault in class X3DConcreteNodepublic final void initialize()
initialize in class X3DConcreteNodepublic boolean getDirectOutput()
getDirectOutput in interface Scriptpublic ScriptObject setDirectOutput(boolean newValue)
setDirectOutput in interface ScriptnewValue - is new value for the directOutput field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public ScriptObject setDirectOutput(SFBoolObject newValue)
setDirectOutput(boolean).newValue - is new value for the directOutput field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public X3DMetadataObject getMetadata()
getMetadata in interface X3DChildNodegetMetadata in interface X3DNodegetMetadata in interface ScriptgetMetadata in interface X3DScriptNodegetMetadataProtoInstance(),
X3D Scene Authoring Hints: Metadata Nodespublic ScriptObject setMetadata(X3DMetadataObject newValue)
setMetadata in interface X3DChildNodesetMetadata in interface X3DNodesetMetadata in interface ScriptsetMetadata in interface X3DScriptNodesetMetadata in class X3DConcreteNodenewValue - is new value for the metadata field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).setMetadata(ProtoInstanceObject),
X3D Scene Authoring Hints: Metadata Nodespublic ScriptObject clearMetadata()
ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive
setAttribute method invocations).public ScriptObject setMetadata(ProtoInstanceObject newValue)
setMetadata in class X3DConcreteNodenewValue - is new value for the metadata field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).setMetadata(X3DMetadataObject)public boolean hasMetadata()
getMetadata(),
getMetadataProtoInstance(),
X3D Scene Authoring Hints: Metadata Nodespublic boolean getMustEvaluate()
getMustEvaluate in interface Scriptpublic ScriptObject setMustEvaluate(boolean newValue)
setMustEvaluate in interface ScriptnewValue - is new value for the mustEvaluate field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public ScriptObject setMustEvaluate(SFBoolObject newValue)
setMustEvaluate(boolean).newValue - is new value for the mustEvaluate field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public java.lang.String[] getUrl()
getUrl in interface X3DUrlObjectgetUrl in interface ScriptgetUrl in interface X3DScriptNodepublic java.util.ArrayList<java.lang.String> getUrlList()
getUrl().public ScriptObject setUrl(java.lang.String[] newValue)
setUrl in interface X3DUrlObjectsetUrl in interface ScriptsetUrl in interface X3DScriptNodenewValue - is new value for the url field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public ScriptObject setUrl(MFStringObject newValue)
setUrl(String[]).newValue - is new value for the url field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public ScriptObject setUrl(SFStringObject newValue)
setUrl(String[]).newValue - is new value for the url field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public ScriptObject setUrl(java.lang.String newValue)
setUrl(String[]).newValue - is new value for the url field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public ScriptObject setUrl(java.util.ArrayList<java.lang.String> newValue)
setUrl(String[]).newValue - is new value for the url field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public ScriptObject clearUrl()
ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive
setAttribute method invocations).public ScriptObject addUrl(java.lang.String newValue)
newValue - is new value to add to the url field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).MFStringObject.cleanupEnumerationValues(String)public ScriptObject addUrl(SFStringObject newValue)
newValue - is new value to add to the url field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).MFStringObject.cleanupEnumerationValues(String)public final ScriptObject setDEF(java.lang.String newValue)
setDEF in interface X3DChildNodesetDEF in interface X3DNodesetDEF in interface ScriptsetDEF in interface X3DScriptNodesetDEF in class X3DConcreteNodenewValue - is new value for the DEF field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public ScriptObject setDEF(SFStringObject newValue)
setDEF(String).newValue - is new value for the DEF field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public final ScriptObject setUSE(java.lang.String newValue)
USE node is still an independent object, with the USE value matching the DEF value in the preceding object.
setUSE() method on this node resets all other fields to their default values (except for containerField) and also releases all child nodes.setUSE in interface X3DChildNodesetUSE in interface X3DNodesetUSE in interface ScriptsetUSE in interface X3DScriptNodesetUSE in class X3DConcreteNodenewValue - is new value for the USE field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public ScriptObject setUSE(SFStringObject newValue)
setUSE(String).newValue - is new value for the USE field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public final ScriptObject setCssClass(java.lang.String newValue)
setCssClass in interface X3DChildNodesetCssClass in interface X3DNodesetCssClass in interface ScriptsetCssClass in interface X3DScriptNodesetCssClass in class X3DConcreteNodenewValue - is new value for the class field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public ScriptObject setCssClass(SFStringObject newValue)
setCssClass(String).newValue - is new value for the class field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public ScriptObject setIS(ISObject newValue)
setIS in class X3DConcreteNodenewValue - is new value for the description field.ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public ISObject getIS()
getIS in class X3DConcreteNodepublic ScriptObject setUSE(ScriptObject DEFnode)
setUSE(String).
setUSE() method on this node resets all other fields to their default values (except for containerField) and also releases all child nodes.
DEFnode - must have a DEF value definedScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).public ScriptObject addComments(java.lang.String newComment)
addComments in class X3DConcreteElementnewComment - initial valueScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive
setAttribute method invocations).public ScriptObject addComments(java.lang.String[] newComments)
addComments in class X3DConcreteElementnewComments - array of commentsScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive
setAttribute method invocations).public ScriptObject addComments(CommentsBlock newCommentsBlock)
addComments in class X3DConcreteElementnewCommentsBlock - block of comments to addScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive
setAttribute method invocations).public java.lang.String toStringX3D(int indentLevel)
toStringX3D in class X3DConcreteElementindentLevel - number of levels of indentation for this elementX3DObject.FILE_EXTENSION_X3D,
X3DObject.FILE_EXTENSION_XML,
X3DObject.toStringXML(),
X3DObject.toFileXML(String),
X3DObject.toFileX3D(String),
X3D XML Encoding,
X3D Compressed Binary Encoding: X3D Canonical Formpublic java.lang.String toStringClassicVRML(int indentLevel)
toStringClassicVRML in class X3DConcreteElementindentLevel - number of levels of indentation for this elementX3DObject.FILE_EXTENSION_CLASSICVRML,
X3D Resources: Virtual Reality Modeling Language (VRML) 97,
Extensible 3D (X3D) encodings Part 2: Classic VRML encoding,
Extensible 3D (X3D) encodings Part 2: Classic VRML encoding, Annex A: Grammarpublic java.lang.String toStringVRML97(int indentLevel)
toStringVRML97 in class X3DConcreteElementindentLevel - number of levels of indentation for this elementX3DObject.FILE_EXTENSION_VRML97,
X3D Resources: Virtual Reality Modeling Language (VRML) 97,
Virtual Reality Modeling Language (VRML) 97 specification,
VRML 97 v2.1 Amendmentpublic X3DConcreteElement findElementByNameValue(java.lang.String nameValue)
findElementByNameValue in class X3DConcreteElementnameValue - is value of the name field being searched for in this element and child elements(if any)findNodeByDEF(String),
X3DConcreteElement.hasAncestorSceneObject(),
X3DConcreteElement.findAncestorX3DObject()public X3DConcreteElement findElementByNameValue(java.lang.String nameValue, java.lang.String elementName)
findElementByNameValue in class X3DConcreteElementnameValue - is value of the name field being searched for in this element and child elements(if any)elementName - identifies the element of interest (meta MetadataString ProtoDeclare CADassembly ProtoInstance HAnimHumanoid etc.)findNodeByDEF(String),
X3DConcreteElement.hasAncestorSceneObject(),
X3DConcreteElement.findAncestorX3DObject()public boolean hasElementByNameValue(java.lang.String nameValue,
java.lang.String elementName)
nameValue - is value of the name field being searched for in this element and child elements(if any)elementName - identifies the element of interest (meta MetadataString ProtoDeclare CADassembly ProtoInstance HAnimHumanoid etc.)findElementByNameValue(String, String)public X3DConcreteNode findNodeByDEF(java.lang.String DEFvalue)
findNodeByDEF in class X3DConcreteElementDEFvalue - is value of the name field being searched for in this element and child elements(if any)findElementByNameValue(String),
X3DConcreteElement.hasAncestorSceneObject(),
X3DConcreteElement.findAncestorX3DObject()public boolean hasNodeByDEF(java.lang.String DEFvalue)
DEFvalue - is value of the name field being searched for in this element and child elements(if any)findNodeByDEF(String)public java.lang.String validate()
validate in class X3DConcreteElementpublic ScriptObject addField(fieldObject newField)
newField - is field to addScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive
setAttribute method invocations).public boolean removeField(fieldObject fieldToRemove)
fieldToRemove - matching field of interestremoveField(String)public boolean removeField(java.lang.String fieldName)
fieldName - matching field of interestremoveField(fieldObject)public void clearFields()
public boolean hasField()
public java.util.ArrayList<fieldObject> getFieldList()
public fieldObject findFieldByName(java.lang.String fieldName)
fieldName - is name attribute for field of interestpublic boolean hasField(java.lang.String fieldName)
fieldName - is name attribute for field of interestpublic ScriptObject setSourceCode(java.lang.String[] newSourceText)
newSourceText - is source code to setScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive
setAttribute method invocations).public ScriptObject setSourceCode(java.lang.String newSourceText)
newSourceText - is source code to setScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive
setAttribute method invocations).public ScriptObject setSourceCode(java.lang.StringBuilder newSourceText)
newSourceText - is source to setScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive
setAttribute method invocations).public ScriptObject appendSourceCode(java.lang.String newSourceText)
newSourceText - is source to appendScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive
setAttribute method invocations).public ScriptObject appendSourceCode(java.lang.StringBuilder newSourceText)
newSourceText - is source to appendScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive
setAttribute method invocations).public ScriptObject clearSource()
ScriptObject - namely this same object to allow sequential method pipelining (i.e. consecutive
setAttribute method invocations).Copyright ©2005-2017 Web3D Consortium under an open-source license, free for any use. Feedback is welcome.