Class LineElement

    • Field Detail

      • line

        private final java.awt.BasicStroke line
        The stroke used to paint the line
      • color

        public java.awt.Color color
        The color of the line. Should not be accessed directly
      • dashesLine

        private final java.awt.BasicStroke dashesLine
        The stroke used to paint the gaps between the dashes
      • dashesBackground

        public java.awt.Color dashesBackground
        The secondary color of the line that is used for the gaps in dashed lines. Should not be accessed directly
      • offset

        public float offset
        The dash offset. Should not be accessed directly
      • realWidth

        public float realWidth
        the real width of this line in meter. Should not be accessed directly
      • wayDirectionArrows

        public boolean wayDirectionArrows
        A flag indicating if the direction arrows should be painted. Should not be accessed directly
    • Constructor Detail

      • LineElement

        protected LineElement​(Cascade c,
                              float defaultMajorZindex,
                              java.awt.BasicStroke line,
                              java.awt.Color color,
                              java.awt.BasicStroke dashesLine,
                              java.awt.Color dashesBackground,
                              float offset,
                              float realWidth,
                              boolean wayDirectionArrows)
    • Method Detail

      • 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
      • linejoinToString

        public java.lang.String linejoinToString​(int linejoin)
        Converts a linejoin of a BasicStroke to a MapCSS string
        Parameters:
        linejoin - The linejoin
        Returns:
        The MapCSS string or null on error.
        See Also:
        BasicStroke.getLineJoin()
      • linecapToString

        public java.lang.String linecapToString​(int linecap)
        Converts a linecap of a BasicStroke to a MapCSS string
        Parameters:
        linecap - The linecap
        Returns:
        The MapCSS string or null on error.
        See Also:
        BasicStroke.getEndCap()
      • createSimpleLineStyle

        public static LineElement createSimpleLineStyle​(java.awt.Color color,
                                                        boolean isAreaEdge)
        Creates a simple line with default width.
        Parameters:
        color - The color to use
        isAreaEdge - If this is an edge for an area. Edges are drawn at lower Z-Index.
        Returns:
        The line style.
      • createLine

        public static LineElement createLine​(Environment env)
        Create a line element from the given MapCSS environment
        Parameters:
        env - The environment
        Returns:
        The line element describing the line that should be painted, or null if none should be painted.
      • createLeftCasing

        public static LineElement createLeftCasing​(Environment env)
        Create a line element for the left casing from the given MapCSS environment
        Parameters:
        env - The environment
        Returns:
        The line element describing the line that should be painted, or null if none should be painted.
      • createRightCasing

        public static LineElement createRightCasing​(Environment env)
        Create a line element for the right casing from the given MapCSS environment
        Parameters:
        env - The environment
        Returns:
        The line element describing the line that should be painted, or null if none should be painted.
      • createCasing

        public static LineElement createCasing​(Environment env)
        Create a line element for the casing from the given MapCSS environment
        Parameters:
        env - The environment
        Returns:
        The line element describing the line that should be painted, or null if none should be painted.