public abstract class KMLAbstractFeature extends KMLAbstractObject implements KMLRenderable
KMLAbstractFeature
implements the KMLRenderable
interface, but does not actually render
anything. Subclasses should override the methods
and doPreRender(gov.nasa.worldwind.ogc.kml.impl.KMLTraversalContext,
gov.nasa.worldwind.render.DrawContext)
to render their contents. If the doRender(gov.nasa.worldwind.ogc.kml.impl.KMLTraversalContext,
gov.nasa.worldwind.render.DrawContext)
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 java.util.List<KMLAbstractStyleSelector> |
styleSelectors
The style selectors specified in the KML Feature element.
|
protected java.lang.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(java.lang.String namespaceURI)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addStyleSelector(KMLAbstractStyleSelector o) |
void |
applyChange(KMLAbstractObject sourceValues) |
protected void |
doAddEventContent(java.lang.Object o,
XMLEventParserContext ctx,
javax.xml.stream.events.XMLEvent event,
java.lang.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 . |
java.lang.String |
getAddress() |
XALAddressDetails |
getAddressDetails() |
AtomPerson |
getAuthor() |
Balloon |
getBalloon()
Get the balloon associated with this feature, if any.
|
java.lang.String |
getDescription() |
KMLExtendedData |
getExtendedData() |
AtomLink |
getLink() |
java.lang.String |
getName() |
java.lang.Boolean |
getOpen() |
java.lang.String |
getPhoneNumber() |
KMLRegion |
getRegion() |
java.lang.Object |
getSnippet() |
java.lang.String |
getSnippetText() |
java.util.List<KMLAbstractStyleSelector> |
getStyleSelectors() |
KMLStyleUrl |
getStyleUrl() |
KMLAbstractSubStyle |
getSubStyle(KMLAbstractSubStyle subStyle,
java.lang.String styleState)
Obtains the effective values for a specified sub-style (IconStyle, ListStyle, etc.) and state
(normal or highlight).
|
KMLAbstractTimePrimitive |
getTimePrimitive() |
KMLAbstractView |
getView() |
java.lang.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(java.lang.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 java.util.List<KMLAbstractStyleSelector> styleSelectors
protected java.lang.Boolean visibility
fields
table.protected KMLAbstractFeature(java.lang.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(java.lang.Object o, XMLEventParserContext ctx, javax.xml.stream.events.XMLEvent event, java.lang.Object... args) throws javax.xml.stream.XMLStreamException
doAddEventContent
in class AbstractXMLEventParser
javax.xml.stream.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 java.lang.String getAddress()
public XALAddressDetails getAddressDetails()
public AtomPerson getAuthor()
public Balloon getBalloon()
public java.lang.String getDescription()
public KMLExtendedData getExtendedData()
public AtomLink getLink()
public java.lang.String getName()
public java.lang.Boolean getOpen()
public java.lang.String getPhoneNumber()
public KMLRegion getRegion()
public java.lang.Object getSnippet()
public java.lang.String getSnippetText()
public java.util.List<KMLAbstractStyleSelector> getStyleSelectors()
public KMLStyleUrl getStyleUrl()
public KMLAbstractSubStyle getSubStyle(KMLAbstractSubStyle subStyle, java.lang.String styleState)
A remote styleUrl that has not yet been resolved is not included in the result. In this case the returned
sub-style is marked with the value 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 java.lang.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
.
If this feature has no Region, this inherits the Region of its nearest ancestor by using the Region on the top of
the KML traversal context's region stack (if any). If there is no ancestor Region this feature is assumed to be
the 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)
Note: Balloon is not a field in the KML Feature element. It's a direct field of this class and enables the client to associate a balloon with the feature.
balloon
- New balloon.protected void setRegion(KMLRegion region)
protected void setTimePrimitive(KMLAbstractTimePrimitive o)
protected void setView(KMLAbstractView o)
public void setVisibility(java.lang.Boolean visibility)
KMLAbstractFeature
is enabled for rendering.visibility
- true
or null
to draw this feature, otherwise false
. The
default value is true
.getVisibility()