Interface OutputDisplay


  • public interface OutputDisplay
    An abstraction of the graphical display of the segmentation output. It allows drawing the area bounds and distinguishing the area types by colors.
    Author:
    burgetr
    • Method Detail

      • drawPage

        void drawPage​(Page page)
        Draws the complete page including all the boxes.
        Parameters:
        page - The page to draw.
      • drawPage

        void drawPage​(Page page,
                      boolean bitmap)
        Draws the complete page by drawing all the boxes or a bitmap screenshot.
        Parameters:
        page - The page to draw.
        bitmap - Use bitmap page screen shot if available.
      • drawBox

        void drawBox​(Box box)
        Draws the box contents on the page depending on the box type. This does not automatically draw the child boxes.
        Parameters:
        box - The box do draw.
      • drawExtent

        void drawExtent​(Box box)
        Draws the box bounds at the output display.
        Parameters:
        box - The box to be displayed
      • drawExtent

        void drawExtent​(Area area)
        Draws the area bounds at the output display.
        Parameters:
        area - The area to be displayed
      • drawRectangle

        void drawRectangle​(Rectangular rect,
                           Color color)
        Draws the given rectangle with the specified color.
        Parameters:
        rect - the rectangle to be drawn
        color - the drawing color
      • drawConnection

        void drawConnection​(ContentRect a1,
                            ContentRect a2,
                            Color color)
        Draws a connection between two content rectangles.
        Parameters:
        a1 - The first content rectangle
        a2 - The second content rectangle
        color - Connection color
      • colorizeByTags

        void colorizeByTags​(ContentRect rect,
                            Set<Tag> s)
        Draws the colorized are bounds. The color is defined by the tags. Multiple colors should be used when there are multiple tags (e.g. splitting the area bounds to several parts). The output display should assign different colors to different tags; the exact implementation of the color mapping depends on the OutputDisplay implementation. The area is not displayed when the tag set is empty.
        Parameters:
        rect - The area to be displayed
        s - A set of tags used for generating the area colors
      • colorizeByClass

        void colorizeByClass​(ContentRect rect,
                             String cname)
        Draws the colorized are bounds. The color is defined by a string. The output display should assign different colors to different strings; the exact implementation of the color mapping depends on the OutputDisplay implementation. The area is not displayed when class name is empty.
        Parameters:
        rect - The area to be displayed
        cname - The class name used for generating the colors.
      • clearArea

        void clearArea​(int x,
                       int y,
                       int width,
                       int height)
        Clears the given area of the display.
        Parameters:
        x - the area X coordinate
        y - the area Y coordinate
        width - the area width
        height - the area height