public class TLcyKML22AddOn extends ALcyFormatAddOn
Lucy AddOn for KML 2.2
This AddOn can decode and visualize KML 2.2. The TLcyKML22AddOn
will add
an application pane to Lucy that can display the model content tree of the KML models that have
been added to a specific view. The model content tree can manipulate the visibility of its
elements.
Time dependant data can be visualized using the TLcyKML22RealtimeAddOn
.
The model content tree of KML is created with the TLcyKML22GUIFactory
, a class that follows
the standard ALcyGUIFactory
so it can easily be overridden for customization.
The KML 2.2 AddOn can also display balloons on its features. These balloons contain HTML
documents. This TLcyKML22AddOn
will make use of Lucy services to notify any HyperlinkListener
that
has been registered using ILcyLucyEnv.addService()
. If the TLcyHyperlinkAddOn
has been plugged into Lucy, the
TLcyKML22AddOn
will use that as default behavior to load hyperlinks.
Constructor and Description |
---|
TLcyKML22AddOn()
Creates a new
TLcyKML22AddOn . |
Modifier and Type | Method and Description |
---|---|
protected ALcyApplicationPaneTool |
createApplicationPaneTool()
Creates the application pane tool responsible for the creation of the ILcyApplicationPane
containing a model content tree.
|
protected ALcyFormat |
createBaseFormat()
Returns a new data format for this add-on.
|
protected TLcyFormatTool |
createFormatTool(ALcyFormat aFormat)
Creates a new format tool for the given format.
|
protected ALcyFormat |
createFormatWrapper(ALcyFormat aBaseFormat)
Returns a new data format wrapper for this add-on.
|
protected ALcyGUIFactory<Component> |
createGUIFactory()
Creates the
ALcyGUIFactory responsible for creating all the components
of the KML model content tree |
ALcyApplicationPaneTool |
getApplicationPaneTool()
Returns the
ALcyApplicationPaneTool created in createApplicationPaneTool() |
ALcyGUIFactory<Component> |
getGUIFactory()
Returns the
ALcyGUIFactory created in createGUIFactory() |
void |
plugInto(ILcyLucyEnv aLucyEnv)
Creates and plugs in the add-on's format.
|
void |
unplugFrom(ILcyLucyEnv aLucyEnv)
Unplugs the add-on's format.
|
getFormat
createPreferencesTool, getLongPrefix, getLucyEnv, getPreferences, getPreferencesTool, getShortPrefix
getConfigSourceName, getDisplayName, setConfigSourceName, setDisplayName
protected TLcyFormatTool createFormatTool(ALcyFormat aFormat)
ALcyFormatAddOn
Creates a new format tool for the given format. It is used to plug all parts of the format (
e.g. ILcdGXYLayerFactory
, ILcdModelDecoder
, etc.) into
ILcyLucyEnv
.
createFormatTool
in class ALcyFormatAddOn
aFormat
- the format for which to create a toolTLcyFormatTool
public void plugInto(ILcyLucyEnv aLucyEnv)
ALcyFormatAddOn
Creates and plugs in the add-on's format.
plugInto
in class ALcyFormatAddOn
aLucyEnv
- the Lucy environment to plug intoALcyAddOn.unplugFrom(com.luciad.lucy.ILcyLucyEnv)
public void unplugFrom(ILcyLucyEnv aLucyEnv)
ALcyFormatAddOn
unplugFrom
in class ALcyFormatAddOn
aLucyEnv
- the Lucy environmentALcyAddOn.plugInto(com.luciad.lucy.ILcyLucyEnv)
protected ALcyApplicationPaneTool createApplicationPaneTool()
Creates the application pane tool responsible for the creation of the ILcyApplicationPane containing a model content tree.
getApplicationPaneTool()
,
TLcyKML22ApplicationPaneTool
public ALcyApplicationPaneTool getApplicationPaneTool()
ALcyApplicationPaneTool
created in createApplicationPaneTool()
ALcyApplicationPaneTool
created in createApplicationPaneTool()
protected ALcyGUIFactory<Component> createGUIFactory()
Creates the ALcyGUIFactory
responsible for creating all the components
of the KML model content tree
public ALcyGUIFactory<Component> getGUIFactory()
ALcyGUIFactory
created in createGUIFactory()
ALcyGUIFactory
created in createGUIFactory()
protected ALcyFormat createBaseFormat()
ALcyFormatAddOn
Returns a new data format for this add-on. Override this method to extend the default format with new functionality.
For example, to alter the icon of the layers of this format, you can decorate the layer factory created in the format:
@Override
protected ALcyFormat createBaseFormat() {
return new ALcyFormatWrapper(super.createBaseFormat()){
@Override
protected ILcdGXYLayerFactory createGXYLayerFactory(){
final ILcdGXYLayerFactory delegate = super.createGXYLayerFactory();
return new ILcdGXYLayerFactory(){
@Override
public ILcdGXYLayer createGXYLayer(ILcdModel aModel){
ILcdGXYLayer layer = delegate.createGXYLayer(aModel);
if (layer != null){
ILcdIcon icon = ...;
layer.setIcon(icon);
}
return layer;
}
}
}
}
}
createBaseFormat
in class ALcyFormatAddOn
protected final ALcyFormat createFormatWrapper(ALcyFormat aBaseFormat)
ALcyFormatAddOn
Returns a new data format wrapper for this add-on. A format wrapper extends the base format with aspects such as asynchronous painting, mutable file behavior, safe guarding, etc.
Overriding this method of an existing add-on should be done with extreme care as add-ons typically rely on the wrappers that should be present (e.g. a safe guard).
createFormatWrapper
in class ALcyFormatAddOn
aBaseFormat
- the base format to wrapALcyFormatWrapper