Class PaintVisitor

    • Constructor Detail

      • PaintVisitor

        public PaintVisitor​(java.awt.Graphics2D g,
                            MapView mv)
        Constructor
        Parameters:
        g - The graphics
        mv - The Mapview
    • Method Detail

      • drawNode

        protected void drawNode​(Node n,
                                java.awt.Color color)
        Draws a circle around the node
        Parameters:
        n - The node
        color - The circle color
      • drawSegment

        protected void drawSegment​(java.awt.Point p1,
                                   java.awt.Point p2,
                                   java.awt.Color color)
        Draws a line around the segment
        Parameters:
        p1 - The first point of segment
        p2 - The second point of segment
        color - The color
      • drawSegment

        protected void drawSegment​(Node n1,
                                   Node n2,
                                   java.awt.Color color)
        Draws a line around the segment
        Parameters:
        n1 - The first node of segment
        n2 - The second node of segment
        color - The color
      • visit

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

        protected boolean isNodeVisible​(Node n)
        Checks if the given node is in the visible area.
        Parameters:
        n - The node to check for visibility
        Returns:
        true if the node is visible
      • isSegmentVisible

        protected boolean isSegmentVisible​(Node n1,
                                           Node n2)
        Checks if the given segment is in the visible area. NOTE: This will return true for a small number of non-visible segments.
        Parameters:
        n1 - The first point of the segment to check
        n2 - The second point of the segment to check
        Returns:
        true if the segment is visible
      • visit

        public void visit​(java.util.List<Node> nodes)
        Description copied from interface: ValidatorVisitor
        Visit a list of nodes that are part of the error
        Specified by:
        visit in interface ValidatorVisitor
        Parameters:
        nodes - The nodes
      • getHighlightColor

        private static java.awt.Color getHighlightColor​(java.awt.Color color)
        Gets the color to draw highlight markers with.
        Parameters:
        color - severity color
        Returns:
        The color.
      • clearPaintedObjects

        public void clearPaintedObjects()
        Clears the internal painted objects collections.