com.jidesoft.gauge
Class DialRadialPaint
java.lang.Object
com.jidesoft.gauge.DialRadialPaint
- All Implemented Interfaces:
- Paint, Transparency
public class DialRadialPaint
- extends Object
- implements Paint
A Paint class where you can easily configure a radial paint that emanates from the pivot point of a dial.
Constructor Summary |
DialRadialPaint(Dial dial,
float[] fractions,
Color[] colors)
Constructs a Radial gradient paint centred on the pivot point of the dial. |
DialRadialPaint(Dial dial,
float[] fractions,
Color[] colors,
float offsetRadius,
float offsetAngle)
This constructor allows you to specify fractions and colors as for the other constructor, but also allows
you to specify an offset for the centre of the radial paint. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DialRadialPaint
public DialRadialPaint(Dial dial,
float[] fractions,
Color[] colors)
- Constructs a Radial gradient paint centred on the pivot point of the dial.
- Parameters:
dial
- the dial from which the paint derives its centre pointfractions
- fractions for specifying the color mixcolors
- the colors to use at the points indicated by fractions
DialRadialPaint
public DialRadialPaint(Dial dial,
float[] fractions,
Color[] colors,
float offsetRadius,
float offsetAngle)
- This constructor allows you to specify fractions and colors as for the other constructor, but also allows
you to specify an offset for the centre of the radial paint. This could be useful for example if you wanted
to use an offset to give the impression of light being projected from a particular direction.
The offset is expressed in terms of the radius
of the dial and an angle, so the paint will be scalable should the component's size be changed.
- Parameters:
dial
- the dial to which the paint will be appliedfractions
- the fraction points corresponding to the colorscolors
- the colors of the radial paintoffsetRadius
- the radius of the offset, specified as a proportion of the pixel radiusoffsetAngle
- the angle of the offset, specified in degrees.
getRadiusProportion
public float getRadiusProportion()
setRadiusProportion
public void setRadiusProportion(Float radiusProportion)
- By default the radius of a DialRadialPaint is defined by the radius of the dial itself, but this becomes
limiting if you want to use it for the paint of a DialFrame surrounding the dial, especially as the fractions
supplied need to be in the range 0.0 to 1.0. Using this method you can modify the radius used for the Paint
by a multiplying factor, allowing you to use this paint class for filling a DialFrame.
- Parameters:
radiusProportion
- a multiplying factor to apply to the radius of the dial
createContext
public PaintContext createContext(ColorModel cm,
Rectangle deviceBounds,
Rectangle2D userBounds,
AffineTransform transform,
RenderingHints hints)
- Specified by:
createContext
in interface Paint
getTransparency
public int getTransparency()
- Specified by:
getTransparency
in interface Transparency