public abstract class KMLAbstractFeature extends KMLAbstractObject implements KMLRenderable
KMLAbstractFeature
implements the KMLRenderable
interface, but does not actually render
anything. Subclasses should override the methods doPreRender(gov.nasa.worldwind.ogc.kml.impl.KMLTraversalContext,
gov.nasa.worldwind.render.DrawContext)
and doRender(gov.nasa.worldwind.ogc.kml.impl.KMLTraversalContext,
gov.nasa.worldwind.render.DrawContext)
to render their contents. If the visibility
property is
set to false
, this does not call doPreRender
and doRender
during rendering.Modifier and Type | Field and Description |
---|---|
protected Balloon |
balloon
A balloon explicitly associated with this feature by the client.
|
protected KMLRegion |
region
The region specified in the KML Feature element.
|
protected List<KMLAbstractStyleSelector> |
styleSelectors
The style selectors specified in the KML Feature element.
|
protected Boolean |
visibility
The visibility flag for the feature.
|
MSG_BOX_CHANGED, MSG_GEOMETRY_CHANGED, MSG_LINK_CHANGED, MSG_STYLE_CHANGED, MSG_TIME_CHANGED, MSG_VIEW_CHANGED
CHARACTERS_CONTENT, fields, namespaceURI, parent
Modifier | Constructor and Description |
---|---|
protected |
KMLAbstractFeature(String namespaceURI)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addStyleSelector(KMLAbstractStyleSelector o) |
void |
applyChange(KMLAbstractObject sourceValues) |
protected void |
doAddEventContent(Object o,
XMLEventParserContext ctx,
XMLEvent event,
Object... args) |
protected void |
doPreRender(KMLTraversalContext tc,
DrawContext dc)
Called from
preRender if this KMLAbstractFeature 's visibility is not set
to false . |
protected void |
doRender(KMLTraversalContext tc,
DrawContext dc)
Called from
render if this KMLAbstractFeature 's visibility is not set to
false . |
String |
getAddress() |
XALAddressDetails |
getAddressDetails() |
AtomPerson |
getAuthor() |
Balloon |
getBalloon()
Get the balloon associated with this feature, if any.
|
String |
getDescription() |
KMLExtendedData |
getExtendedData() |
AtomLink |
getLink() |
String |
getName() |
Boolean |
getOpen() |
String |
getPhoneNumber() |
KMLRegion |
getRegion() |
Object |
getSnippet() |
String |
getSnippetText() |
List<KMLAbstractStyleSelector> |
getStyleSelectors() |
KMLStyleUrl |
getStyleUrl() |
KMLAbstractSubStyle |
getSubStyle(KMLAbstractSubStyle subStyle,
String styleState)
Obtains the effective values for a specified sub-style (IconStyle, ListStyle, etc.) and state
(normal or highlight).
|
KMLAbstractTimePrimitive |
getTimePrimitive() |
KMLAbstractView |
getView() |
Boolean |
getVisibility()
Indicates whether this
KMLAbstractFeature is enabled for rendering. |
boolean |
hasStyle() |
boolean |
hasStyleSelectors() |
protected boolean |
isFeatureActive(KMLTraversalContext tc,
DrawContext dc)
Indicates whether this
KMLAbstractFeature is active and should be rendered on the specified
DrawContext . |
protected void |
mergeStyleSelectors(KMLAbstractFeature sourceFeature)
Merge a list of incoming style selectors with the current list.
|
void |
preRender(KMLTraversalContext tc,
DrawContext dc)
Pre-render this element.
|
void |
render(KMLTraversalContext tc,
DrawContext dc)
Render this element.
|
protected void |
renderBalloon(KMLTraversalContext tc,
DrawContext dc)
Draws the
associated with this KML feature. |
void |
setBalloon(Balloon balloon)
Set the balloon associated with this feature.
|
protected void |
setRegion(KMLRegion region) |
protected void |
setTimePrimitive(KMLAbstractTimePrimitive o) |
protected void |
setView(KMLAbstractView o) |
void |
setVisibility(Boolean visibility)
Specifies whether this
KMLAbstractFeature is enabled for rendering. |
getId, getRoot, getTargetId, onChange, onMessage
allocate, doAddCharacters, doAddEventAttribute, doParseEventAttributes, doParseEventContent, freeResources, getAConstructor, getCharacters, getField, getField, getFields, getNamespaceURI, getParent, hasField, hasField, hasFields, mergeFields, newInstance, overrideFields, parse, parseCharacterContent, removeField, setField, setField, setFields, setNamespaceURI, setParent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onMessage
protected Balloon balloon
protected KMLRegion region
protected List<KMLAbstractStyleSelector> styleSelectors
protected Boolean visibility
fields
table.protected KMLAbstractFeature(String namespaceURI)
namespaceURI
- the qualifying namespace URI. May be null to indicate no namespace qualification.protected void addStyleSelector(KMLAbstractStyleSelector o)
public void applyChange(KMLAbstractObject sourceValues)
applyChange
in class KMLAbstractObject
protected void doAddEventContent(Object o, XMLEventParserContext ctx, XMLEvent event, Object... args) throws XMLStreamException
doAddEventContent
in class AbstractXMLEventParser
XMLStreamException
protected void doPreRender(KMLTraversalContext tc, DrawContext dc)
preRender
if this KMLAbstractFeature
's visibility
is not set
to false
. Subclasses should override this method to pre-render their content.tc
- the current KML traversal context.dc
- the current draw context.protected void doRender(KMLTraversalContext tc, DrawContext dc)
render
if this KMLAbstractFeature
's visibility
is not set to
false
. Subclasses should override this method to render their content.tc
- the current KML traversal context.dc
- the current draw context.public String getAddress()
public XALAddressDetails getAddressDetails()
public AtomPerson getAuthor()
public Balloon getBalloon()
public String getDescription()
public KMLExtendedData getExtendedData()
public AtomLink getLink()
public String getName()
public Boolean getOpen()
public String getPhoneNumber()
public KMLRegion getRegion()
public Object getSnippet()
public String getSnippetText()
public List<KMLAbstractStyleSelector> getStyleSelectors()
public KMLStyleUrl getStyleUrl()
public KMLAbstractSubStyle getSubStyle(KMLAbstractSubStyle subStyle, String styleState)
AVKey.UNRESOLVED
. The same is true when a
StyleMap style selector contains a reference to an external Style and that reference has not been resolved.styleState
- the style mode, either \"normal\" or \"highlight\".subStyle
- an instance of the sub-style desired, such as KMLIconStyle
.
The effective sub-style values are accumulated and merged into this instance. The instance
should not be one from within the KML document because its values are overridden and augmented;
it's just an independent variable in which to return the merged attribute values. For
convenience, the instance specified is returned as the return value of this method.subStyle
argument.public KMLAbstractTimePrimitive getTimePrimitive()
public KMLAbstractView getView()
public Boolean getVisibility()
KMLAbstractFeature
is enabled for rendering. This returns null
if no visibility is specified. This indicates the default visibility of true
should be used.true
or null
to draw feature shape, otherwise false
. The default
value is true
.setVisibility(Boolean)
public boolean hasStyle()
public boolean hasStyleSelectors()
protected boolean isFeatureActive(KMLTraversalContext tc, DrawContext dc)
KMLAbstractFeature
is active and should be rendered on the specified
DrawContext
. This returns true
if the following conditions are all true
:
visibility
is unspecified (null
) or is set to
true
.DrawContext
.DrawContext's view and is rendered according to its visibility
flag. A Region is
considered active if it is visible, and the DrawContext
meets the Region's level of detail
criteria.
tc
- the current KML traversal context. Specifies an inherited Region (if any) and a detail hint.dc
- the current draw context. Used to determine whether this feature's Region is active.true
if this feature should be rendered, otherwise false
.protected void mergeStyleSelectors(KMLAbstractFeature sourceFeature)
sourceFeature
- the incoming style selectors.public void preRender(KMLTraversalContext tc, DrawContext dc)
preRender
in interface KMLRenderable
tc
- the current KML traversal context.dc
- the current draw context.public void render(KMLTraversalContext tc, DrawContext dc)
render
in interface KMLRenderable
tc
- the current KML traversal context.dc
- the current draw context.protected void renderBalloon(KMLTraversalContext tc, DrawContext dc)
Balloon
associated with this KML feature. This does
nothing if there is no Balloon
associated with this feature.tc
- the current KML traversal context.dc
- the current draw context.public void setBalloon(Balloon balloon)
balloon
- New balloon.protected void setRegion(KMLRegion region)
protected void setTimePrimitive(KMLAbstractTimePrimitive o)
protected void setView(KMLAbstractView o)
public void setVisibility(Boolean visibility)
KMLAbstractFeature
is enabled for rendering.visibility
- true
or null
to draw this feature, otherwise false
. The
default value is true
.getVisibility()