[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(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
表示可应用于单元格的折角装饰设置。

折角定义了折角颜色、显示折角的角以及其大小。


 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)
      创建 CornerFold 类的新实例。

      使用指定颜色、折角位置和大小初始化折角。如果 position 为 null,则创建的折角不带任何折角位置标志。

      
       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 - 折角的颜色。
      position - 显示折角的位置。如果为 null,则不设置折角位置。
      size - 折角的大小,以像素为单位。
  • Method Details

    • getColor

      public Color getColor()
      获取折角的颜色。

      返回用于呈现折角指示器的 Color。

      
       CornerFold cornerFold = new CornerFold(
           Color.GetRed(),
           EnumSet.of(CornerPosition.LeftTop, CornerPosition.RightTop),
           8
       );
       Color color = cornerFold.getColor();
       
      Specified by:
      getColor in interface ICornerFold
      Returns:
      折角的颜色。如果未设置颜色,则返回 null。
    • getPosition

      public EnumSet<CornerPosition> getPosition()
      获取折角的位置。

      返回一组 CornerPosition 标志,用于指示哪些角显示折角。如果未设置任何角位置,此方法返回空的 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:
      一个包含折角角位置的 EnumSet。如果未设置位置,则返回空集合。
    • getSize

      public int getSize()
      获取折角的像素大小。

      返回用于呈现折角指示器的像素大小。如果未设置大小,此方法返回 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:
      折角的大小(以像素为单位)。如果未设置大小,则返回 0。