Package org.web3d.x3d.sai.Text
Interface Text
- All Superinterfaces:
X3DGeometryNode
,X3DNode
- All Known Implementing Classes:
Text
Text is a 2D (flat) geometry node that can contain multiple lines of string values.
Warning: this is an abstract interface that cannot be instantiated as a concrete object. Java programmers typically only need to use concrete objects provided by the
Package hint: This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI).
Warning: this is an abstract interface that cannot be instantiated as a concrete object. Java programmers typically only need to use concrete objects provided by the
org.web3d.x3d.jsail
classes.
Text node tooltip: [X3DGeometryNode] Text is a 2D (flat) geometry node that can contain multiple lines of string values. Layout and styling is controlled by a contained FontStyle node.
- Hint: String (computer science) https://en.wikipedia.org/wiki/String_(computer_science)
- Hint: full internationalization (i18n) and localization (l10n) features are available for any written language.
- Hint: relates to Internationalization (i18n) http://www.w3.org/standards/webdesign/i18n
- Hint: insert a Shape node before adding geometry or Appearance.
- Hint: for advanced extensibility, authors can substitute a type-matched ProtoInstance node (with correct containerField value) for contained node content.
- Warning: Text node requires X3D profile='Immersive' or <component name='Text' level='1'/>
Package hint: This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI).
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionProvide org.web3d.x3d.sai.Text.X3DFontStyleNode instance (using a properly typed node) from inputOutput SFNode field fontStyle.float[]
Provide array of float results within allowed range of [0,infinity) from inputOutput MFFloat field named length.float[]
Provide array of 2-tuple float results from outputOnly MFVec2f field named lineBounds.float
Provide float value within allowed range of [0,infinity) from inputOutput SFFloat field named maxExtent.Provide org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.float[]
Provide array of 3-tuple float results from outputOnly SFVec3f field named origin.boolean
getSolid()
Provide boolean value from initializeOnly SFBool field named solid.String[]
Provide array of String results from inputOutput MFString field named string.float[]
Provide array of 2-tuple float results from outputOnly SFVec2f field named textBounds.setFontStyle
(X3DFontStyleNode newValue) Accessor method to assign org.web3d.x3d.sai.Text.X3DFontStyleNode instance (using a properly typed node) to inputOutput SFNode field fontStyle.setLength
(float[] newValue) Accessor method to assign float array to inputOutput MFFloat field named length.setMaxExtent
(float newValue) Accessor method to assign float value to inputOutput SFFloat field named maxExtent.setMetadata
(X3DMetadataObject newValue) Accessor method to assign org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.setSolid
(boolean newValue) Accessor method to assign boolean value to initializeOnly SFBool field named solid.Accessor method to assign String array to inputOutput MFString field named string.
-
Method Details
-
getFontStyle
X3DFontStyleNode getFontStyle()Provide org.web3d.x3d.sai.Text.X3DFontStyleNode instance (using a properly typed node) from inputOutput SFNode field fontStyle.
Tooltip: [X3DFontStyleNode] The fontStyle field can contain a FontStyle or ScreenFontStyle node defining size, family, and style for presented text.- Hint: Wikipedia https://en.wikipedia.org/wiki/Font
- Returns:
- value of fontStyle field
-
setFontStyle
Accessor method to assign org.web3d.x3d.sai.Text.X3DFontStyleNode instance (using a properly typed node) to inputOutput SFNode field fontStyle.
Tooltip: [X3DFontStyleNode] The fontStyle field can contain a FontStyle or ScreenFontStyle node defining size, family, and style for presented text.- Hint: Wikipedia https://en.wikipedia.org/wiki/Font
- Parameters:
newValue
- is new value for the fontStyle field.- Returns:
Text
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
getLength
float[] getLength()Provide array of float results within allowed range of [0,infinity) from inputOutput MFFloat field named length.
Tooltip: Array of length values for each text string in the local coordinate system. Each string is stretched or compressed to fit. *- Returns:
- value of length field
-
setLength
Accessor method to assign float array to inputOutput MFFloat field named length.
Tooltip: Array of length values for each text string in the local coordinate system. Each string is stretched or compressed to fit. *- Parameters:
newValue
- is new value for the length field.- Returns:
Text
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
getLineBounds
float[] getLineBounds()Provide array of 2-tuple float results from outputOnly MFVec2f field named lineBounds.
Tooltip: Array of 2D bounding box values for each line of text in the local coordinate system.- Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
- Returns:
- value of lineBounds field
-
getMaxExtent
float getMaxExtent()Provide float value within allowed range of [0,infinity) from inputOutput SFFloat field named maxExtent.
Tooltip: Limits/compresses all text strings if max string length is longer than maxExtent, as measured in local coordinate system. *- Returns:
- value of maxExtent field
-
setMaxExtent
Accessor method to assign float value to inputOutput SFFloat field named maxExtent.
Tooltip: Limits/compresses all text strings if max string length is longer than maxExtent, as measured in local coordinate system. *- Parameters:
newValue
- is new value for the maxExtent field.- Returns:
Text
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
getMetadata
X3DMetadataObject getMetadata()Provide org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.
Tooltip: [X3DMetadataObject] Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.- Hint: X3D Architecture 7.2.4 Metadata https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS /Part01/components/core.html#Metadata
- Specified by:
getMetadata
in interfaceX3DGeometryNode
- Specified by:
getMetadata
in interfaceX3DNode
- Returns:
- value of metadata field
- See Also:
-
setMetadata
Accessor method to assign org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.
Tooltip: [X3DMetadataObject] Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.- Hint: X3D Architecture 7.2.4 Metadata https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS /Part01/components/core.html#Metadata
- Specified by:
setMetadata
in interfaceX3DGeometryNode
- Specified by:
setMetadata
in interfaceX3DNode
- Parameters:
newValue
- is new value for the metadata field.- Returns:
Text
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).- See Also:
-
getOrigin
float[] getOrigin()Provide array of 3-tuple float results from outputOnly SFVec3f field named origin.
Tooltip: origin of the text local coordinate system, in units of the coordinate system in which the Text node is embedded. The value of the origin field represents the upper left corner of the textBounds.- Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
- Returns:
- value of origin field
-
getSolid
boolean getSolid()Provide boolean value from initializeOnly SFBool field named solid.
Tooltip: Setting solid true means draw only one side of polygons (backface culling on), setting solid false means draw both sides of polygons (backface culling off).- Hint: mnemonic "this geometry is solid like a brick" (you don't render the inside of a brick).
- Warning: default value true can completely hide geometry if viewed from wrong side!
- Hint: if in doubt, use solid='false' for maximum visibility.
- Warning: solid false not supported in VRML97.
- Hint: accessType relaxed to inputOutput in order to support animation and visualization.
- Returns:
- value of solid field
-
setSolid
Accessor method to assign boolean value to initializeOnly SFBool field named solid.
Tooltip: Setting solid true means draw only one side of polygons (backface culling on), setting solid false means draw both sides of polygons (backface culling off).- Hint: mnemonic "this geometry is solid like a brick" (you don't render the inside of a brick).
- Warning: default value true can completely hide geometry if viewed from wrong side!
- Hint: if in doubt, use solid='false' for maximum visibility.
- Warning: solid false not supported in VRML97.
- Hint: accessType relaxed to inputOutput in order to support animation and visualization.
- Parameters:
newValue
- is new value for the solid field.- Returns:
Text
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
getString
String[] getString()Provide array of String results from inputOutput MFString field named string.
Tooltip: Single or multiple string values to present as Text. Each value in the string array (including empty strings) gets displayed on a separate line.- Hint: MFString arrays can have multiple values, so separate each individual string by quote marks.
- Hint: Strings can contain quote marks by first escaping them with a backslash example: "say \"hello\" please"
- Hint: many XML tools substitute XML character references for special characters automatically if needed within an attribute value (such as & for & ampersand character, or " for " quotation-mark character).
- Hint: relates to Internationalization (i18n) http://www.w3.org/standards/webdesign/i18n Example: https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter02-GeometryPrimitives/TextIndex.html Example: https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter02-GeometryPrimitives/TextSpecialCharactersIndex.html
- Returns:
- value of string field
-
setString
Accessor method to assign String array to inputOutput MFString field named string.
Tooltip: Single or multiple string values to present as Text. Each value in the string array (including empty strings) gets displayed on a separate line.- Hint: MFString arrays can have multiple values, so separate each individual string by quote marks.
- Hint: Strings can contain quote marks by first escaping them with a backslash example: "say \"hello\" please"
- Hint: many XML tools substitute XML character references for special characters automatically if needed within an attribute value (such as & for & ampersand character, or " for " quotation-mark character).
- Hint: relates to Internationalization (i18n) http://www.w3.org/standards/webdesign/i18n Example: https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter02-GeometryPrimitives/TextIndex.html Example: https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter02-GeometryPrimitives/TextSpecialCharactersIndex.html
- Parameters:
newValue
- is new value for the string field.- Returns:
Text
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
getTextBounds
float[] getTextBounds()Provide array of 2-tuple float results from outputOnly SFVec2f field named textBounds.
Tooltip: 2D bounding box value for all lines of text in the local coordinate system.- Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
- Returns:
- value of textBounds field
-