[]
        
(Showing Draft Content)

CornerFold

Class CornerFold

java.lang.Object
com.grapecity.documents.excel.CornerFold
All Implemented Interfaces:
ICornerFold

public class CornerFold extends Object implements ICornerFold
Represents corner fold decoration settings that can be applied to a cell.

A corner fold defines the fold color, the corners where the fold is shown, and its size.


 ICornerFold fold = new CornerFold(
     Color.GetRed(),
     EnumSet.of(CornerPosition.LeftTop, CornerPosition.RightTop),
     8
 );
 worksheet.getRange("A1").setDecoration(new CellDecoration(fold));
 ICornerFold cornerFold = worksheet.getRange("A1").getDecoration().getCornerFold();
 Color color = cornerFold.getColor();
 
  • Constructor Details

    • CornerFold

      public CornerFold(Color color, EnumSet<CornerPosition> position, int size)
      Creates a new instance of the CornerFold class.

      Initializes a corner fold with the specified color, corner positions, and size. If position is null, the corner fold is created without any corner position flags.

      
       CornerFold cornerFold = new CornerFold(
           Color.GetRed(),
           EnumSet.of(CornerPosition.LeftTop, CornerPosition.RightTop),
           8
       );
       Color color = cornerFold.getColor();
       EnumSet<CornerPosition> positions = cornerFold.getPosition();
       int size = cornerFold.getSize();
       
      Parameters:
      color - The color of the corner fold.
      position - The positions where the corner fold is displayed. If null, no corner position is set.
      size - The size of the corner fold in pixels.
  • Method Details

    • getColor

      public Color getColor()
      Gets the color of the corner fold.

      Returns the Color used to render the fold indicator.

      
       CornerFold cornerFold = new CornerFold(
           Color.GetRed(),
           EnumSet.of(CornerPosition.LeftTop, CornerPosition.RightTop),
           8
       );
       Color color = cornerFold.getColor();
       
      Specified by:
      getColor in interface ICornerFold
      Returns:
      The color of the corner fold. Returns null if no color is set.
    • getPosition

      public EnumSet<CornerPosition> getPosition()
      Gets the position of the corner fold.

      Returns the set of CornerPosition flags that indicate which corners display the fold. If no corner position is set, this method returns an empty EnumSet.

      
       CornerFold cornerFold = new CornerFold(
           Color.GetRed(),
           EnumSet.of(CornerPosition.LeftTop, CornerPosition.RightTop),
           8
       );
       EnumSet<CornerPosition> positions = cornerFold.getPosition();
       
      Specified by:
      getPosition in interface ICornerFold
      Returns:
      An EnumSet containing the corner positions of the fold. Returns an empty set if no position is set.
    • getSize

      public int getSize()
      Gets the size of the corner fold in pixels.

      Returns the pixel size used to render the fold indicator. If no size is set, this method returns 0.

      
       CornerFold cornerFold = new CornerFold(
           Color.GetRed(),
           EnumSet.of(CornerPosition.LeftTop, CornerPosition.RightTop),
           8
       );
       int size = cornerFold.getSize();
       
      Specified by:
      getSize in interface ICornerFold
      Returns:
      The size of the corner fold in pixels. Returns 0 if no size is set.