Class GradientCanvas

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.openjump.core.rasterimage.styler.ui.GradientCanvas
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class GradientCanvas extends JComponent
This class allows to create a JComponent whose background is stretched between two colors. The stretched is from top to bottom and with horizonal effect.
Author:
GeomaticaEAmbiente
See Also:
  • Constructor Details

    • GradientCanvas

      public GradientCanvas(ColorMapEntry[] colorMapEntries, int width, int height, GradientCanvas.GradientType type)
      Construct a JComponent whose background is stretched between colorStart and colorEnd.
      Parameters:
      colorMapEntries - map values to colors
      width - Width of the stretched effect.
      height - Height of the stretched effect.
      type - Gradient direction. HORIZONTAL colorStart is on left and colorEnd is on right, VERTICAL colorStart is at top and colorEnd is bottom.
    • GradientCanvas

      public GradientCanvas(ColorMapEntry[] colorMapEntries, int width, int height, GradientCanvas.GradientType type, GradientCanvas.GradientOrientation orientation)
      Construct a JComponent whose background is stretched between colorStart and colorEnd.
      Parameters:
      colorMapEntries - map values to colors
      width - Width of the stretched effect.
      height - Height of the stretched effect.
      type - Gradient direction. HORIZONTAL colorStart is on left and colorEnd is on right, VERTICAL colorStart is at top and colorEnd is bottom.
      orientation - Gradient orientation. DIRECT is oriented from top to bottom or from left to right, INVERSE is the opposite.
  • Method Details