public class TLcdEarthRepositoryModelFactory extends Object
TLcdEarthTileRepository
.
This factory will create all required files for a repository (ex. the database and the model
reference) and an empty asset model (see TLcdEarthTileRepository
for more information). The created models will contain 1 TLcdEarthTileRepository
element and have a ILcdEarthAssetBasedModelDescriptor
. This is also demonstrated in
the following snippet:
// Create the repository model ILcdModel repositoryModel = repositoryModelFactory.createRepository( "/path/to/my/repository" ); // Get the repository TLcdEarthTileRepository repository = ( TLcdEarthTileRepository ) repositoryModel.elements().nextElement(); // Get the asset model that describes the contents of the repository ILcdEarthAssetBasedModelDescriptor modelDescriptor = ( ILcdEarthAssetBasedModelDescriptor ) repositoryModel.getModelDescriptor(); ILcdModel repositoryAssetModel = modelDescriptor.getAssetModel( repository );If the asset model of a repository model created by this factory is changed it can be saved by using its model encoder. This is also demonstrated in the following snippet:
ILcdModel repositoryAssetModel = ...; // the asset model that describes the contents of the repository // add/remove some assets to/from repositoryAssetModel // Save the asset model repositoryAssetModel.getModelEncoder().save( repositoryAssetModel );
TLcdEarthRepositoryModelDecoder
,
TLcdEarthTileRepository
Constructor and Description |
---|
TLcdEarthRepositoryModelFactory()
Constructs a new
TLcdEarthRepositoryModelFactory with the default model reference
encoder/decoder and asset codecs. |
Modifier and Type | Method and Description |
---|---|
void |
addAssetCodec(ILcdEarthAssetCodec aCodec)
Adds the specified asset codec.
|
protected TLcdEarthTileRepository |
createRepository(String aRepositoryName,
ILcdEarthTileSet aTileSet)
Creates a new tile repository with the given name.
|
ILcdModel |
createRepositoryModel(String aSourceName)
Create a new tile repository model that has a repository with the advised tile structure.
|
ILcdModel |
createRepositoryModel(String aSourceName,
ILcdEarthTileSet aTileSet,
ILcdModelReference aModelReference)
Create a new tile repository model.
|
Collection<ILcdEarthAssetCodec> |
getAssetCodecs()
Returns the current collection of asset codecs.
|
boolean |
removeAssetCodec(ILcdEarthAssetCodec aCodec)
Removes the specified asset codec.
|
public TLcdEarthRepositoryModelFactory()
TLcdEarthRepositoryModelFactory
with the default model reference
encoder/decoder and asset codecs.public void addAssetCodec(ILcdEarthAssetCodec aCodec)
aCodec
- the asset codec that should be addedpublic boolean removeAssetCodec(ILcdEarthAssetCodec aCodec)
aCodec
- the asset codec that should be removedpublic Collection<ILcdEarthAssetCodec> getAssetCodecs()
public ILcdModel createRepositoryModel(String aSourceName) throws IOException
aSourceName
- the source name of the repositoryIOException
- if an IO error occurspublic ILcdModel createRepositoryModel(String aSourceName, ILcdEarthTileSet aTileSet, ILcdModelReference aModelReference) throws IOException
aSourceName
- the source name of the repositoryaTileSet
- the tileset that will provide tiles to the repositoryaModelReference
- the model reference of the repositoryIOException
- if an IO error occurscreateRepositoryModel(String)
protected TLcdEarthTileRepository createRepository(String aRepositoryName, ILcdEarthTileSet aTileSet) throws IOException
TLcdEarthTileRepository
instance.aRepositoryName
- the name of the repository to openaTileSet
- the tileset that will provide tiles to this repositoryIOException
- if the repository already exists or could not be createdTLcdEarthTileRepository.TLcdEarthTileRepository(String,
com.luciad.earth.tileset.ILcdEarthTileSet)