The base class for Substance fill painters is
Fill painters are used to paint the inner fill of most UI components,
such as buttons, check boxes, radio buttons, progress bars, tabs,
scroll bars and others. This allows providing a consistent and pluggable
appearance to those components. In addition, it provides an external API
for applications that wish to skin custom components in a visually
The only painting method in
* Fills the contour that matches the specified parameters.
* @param g
* Graphics context.
* @param comp
* Component to paint.
* @param width
* Width of a UI component.
* @param height
* Height of a UI component.
* @param contour
* Contour of a UI component.
* @param isFocused
* Indication whether component owns the focus.
* @param fillScheme
* The fill color scheme.
* @param hasShine
* Indication whether the returned image should have a 3D shine
* spot in its top half.
public void paintContourBackground(Graphics g, Component comp, int width,
int height, Shape contour, boolean isFocused,
SubstanceColorScheme fillScheme, boolean hasShine);
contour parameter specifies
the actual shape to fill and the
fillScheme specifies the Substance
color scheme to be used to compute the colors. The internal implementation of
a specific fill painter may decide to ignore the
hasShine if these are not
relevant. In addition, specific implementation may maintain an internal
cache of computed images if the computation is CPU-heavy.
Important thing to note - a fill painter should not paint the
focus ring or the border; these are painted by separate painters. As noted
isFocused can be ignored
by the specific painter implementation.
Applications that wish to provide a custom (branding) fill painter
may utilize the existing
base class. The subclass can override any one of the six base methods that compute
fill colors at four fill and two shine vertical locations (see
Most core Substance fill painters extend this class. Note that
if your fill painter does not paint the shine spot, return
If you wish to use the fil painter of the current skin to provide additional custom painting in your application, call:
SubstanceLookAndFeel.getCurrentSkin()to retrieve the current skin.
SubstanceSkin.getFillPainter()to retrieve the fill painter of the current skin.
SubstanceFillPainter.paintContourBackground()to paint the background on the specific graphics context.