Class VectorPrimitive

    • Constructor Detail

      • VectorPrimitive

        protected VectorPrimitive​(java.lang.String layer)
        Create a primitive for a specific vector layer
        Parameters:
        layer - The layer for the primitive
    • Method Detail

      • keysChangedImpl

        protected void keysChangedImpl​(java.util.Map<java.lang.String,​java.lang.String> originalKeys)
        Description copied from class: AbstractPrimitive
        What to do, when the tags have changed by one of the tag-changing methods.
        Specified by:
        keysChangedImpl in class AbstractPrimitive
        Parameters:
        originalKeys - original tags
      • setHighlighted

        public void setHighlighted​(boolean highlighted)
        Description copied from interface: IPrimitive
        Updates the highlight flag for this primitive.
        Specified by:
        setHighlighted in interface IPrimitive
        Parameters:
        highlighted - The new highlight flag.
      • isAnnotated

        public boolean isAnnotated()
        Description copied from interface: IPrimitive
        Determines if this object is considered "annotated". To be "annotated", an object must have one or more "work in progress" tags, such as "note" or "fixme".
        Specified by:
        isAnnotated in interface IPrimitive
        Overrides:
        isAnnotated in class AbstractPrimitive
        Returns:
        true if this object is considered "annotated"
      • isCachedStyleUpToDate

        public final boolean isCachedStyleUpToDate()
        Description copied from interface: Stylable
        Check if the cached style for this primitive is up to date.
        Specified by:
        isCachedStyleUpToDate in interface Stylable
        Returns:
        true if the cached style for this primitive is up to date
      • getReferrers

        public final java.util.List<VectorPrimitivegetReferrers​(boolean allowWithoutDataset)
        Description copied from interface: IPrimitive
        Find primitives that reference this primitive. Returns only primitives that are included in the same dataset as this primitive.
        For example following code will add wnew as referer to all nodes of existingWay, but this method will not return wnew because it's not part of the dataset
        Way wnew = new Way(existingWay)
        Specified by:
        getReferrers in interface IPrimitive
        Parameters:
        allowWithoutDataset - If true, method will return empty list if primitive is not part of the dataset. If false, exception will be thrown in this case
        Returns:
        a collection of all primitives that reference this primitive.
      • addReferrer

        protected void addReferrer​(IPrimitive referrer)
        Add new referrer. If referrer is already included then no action is taken
        Parameters:
        referrer - The referrer to add
      • removeReferrer

        protected void removeReferrer​(IPrimitive referrer)
        Remove referrer. No action is taken if referrer is not registered
        Parameters:
        referrer - The referrer to remove
      • referrers

        private <T extends IPrimitive> java.util.stream.Stream<T> referrers​(boolean allowWithoutDataset,
                                                                            java.lang.Class<T> filter)
      • referrers

        public final <T extends IPrimitive> java.util.stream.Stream<T> referrers​(java.lang.Class<T> filter)
        Gets all primitives in the current dataset that reference this primitive.
        Type Parameters:
        T - type of primitives
        Parameters:
        filter - restrict primitives to subclasses
        Returns:
        the referrers as Stream
      • setId

        protected void setId​(long id)
        Set the id of the object
        Parameters:
        id - The id
      • setDisabled

        public void setDisabled​(boolean disabled)
        Make this object disabled
        Parameters:
        disabled - true to disable the object
      • getLayer

        public java.lang.String getLayer()
        Data layer information *
        Specified by:
        getLayer in interface DataLayer<java.lang.String>
        Returns:
        The layer