[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

ColorDataIndex

Enum Class ColorDataIndex

java.lang.Object
java.lang.Enum<ColorDataIndex>
com.grapecity.documents.excel.ColorDataIndex
All Implemented Interfaces:
Serializable, Comparable<ColorDataIndex>, Constable

public enum ColorDataIndex extends Enum<ColorDataIndex>
表示边框、字体或填充等颜色索引属性可使用的特殊颜色索引值。

使用此枚举可应用内置颜色索引含义,而不是基于调色板的数字索引。例如,Automatic 表示自动颜色,None 表示目标颜色未设置或无颜色。


 IRange cell = worksheet.getRange("A1");
 cell.setValue("ColorDataIndex example");
 cell.getInterior().setPattern(Pattern.Solid);
 cell.getInterior().setPatternColorIndex(ColorDataIndex.Automatic.getValue());
 ColorDataIndex patternColorIndex =
         ColorDataIndex.forValue(cell.getInterior().getPatternColorIndex());
 
  • Enum Constant Details

    • None

      public static final ColorDataIndex None
      指定不填充。
    • Automatic

      public static final ColorDataIndex Automatic
      指定一个自动颜色。
  • Method Details

    • values

      public static ColorDataIndex[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ColorDataIndex valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public int getValue()
      Gets the integer value of the color data index.
      Returns:
      The integer value of the color data index.
    • forValue

      public static ColorDataIndex forValue(int value)
      Returns the color data index associated with the specified integer value.
      Parameters:
      value - The integer value of the color data index.
      Returns:
      The ColorDataIndex enum constant associated with the specified value.
      Throws:
      IllegalArgumentException - if value does not match a defined color data index.