Class AbstractBorderPainter
- java.lang.Object
-
- org.eclipse.nebula.paperclips.core.border.AbstractBorderPainter
-
- All Implemented Interfaces:
BorderPainter
- Direct Known Subclasses:
GapBorderPainter,LineBorderPainter
public abstract class AbstractBorderPainter extends java.lang.Object implements BorderPainter
Abstract implementation of BorderPainter providing implementation of helper methods.
-
-
Constructor Summary
Constructors Constructor Description AbstractBorderPainter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract intgetBottom(boolean open)Returns the border inset, in pixels, from the bottom.intgetHeight(boolean topOpen, boolean bottomOpen)Returns the sum of the top and bottom border insets.abstract intgetLeft()Returns the border inset, in pixels, from the left.intgetMaxHeight()Returns the sum of the maximum top and bottom border insets.abstract intgetRight()Returns the border inset, in pixels, from the right.abstract intgetTop(boolean open)Returns the border inset, in pixels, from the top.intgetWidth()Returns the sum of the left and right border insets.abstract voidpaint(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
-
Methods inherited from interface org.eclipse.nebula.paperclips.core.border.BorderPainter
dispose, getOverlap
-
-
-
-
Method Detail
-
paint
public abstract 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. Depending on the type of border, the top and bottom of may be painted differently depending on the values oftopOpenandbottomOpen.- Specified by:
paintin interfaceBorderPainter- 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.
-
getLeft
public abstract int getLeft()
Returns the border inset, in pixels, from the left.- Specified by:
getLeftin interfaceBorderPainter- Returns:
- the border inset, in pixels, from the left.
-
getRight
public abstract int getRight()
Returns the border inset, in pixels, from the right.- Specified by:
getRightin interfaceBorderPainter- Returns:
- the border inset, in pixels, from the right.
-
getWidth
public final int getWidth()
Returns the sum of the left and right border insets.- Specified by:
getWidthin interfaceBorderPainter- Returns:
- the sum of the left and right border insets.
-
getTop
public abstract int getTop(boolean open)
Returns the border inset, in pixels, from the top.- Specified by:
getTopin interfaceBorderPainter- 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 abstract int getBottom(boolean open)
Returns the border inset, in pixels, from the bottom.- Specified by:
getBottomin interfaceBorderPainter- 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.
-
getHeight
public final int getHeight(boolean topOpen, boolean bottomOpen)Returns the sum of the top and bottom border insets.- Specified by:
getHeightin interfaceBorderPainter- Parameters:
topOpen- If true, the inset of an open border will be returned. If false, the inset of a closed border will be returned.bottomOpen- If true, the inset of an open border will be returned. If false, the inset of a closed border will be returned.- Returns:
- the sum of the top and bottom border insets.
-
getMaxHeight
public final int getMaxHeight()
Returns the sum of the maximum top and bottom border insets.- Specified by:
getMaxHeightin interfaceBorderPainter- Returns:
- the sum of the maximum top and bottom border insets.
-
-