[]
ICellDecoration单元格装饰可以包含折角和/或图标,用于直观标注单元格。将此类与 IRange.setDecoration(ICellDecoration) 一起使用,可以将装饰应用到单元格或单元格区域。这是 SpreadJS 特有功能,支持导出为 .sjs 和 .ssjson 格式。
ICornerFold cornerFold = new CornerFold(Color.GetRed(), EnumSet.of(CornerPosition.LeftTop), 8);
ICellDecorationIcon icon = new CellDecorationIcon("data:image/svg+xml;base64,PHN2Zz4=", 12, 12, IconPosition.OutsideRight);
CellDecoration decoration = new CellDecoration(cornerFold, Collections.singletonList(icon));
worksheet.getRange("A1").setDecoration(decoration);
CellDecoration(ICornerFold cornerFold) CellDecoration(ICornerFold cornerFold,
List<ICellDecorationIcon> icons) CellDecoration(List<ICellDecorationIcon> icons) cornerFold - 折角。icons - 图标。cornerFold - 折角。icons - 图标。
ICornerFold cornerFold = new CornerFold(Color.GetRed(), EnumSet.of(CornerPosition.LeftTop), 8);
CellDecoration decoration = new CellDecoration(cornerFold);
ICornerFold actualCornerFold = decoration.getCornerFold();
getCornerFold in interface ICellDecoration
ICellDecorationIcon icon = new CellDecorationIcon(
"data:image/svg+xml;base64,PHN2Zz4=", 12, 12, IconPosition.OutsideRight);
CellDecoration decoration = new CellDecoration(Collections.singletonList(icon));
List<ICellDecorationIcon> icons = decoration.getIcons();
getIcons in interface ICellDecoration