Class GapBorder

java.lang.Object
org.eclipse.nebula.paperclips.core.border.GapBorder
All Implemented Interfaces:
Border

public class GapBorder
extends java.lang.Object
implements Border
A border which leaves a gap around the target Print.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    int bottom
    The bottom gap of a closed border, expressed in points.
    int left
    The left side gap, expressed in points.
    int openBottom
    The bottom gap of an open border, expressed in points.
    int openTop
    The top gap of an open border, expressed in points.
    int right
    The right side gap, expressed in points.
    int top
    The top gap of a closed border, expressed in points.
  • Constructor Summary

    Constructors 
    Constructor Description
    GapBorder()
    Constructs a GapBorder with 0 gap around all sides.
    GapBorder​(int gap)
    Constructs a GapBorder with the given gap around all sides.
  • Method Summary

    Modifier and Type Method Description
    (package private) int checkGap​(int gap)  
    BorderPainter createPainter​(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
    Creates a BorderPainter which uses the given Device and GC.
    boolean equals​(java.lang.Object obj)  
    int hashCode()  
    void setGap​(int gap)
    Sets the left, right, closed top and closed bottom gaps to he argument.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • top

      public int top
      The top gap of a closed border, expressed in points.
    • bottom

      public int bottom
      The bottom gap of a closed border, expressed in points.
    • left

      public int left
      The left side gap, expressed in points.
    • right

      public int right
      The right side gap, expressed in points.
    • openTop

      public int openTop
      The top gap of an open border, expressed in points.
    • openBottom

      public int openBottom
      The bottom gap of an open border, expressed in points.
  • Constructor Details

    • GapBorder

      public GapBorder()
      Constructs a GapBorder with 0 gap around all sides.
    • GapBorder

      public GapBorder​(int gap)
      Constructs a GapBorder with the given gap around all sides.
      Parameters:
      gap - the gap, expressed in points.
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • setGap

      public void setGap​(int gap)
      Sets the left, right, closed top and closed bottom gaps to he argument.
      Parameters:
      gap - the gap, expressed in points.
    • checkGap

      int checkGap​(int gap)
    • createPainter

      public BorderPainter createPainter​(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
      Description copied from interface: Border
      Creates a BorderPainter which uses the given Device and GC.
      Specified by:
      createPainter in interface Border
      Parameters:
      device - the print device.
      gc - a GC for drawing to the print device.
      Returns:
      a BorderPainter for painting the border on the given Device and GC.