org.jhotdraw.samples.svg
Class RadialGradient

java.lang.Object
  extended by org.jhotdraw.samples.svg.RadialGradient
All Implemented Interfaces:
java.lang.Cloneable, Gradient

public class RadialGradient
extends java.lang.Object
implements Gradient

Represents an SVG RadialGradient.

Version:
1.0.2 2009-04-17 Gracefully handle non-invertible transforms.
1.0.1 2007-04-10 Radius for gradients which are relative to figure boudns is computed better.
1.0 December 9, 2006 Created.
Author:
Werner Randelshofer

Field Summary
private  double cx
           
private  double cy
           
private  double fx
           
private  double fy
           
private  boolean isRelativeToFigureBounds
           
private  double r
           
private  java.awt.Color[] stopColors
           
private  double[] stopOffsets
           
private  double[] stopOpacities
           
private  java.awt.geom.AffineTransform transform
           
 
Constructor Summary
RadialGradient()
          Creates a new instance.
RadialGradient(double cx, double cy, double fx, double fy, double r, double[] stopOffsets, java.awt.Color[] stopColors, double[] stopOpacities, boolean isRelativeToFigureBounds, java.awt.geom.AffineTransform tx)
           
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object o)
           
 boolean equals(RadialGradient that)
           
 double getCX()
           
 double getCY()
           
 double getFX()
           
 double getFY()
           
 java.awt.Paint getPaint(Figure f, double opacity)
           
 double getR()
           
 java.awt.Color[] getStopColors()
           
 double[] getStopOffsets()
           
 double[] getStopOpacities()
           
 java.awt.geom.AffineTransform getTransform()
           
 int hashCode()
           
 boolean isRelativeToFigureBounds()
           
 void makeRelativeToFigureBounds(Figure f)
           
 void setGradientCircle(double cx, double cy, double r)
           
 void setRelativeToFigureBounds(boolean b)
           
 void setStops(double[] offsets, java.awt.Color[] colors, double[] stopOpacities)
           
 void setTransform(java.awt.geom.AffineTransform tx)
           
 void transform(java.awt.geom.AffineTransform tx)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cx

private double cx

cy

private double cy

fx

private double fx

fy

private double fy

r

private double r

isRelativeToFigureBounds

private boolean isRelativeToFigureBounds

stopOffsets

private double[] stopOffsets

stopColors

private java.awt.Color[] stopColors

transform

private java.awt.geom.AffineTransform transform

stopOpacities

private double[] stopOpacities
Constructor Detail

RadialGradient

public RadialGradient()
Creates a new instance.


RadialGradient

public RadialGradient(double cx,
                      double cy,
                      double fx,
                      double fy,
                      double r,
                      double[] stopOffsets,
                      java.awt.Color[] stopColors,
                      double[] stopOpacities,
                      boolean isRelativeToFigureBounds,
                      java.awt.geom.AffineTransform tx)
Method Detail

setGradientCircle

public void setGradientCircle(double cx,
                              double cy,
                              double r)

setStops

public void setStops(double[] offsets,
                     java.awt.Color[] colors,
                     double[] stopOpacities)

setRelativeToFigureBounds

public void setRelativeToFigureBounds(boolean b)

makeRelativeToFigureBounds

public void makeRelativeToFigureBounds(Figure f)
Specified by:
makeRelativeToFigureBounds in interface Gradient

getPaint

public java.awt.Paint getPaint(Figure f,
                               double opacity)
Specified by:
getPaint in interface Gradient

getCX

public double getCX()

getCY

public double getCY()

getFX

public double getFX()

getFY

public double getFY()

getR

public double getR()

getStopOffsets

public double[] getStopOffsets()

getStopColors

public java.awt.Color[] getStopColors()

getStopOpacities

public double[] getStopOpacities()

isRelativeToFigureBounds

public boolean isRelativeToFigureBounds()
Specified by:
isRelativeToFigureBounds in interface Gradient

setTransform

public void setTransform(java.awt.geom.AffineTransform tx)

getTransform

public java.awt.geom.AffineTransform getTransform()

transform

public void transform(java.awt.geom.AffineTransform tx)
Specified by:
transform in interface Gradient

clone

public java.lang.Object clone()
Specified by:
clone in interface Gradient
Overrides:
clone in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

equals

public boolean equals(RadialGradient that)