ago.beans
Class Gradient

java.lang.Object
  |
  +--ago.beans.Gradient
All Implemented Interfaces:
java.io.Serializable

public class Gradient
extends java.lang.Object
implements java.io.Serializable

Class giving Image, formed of several points with key colors, and the points, forming transition from one key color to another. Gradient can be horizontal or vertical. You can make Gradient with any numbers of colors, any colors, any destance between colors. There is easy visual editor for this property.

Version:
1.0 / 17 may 2004
Author:
Arcadiy Gobuzov
See Also:
Serialized Form

Constructor Summary
Gradient()
          default Gradient (blue->white->orange), segments = 256 delay = 10
Gradient(int color1, int color2)
          Create Gradient with 2 key colors & segments = 100.
Gradient(java.lang.String[] colors, float[] ranges, int segments, int delay)
          using for JavaInitializationString Allways ranges[0]=0, ranges[last]=1
 
Method Summary
 java.lang.Object clone()
           
 java.awt.Image getImage()
           
static java.awt.Image rot90(java.awt.Image img)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Gradient

public Gradient()
default Gradient (blue->white->orange), segments = 256 delay = 10


Gradient

public Gradient(java.lang.String[] colors,
                float[] ranges,
                int segments,
                int delay)
using for JavaInitializationString Allways ranges[0]=0, ranges[last]=1

Parameters:
colors - array of gradient colors.
Note: colors value must to be wrote as strings in hex mode, without "0x"!
Examples: "ffffff" - for white, "ff0000" - for red et.c. String array used here, because some IDE not define hex integer for bean's parameters
ranges - array with distances between key-colors points
segments - how many points total
delay - speed of color changing (for dynamic components only, ie AgoLabel & AgoButton )

Gradient

public Gradient(int color1,
                int color2)
Create Gradient with 2 key colors & segments = 100.

Parameters:
color1 - start color
color2 - end color
Method Detail

getImage

public java.awt.Image getImage()
Returns:
horizontal Image of gradient. To get vertical image, use rot90 method here

rot90

public static java.awt.Image rot90(java.awt.Image img)
Parameters:
img - image to rotate
Returns:
new image, rotated to the right

toString

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

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object