Class ReparentContext

    • Method Detail

      • getUnprojectedFeatures

        public final FeatureHolder getUnprojectedFeatures()
        Description copied from interface: ProjectionContext
        Get the features before projection.

        If you are projecting all the features in some feature holder, that is what this method should return.

        Specified by:
        getUnprojectedFeatures in interface ProjectionContext
        Returns:
        the features before projection
      • projectFeature

        public Feature projectFeature​(Feature feat)
        Create a single projected feature using the rules of this ProjectedFeatureHolder.
        Specified by:
        projectFeature in interface ProjectionContext
        Parameters:
        feat - the Feature to project
        Returns:
        a Feature representing feat after being transformed by this context
      • revertFeature

        public Feature revertFeature​(Feature feat)
        Description copied from interface: ProjectionContext
        Unproject a feature.

        This is the inverse opperation to @link projectFeature().

        Note: The result of calling this method for a feature that is not projected through this context is not specified by this API, but it is reasonable to assume that bad things will happen.

        Specified by:
        revertFeature in interface ProjectionContext
        Parameters:
        feat - the Feature to un-project
        Returns:
        the unprojected feature
      • projectFilter

        public final FeatureFilter projectFilter​(FeatureFilter ff)
        Description copied from interface: ProjectionContext
        Transform a filter on unprojected features so that it applies to projected features.
        Specified by:
        projectFilter in interface ProjectionContext
        Parameters:
        ff - the FeatureFilter to transform
        Returns:
        the transformed FeatureFilter
      • revertFilter

        public final FeatureFilter revertFilter​(FeatureFilter ff)
        Description copied from interface: ProjectionContext
        Transform a filter on projected features so that it applies to unprojected features.
        Specified by:
        revertFilter in interface ProjectionContext
        Parameters:
        ff - the FeatureFilter to transform
        Returns:
        the transformed FeatureFilter
      • getSequence

        public final Sequence getSequence​(Feature f)
        Description copied from interface: ProjectionContext
        Get the sequence for a feature.

        This will be the return value of projFeat.getParent().

        Specified by:
        getSequence in interface ProjectionContext
        Parameters:
        f - the projected Feature
        Returns:
        the Sequence of the Feature
      • projectChildFeatures

        public FeatureHolder projectChildFeatures​(Feature f,
                                                  FeatureHolder parent)
        Description copied from interface: ProjectionContext
        Project all features that are children of feature so that they become children of parent.
        Specified by:
        projectChildFeatures in interface ProjectionContext
        Parameters:
        f - the Feature to project all children of
        parent - the new parent feature holder
        Returns:
        a FeatureHolder containing projections of all children of feature so that f.getParent() is equal to parent
      • createFeature

        public final Feature createFeature​(Feature.Template projTempl)
                                    throws BioException,
                                           ChangeVetoException
        Description copied from interface: ProjectionContext
        Create a projected feature with properties matching the template.

        You will probably implement this by delegating to the unprojected feature holder. It is imperative that the template properties are unprojected first so that when the newly created feature is projected, the properties match up.

        Not every projection context has fully reversible semantics. Use your discression and come up with a reasonable plan that causes least supprise to the user.

        Specified by:
        createFeature in interface ProjectionContext
        Parameters:
        projTempl - the Feature.Template to instantiate
        Returns:
        a new projected Feature matching the template as closely as possible
        Throws:
        BioException - if there was a problem instantiating the template
        ChangeVetoException - if the feature creation was vetoed
      • removeChangeListener

        public final void removeChangeListener​(Feature f,
                                               ChangeListener cl,
                                               ChangeType ct)
        Description copied from interface: ProjectionContext
        Remove a ChangeListener from a projected feature.
        Specified by:
        removeChangeListener in interface ProjectionContext
        Parameters:
        f - the projected Feature to remove the listener for
        cl - the ChangeListener to remove
        ct - the ChangeType it is registered for
      • projectFeatures

        public final FeatureHolder projectFeatures​(FeatureHolder fh)
        Description copied from interface: ProjectionContext
        Project all of the features in a FeatureHolder.

        Warning: The results of calling this method for features that are not in getUnprojectedFeatures() is not specified by this API, but it is reasonable to assume that bad things will happen.

        Specified by:
        projectFeatures in interface ProjectionContext
        Parameters:
        fh - the FeatureHolder containing the features to project
        Returns:
        a FeatureHolder containing all the features projected