public class TLcyBingMapsAddOn extends ALcyFormatAddOn
This add-on provides support for Bing maps data on a 2D map.
Constructor and Description |
---|
TLcyBingMapsAddOn()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
protected ALcyFormat |
createBaseFormat()
Returns a new data format for this add-on.
|
Component |
createCopyrightComponent(ILcdGXYView aGXYView)
Returns a component representing the copyright information of the Bing map layers contained
in
aGXYView which will be added on the map. |
protected ALcyFormat |
createFormatWrapper(ALcyFormat aBaseFormat)
Returns a new data format wrapper for this add-on.
|
Component |
createLogoComponent(ILcdGXYView aGXYView)
Returns a component representing the logo of the Bing map layers contained in
aGXYView which will be added on the map. |
void |
plugInto(ILcyLucyEnv aLucyEnv)
Creates and plugs in the add-on's format.
|
createFormatTool, getFormat, unplugFrom
createPreferencesTool, getLongPrefix, getLucyEnv, getPreferences, getPreferencesTool, getShortPrefix
getConfigSourceName, getDisplayName, setConfigSourceName, setDisplayName
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)
protected ALcyFormat createBaseFormat()
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;
}
}
}
}
}
When overriding this method, it might be required to override createCopyrightComponent(com.luciad.view.gxy.ILcdGXYView)
as well.
createBaseFormat
in class ALcyFormatAddOn
createCopyrightComponent(com.luciad.view.gxy.ILcdGXYView)
,
createLogoComponent(com.luciad.view.gxy.ILcdGXYView)
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
public Component createCopyrightComponent(ILcdGXYView aGXYView)
Returns a component representing the copyright information of the Bing map layers contained
in aGXYView
which will be added on the map.
This method will be called once for the view of each created ILcyMapComponent
.
It is up to the returned component to keep its state in sync with the state of
aGXYView
. E.g. when a Bing layer is added, the component should contain the
relevant copyright information. When the scale of the view changes, the copyright info in the
component should be updated, ... .
The default implementation of this method relies on the default implementation of the
created ALcyFormat
. When customizing that ALcyFormat
,
it might be required to override this method as well.
aGXYView
- The viewaGXYView
public Component createLogoComponent(ILcdGXYView aGXYView)
Returns a component representing the logo of the Bing map layers contained in
aGXYView
which will be added on the map.
This method will be called once for the view of each created ILcyMapComponent
.
It is up to the returned component to keep its state in sync with the state of
aGXYView
. E.g. when a Bing layer is added, the component should contain the
relevant logo.
The default implementation of this method relies on the default implementation of the
created ALcyFormat
. When customizing that ALcyFormat
,
it might be required to override this method as well.
aGXYView
- The viewaGXYView