JHotDraw 7.4.1

org.jhotdraw.samples.svg
Class LinearGradient

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

public class LinearGradient
extends java.lang.Object
implements Gradient

Represents an SVG LinearGradient.

Version:
$Id: LinearGradient.java 604 2010-01-09 12:00:29Z rawcoder $
Author:
Werner Randelshofer

Constructor Summary
LinearGradient()
          Creates a new instance.
LinearGradient(double x1, double y1, double x2, double y2, double[] stopOffsets, java.awt.Color[] stopColors, double[] stopOpacities, boolean isRelativeToFigureBounds, java.awt.geom.AffineTransform tx)
           
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(LinearGradient that)
           
 boolean equals(java.lang.Object o)
           
 java.awt.Paint getPaint(Figure f, double opacity)
           
 java.awt.Color[] getStopColors()
           
 double[] getStopOffsets()
           
 double[] getStopOpacities()
           
 java.awt.geom.AffineTransform getTransform()
           
 double getX1()
           
 double getX2()
           
 double getY1()
           
 double getY2()
           
 int hashCode()
           
 boolean isRelativeToFigureBounds()
           
 void makeRelativeToFigureBounds(Figure f)
           
 void setGradientVector(double x1, double y1, double x2, double y2)
           
 void setRelativeToFigureBounds(boolean b)
           
 void setStops(double[] offsets, java.awt.Color[] colors, double[] stopOpacities)
           
 void setTransform(java.awt.geom.AffineTransform tx)
           
 java.lang.String toString()
           
 void transform(java.awt.geom.AffineTransform tx)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinearGradient

public LinearGradient()
Creates a new instance.


LinearGradient

public LinearGradient(double x1,
                      double y1,
                      double x2,
                      double y2,
                      double[] stopOffsets,
                      java.awt.Color[] stopColors,
                      double[] stopOpacities,
                      boolean isRelativeToFigureBounds,
                      java.awt.geom.AffineTransform tx)
Method Detail

setGradientVector

public void setGradientVector(double x1,
                              double y1,
                              double x2,
                              double y2)

setStops

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

setRelativeToFigureBounds

public void setRelativeToFigureBounds(boolean b)

isRelativeToFigureBounds

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

getX1

public double getX1()

getY1

public double getY1()

getX2

public double getX2()

getY2

public double getY2()

getStopOffsets

public double[] getStopOffsets()

getStopColors

public java.awt.Color[] getStopColors()

getStopOpacities

public double[] getStopOpacities()

getTransform

public java.awt.geom.AffineTransform getTransform()

getPaint

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setTransform

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

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

makeRelativeToFigureBounds

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

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(LinearGradient that)

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.