[]
        
(Showing Draft Content)

IRectangularGradient

Interface IRectangularGradient


public interface IRectangularGradient
Represents a rectangular gradient fill definition.

The IRectangularGradient object transitions through a series of colors within a rectangular gradient fill. Use this interface to configure the gradient convergence points at the left, top, right, and bottom edges and to manage the gradient IColorStops.


 IRange cell = worksheet.getRange("A1");
 cell.getInterior().setPattern(Pattern.RectangularGradient);
 IRectangularGradient gradient = (IRectangularGradient) cell.getInterior().getGradient();
 gradient.setLeft(0.1);
 gradient.setTop(0.2);
 gradient.setRight(0.9);
 gradient.setBottom(0.8);
 
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Gets the convergence position of the rectangular gradient fill at the bottom.
    Gets the color stops for this rectangular gradient.
    double
    Gets the convergence position of the rectangular gradient fill at the left.
    double
    Gets the convergence position of the rectangular gradient fill at the right.
    double
    Gets the convergence position of the rectangular gradient fill at the top.
    void
    setBottom(double value)
    Sets the convergence position of the rectangular gradient fill at the bottom.
    void
    setLeft(double value)
    Sets the convergence position of the rectangular gradient fill at the left.
    void
    setRight(double value)
    Sets the convergence position of the rectangular gradient fill at the right.
    void
    setTop(double value)
    Sets the convergence position of the rectangular gradient fill at the top.
  • Method Details

    • getColorStops

      IColorStops getColorStops()
      Gets the color stops for this rectangular gradient.

      Returns the IColorStops collection for the IRectangularGradient object. The returned collection contains the IColorStop objects that define the colors and positions used by the gradient fill.

      
       worksheet.getRange("A1").getInterior().setPattern(Pattern.RectangularGradient);
       IRectangularGradient gradient = (IRectangularGradient) worksheet.getRange("A1").getInterior().getGradient();
       IColorStops colorStops = gradient.getColorStops();
       colorStops.get(0).setColor(Color.FromArgb(255, 0, 0));
       colorStops.get(1).setColor(Color.FromArgb(0, 255, 0));
       
      Returns:
      The IColorStops collection for this rectangular gradient.
    • getBottom

      double getBottom()
      Gets the convergence position of the rectangular gradient fill at the bottom.

      Use this property to read the bottom convergence setting of a rectangular gradient fill.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.RectangularGradient);
       IRectangularGradient gradient = (IRectangularGradient) cell.getInterior().getGradient();
       gradient.setBottom(0.8);
       double bottom = gradient.getBottom();
       
      Returns:
      The convergence position of the rectangular gradient fill at the bottom.
    • setBottom

      void setBottom(double value)
      Sets the convergence position of the rectangular gradient fill at the bottom.

      Use this property to set the bottom convergence setting of a rectangular gradient fill.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.RectangularGradient);
       IRectangularGradient gradient = (IRectangularGradient) cell.getInterior().getGradient();
       gradient.setBottom(0.8);
       
      Parameters:
      value - The convergence position of the rectangular gradient fill at the bottom.
    • getLeft

      double getLeft()
      Gets the convergence position of the rectangular gradient fill at the left.

      Use this property to read the left-side convergence setting of a rectangular gradient fill.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.RectangularGradient);
       IRectangularGradient gradient = (IRectangularGradient) cell.getInterior().getGradient();
       gradient.setLeft(0.2);
       double left = gradient.getLeft();
       
      Returns:
      The convergence position of the rectangular gradient fill at the left.
    • setLeft

      void setLeft(double value)
      Sets the convergence position of the rectangular gradient fill at the left.

      Use this property to set the left-side convergence setting of a rectangular gradient fill.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.RectangularGradient);
       IRectangularGradient gradient = (IRectangularGradient) cell.getInterior().getGradient();
       gradient.setLeft(0.2);
       
      Parameters:
      value - The convergence position of the rectangular gradient fill at the left.
    • getRight

      double getRight()
      Gets the convergence position of the rectangular gradient fill at the right.

      This value controls the right-side convergence position of a rectangular gradient fill.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.RectangularGradient);
       IRectangularGradient gradient = (IRectangularGradient) cell.getInterior().getGradient();
       gradient.setRight(0.3);
       double right = gradient.getRight();
       
      Returns:
      The convergence position of the rectangular gradient fill at the right.
    • setRight

      void setRight(double value)
      Sets the convergence position of the rectangular gradient fill at the right.

      This value controls the right-side convergence position of a rectangular gradient fill.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.RectangularGradient);
       IRectangularGradient gradient = (IRectangularGradient) cell.getInterior().getGradient();
       gradient.setRight(0.3);
       
      Parameters:
      value - The convergence position of the rectangular gradient fill at the right.
    • getTop

      double getTop()
      Gets the convergence position of the rectangular gradient fill at the top.

      Use this property to read the top convergence setting of a rectangular gradient fill.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.RectangularGradient);
       IRectangularGradient gradient = (IRectangularGradient) cell.getInterior().getGradient();
       gradient.setTop(0.2);
       double top = gradient.getTop();
       
      Returns:
      The convergence position of the rectangular gradient fill at the top.
    • setTop

      void setTop(double value)
      Sets the convergence position of the rectangular gradient fill at the top.

      Use this property to set the top convergence setting of a rectangular gradient fill.

      
       IRange cell = worksheet.getRange("A1");
       cell.getInterior().setPattern(Pattern.RectangularGradient);
       IRectangularGradient gradient = (IRectangularGradient) cell.getInterior().getGradient();
       gradient.setTop(0.2);
       
      Parameters:
      value - The convergence position of the rectangular gradient fill at the top.