public class TLcyDrawingDataModelDescriptor extends TLcyDrawingModelDescriptor implements ILcdDataModelDescriptor
Extension of TLcyDrawingModelDescriptor
which also implements ILcdDataModelDescriptor
.
Instances of this class can be created through the Builder
class.
Typically, when you create your own TLcyDrawingDataModelDescriptor
instance, you will also create your own
drawing model and layer.
The following code snippets shows how this can be achieved:
TLcyDrawingDataModelDescriptor.Builder builder = TLcyDrawingDataModelDescriptor.Builder.newInstance();
builder.sourceName(null) //null source as we create a model from scratch
.displayName(""My drawing model");
//add some properties
builder.addStringProperty("Name")
.addIntegerProperty("Population");
//build the model descriptor
TLcyDrawingDataModelDescriptor descriptor = builder.build();
//Create a model and layer using the available model factories and layer factories from Lucy
ILcyLucyEnv lucy = ...;
ILcdModel drawingModel = new TLcyCompositeModelFactory(lucy).createModel(descriptor, new TLcdGeodeticReference());
ILcdGXYLayer gxyLayer = new TLcyCompositeGXYLayerFactory(lucy).createGXYLayer(drawingModel);
This is the default ILcdModelDescriptor
for drawing models. The
TLcyDrawingModelDescriptor
is only used when specified in the configuration file of
the drawing add-on (see the TLcyDrawingAddOn.useDataModel
property).
Modifier and Type | Class and Description |
---|---|
static class |
TLcyDrawingDataModelDescriptor.Builder
Builder class for
TLcyDrawingDataModelDescriptor instances. |
fFeatureClasses
Constructor and Description |
---|
TLcyDrawingDataModelDescriptor(String aSourceName,
String aDisplayName)
Deprecated.
Use the
TLcyDrawingDataModelDescriptor.Builder instead |
TLcyDrawingDataModelDescriptor(String aSourceName,
String aDisplayName,
TLcyDrawingStyleRepository aDrawingModelStyle)
Deprecated.
Use the
TLcyDrawingDataModelDescriptor.Builder instead |
Modifier and Type | Method and Description |
---|---|
TLcdDataModel |
getDataModel()
Returns the data model that describes the elements of the model.
|
TLcdDataType |
getDataType()
Returns the one and only
TLcdDataType of this data model . |
Set<TLcdDataType> |
getModelElementTypes()
Returns a set containing all the data types of which instances can be elements in the model
associated with this descriptor.
|
Set<TLcdDataType> |
getModelTypes()
Returns a set containing all the types of which instances can be used (including both
top-level elements and child objects) in the model associated with this descriptor.
|
void |
setDataModel(TLcdDataModel aDataModel)
Set the
TLcdDataModel for this descriptor. |
addFeature, getDrawingStyleRepository, getFeatureClass, getFeatureCount, getFeatureIndex, getFeatureName, removeFeature, setFeature
getFeaturedDescriptor
getDisplayName, getSourceName, getTypeName, setDisplayName, setSourceName, setTypeName, sourceNameToDisplayName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDisplayName, getSourceName, getTypeName
getFeatureUnitOfMeasure
@Deprecated public TLcyDrawingDataModelDescriptor(String aSourceName, String aDisplayName)
TLcyDrawingDataModelDescriptor.Builder
insteadTLcyDrawingDataModelDescriptor
with the given parameters. Use
setDataModel(com.luciad.datamodel.TLcdDataModel)
to set the TLcdDataModel
associated to this descriptor.aSourceName
- the source nameaDisplayName
- the display name@Deprecated public TLcyDrawingDataModelDescriptor(String aSourceName, String aDisplayName, TLcyDrawingStyleRepository aDrawingModelStyle)
TLcyDrawingDataModelDescriptor.Builder
insteadTLcyDrawingDataModelDescriptor
with the given parameters. Use
setDataModel(com.luciad.datamodel.TLcdDataModel)
to set the TLcdDataModel
associated to this descriptor.aSourceName
- the source nameaDisplayName
- the display nameaDrawingModelStyle
- Repository containing SLD styles which can be used by the domain
objectspublic void setDataModel(TLcdDataModel aDataModel)
Set the TLcdDataModel
for this descriptor. This method should be called before
using the ILcdDataModelDescriptor
methods.
As soon as the corresponding ILcdModel
for this descriptor is in use, this
method should no longer be used.
aDataModel
- the data model for this descriptorpublic TLcdDataModel getDataModel()
ILcdDataModelDescriptor
Returns the data model that describes the elements of the model. Note that not necessarily all data in the model will be of a type of this data model. Very likely, types from the dependencies of the returned data model are used as well.
In case the model accepts objects from multiple data models, an anonymous
data model that depends on all these data models should be returned
(see TLcdDataModelBuilder.createAnonymousDataModel(java.util.Collection)
).
getDataModel
in interface ILcdDataModelDescriptor
public Set<TLcdDataType> getModelElementTypes()
ILcdDataModelDescriptor
Returns a set containing all the data types of which instances can be elements in the model associated with this descriptor. Implementations are free to limit the result to only include the types of which there are actually elements in the model; but they are not required to do so.
Implementations should return null
in case they don't know
which element types are present in the model.
For each element of the model associated with this model descriptor, the following holds true :
getModelElementTypes().contains( element.getDataType() )
.
getModelElementTypes
in interface ILcdDataModelDescriptor
public Set<TLcdDataType> getModelTypes()
ILcdDataModelDescriptor
Returns a set containing all the types of which instances can be used (including both top-level elements and child objects) in the model associated with this descriptor. Implementations are free to limit the result to only include the types of which there are actually instances in the model; but they are not required to do so.
A simple and correct implementation would be to return
getDataModel().getTypes()
. Implementations are encouraged to return a subset of
this set if they can do so without spending an unreasonable amount of resources.
Implementations should return null
in case they don't know
which types are present in the model.
getModelTypes
in interface ILcdDataModelDescriptor
public TLcdDataType getDataType()
TLcdDataType
of this data model
.TLcdDataType
of this data model
.