UIX 2.2.15

oracle.cabo.image.painter
Class AdjustableBorderPainter

java.lang.Object
  |
  +--oracle.cabo.image.painter.AbstractPainter
        |
        +--oracle.cabo.image.painter.AbstractWrappingPainter
              |
              +--oracle.cabo.image.painter.AbstractBorderPainter
                    |
                    +--oracle.cabo.image.painter.AdjustableBorderPainter
All Implemented Interfaces:
BorderPainter, Painter

public class AdjustableBorderPainter
extends AbstractBorderPainter

A border that insets painting of the wrapped painter by an amount which is adjustable from font to font. The font-specific offsets are defined by named styles in an XSS document. Style names for each font are dervied by prepending the provided prefix to the font name. For example, if the prefix is "BLAFServerButtonPadding" the style with the name "BLAFServerButtonPaddingDialog" defines the insets for the "Dialog" font. Padding values for each inset are defined using the CSS style properties "padding-top", "padding-bottom", "padding-left" and "padding-right".


Constructor Summary
AdjustableBorderPainter(Painter wrappedPainter, int top, int left, int bottom, int right, java.lang.String styleNamePrefix)
Creates a BorderPainter that insets painting by the specified amount.

Method Summary
protected ImmInsets getOwnInsets(PaintContext context)
Returns the insets of just this BorderPainter.

Methods inherited from class oracle.cabo.image.painter.AbstractBorderPainter
getFillInsets, getInsets, getMinimumSize, getOwnFillInsets, getPreferredSize, paint, paintBorder

Methods inherited from class oracle.cabo.image.painter.AbstractWrappingPainter
getWrappedPainter

Methods inherited from class oracle.cabo.image.painter.AbstractPainter
getData, getDataKey

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AdjustableBorderPainter

public AdjustableBorderPainter(Painter wrappedPainter,
                               int top,
                               int left,
                               int bottom,
                               int right,
                               java.lang.String styleNamePrefix)
Creates a BorderPainter that insets painting by the specified amount.

The specified insets are used as default values if font-specific insets are not found when measuring/painting the border.

Parameters:
wrappedPainter - Painter to wrap this border around.
top - Amount to inset painting from the top.
left - Amount to inset painting from the left.
bottom - Amount to inset painting from the bottom.
right - Amount to inset painting from the right.
styleNamePrefix - The prefix to use for the style name which defines the insets for this instance.

Method Detail

getOwnInsets

protected ImmInsets getOwnInsets(PaintContext context)
Returns the insets of just this BorderPainter. These are the insets that were passed into our constructor.
Overrides:
getOwnInsets in class AbstractBorderPainter
Parameters:
context - PaintContext to use when getting our own Insets
Returns:
The insets of just this BorderPainter.
See Also:
AbstractBorderPainter.getInsets(oracle.cabo.image.painter.PaintContext)

UIX 2.2.15