Class LayerType

    • Constructor Detail

      • LayerType

        protected LayerType()
    • Method Detail

      • getName

        public String getName()
        Gets the name of this layer type. This name is used to persist / externalise layers of this type.

        The default implementation returns the name given by the LayerTypeMetadata.name() annotation property, if any. Otherwise, the fully qualified class name is returned.

        As of Ceres 0.13, it is not recommended to override this method. Instead use the LayerTypeMetadata.name() annotation property for your special layer type.

        Returns:
        The name of this layer type.
      • getAliases

        public String[] getAliases()
        Gets the alias names under which this layer type is also known. The intention is to allow changing the type name and be backwards compatible with respect to layer types that have been persisted / externalised before the name change occurred.

        The default implementation returns the alias names given by the LayerTypeMetadata.aliasNames() annotation property, if any. Otherwise, an empty array is returned.

        As of Ceres 0.13, it is not recommended to override this method. Instead use the LayerTypeMetadata annotation for your special layer type.

        Returns:
        The aliases of this layer type.
      • isValidFor

        public abstract boolean isValidFor​(LayerContext ctx)
        Tests if this type can create layers for the given application provided context. Note that some applications may provide their context through the extension object interface (see ExtensibleObject.getExtension(Class)).
        Parameters:
        ctx - An application-dependent layer context.
        Returns:
        true if the type is valid with respect to the given context.
      • createWithSceneView

        public boolean createWithSceneView​(LayerContext ctx)
        Tests if this type should be created by default with a new ProductSceneView. LayerTypes should check preferences to determine if a user wants this layer type enabled by default when opening a new ProductSceneView.
        Parameters:
        ctx - An application-dependent layer context.
        Returns:
        true if the type should open with the scene view by default
      • createLayer

        public abstract Layer createLayer​(LayerContext ctx,
                                          PropertySet layerConfig)
        Creates a layer instance for the given application provided context and the given layer configuration. The configuration may contain both, inmutable construction parameters passed to specific layer constructor as well as mutable layer properties.
        Parameters:
        ctx - An application provided context, may be null. The parameter may be ignored by many layer types.
        layerConfig - The layer configuration.
        Returns:
        A new layer instance.
      • createLayerConfig

        public abstract PropertySet createLayerConfig​(LayerContext ctx)
        Creates a default configuration instance for the type of layers this type can create. After a default configuration has been created it is usually modified to specify a layer's construction parameters, e.g. for an image layer this could be the file path to the image file. Then, an application will pass the configuration to the createLayer(com.bc.ceres.glayer.LayerContext, com.bc.ceres.binding.PropertySet) method in order to create a new layer instance.
        Parameters:
        ctx - An application provided context, may be null. The parameter may be ignored by many layer types.
        Returns:
        A new layer (default) configuration.