JMSL Chart Programmer’s Guide
Chapter 9 3D Drawing Elements
JMSL provides these Chart3D drawing elements:
*Line Attributes 235
*Tube Attributes 236
*Marker Attributes 236
*Fill Attributes 238
*Text Attributes 239
*Labels 241
*AxisXYZ 241
Line Attributes
All lines, except for those used to draw markers or outline filled regions are affected by the attributes described in this section. These include axis lines and lines drawn when a Data node is rendered with its DataType attribute having its DATA_TYPE_LINE bit set.
Attribute LineColor
LineColor is a Color-valued attribute that determines the color of the line. Its default value is Color.black.
Attribute ColorFunction
ColorFunction is a Color-valued method which maps spatial points to colors. If ColorFunction is not defined then the line is drawn with a solid color set by attribute LineColor.
Attribute LineWidth
LineWidth is a double-valued attribute that determines the thickness of the lines. Its default value is 1.0.
Tube Attributes
Tubes are three dimensional shaded lines. A Data node is rendered as a tube if its DataType has its DATA_TYPE_TUBE bit set.
Attribute LineColor
LineColor is a Color-valued attribute that determines the color of the tube. Its default value is Color.black.
Attribute ColorFunction
ColorFunction is a Color-valued method which maps spatial points to colors. If ColorFunction is not defined then the tube is drawn with a solid color set by attribute LineColor.
Marker Attributes
Markers are drawn when a Data node is rendered with its DataType attribute having its DATA_TYPE_MARKER bit set. Drawing of markers is affected by the attributes described in this section. Note that when markers are drawn using lines, the line attributes do not apply to markers.
An alternative to markers are images, which can be used to draw arbitrary symbols instead of markers.
MarkerType
MarkerType is an integer-valued attribute that determines which marker will be drawn. There are constants defined in ChartNode3d for the marker types. The default value is MARKER_TYPE_CUBE. The following table defines marker types.
Marker Type
Description
Cube with its edges outlined in a contrasting color.
Solid colored cube without edge outlining.
Shaded sphere
Tetrahedron with its edges outlined in a contrasting color.
Solid colored tetrahedron without edge outlining.
3D plus sign with its edges outlined in a contrasting color.
Solid 3D plus sign without edge outlining
Marker defined by the user set using the attribute CustomMarkerFactory.
Attribute MarkerColor
MarkerColor is a Color-valued attribute that determines the color of the marker. Its default value is Color.black.
Attribute MarkerSize
MarkerSize is a double-valued attribute that determines the size of the marker. The default value is 1.0.
Attribute MarkerPulsingCycle
Cycle time, in seconds, for pulsing the marker. If this time is less than or equal to zero the marker is not pulsed. The default value is zero.
Attribute MarkerPulsingCycleOffset
Offset time, in seconds, from the time rendering begins to when the marker begins pulsing. This attribute allows different markers to pulse with different phases.
Attribute MarkerPulsingMinimumScale
The minimum marker size during a pulse cycle is the value of the MarkerPulsingMinimumScale attribute times the value of the MarkerSize attribute.
Attribute MarkerPulsingMaximumScale
The maximum marker size during a pulse cycle is the value of the MarkerPulsingMaximumScale attribute times the value of the MarkerSize attribute.
Attribute MarkerRotatingCycle
Cycle time, in seconds, for rotating the marker. If this time is less than or equal to zero the marker is not rotated. The default value is zero.
Attribute MarkerRotatingCycleOffset
Offset time, in seconds, from the time rendering begins to when the marker begins rotating. This attribute allows different markers to rotate with different phases.
Attribute MarkerRotatingAxis
A double[3] array containing the axis of rotation. The default is (0,0,1), the z-axis.
Fill Attributes
Attribute FillColor
FillColor is a Color-valued attribute that determines the color of a surface. The default value is Color.black.
Attribute ColorFunction
Colorfunction is a Color-valued method which maps spatial points to colors. The default is null. If both FillColor and ColorFunction are set, ColorFunction is used to color the surface.
Attribute Material
Material defines the appearance of an object under illumination. Its value is a Material. Its default value is the Material object created with default parameters.
Text Attributes
Attribute FontName
FontName is a string-valued attribute that specifies the logical font name or a font face name. The default value is "SansSerif". Java always defines the font names “Dialog”, “DialogInput”, “Monospaced”, “Serif”, “SansSerif”, and “Symbol”. Depending on the system, additional font names may be defined.
Attribute FontSize
FontSize is an integer-valued attribute that specifies the point size of the font. The default value is 12.
Attribute FontStyle
FontStyle is an integer-valued attribute that specifies the font style. This can be a bitwise combination of Font.PLAIN, Font.BOLD and/or Font.ITALIC. The default value is Font.PLAIN.
Attribute TextColor
TextColor is a Color-valued attribute that specifies the color in which the text is drawn. The default value is Color.black.
Attribute TextFormat
TextFormat is a Format-valued or a String-valued attribute that specifies how to format string objects.
TextFormat can also be set using a String, which is used to generate a Format object when the attribute is accessed. The Format object is created using the value of locale in the chart node.
Some strings have special meanings (case is ignored in these strings):
*"Date(SHORT)" means use:
DateFormat.getDateInstance(SHORT, Locale)
*"Date(MEDIUM)" means use
DateFormat.getDateInstance(MEDIUM, Locale)
*"Date(LONG)" means use:
DateFormat.getDateInstance(LONG, Locale)
*"Currency" means use
NumberFormat.getCurrencyInstance(Locale)
*"Percent" means use:
NumberFormat.getPercentInstance(Locale)
If TextFormat has a string value that is not one of the above, then
new DecimalFormat(value, new DecimalFormatSymbols(Locale))
is used. For example, if its value is a String "0.00", then numbers will be formatted with exactly two digits after the decimal place. See DecimalFormat for a detailed description of these format patterns.
The default value of TextFormat is the value returned by the factory method NumberFormat.getInstance(Locale).