Class DefaultTextChunk

    • Constructor Detail

      • DefaultTextChunk

        public DefaultTextChunk()
      • DefaultTextChunk

        public DefaultTextChunk​(Rectangular r,
                                Area sourceArea,
                                Box sourceBox)
    • Method Detail

      • getChunkSet

        public ChunkSet getChunkSet()
        Description copied from interface: TextChunk
        Gets the chunk set the chunk belongs to.
        Specified by:
        getChunkSet in interface TextChunk
        Returns:
        the chunk set or null when the chunk does not belong to any set.
      • setChunkSet

        public void setChunkSet​(ChunkSet chunkSet)
      • setText

        public void setText​(String text)
      • getText

        public String getText()
        Description copied from interface: TextChunk
        Gets the complete text of the chunk.
        Specified by:
        getText in interface TextChunk
        Returns:
        the text chunk.
      • getName

        public String getName()
        Description copied from interface: TextChunk
        Gets a readable name of the chunk for listing purposes.
        Specified by:
        getName in interface TextChunk
        Returns:
        the chunk name.
      • setName

        public void setName​(String name)
        Description copied from interface: TextChunk
        Sets a readable name of the chunk for listing purposes.
        Specified by:
        setName in interface TextChunk
        Parameters:
        name - the chunk name
      • getSourceArea

        public Area getSourceArea()
        Description copied from interface: TextChunk
        Gets the source area the chunk was extracted from.
        Specified by:
        getSourceArea in interface TextChunk
        Returns:
        the source area
      • setSourceArea

        public void setSourceArea​(Area sourceArea)
      • getSourceBox

        public Box getSourceBox()
        Description copied from interface: TextChunk
        Gets the source box the chunk was extracted from.
        Specified by:
        getSourceBox in interface TextChunk
        Returns:
        the source box
      • setSourceBox

        public void setSourceBox​(Box sourceBox)
      • getFontFamily

        public String getFontFamily()
        Description copied from interface: TextChunk
        Gets the font family of the chunk.
        Specified by:
        getFontFamily in interface TextChunk
        Returns:
        the font family name
      • setFontFamily

        public void setFontFamily​(String fontFamily)
      • getColor

        public Color getColor()
        Description copied from interface: TextChunk
        Gets the text color of the chunk.
        Specified by:
        getColor in interface TextChunk
        Returns:
        the text color
      • setColor

        public void setColor​(Color color)
      • getEffectiveBackgroundColor

        public Color getEffectiveBackgroundColor()
        Description copied from interface: TextChunk
        Gets the efficient background color of the chunk.
        Specified by:
        getEffectiveBackgroundColor in interface TextChunk
        Returns:
        the background color or nul when transparent.
      • setEffectiveBackgroundColor

        public void setEffectiveBackgroundColor​(Color effectiveBackgroundColor)
      • addTag

        public void addTag​(Tag tag,
                           float support)
        Description copied from interface: Taggable
        Adds a tag to this area. If the tag is already assigned to the area, the greater of the original and new support will be used.
        Specified by:
        addTag in interface Taggable
        Parameters:
        tag - The tag to be added.
        support - The assigned tag support from 0.0 to 1.0
      • hasTag

        public boolean hasTag​(Tag tag)
        Description copied from interface: Taggable
        Tests whether the area has this tag.
        Specified by:
        hasTag in interface Taggable
        Parameters:
        tag - the tag to be tested.
        Returns:
        true if the area has this tag
      • hasTag

        public boolean hasTag​(Tag tag,
                              float minSupport)
        Description copied from interface: Taggable
        Tests whether the area has this tag with a support greater or equal to the specified value.
        Specified by:
        hasTag in interface Taggable
        Parameters:
        tag - the tag to be tested
        minSupport - minimal required support
        Returns:
        true if the area has this tag
      • getSupportedTags

        public Set<Tag> getSupportedTags​(float minSupport)
        Description copied from interface: Taggable
        Obtains all the tags with the support greater or equal to the specified value.
        Specified by:
        getSupportedTags in interface Taggable
        Parameters:
        minSupport - minimal required support
        Returns:
        a set of tags with at least the minimal support (possibly empty)
      • getTagSupport

        public float getTagSupport​(Tag tag)
        Description copied from interface: Taggable
        Obtains the support of the given tag assignment
        Specified by:
        getTagSupport in interface Taggable
        Parameters:
        tag - The tag to be tested
        Returns:
        The support of the given tag in the range 0.0 to 1.0. Returns 0.0 when the tag is not assigned to this area.
      • getMostSupportedTag

        public Tag getMostSupportedTag()
        Description copied from interface: Taggable
        Obtains the tag with the greatest support that is assigned to this area.
        Specified by:
        getMostSupportedTag in interface Taggable
        Returns:
        The tag with the greatest support or null if there are no tags assigned to this area
      • removeAllTags

        public void removeAllTags​(Collection<Tag> c)
        Removes all tags that belong to the given collection.
        Parameters:
        c - A collection of tags to be removed.
      • removeTag

        public void removeTag​(Tag tag)
        Removes the specific tag
        Specified by:
        removeTag in interface Taggable
        Parameters:
        tag -
      • getTags

        public Map<Tag,​Float> getTags()
        Obtains the set of tags assigned to the area.
        Specified by:
        getTags in interface Taggable
        Returns:
        a set of tags
      • copyStyle

        protected void copyStyle​(Area src)