Class LineBorderPainter
java.lang.Object
org.eclipse.nebula.paperclips.core.border.AbstractBorderPainter
org.eclipse.nebula.paperclips.core.border.LineBorderPainter
- All Implemented Interfaces:
BorderPainter
class LineBorderPainter extends AbstractBorderPainter
-
Constructor Summary
Constructors Constructor Description LineBorderPainter(LineBorder border, org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
-
Method Summary
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 org.eclipse.nebula.paperclips.core.border.AbstractBorderPainter
getHeight, getMaxHeight, getWidth
-
Constructor Details
-
LineBorderPainter
LineBorderPainter(LineBorder border, org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.GC gc)
-
-
Method Details
-
getLeft
public int getLeft()Description copied from class:AbstractBorderPainter
Returns the border inset, in pixels, from the left.- Specified by:
getLeft
in interfaceBorderPainter
- Specified by:
getLeft
in classAbstractBorderPainter
- Returns:
- the border inset, in pixels, from the left.
-
getRight
public int getRight()Description copied from class:AbstractBorderPainter
Returns the border inset, in pixels, from the right.- Specified by:
getRight
in interfaceBorderPainter
- Specified by:
getRight
in classAbstractBorderPainter
- Returns:
- the border inset, in pixels, from the right.
-
getTop
public int getTop(boolean open)Description copied from class:AbstractBorderPainter
Returns the border inset, in pixels, from the top.- Specified by:
getTop
in interfaceBorderPainter
- Specified by:
getTop
in classAbstractBorderPainter
- 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 interfaceBorderPainter
- Specified by:
getBottom
in classAbstractBorderPainter
- 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 oftopOpen
andbottomOpen
.- Specified by:
paint
in interfaceBorderPainter
- Specified by:
paint
in classAbstractBorderPainter
- 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 paintheight
- The height of the border to painttopOpen
- 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 toGridPrint.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.
-