public class RMGradientFill extends RMFill
Modifier and Type | Class and Description |
---|---|
static class |
RMGradientFill.ColorStop
Simple static class to represent a stop (they're immutable).
|
Constructor and Description |
---|
RMGradientFill()
Creates an uninitialized gradient fill.
|
RMGradientFill(RMColor aColor1,
RMColor aColor2,
float aRotation)
Creates a gradient fill from the given start color to the given end color with the given roll.
|
Modifier and Type | Method and Description |
---|---|
RMGradientFill |
clone()
Standard clone implementation.
|
RMGradientFill |
deriveGradient(boolean isRadial)
Returns a new gradient which is a copy of this gradient but of a different type.
|
RMGradientFill |
deriveGradient(float aRoll)
Returns a new gradient which is a copy of this gradient but with a different roll value.
|
boolean |
equals(java.lang.Object anObj)
Standard equals implementation.
|
java.lang.Object |
fromXML(com.reportmill.archiver.RXArchiver anArchiver,
com.reportmill.archiver.RXElement anElement,
java.lang.Object anOwner)
XML unarchival.
|
RMColor |
getColor()
Returns the color associated with this fill.
|
RMGradientFill.ColorStop |
getColorStop(int anIndex)
Returns the individual color stop at given index.
|
int |
getColorStopCount()
Returns the number of color stops in the gradient
|
java.util.List<RMGradientFill.ColorStop> |
getColorStops()
Returns the list of color stops.
|
void |
getGradientAxis(RMShape aShape,
RMPath aPath,
java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2)
Returns the 2 points, in the shape's coordinate system, which define the gradient.
|
java.awt.geom.Rectangle2D |
getGradientBounds(java.awt.Shape aShape)
Returns the gradient bounds for a given shape which is the bounds required to encompass the entire shape in the
coordinates of the gradient rotation (effectively the bounds of the shape rotated by opposite gradient rotation).
|
java.awt.Paint |
getPaint(float startx,
float starty,
float endx,
float endy)
Returns a java.awt.Paint instance to draw this gradient.
|
float |
getRoll()
Returns the gradient's rotation.
|
RMColor |
getStopColor(int index)
Returns the color of the stop at the given index.
|
float |
getStopPosition(int index)
Returns the position (in the range {0-1}) for the given stop index.
|
boolean |
hasAlpha()
Returns true if any of the colors in the gradient have alpha
|
int |
insertColorStop(RMColor aColor,
float position)
Adds a new color stop at the given position.
|
void |
paint(com.reportmill.shape.RMShapePainter sp,
java.awt.Graphics2D g,
RMShape aShape)
Render this fill in a Java2D Graphics2D.
|
void |
removeColorStop(int index)
Removes the stop at the given index.
|
void |
reverseColors()
Reverse the order of the color stops
|
void |
setColor(RMColor aColor)
Sets color of first stop.
|
void |
setColorStop(int index,
RMColor aColor,
float position)
Sets the color & position of the stop at the given index.
|
void |
setStops(java.util.List<RMGradientFill.ColorStop> newStops)
Resets all the stops from the new list.
|
com.reportmill.archiver.RXElement |
toXML(com.reportmill.archiver.RXArchiver anArchiver,
java.lang.Object anOwner)
XML archival.
|
deriveFill, getBounds, getName
addListener, addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, getListener, getListenerCount, getListeners, isFirePropertyChangeEnabled, isUndoing, removeListener, removePropertyChangeListener, setFirePropertyChangeEnabled, setUndoing, toString
public int getColorStopCount()
public RMGradientFill.ColorStop getColorStop(int anIndex)
public java.util.List<RMGradientFill.ColorStop> getColorStops()
public void setColorStop(int index, RMColor aColor, float position)
public void removeColorStop(int index)
public void setStops(java.util.List<RMGradientFill.ColorStop> newStops)
public int insertColorStop(RMColor aColor, float position)
public void reverseColors()
public float getRoll()
public RMGradientFill deriveGradient(float aRoll)
public RMGradientFill deriveGradient(boolean isRadial)
public java.awt.geom.Rectangle2D getGradientBounds(java.awt.Shape aShape)
public void getGradientAxis(RMShape aShape, RMPath aPath, java.awt.geom.Point2D p1, java.awt.geom.Point2D p2)
public RMColor getColor()
public void setColor(RMColor aColor)
public RMColor getStopColor(int index)
public float getStopPosition(int index)
public boolean hasAlpha()
public java.awt.Paint getPaint(float startx, float starty, float endx, float endy)
public void paint(com.reportmill.shape.RMShapePainter sp, java.awt.Graphics2D g, RMShape aShape)
public boolean equals(java.lang.Object anObj)
public RMGradientFill clone()
public com.reportmill.archiver.RXElement toXML(com.reportmill.archiver.RXArchiver anArchiver, java.lang.Object anOwner)