Class GapBorderPainter

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int bottom  
      (package private) int left  
      (package private) int openBottom  
      (package private) int openTop  
      (package private) int right  
      (package private) int top  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Disposes the system resources allocated by this BorderPainter.
      int getBottom​(boolean open)
      Returns the border inset, in pixels, from the bottom.
      int getLeft()
      Returns the border inset, in pixels, from the left.
      org.eclipse.swt.graphics.Point getOverlap()
      Returns the x and y distance that two of the same BorderPainters would overlap to create the appearance of a single border between the two.
      int getRight()
      Returns the border inset, in pixels, from the right.
      int getTop​(boolean open)
      Returns the border inset, in pixels, from the top.
      void paint​(org.eclipse.swt.graphics.GC gc, int x, int y, int width, int height, boolean topOpen, boolean bottomOpen)
      Paints a border around the specified region.
      (package private) static int toPixels​(int points, int dpi)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • top

        final int top
      • openTop

        final int openTop
      • bottom

        final int bottom
      • openBottom

        final int openBottom
      • left

        final int left
      • right

        final int right
    • Constructor Detail

      • GapBorderPainter

        GapBorderPainter​(GapBorder target,
                         org.eclipse.swt.graphics.Device device)
    • Method Detail

      • toPixels

        static int toPixels​(int points,
                            int dpi)
      • getBottom

        public int getBottom​(boolean open)
        Description copied from class: AbstractBorderPainter
        Returns the border inset, in pixels, from the bottom.
        Specified by:
        getBottom in interface BorderPainter
        Specified by:
        getBottom in class AbstractBorderPainter
        Parameters:
        open - If true, the inset of an open border will be returned. If false, the inset of a closed border will be returned.
        Returns:
        the border inset, in pixels, from the bottom.
      • getTop

        public int getTop​(boolean open)
        Description copied from class: AbstractBorderPainter
        Returns the border inset, in pixels, from the top.
        Specified by:
        getTop in interface BorderPainter
        Specified by:
        getTop in class AbstractBorderPainter
        Parameters:
        open - If true, the inset of an open border will be returned. If false, the inset of a closed border will be returned.
        Returns:
        the border inset, in pixels, from the top.
      • getOverlap

        public org.eclipse.swt.graphics.Point getOverlap()
        Description copied from interface: BorderPainter
        Returns the x and y distance that two of the same BorderPainters would overlap to create the appearance of a single border between the two. This method is used by GridPrint whenever the horizontal and/or vertical spacing fields are set to GridPrint.BORDER_OVERLAP.
        Returns:
        the distance that this border painter would overlap an adjacent one.
      • paint

        public void paint​(org.eclipse.swt.graphics.GC gc,
                          int x,
                          int y,
                          int width,
                          int height,
                          boolean topOpen,
                          boolean bottomOpen)
        Description copied from class: AbstractBorderPainter
        Paints a border around the specified region. Depending on the type of border, the top and bottom of may be painted differently depending on the values of topOpen and bottomOpen.
        Specified by:
        paint in interface BorderPainter
        Specified by:
        paint in class AbstractBorderPainter
        Parameters:
        gc - The graphics context to paint on.
        x - The x coordinate of the top left corner of the border.
        y - The y coordinate of the top left corner of the border.
        width - The width of the border to paint
        height - The height of the border to paint
        topOpen - If true, the top border should be drawn "open," to indicate that this is the continuation of a border in a previous iteration. If false, the border should be drawn "closed" to indicate that this is the first iteration on the BorderPrint's target.
        bottomOpen - If true, the bottom border should be drawn "open," to indicate that the BorderPrint's target was not consumed in this iteration. If false, the bottom border should be drawn "closed," to indicate that the BorderPrint's target completed during this iteration.
      • dispose

        public void dispose()
        Description copied from interface: BorderPainter
        Disposes the system resources allocated by this BorderPainter. The dispose method is not a permanent disposal of a BorderPainter. It is intended to reclaim system resources, however future calls to paint(GC,int,int) may require that the resources be allocated again.