Class TextElement

  • All Implemented Interfaces:
    StyleKeys

    public class TextElement
    extends StyleElement
    The text that is drawn for a way/area. It may be drawn along the outline or onto the way.
    Since:
    11722
    • Constructor Detail

      • TextElement

        protected TextElement​(Cascade c,
                              TextLabel text,
                              PositionForAreaStrategy labelPositionStrategy)
        Create a new way/area text element definition
        Parameters:
        c - The cascade
        text - The text
        labelPositionStrategy - The position in the area.
    • Method Detail

      • create

        public static TextElement create​(Environment env)
        Create a new text element
        Parameters:
        env - The environment to read the text data from
        Returns:
        The text element or null if it could not be created.
      • createForContent

        public static TextElement createForContent​(Environment env)
        JOSM traditionally adds both line and content text elements if a fill style was set. For now, we simulate this by generating a TextElement if no text-position was provided.
        Parameters:
        env - The environment to read the text data from
        Returns:
        The text element or null if it could not be created.
      • paintPrimitive

        public void paintPrimitive​(IPrimitive primitive,
                                   MapPaintSettings paintSettings,
                                   StyledMapRenderer painter,
                                   boolean selected,
                                   boolean outermember,
                                   boolean member)
        Description copied from class: StyleElement
        draws a primitive
        Specified by:
        paintPrimitive in class StyleElement
        Parameters:
        primitive - primitive to draw
        paintSettings - paint settings
        painter - painter
        selected - true, if primitive is selected
        outermember - true, if primitive is not selected and outer member of a selected multipolygon relation
        member - true, if primitive is not selected and member of a selected relation