/** @param partition where to remove this style from */ public void removeStyle(BasePartition partition) { partition.setStyleMask(partition.getStyleMask() & ~mask); if (color != null) partition.setColorRGB(null); if (bgColor != null) partition.setBgColorRGB(null); if (fontDataName != null && fontDataName != NORMAL_FONT_NAME) partition.setFontDataName(NORMAL_FONT_NAME); }
/** @param partition where to apply this style to */ public void applyStyle(BasePartition partition) { if ((mask & FontStyle.SUB) != 0) partition.setSup(false); if ((mask & FontStyle.SUP) != 0) partition.setSub(false); partition.setStyleMask(partition.getStyleMask() | mask); if (color != null) partition.setColorRGB(color); if (bgColor != null) partition.setBgColorRGB(bgColor); if (fontDataName != null) partition.setFontDataName(fontDataName); }
/** @param partition where to set this style to */ public void setStyle(BasePartition partition) { partition.setStyleMask(mask); partition.setColorRGB(color); partition.setBgColorRGB(bgColor); partition.setFontDataName(fontDataName); }