Class SpecularRectangularSurfacePainter
- java.lang.Object
-
- org.pushingpixels.radiance.theming.api.painter.surface.SpecularRectangularSurfacePainter
-
- All Implemented Interfaces:
RadianceSurfacePainter,RadianceTrait
public class SpecularRectangularSurfacePainter extends java.lang.Object implements RadianceSurfacePainter
Surface painter that draws visuals with subtle 3D gradient appearance. This class is part of officially supported API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classSpecularRectangularSurfacePainter.Shineprivate classSpecularRectangularSurfacePainter.ShineContextThis class is based on Romain Guy's work from http://www.jroller.com/gfx/entry/new_blendings_modes_for_java2d available under BSD license.
-
Field Summary
Fields Modifier and Type Field Description private floatalphaprivate RadianceSurfacePainterbaseSurfacePainterprivate ContainerColorTokensSingleColorQuerybottomQueryprivate static intSCALEprivate ContainerColorTokensSingleColorQuerytopQuery
-
Constructor Summary
Constructors Constructor Description SpecularRectangularSurfacePainter(RadianceSurfacePainter baseSurfacePainter, float alpha)SpecularRectangularSurfacePainter(RadianceSurfacePainter baseSurfacePainter, ContainerColorTokensSingleColorQuery topQuery, ContainerColorTokensSingleColorQuery bottomQuery, float alpha)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDisplayName()Returns the display name ofthistrait.private java.awt.image.BufferedImagegetShineImage(java.awt.Component comp, java.awt.Shape outline, java.awt.Color topShineColor, java.awt.Color bottomShineColor, float alpha, int shineWidth, int shineHeight)voidpaintSurface(java.awt.Graphics g, java.awt.Component comp, float width, float height, java.awt.Shape outline, ContainerColorTokens colorTokens)Fills the surface defined by the specified outline.private doublespline(double startY, double control1Y, double control2Y, double endY, double t)
-
-
-
Field Detail
-
SCALE
private static int SCALE
-
baseSurfacePainter
private RadianceSurfacePainter baseSurfacePainter
-
alpha
private float alpha
-
topQuery
private ContainerColorTokensSingleColorQuery topQuery
-
bottomQuery
private ContainerColorTokensSingleColorQuery bottomQuery
-
-
Constructor Detail
-
SpecularRectangularSurfacePainter
public SpecularRectangularSurfacePainter(RadianceSurfacePainter baseSurfacePainter, float alpha)
-
SpecularRectangularSurfacePainter
public SpecularRectangularSurfacePainter(RadianceSurfacePainter baseSurfacePainter, ContainerColorTokensSingleColorQuery topQuery, ContainerColorTokensSingleColorQuery bottomQuery, float alpha)
-
-
Method Detail
-
getDisplayName
public java.lang.String getDisplayName()
Description copied from interface:RadianceTraitReturns the display name ofthistrait. This method is part of officially supported API.- Specified by:
getDisplayNamein interfaceRadianceTrait- Returns:
- The display name of
thistrait.
-
spline
private double spline(double startY, double control1Y, double control2Y, double endY, double t)
-
paintSurface
public void paintSurface(java.awt.Graphics g, java.awt.Component comp, float width, float height, java.awt.Shape outline, ContainerColorTokens colorTokens)Description copied from interface:RadianceSurfacePainterFills the surface defined by the specified outline.- Specified by:
paintSurfacein interfaceRadianceSurfacePainter- Parameters:
g- Graphics context.comp- Component to paint.width- Width of a UI component.height- Height of a UI component.outline- Outline of a UI component.colorTokens- Color tokens.
-
getShineImage
private java.awt.image.BufferedImage getShineImage(java.awt.Component comp, java.awt.Shape outline, java.awt.Color topShineColor, java.awt.Color bottomShineColor, float alpha, int shineWidth, int shineHeight)
-
-