Class RelativeLinearGradientPaint
java.lang.Object
com.inductiveautomation.ignition.client.util.gui.paints.MultipleGradientPaint
com.inductiveautomation.ignition.client.util.gui.paints.RelativeLinearGradientPaint
- All Implemented Interfaces:
- RelativePaint,- RotatablePaint,- Paint,- Transparency
public final class RelativeLinearGradientPaint
extends MultipleGradientPaint
implements RelativePaint, RotatablePaint
Similar to LinearGradientPaint, but this one specifies it's points as percentages of the user-space bounds of the
 object it will fill.
- 
Nested Class SummaryNested classes/interfaces inherited from class com.inductiveautomation.ignition.client.util.gui.paints.MultipleGradientPaintMultipleGradientPaint.ColorSpaceType, MultipleGradientPaint.CycleMethod
- 
Field SummaryFields inherited from class com.inductiveautomation.ignition.client.util.gui.paints.MultipleGradientPaintgradientTransformFields inherited from interface java.awt.TransparencyBITMASK, OPAQUE, TRANSLUCENT
- 
Constructor SummaryConstructorsConstructorDescriptionRelativeLinearGradientPaint(Point2D start, Point2D end, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod) Constructs aLinearGradientPaintwith a defaultSRGBcolor space.RelativeLinearGradientPaint(Point2D start, Point2D end, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod, MultipleGradientPaint.ColorSpaceType colorSpace, AffineTransform gradientTransform) Constructs aLinearGradientPaint.
- 
Method SummaryModifier and TypeMethodDescriptionvoidbeforePaint(Rectangle2D shapeSize) createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform transform, RenderingHints hints) Returns a copy of the end point of the gradient axis.Returns a copy of the start point of the gradient axis.voidrotatePaint(double angle, Point2D anchor, Rectangle2D r1, Rectangle2D r2) Call to rotate this paint.Methods inherited from class com.inductiveautomation.ignition.client.util.gui.paints.MultipleGradientPaintcopyOf, copyOf, copyOf, getColors, getColorSpace, getCycleMethod, getFractions, getTransform, getTransparencyMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.awt.TransparencygetTransparency
- 
Constructor Details- 
RelativeLinearGradientPaintpublic RelativeLinearGradientPaint(Point2D start, Point2D end, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod) Constructs aLinearGradientPaintwith a defaultSRGBcolor space.- Parameters:
- start- the gradient axis start- Point2Din user space
- end- the gradient axis end- Point2Din user space
- fractions- numbers ranging from 0.0 to 1.0 specifying the distribution of colors along the gradient
- colors- array of colors corresponding to each fractional value
- cycleMethod- either- NO_CYCLE,- REFLECT, or- REPEAT
- Throws:
- NullPointerException- if one of the points is null, or- fractionsarray is null, or- colorsarray is null, or- cycleMethodis null
- IllegalArgumentException- if start and end points are the same points, or- fractions.length != colors.length, or- colorsis less than 2 in size, or a- fractionsvalue is less than 0.0 or greater than 1.0, or the- fractionsare not provided in strictly increasing order
 
- 
RelativeLinearGradientPaintpublic RelativeLinearGradientPaint(Point2D start, Point2D end, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod, MultipleGradientPaint.ColorSpaceType colorSpace, AffineTransform gradientTransform) Constructs aLinearGradientPaint.- Parameters:
- start- the gradient axis start- Point2Din user space
- end- the gradient axis end- Point2Din user space
- fractions- numbers ranging from 0.0 to 1.0 specifying the distribution of colors along the gradient
- colors- array of colors corresponding to each fractional value
- cycleMethod- either- NO_CYCLE,- REFLECT, or- REPEAT
- colorSpace- which color space to use for interpolation, either- SRGBor- LINEAR_RGB
- gradientTransform- transform to apply to the gradient
- Throws:
- NullPointerException- if one of the points is null, or- fractionsarray is null, or- colorsarray is null, or- cycleMethodis null, or- colorSpaceis null, or- gradientTransformis null
- IllegalArgumentException- if start and end points are the same points, or- fractions.length != colors.length, or- colorsis less than 2 in size, or a- fractionsvalue is less than 0.0 or greater than 1.0, or the- fractionsare not provided in strictly increasing order
 
 
- 
- 
Method Details- 
beforePaint- Specified by:
- beforePaintin interface- RelativePaint
 
- 
createContextpublic PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform transform, RenderingHints hints) - Specified by:
- createContextin interface- Paint
 
- 
rotatePaintDescription copied from interface:RotatablePaintCall to rotate this paint.- Specified by:
- rotatePaintin interface- RotatablePaint
- r1- The bounds of the shape before rotation.
- r2- The bounds of the shape after rotation.
 
- 
getStartPointReturns a copy of the start point of the gradient axis.- Returns:
- a Point2Dobject that is a copy of the point that anchors the first color of thisLinearGradientPaint
 
- 
getEndPointReturns a copy of the end point of the gradient axis.- Returns:
- a Point2Dobject that is a copy of the point that anchors the last color of thisLinearGradientPaint
 
 
-