Class WireframeMapRenderer

    • Constructor Detail

      • WireframeMapRenderer

        public WireframeMapRenderer​(java.awt.Graphics2D g,
                                    NavigatableComponent nc,
                                    boolean isInactiveMode)
        Creates an wireframe render
        Parameters:
        g - the graphics context. Must not be null.
        nc - the map viewport. Must not be null.
        isInactiveMode - if true, the paint visitor shall render OSM objects such that they look inactive. Example: rendering of data in an inactive layer using light gray as color only.
        Throws:
        java.lang.IllegalArgumentException - if g is null
        java.lang.IllegalArgumentException - if nc is null
    • Method Detail

      • getColors

        public void getColors()
        Description copied from class: AbstractMapRenderer
        Reads the color definitions from preferences. This function is public, so that color names in preferences can be displayed even without calling the wireframe display before.
        Overrides:
        getColors in class AbstractMapRenderer
      • render

        public void render​(OsmData<?,​?,​?,​?> data,
                           boolean virtual,
                           Bounds bounds)
        Description copied from interface: Rendering

        Renders the OSM data in data

        Specified by:
        render in interface Rendering
        Parameters:
        data - the data set to be rendered
        virtual - if true, renders virtual nodes. Otherwise, ignores them.
        bounds - the bounding box for the data to be rendered. Only objects within or intersecting with bbox are rendered
      • max

        private static int max​(int a,
                               int b,
                               int c,
                               int d)
        Helper function to calculate maximum of 4 values.
        Parameters:
        a - First value
        b - Second value
        c - Third value
        d - Fourth value
        Returns:
        maximumof a, b, c, d
      • visit

        public void visit​(INode n)
        Draw a small rectangle. White if selected (as always) or red otherwise.
        Specified by:
        visit in interface PrimitiveVisitor
        Parameters:
        n - The node to draw.
      • visit

        public void visit​(IWay<?> w)
        Draw a line for all way segments.
        Specified by:
        visit in interface PrimitiveVisitor
        Parameters:
        w - The way to draw.
      • drawNode

        public void drawNode​(INode n,
                             java.awt.Color color,
                             int size,
                             boolean fill)
        Description copied from class: AbstractMapRenderer
        Draw the node as small square with the given color.
        Specified by:
        drawNode in class AbstractMapRenderer
        Parameters:
        n - The node to draw.
        color - The color of the node.
        size - size in pixels
        fill - determines if the square must be filled
      • drawSegment

        protected void drawSegment​(MapPath2D path,
                                   MapViewState.MapViewPoint mv1,
                                   MapViewState.MapViewPoint mv2,
                                   boolean showDirection)
        Draw a line with the given color.
        Parameters:
        path - The path to append this segment.
        mv1 - First point of the way segment.
        mv2 - Second point of the way segment.
        showDirection - true if segment direction should be indicated
        Since:
        10827
      • drawSegment

        protected void drawSegment​(MapViewState.MapViewPoint p1,
                                   MapViewState.MapViewPoint p2,
                                   java.awt.Color col,
                                   boolean showDirection)
        Draw a line with the given color.
        Parameters:
        p1 - First point of the way segment.
        p2 - Second point of the way segment.
        col - The color to use for drawing line.
        showDirection - true if segment direction should be indicated.
        Since:
        10827
      • displaySegments

        protected void displaySegments()
        Finally display all segments in currect path.
      • displaySegments

        protected void displaySegments​(java.awt.Color newColor)
        Finally display all segments in currect path.
        Parameters:
        newColor - This color is set after the path is drawn.