public class TLcyLspMS2525bAddOn extends ALcyLspFormatAddOn
This add-on registers the Lightspeed related functionality of the TLcyMS2525bAddOn
. It creates a format
which creates the necessary factories. This format can be modified by
overriding the createBaseFormat()
method.
As an ALcyFormatBarFactory
is used for the UI to create new domain objects,
this add-on requires the TLcyFormatBarAddOn
(or equivalent) to show its tool bar for drawing new symbols.
Without such add-on, that UI will never become visible to the end-user.
ALcyLspFormatAddOn
, this add-on offers some extra customization
options by exposing certain parts of the UI as sample code.
The format bar, which contains the UI elements to create new domain objects, is available as sample code.
See the LspMS2525FormatBarFactory
sample class.
If you want to make modifications to our format bar, you can start from the source code of this class.
Plugging in the custom format bar factory is done by returning it from ALcyLspFormat.createFormatBarFactory()
:
@Override
protected ALcyLspFormat createBaseFormat(){
return new ALcyLspFormatWrapper(super.createBaseFormat()){
@Override
protected ALcyFormatBarFactory createFormatBarFactory(){
return new CustomLspMS2525FormatBarFactory();
}
}
}
The object properties panel, which contains the UI to modify an existing domain object, is also available as sample code.
However, the object properties panel is shared between GXY and Lightspeed as it has no view-specific dependency.
Therefore it is provided by the TLcyMS2525bAddOn
.
Consult the class javadoc of that add-on for more information on how to customize it.
Constructor and Description |
---|
TLcyLspMS2525bAddOn()
Creates a new
TLcyLspMS2525bAddOn instance. |
Modifier and Type | Method and Description |
---|---|
protected ALcyLspFormat |
createBaseFormat()
Returns a new data format for this add-on.
|
protected ALcyLspFormat |
createFormatWrapper(ALcyLspFormat aBaseFormat)
Returns a new data format wrapper for this add-on.
|
void |
plugInto(ILcyLucyEnv aLucyEnv)
Creates and plugs in the add-on's format and preferences tool.
|
void |
unplugFrom(ILcyLucyEnv aLucyEnv)
Unplugs the add-on's format and preferences tool.
|
createFormatTool, getFormat
createPreferencesTool, getLongPrefix, getLucyEnv, getPreferences, getPreferencesTool, getShortPrefix
getConfigSourceName, getDisplayName, setConfigSourceName, setDisplayName
public TLcyLspMS2525bAddOn()
TLcyLspMS2525bAddOn
instance.public void plugInto(ILcyLucyEnv aLucyEnv)
ALcyLspFormatAddOn
plugInto
in class ALcyLspFormatAddOn
aLucyEnv
- the Lucy environment to plug intoALcyAddOn.unplugFrom(com.luciad.lucy.ILcyLucyEnv)
public void unplugFrom(ILcyLucyEnv aLucyEnv)
ALcyLspFormatAddOn
unplugFrom
in class ALcyLspFormatAddOn
aLucyEnv
- the Lucy environmentALcyAddOn.plugInto(com.luciad.lucy.ILcyLucyEnv)
protected ALcyLspFormat createBaseFormat()
ALcyLspFormatAddOn
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 ALcyLspFormat createBaseFormat() {
return new ALcyLspFormatWrapper(super.createBaseFormat()){
@Override
protected ILspLayerFactory createLayerFactory(){
final ILspLayerFactory delegate = super.createLayerFactory();
return new ILspLayerFactory(){
@Override
public boolean canCreateLayers(ILcdModel aModel){
return delegate.canCreateLayers(aModel);
}
@Override
public Collection<ILspLayer> createLayers(ILcdModel aModel){
Collection<ILspLayer> layers = delegate.createLayers(aModel);
for(ILspLayer layer : layers){
ILcdIcon icon = ...;
layer.setIcon(icon)
}
return layers;
}
}
}
}
}
createBaseFormat
in class ALcyLspFormatAddOn
protected final ALcyLspFormat createFormatWrapper(ALcyLspFormat aBaseFormat)
ALcyLspFormatAddOn
Returns a new data format wrapper for this add-on. A format wrapper extends the base format with aspects such as 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 ALcyLspFormatAddOn
aBaseFormat
- the base format to wrapALcyLspFormatWrapper