public interface ShapeAttributes extends Exportable
Path
, Polygon
, and SurfaceShape
. Changes made to the
attributes are applied to the shape when the WorldWindow
renders the next frame. Instances of
ShapeAttributes
may be shared by many shapes, thereby reducing the memory normally required to store
attributes for each shape.FORMAT_NOT_SUPPORTED, FORMAT_PARTIALLY_SUPPORTED, FORMAT_SUPPORTED
Modifier and Type | Method and Description |
---|---|
ShapeAttributes |
copy()
Returns a new ShapeAttributes instance of the same type as this ShapeAttributes who's properties are configured
exactly as this ShapeAttributes.
|
void |
copy(ShapeAttributes attributes)
Copies the specified ShapeAttributes' properties into this object's properties.
|
double |
getImageScale()
Indicates the amount the shape's texture is scaled by as a floating-point value.
|
Object |
getImageSource()
Indicates the image source that is applied as a texture to the shape's interior.
|
Material |
getInteriorMaterial()
Indicates the material properties of the shape's interior.
|
double |
getInteriorOpacity()
Indicates the opacity of the shape's interior as a floating-point value in the range 0.0 to 1.0.
|
Material |
getOutlineMaterial()
Indicates the material properties of the shape's outline.
|
double |
getOutlineOpacity()
Indicates the opacity of the shape's outline as a floating-point value in the range 0.0 to 1.0.
|
int |
getOutlineStippleFactor()
Indicates the number of times each bit in the outline stipple pattern is repeated before the next bit is used.
|
short |
getOutlineStipplePattern()
Indicates the 16-bit integer that defines which pixels are rendered in the shape's outline.
|
double |
getOutlineWidth()
Indicates the line width (in pixels) used when rendering the shape's outline.
|
void |
getRestorableState(RestorableSupport rs,
RestorableSupport.StateObject so)
Saves the attributes' current state in the specified
RestorableSupport . |
boolean |
isDrawInterior()
Indicates whether the shape's interior geometry is drawn.
|
boolean |
isDrawOutline()
Indicates whether the shape's outline geometry is drawn.
|
boolean |
isEnableAntialiasing()
Indicates whether the shape is rendered with smooth lines and edges.
|
boolean |
isEnableLighting()
Indicates whether lighting is applied to the shape.
|
boolean |
isUnresolved()
Indicates whether some of the shape's attributes are unresolved.
|
void |
restoreState(RestorableSupport rs,
RestorableSupport.StateObject so)
Restores the state of any attributes contained in the specified
RestorableSupport . |
void |
setDrawInterior(boolean draw)
Specifies whether to draw the shape's interior geometry.
|
void |
setDrawOutline(boolean draw)
Specifies whether to draw the shape's outline geometry.
|
void |
setEnableAntialiasing(boolean enable)
Specifies whether the shape should be rendered with smooth lines and edges.
|
void |
setEnableLighting(boolean enableLighting)
Specifies whether to apply lighting to the shape.
|
void |
setImageScale(double scale)
Specifies the amount to scale the shape's texture as a floating-point value.
|
void |
setImageSource(Object imageSource)
Specifies the image source to apply as a texture to the shape's interior, or
null to specify that
the shape should not have a texture. |
void |
setInteriorMaterial(Material material)
Specifies the material properties of the shape's interior.
|
void |
setInteriorOpacity(double opacity)
Specifies the opacity of the shape's interior as a floating-point value in the range 0.0 to 1.0.
|
void |
setOutlineMaterial(Material material)
Specifies the material properties of the shape's outline.
|
void |
setOutlineOpacity(double opacity)
Specifies the opacity of the shape's outline as a floating-point value in the range 0.0 to 1.0.
|
void |
setOutlineStippleFactor(int factor)
Specifies the number of times each bit in the outline stipple pattern should be repeated before the next bit is
used.
|
void |
setOutlineStipplePattern(short pattern)
Specifies a 16-bit integer that defines which pixels are rendered in the shape's outline.
|
void |
setOutlineWidth(double width)
Specifies the line width (in pixels) to use when rendering the shape's outline.
|
void |
setUnresolved(boolean unresolved)
Specifies whether some of the shape's attributes are unresolved.
|
export, isExportFormatSupported
ShapeAttributes copy()
void copy(ShapeAttributes attributes)
null
.attributes
- the attributes to copy.double getImageScale()
setImageScale(double)
Object getImageSource()
String
path, a URL
, a BufferedImage
, or null
.setImageSource(Object)
Material getInteriorMaterial()
setInteriorMaterial(Material)
double getInteriorOpacity()
setInteriorOpacity(double)
Material getOutlineMaterial()
setOutlineMaterial(Material)
double getOutlineOpacity()
setOutlineOpacity(double)
int getOutlineStippleFactor()
setOutlineStippleFactor(int)
short getOutlineStipplePattern()
setOutlineStipplePattern(short)
double getOutlineWidth()
setOutlineWidth(double)
void getRestorableState(RestorableSupport rs, RestorableSupport.StateObject so)
RestorableSupport
. If the
StateObject
is not null
the state is appended to it. Otherwise the state is added to
the RestorableSupport
root. This state can be restored later by calling restoreState(gov.nasa.worldwind.util.RestorableSupport, gov.nasa.worldwind.util.RestorableSupport.StateObject)
.rs
- the RestorableSupport
that receives the attributes' state.so
- the StateObject
the state is appended to, if not null
.IllegalArgumentException
- if rs
is null
.boolean isDrawInterior()
true
if the shape's interior is drawn, otherwise false
.setDrawInterior(boolean)
boolean isDrawOutline()
true
if the shape's outline is drawn, otherwise false
.setDrawOutline(boolean)
boolean isEnableAntialiasing()
true
if the shape is drawn with smooth lines and edges, otherwise false
.setEnableAntialiasing(boolean)
boolean isEnableLighting()
true
to apply lighting, otherwise false
.setEnableLighting(boolean)
boolean isUnresolved()
true
to indicate that one or more attributes are unresolved, otherwise false
.setUnresolved(boolean)
void restoreState(RestorableSupport rs, RestorableSupport.StateObject so)
RestorableSupport
. If the
StateObject
is not null
it's searched for attribute state values, otherwise the
RestorableSupport
root is searched.rs
- the RestorableSupport
that contains the attributes' state.so
- the StateObject
to search for state values, if not null
.IllegalArgumentException
- if rs
is null
.void setDrawInterior(boolean draw)
draw
- true
to draw the shape's interior, otherwise false
.isDrawInterior()
void setDrawOutline(boolean draw)
draw
- true
to draw the shape's outline, otherwise false
.isDrawOutline()
void setEnableAntialiasing(boolean enable)
enable
- true
to draw the shape with smooth lines and edges, otherwise false
.isEnableAntialiasing()
void setEnableLighting(boolean enableLighting)
DrawContext
's standard lighting by calling DrawContext.beginStandardLighting()
and DrawContext.endStandardLighting()
before and after the shape is rendered, respectively.enableLighting
- true
to apply lighting, otherwise false
.isEnableLighting()
void setImageScale(double scale)
scale
- the amount to scale the shape's texture as a floating-point value.IllegalArgumentException
- if scale
is less than or equal to zero.getImageScale()
,
setImageSource(Object)
void setImageSource(Object imageSource)
null
to specify that
the shape should not have a texture. When not null
, the texture replaces the shape's interior
material. The source type may be one of the following: String
containing a path to a local file,
or a resource on the classpath.URL
BufferedImage
null
URL
, it is read only when the
shape is rendered.imageSource
- the source of the shape's texture, either a String
path, a URL
, a
BufferedImage
, or null
.getImageSource()
void setInteriorMaterial(Material material)
material
- the material to apply to the shape's interior.IllegalArgumentException
- if material
is null
.getInteriorMaterial()
void setInteriorOpacity(double opacity)
opacity
- the interior opacity as a floating-point value from 0.0 to 1.0.IllegalArgumentException
- if opacity
is less than 0.0 or greater than 1.0.getInteriorOpacity()
void setOutlineMaterial(Material material)
material
- the material to apply to the shape's outline.IllegalArgumentException
- if material
is null
.getOutlineMaterial()
void setOutlineOpacity(double opacity)
opacity
- the outline opacity as a floating-point value from 0.0 to 1.0.IllegalArgumentException
- if opacity
is less than 0.0 or greater than 1.0.getOutlineOpacity()
void setOutlineStippleFactor(int factor)
factor
is 3, each bit is repeated 3 times before using the next bit. The
specified factor
must be either zero or an integer greater than zero. The factor
may be
limited by an implementation-defined maximum during rendering. The maximum stipple factor is typically 256.
To disable outline stippling, either specify a stipple factor of 0, or specify a stipple pattern of all 1 bits:
0xFFFF
.factor
- the number of times each bit in the outline stipple pattern should be repeated.IllegalArgumentException
- if factor
is less than zero.getOutlineStippleFactor()
,
setOutlineStipplePattern(short)
void setOutlineStipplePattern(short pattern)
0xFFFF
.pattern
- a 16-bit integer whose bit pattern defines which pixels are rendered in the shape's outline.getOutlineStipplePattern()
,
setOutlineStippleFactor(int)
void setOutlineWidth(double width)
width
must be zero or a positive floating-point value. Specifying a line width of zero disables the shape's outline.
The width
may be limited by an implementation-defined maximum during rendering. The maximum width is
typically 10 pixels.width
- the line width in pixels.IllegalArgumentException
- if width
is less than zero.getOutlineWidth()
void setUnresolved(boolean unresolved)
true
, then sets it to false
once the retrieval is complete. Code that interprets the
attributes knows that the attributes are complete when unresolved is false
.unresolved
- true
to specify that one or more attributes are unresolved, otherwise
false
.isUnresolved()