public class KMLAbstractContainer extends KMLAbstractFeature
Modifier and Type | Field and Description |
---|---|
protected java.util.ArrayList<KMLAbstractFeature> |
features |
balloon, region, styleSelectors, visibility
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 |
KMLAbstractContainer(java.lang.String namespaceURI)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addFeature(KMLAbstractFeature feature) |
void |
applyChange(KMLAbstractObject sourceValues) |
protected void |
beginRendering(KMLTraversalContext tc,
DrawContext dc)
Prepares this KML container for rendering.
|
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)
Pre-renders the KML features held by this
KMLAbstractContainer . |
protected void |
doRender(KMLTraversalContext tc,
DrawContext dc)
Renders the KML features held by this
KMLAbstractContainer . |
protected void |
endRendering(KMLTraversalContext tc,
DrawContext dc)
Restores any rendering state changed during rendering.
|
java.util.List<KMLAbstractFeature> |
getFeatures() |
protected boolean |
isFeatureActive(KMLTraversalContext tc,
DrawContext dc)
Indicates whether this
KMLAbstractContainer is active and should be rendered on the specified
DrawContext . |
protected void |
mergeFeatures(KMLAbstractContainer sourceContainer)
Merge a list of incoming features with the current list.
|
void |
onMessage(Message msg)
Invoked when a message is received.
|
protected void |
preRenderFeatures(KMLTraversalContext tc,
DrawContext dc)
PreRenders this KML container's list of KML features, in the order they appear in the list.
|
void |
removeFeature(KMLAbstractFeature feature) |
protected void |
renderFeatures(KMLTraversalContext tc,
DrawContext dc)
Draws this KML container's list of KML features, in the order they appear in the list.
|
addStyleSelector, getAddress, getAddressDetails, getAuthor, getBalloon, getDescription, getExtendedData, getLink, getName, getOpen, getPhoneNumber, getRegion, getSnippet, getSnippetText, getStyleSelectors, getStyleUrl, getSubStyle, getTimePrimitive, getView, getVisibility, hasStyle, hasStyleSelectors, mergeStyleSelectors, preRender, render, renderBalloon, setBalloon, setRegion, setTimePrimitive, setView, setVisibility
getId, getRoot, getTargetId, onChange
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
protected java.util.ArrayList<KMLAbstractFeature> features
protected KMLAbstractContainer(java.lang.String namespaceURI)
namespaceURI
- the qualifying namespace URI. May be null to indicate no namespace qualification.public void addFeature(KMLAbstractFeature feature)
public void applyChange(KMLAbstractObject sourceValues)
applyChange
in class KMLAbstractFeature
protected void beginRendering(KMLTraversalContext tc, DrawContext dc)
endRendering
.tc
- the current KML traversal context.dc
- the current draw context.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 KMLAbstractFeature
javax.xml.stream.XMLStreamException
protected void doPreRender(KMLTraversalContext tc, DrawContext dc)
KMLAbstractContainer
.
Pushes this container's Region on the KML traversal context's region stack before rendering the features, and
pops the Region off the stack afterward. Descendant features use the KML traversal context's region stack to
inherit Regions from parent containers.doPreRender
in class KMLAbstractFeature
tc
- the current KML traversal context.dc
- the current draw context.protected void doRender(KMLTraversalContext tc, DrawContext dc)
KMLAbstractContainer
.
Pushes this container's Region on the KML traversal context's region stack before rendering the features, and
pops the Region off the stack afterward. Descendant features use the KML traversal context's region stack to
inherit Regions from parent containers.doRender
in class KMLAbstractFeature
tc
- the current KML traversal context.dc
- the current draw context.protected void endRendering(KMLTraversalContext tc, DrawContext dc)
beginRendering
.tc
- the current KML traversal context.dc
- the current draw context.public java.util.List<KMLAbstractFeature> getFeatures()
protected boolean isFeatureActive(KMLTraversalContext tc, DrawContext dc)
KMLAbstractContainer
is active and should be rendered on the specified
DrawContext
. This returns true
if this container's visibility
is
unspecified (null
) or is set to true
.
Regions do not apply directly to KML containers, because a descendant features can override the container's
Region with its own. Since a descendant Region may be larger or have a less restrictive LOD range than this
container, we cannot determine the visibility of the entire tree based on this container's Region. A container's
Region is inherited by any descendants that do not specify a Region, and Region visibility is determined at the
leaf nodes.isFeatureActive
in class KMLAbstractFeature
tc
- the current KML traversal context. This parameter is ignored.dc
- the draw context. This parameter is ignored.true
if this container should be rendered, otherwise false
.protected void mergeFeatures(KMLAbstractContainer sourceContainer)
sourceContainer
- the incoming container of features.public void onMessage(Message msg)
MessageListener
onMessage
in interface MessageListener
onMessage
in class KMLAbstractObject
msg
- The message that was received.protected void preRenderFeatures(KMLTraversalContext tc, DrawContext dc)
tc
- the current KML traversal context.dc
- the current draw context.public void removeFeature(KMLAbstractFeature feature)
protected void renderFeatures(KMLTraversalContext tc, DrawContext dc)
tc
- the current KML traversal context.dc
- the current draw context.