Class LineBorderPainter

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.eclipse.swt.graphics.Point borderWidth  
      private org.eclipse.swt.graphics.Device device  
      private org.eclipse.swt.graphics.Point lineWidth  
      private org.eclipse.swt.graphics.RGB rgb  
    • Constructor Summary

      Constructors 
      Constructor Description
      LineBorderPainter​(LineBorder border, org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)  
    • Method Summary

      All 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.
      • Methods inherited from class java.lang.Object

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

      • device

        private final org.eclipse.swt.graphics.Device device
      • rgb

        private final org.eclipse.swt.graphics.RGB rgb
      • lineWidth

        private final org.eclipse.swt.graphics.Point lineWidth
      • borderWidth

        private final org.eclipse.swt.graphics.Point borderWidth
    • Constructor Detail

      • LineBorderPainter

        LineBorderPainter​(LineBorder border,
                          org.eclipse.swt.graphics.Device device,
                          org.eclipse.swt.graphics.GC gc)
    • Method Detail

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