Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jvnet.substance.painter.border
Class InnerDelegateBorderPainter

    java.lang.Object
      org.jvnet.substance.painter.border.InnerDelegateBorderPainter

All Implemented Interfaces:
  SubstanceTrait, SubstanceBorderPainter

Direct Known Subclasses:
  ClassicInnerBorderPainter, FlatInnerBorderPainter, GlassInnerBorderPainter

    public abstract class InnerDelegateBorderPainter

extends java.lang.Object
implements SubstanceBorderPainter

Abstract base class for painters that provide inner painting. The implementation is based on three main parts:

- The delegate border painter that paints the outer and inner parts of the border.
- Shift kind that specifies how to compute the color scheme of the inner part based on the color scheme of the border.
- Shift coefficient that specifies how different is the color scheme of the inner part from the color scheme of the border.

Author:
  Kirill Grouchnikov

Field Summary
`protected SubstanceBorderPainter` | `delegate` Mandatory delegate painter.
`protected java.lang.String` | `painterName` Display name of `this` painter.
`protected float` | `shiftCoef` Shift coefficient.
`protected SubstanceConstants.ColorShiftKind` | `shiftKind` Color shift kind.
`protected static LazyResettableHashMap<SubstanceColorScheme>` | `shiftMap` Map of shifted color schemes (to speed up the subsequent lookups).

Constructor Summary
`InnerDelegateBorderPainter(java.lang.String painterName, SubstanceBorderPainter delegate)` Creates an inner painter.
`InnerDelegateBorderPainter(java.lang.String painterName, SubstanceBorderPainter delegate, float shiftCoef, SubstanceConstants.ColorShiftKind shiftKind)` Creates an inner painter.

Method Summary
`SubstanceBorderPainter` | `getDelegate()` Returns the painting delegate.
`java.lang.String` | `getDisplayName()` Returns the display name of `this` trait.
`void` | `paintBorder(java.awt.Graphics g, java.awt.Component comp, int width, int height, java.awt.Shape contour, java.awt.Shape innerContour, SubstanceColorScheme colorScheme1, SubstanceColorScheme colorScheme2, float cyclePos, boolean useCyclePosAsInterpolation)`
Paints the control border.

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

Field Detail

### painterName

    protected java.lang.String painterName

  Display name of `this` painter.

### delegate

    protected SubstanceBorderPainter delegate

  Mandatory delegate painter.

### shiftCoef

    protected float shiftCoef

  Shift coefficient. Must be in 0.0-1.0 range.

### shiftKind

    protected SubstanceConstants.ColorShiftKind shiftKind

  Color shift kind.

### shiftMap

    protected static LazyResettableHashMap<SubstanceColorScheme> shiftMap

  Map of shifted color schemes (to speed up the subsequent lookups).

Constructor Detail

### InnerDelegateBorderPainter

    public InnerDelegateBorderPainter(java.lang.String painterName,
                                      SubstanceBorderPainter delegate)

  Creates an inner painter.

  Parameters:
    `painterName` - Painter display name.
    `delegate` - Delegate painter.

### InnerDelegateBorderPainter

    public InnerDelegateBorderPainter(java.lang.String painterName,
                                      SubstanceBorderPainter delegate,
                                      float shiftCoef,
                                      SubstanceConstants.ColorShiftKind shiftKind)

  Creates an inner painter.

  Parameters:
    `painterName` - Painter display name.
    `delegate` - Delegate painter.
    `shiftCoef` - Shift coefficient. Must be in 0.0-1.0 range.
    `shiftKind` - Color shift kind.

Method Detail

### getDisplayName

    public java.lang.String getDisplayName()

  Description copied from interface: `SubstanceTrait`
  Returns the display name of `this` trait. This method is part of officially supported API.

  Specified by:
    `getDisplayName` in interface `SubstanceTrait`
  Returns:
    The display name of `this` trait.

### paintBorder

    public void paintBorder(java.awt.Graphics g,
                            java.awt.Component comp,
                            int width,
                            int height,
                            java.awt.Shape contour,
                            java.awt.Shape innerContour,
                            SubstanceColorScheme colorScheme1,
                            SubstanceColorScheme colorScheme2,
                            float cyclePos,
                            boolean useCyclePosAsInterpolation)

  Description copied from interface: `SubstanceBorderPainter`
  Paints the control border.

  Specified by:
    `paintBorder` in interface `SubstanceBorderPainter`
  Parameters:
    `g` - Graphics.
    `comp` - Component.
    `width` - Width of a UI component.
    `height` - Height of a UI component.
    `contour` - Contour of a UI component.
    `innerContour` - Inner contour of a UI component. May be ignored if the specific implementation paints only the outside border.
    `colorScheme1` - The first color scheme.
    `colorScheme2` - The second color scheme.
    `cyclePos` - Cycle position. Is used for rollover and pulsation effects. Must be in 0..10 range.
    `useCyclePosAsInterpolation` - Indicates the algorithm to use for computing various colors. If `true`, the `cyclePos` is used to interpolate colors between different color components of both color schemes. If `false`, the `cyclePos` is used to interpolate colors between different color components of the first color scheme.

### getDelegate

    public SubstanceBorderPainter getDelegate()

  Returns the painting delegate.

  Returns:
    Painting delegate.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD