import org.apache.poi.hssf.record.WriteProtectRecord;
import org.apache.poi.hssf.record.common.UnicodeString;
import org.apache.poi.hssf.record.crypto.Biff8EncryptionKey;
-import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.hssf.util.HSSFColor.HSSFColorPredefined;
import org.apache.poi.poifs.crypt.CryptoFunctions;
import org.apache.poi.poifs.crypt.Decryptor;
import org.apache.poi.poifs.crypt.EncryptionInfo;
* @return Workbook object
*/
public static InternalWorkbook createWorkbook(List<Record> recs) {
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "Workbook (readfile) created with reclen=",
Integer.valueOf(recs.size()));
+ }
InternalWorkbook retval = new InternalWorkbook();
List<Record> records = new ArrayList<Record>(recs.size() / 3);
retval.records.setRecords(records);
if (rec.getSid() == EOFRecord.sid) {
records.add(rec);
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found workbook eof record at " + k);
+ }
break;
}
switch (rec.getSid()) {
case BoundSheetRecord.sid :
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found boundsheet record at " + k);
+ }
retval.boundsheets.add((BoundSheetRecord) rec);
retval.records.setBspos( k );
break;
case SSTRecord.sid :
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found sst record at " + k);
+ }
retval.sst = ( SSTRecord ) rec;
break;
case FontRecord.sid :
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found font record at " + k);
+ }
retval.records.setFontpos( k );
retval.numfonts++;
break;
case ExtendedFormatRecord.sid :
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found XF record at " + k);
+ }
retval.records.setXfpos( k );
retval.numxfs++;
break;
case TabIdRecord.sid :
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found tabid record at " + k);
+ }
retval.records.setTabpos( k );
break;
case ProtectRecord.sid :
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found protect record at " + k);
+ }
retval.records.setProtpos( k );
break;
case BackupRecord.sid :
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found backup record at " + k);
+ }
retval.records.setBackuppos( k );
break;
case ExternSheetRecord.sid :
case NameRecord.sid :
case SupBookRecord.sid :
// LinkTable can start with either of these
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found SupBook record at " + k);
+ }
retval.linkTable = new LinkTable(recs, k, retval.records, retval.commentRecords);
k+=retval.linkTable.getRecordCount() - 1;
continue;
case FormatRecord.sid :
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found format record at " + k);
+ }
retval.formats.add((FormatRecord) rec);
retval.maxformatid = retval.maxformatid >= ((FormatRecord)rec).getIndexCode() ? retval.maxformatid : ((FormatRecord)rec).getIndexCode();
break;
case DateWindow1904Record.sid :
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found datewindow1904 record at " + k);
+ }
retval.uses1904datewindowing = ((DateWindow1904Record)rec).getWindowing() == 1;
break;
case PaletteRecord.sid:
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found palette record at " + k);
+ }
retval.records.setPalettepos( k );
break;
case WindowOneRecord.sid:
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found WindowOneRecord at " + k);
+ }
retval.windowOne = (WindowOneRecord) rec;
break;
case WriteAccessRecord.sid:
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found WriteAccess at " + k);
+ }
retval.writeAccess = (WriteAccessRecord) rec;
break;
case WriteProtectRecord.sid:
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found WriteProtect at " + k);
+ }
retval.writeProtect = (WriteProtectRecord) rec;
break;
case FileSharingRecord.sid:
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found FileSharing at " + k);
+ }
retval.fileShare = (FileSharingRecord) rec;
break;
case NameCommentRecord.sid:
final NameCommentRecord ncr = (NameCommentRecord) rec;
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "found NameComment at " + k);
+ }
retval.commentRecords.put(ncr.getNameText(), ncr);
break;
default:
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "ignoring record (sid=" + rec.getSid() + ") at " + k);
+ }
break;
}
records.add(rec);
if (retval.windowOne == null) {
retval.windowOne = createWindowOne();
}
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "exit create workbook from existing file function");
+ }
return retval;
}
*/
public static InternalWorkbook createWorkbook()
{
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log( DEBUG, "creating new workbook from scratch" );
+ }
InternalWorkbook retval = new InternalWorkbook();
List<Record> records = new ArrayList<Record>( 30 );
retval.records.setRecords(records);
records.add(InternalWorkbook.createExtendedSST());
records.add(EOFRecord.instance);
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log( DEBUG, "exit create new workbook from scratch" );
+ }
return retval;
}
*/
public void setSheetBof(int sheetIndex, int pos) {
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "setting bof for sheetnum =", Integer.valueOf(sheetIndex),
" at pos=", Integer.valueOf(pos));
+ }
checkSheets(sheetIndex);
getBoundSheetRec(sheetIndex)
.setPositionOfBof(pos);
checkSheets(sheetnum);
// YK: Mimic Excel and silently truncate sheet names longer than 31 characters
- if(sheetname.length() > 31) sheetname = sheetname.substring(0, 31);
+ if(sheetname.length() > 31) {
+ sheetname = sheetname.substring(0, 31);
+ }
BoundSheetRecord sheet = boundsheets.get(sheetnum);
sheet.setSheetname(sheetname);
*/
public int getNumSheets() {
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "getNumSheets=", Integer.valueOf(boundsheets.size()));
+ }
return boundsheets.size();
}
*/
public int getNumExFormats() {
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "getXF=", Integer.valueOf(numxfs));
+ }
return numxfs;
}
*/
public int addSSTString(UnicodeString string) {
- if (log.check( POILogger.DEBUG ))
- log.log(DEBUG, "insert to sst string='", string);
+ if (log.check( POILogger.DEBUG )) {
+ log.log(DEBUG, "insert to sst string='", string);
+ }
if (sst == null) {
insertSST();
}
}
UnicodeString retval = sst.getString(str);
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "Returning SST for index=", Integer.valueOf(str),
" String= ", retval);
+ }
return retval;
}
*/
public void insertSST() {
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log(DEBUG, "creating new SST via insertSST!");
+ }
sst = new SSTRecord();
records.add(records.size() - 1, createExtendedSST());
records.add(records.size() - 2, sst);
*/
public int serialize( int offset, byte[] data )
{
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log( DEBUG, "Serializing Workbook with offsets" );
+ }
int pos = 0;
///// DEBUG END /////
pos += len; // rec.length;
}
- if (log.check( POILogger.DEBUG ))
+ if (log.check( POILogger.DEBUG )) {
log.log( DEBUG, "Exiting serialize workbook" );
+ }
return pos;
}
for ( int k = 0; k < records.size(); k++ )
{
Record record = records.get( k );
- if (record instanceof SSTRecord)
+ if (record instanceof SSTRecord) {
sst = (SSTRecord)record;
+ }
- if (record.getSid() == ExtSSTRecord.sid && sst != null)
+ if (record.getSid() == ExtSSTRecord.sid && sst != null) {
retval += sst.calcExtSSTRecordSize();
- else
+ } else {
retval += record.getRecordSize();
+ }
}
return retval;
try {
String username = System.getProperty("user.name");
// Google App engine returns null for user.name, see Bug 53974
- if(username == null) username = defaultUserName;
+ if(username == null) {
+ username = defaultUserName;
+ }
retval.setUsername(username);
} catch (AccessControlException e) {
retval.setPaletteOptions(( short ) 0);
retval.setAdtlPaletteOptions(( short ) 0);
retval.setFillPaletteOptions(( short ) 0x20c0);
- retval.setTopBorderPaletteIdx(HSSFColor.BLACK.index);
- retval.setBottomBorderPaletteIdx(HSSFColor.BLACK.index);
- retval.setLeftBorderPaletteIdx(HSSFColor.BLACK.index);
- retval.setRightBorderPaletteIdx(HSSFColor.BLACK.index);
+ retval.setTopBorderPaletteIdx(HSSFColorPredefined.BLACK.getIndex());
+ retval.setBottomBorderPaletteIdx(HSSFColorPredefined.BLACK.getIndex());
+ retval.setLeftBorderPaletteIdx(HSSFColorPredefined.BLACK.getIndex());
+ retval.setRightBorderPaletteIdx(HSSFColorPredefined.BLACK.getIndex());
return retval;
}
FormatRecord rec = new FormatRecord(maxformatid, formatString);
int pos = 0;
- while ( pos < records.size() && records.get( pos ).getSid() != FormatRecord.sid )
+ while ( pos < records.size() && records.get( pos ).getSid() != FormatRecord.sid ) {
pos++;
+ }
pos += formats.size();
formats.add( rec );
records.add( pos, rec );
int matches = 0;
for (Record record : records) {
if (record.getSid() == sid) {
- if (matches++ == pos)
+ if (matches++ == pos) {
return record;
+ }
}
}
return null;
Record rec = records.get(palettePos);
if (rec instanceof PaletteRecord) {
palette = (PaletteRecord) rec;
- } else throw new RuntimeException("InternalError: Expected PaletteRecord but got a '"+rec+"'");
+ } else {
+ throw new RuntimeException("InternalError: Expected PaletteRecord but got a '"+rec+"'");
+ }
}
else
{
drawingManager = new DrawingManager2(dgg);
if(bStore != null){
for(EscherRecord bs : bStore.getChildRecords()){
- if(bs instanceof EscherBSERecord) escherBSERecords.add((EscherBSERecord)bs);
+ if(bs instanceof EscherBSERecord) {
+ escherBSERecords.add((EscherBSERecord)bs);
+ }
}
}
return drawingManager;
drawingManager = new DrawingManager2(dgg);
if(bStore != null){
for(EscherRecord bs : bStore.getChildRecords()){
- if(bs instanceof EscherBSERecord) escherBSERecords.add((EscherBSERecord)bs);
+ if(bs instanceof EscherBSERecord) {
+ escherBSERecords.add((EscherBSERecord)bs);
+ }
}
}
}
splitMenuColors.setColor4(0x100000F7);
dggContainer.addChildRecord(dgg);
- if (bstoreContainer != null)
+ if (bstoreContainer != null) {
dggContainer.addChildRecord( bstoreContainer );
+ }
dggContainer.addChildRecord(opt);
dggContainer.addChildRecord(splitMenuColors);
package org.apache.poi.hssf.util;
-import java.lang.reflect.Field;
import java.util.Collections;
+import java.util.EnumMap;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
import org.apache.poi.ss.usermodel.Color;
+import org.apache.poi.util.Removal;
/**
* Each color has an index (for the standard palette in Excel (tm) ),
* native (RGB) triplet and string triplet. The string triplet is as the
* color would be represented by Gnumeric. Having (string) this here is a bit of a
- * collusion of function between HSSF and the HSSFSerializer but I think its
+ * collision of function between HSSF and the HSSFSerializer but I think its
* a reasonable one in this case.
*/
public class HSSFColor implements Color {
- private static Map<Integer,HSSFColor> indexHash;
+
+ private static Map<Integer,HSSFColor> indexHash;
+ private static Map<HSSFColorPredefined,HSSFColor> enumList;
+
+ private java.awt.Color color;
+ private int index;
+ private int index2;
+
+ /**
+ * Predefined HSSFColors with their given palette index (and an optional 2nd index)
+ *
+ * @since POI 3.16 beta 2
+ */
+ public enum HSSFColorPredefined {
+ BLACK (0x08, -1, 0x000000),
+ BROWN (0x3C, -1, 0x993300),
+ OLIVE_GREEN (0x3B, -1, 0x333300),
+ DARK_GREEN (0x3A, -1, 0x003300),
+ DARK_TEAL (0x38, -1, 0x003366),
+ DARK_BLUE (0x12, 0x20, 0x000080),
+ INDIGO (0x3E, -1, 0x333399),
+ GREY_80_PERCENT (0x3F, -1, 0x333333),
+ ORANGE (0x35, -1, 0xFF6600),
+ DARK_YELLOW (0x13, -1, 0x808000),
+ GREEN (0x11, -1, 0x008000),
+ TEAL (0x15, 0x26, 0x008080),
+ BLUE (0x0C, 0x27, 0x0000FF),
+ BLUE_GREY (0x36, -1, 0x666699),
+ GREY_50_PERCENT (0x17, -1, 0x808080),
+ RED (0x0A, -1, 0xFF0000),
+ LIGHT_ORANGE (0x34, -1, 0xFF9900),
+ LIME (0x32, -1, 0x99CC00),
+ SEA_GREEN (0x39, -1, 0x339966),
+ AQUA (0x31, -1, 0x33CCCC),
+ LIGHT_BLUE (0x30, -1, 0x3366FF),
+ VIOLET (0x14, 0x24, 0x800080),
+ GREY_40_PERCENT (0x37, -1, 0x969696),
+ PINK (0x0E, 0x21, 0xFF00FF),
+ GOLD (0x33, -1, 0xFFCC00),
+ YELLOW (0x0D, 0x22, 0xFFFF00),
+ BRIGHT_GREEN (0x0B, -1, 0x00FF00),
+ TURQUOISE (0x0F, 0x23, 0x00FFFF),
+ DARK_RED (0x10, 0x25, 0x800000),
+ SKY_BLUE (0x28, -1, 0x00CCFF),
+ PLUM (0x3D, 0x19, 0x993366),
+ GREY_25_PERCENT (0x16, -1, 0xC0C0C0),
+ ROSE (0x2D, -1, 0xFF99CC),
+ LIGHT_YELLOW (0x2B, -1, 0xFFFF99),
+ LIGHT_GREEN (0x2A, -1, 0xCCFFCC),
+ LIGHT_TURQUOISE (0x29, 0x1B, 0xCCFFFF),
+ PALE_BLUE (0x2C, -1, 0x99CCFF),
+ LAVENDER (0x2E, -1, 0xCC99FF),
+ WHITE (0x09, -1, 0xFFFFFF),
+ CORNFLOWER_BLUE (0x18, -1, 0x9999FF),
+ LEMON_CHIFFON (0x1A, -1, 0xFFFFCC),
+ MAROON (0x19, -1, 0x7F0000),
+ ORCHID (0x1C, -1, 0x660066),
+ CORAL (0x1D, -1, 0xFF8080),
+ ROYAL_BLUE (0x1E, -1, 0x0066CC),
+ LIGHT_CORNFLOWER_BLUE(0x1F, -1, 0xCCCCFF),
+ TAN (0x2F, -1, 0xFFCC99),
+
+ /**
+ * Special Default/Normal/Automatic color.<p>
+ * <i>Note:</i> This class is NOT in the default Map returned by HSSFColor.
+ * The index is a special case which is interpreted in the various setXXXColor calls.
+ */
+ AUTOMATIC (0x40, -1, 0x000000);
+
+ private HSSFColor color;
+
+ HSSFColorPredefined(int index, int index2, int rgb) {
+ this.color = new HSSFColor(index, index2, new java.awt.Color(rgb));
+ }
+
+ /**
+ * @see HSSFColor#getIndex()
+ */
+ public short getIndex() {
+ return color.getIndex();
+ }
+
+ /**
+ * @see HSSFColor#getIndex2()
+ */
+ public short getIndex2() {
+ return color.getIndex2();
+ }
+
+ /**
+ * @see HSSFColor#getTriplet()
+ */
+ public short [] getTriplet() {
+ return color.getTriplet();
+ }
+
+ /**
+ * @see HSSFColor#getHexString()
+ */
+ public String getHexString() {
+ return color.getHexString();
+ }
+
+ /**
+ * @return (a copy of) the HSSFColor assigned to the enum
+ */
+ public HSSFColor getColor() {
+ return new HSSFColor(getIndex(), getIndex2(), color.color);
+ }
+ }
+
/** Creates a new instance of HSSFColor */
- public HSSFColor()
- {
+ public HSSFColor() {
+ // automatic index
+ this(0x40, -1, java.awt.Color.BLACK);
+ }
+
+ public HSSFColor(int index, int index2, java.awt.Color color) {
+ this.index = index;
+ this.index2 = index2;
+ this.color = color;
}
/**
*
* @return a Map containing all colours keyed by <tt>Integer</tt> excel-style palette indexes
*/
- public final static Map<Integer,HSSFColor> getIndexHash() {
+ public static final synchronized Map<Integer,HSSFColor> getIndexHash() {
if(indexHash == null) {
indexHash = Collections.unmodifiableMap( createColorsByIndexMap() );
}
* the table, then call {@link #getIndexHash()} which returns a
* statically cached imuatable map of colours.
*/
- public final static Map<Integer,HSSFColor> getMutableIndexHash() {
+ public static final Map<Integer,HSSFColor> getMutableIndexHash() {
return createColorsByIndexMap();
}
private static Map<Integer,HSSFColor> createColorsByIndexMap() {
- HSSFColor[] colors = getAllColors();
- Map<Integer,HSSFColor> result = new HashMap<Integer,HSSFColor>(colors.length * 3 / 2);
-
- for (int i = 0; i < colors.length; i++) {
- HSSFColor color = colors[i];
-
- Integer index1 = Integer.valueOf(color.getIndex());
- if (result.containsKey(index1)) {
- HSSFColor prevColor = result.get(index1);
- throw new RuntimeException("Dup color index (" + index1
- + ") for colors (" + prevColor.getClass().getName()
- + "),(" + color.getClass().getName() + ")");
- }
- result.put(index1, color);
- }
+ Map<HSSFColorPredefined,HSSFColor> eList = mapEnumToColorClass();
+ Map<Integer,HSSFColor> result = new HashMap<Integer,HSSFColor>(eList.size() * 3 / 2);
- for (int i = 0; i < colors.length; i++) {
- HSSFColor color = colors[i];
- Integer index2 = getIndex2(color);
- if (index2 == null) {
- // most colors don't have a second index
- continue;
+ for (Map.Entry<HSSFColorPredefined,HSSFColor> colorRef : eList.entrySet()) {
+ Integer index1 = (int)colorRef.getKey().getIndex();
+ if (!result.containsKey(index1)) {
+ result.put(index1, colorRef.getValue());
+ }
+ Integer index2 = (int)colorRef.getKey().getIndex2();
+ if (index2 != -1 && !result.containsKey(index2)) {
+ result.put(index2, colorRef.getValue());
}
-// if (result.containsKey(index2)) {
-// if (false) { // Many of the second indexes clash
-// HSSFColor prevColor = (HSSFColor)result.get(index2);
-// throw new RuntimeException("Dup color index (" + index2
-// + ") for colors (" + prevColor.getClass().getName()
-// + "),(" + color.getClass().getName() + ")");
-// }
-// }
- result.put(index2, color);
}
return result;
}
- private static Integer getIndex2(HSSFColor color) {
-
- Field f;
- try {
- f = color.getClass().getDeclaredField("index2");
- } catch (NoSuchFieldException e) {
- // can happen because not all colors have a second index
- return null;
- }
-
- Short s;
- try {
- s = (Short) f.get(color);
- } catch (IllegalArgumentException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- }
- return Integer.valueOf(s.intValue());
- }
-
- private static HSSFColor[] getAllColors() {
-
- return new HSSFColor[] {
- new BLACK(), new BROWN(), new OLIVE_GREEN(), new DARK_GREEN(),
- new DARK_TEAL(), new DARK_BLUE(), new INDIGO(), new GREY_80_PERCENT(),
- new ORANGE(), new DARK_YELLOW(), new GREEN(), new TEAL(), new BLUE(),
- new BLUE_GREY(), new GREY_50_PERCENT(), new RED(), new LIGHT_ORANGE(), new LIME(),
- new SEA_GREEN(), new AQUA(), new LIGHT_BLUE(), new VIOLET(), new GREY_40_PERCENT(),
- new PINK(), new GOLD(), new YELLOW(), new BRIGHT_GREEN(), new TURQUOISE(),
- new DARK_RED(), new SKY_BLUE(), new PLUM(), new GREY_25_PERCENT(), new ROSE(),
- new LIGHT_YELLOW(), new LIGHT_GREEN(), new LIGHT_TURQUOISE(), new PALE_BLUE(),
- new LAVENDER(), new WHITE(), new CORNFLOWER_BLUE(), new LEMON_CHIFFON(),
- new MAROON(), new ORCHID(), new CORAL(), new ROYAL_BLUE(),
- new LIGHT_CORNFLOWER_BLUE(), new TAN(),
- };
- }
-
/**
* this function returns all colors in a hastable. Its not implemented as a
* static member/staticly initialized because that would be dirty in a
}
private static Map<String,HSSFColor> createColorsByHexStringMap() {
- HSSFColor[] colors = getAllColors();
- Map<String,HSSFColor> result = new HashMap<String,HSSFColor>(colors.length * 3 / 2);
-
- for (int i = 0; i < colors.length; i++) {
- HSSFColor color = colors[i];
-
- String hexString = color.getHexString();
- if (result.containsKey(hexString)) {
- HSSFColor other = result.get(hexString);
- throw new RuntimeException(
- "Dup color hexString (" + hexString
- + ") for color (" + color.getClass().getName() + ") - "
- + " already taken by (" + other.getClass().getName() + ")"
- );
+ Map<HSSFColorPredefined,HSSFColor> eList = mapEnumToColorClass();
+ Map<String,HSSFColor> result = new HashMap<String,HSSFColor>(eList.size());
+
+ for (Map.Entry<HSSFColorPredefined,HSSFColor> colorRef : eList.entrySet()) {
+ String hexString = colorRef.getKey().getHexString();
+ if (!result.containsKey(hexString)) {
+ result.put(hexString, colorRef.getValue());
}
- result.put(hexString, color);
}
return result;
}
/**
- * returns color standard palette index (0x08)
+ * Maps the Enums to the HSSFColor subclasses, in cases of user code evaluating the classname
+ *
+ * @deprecated in 3.16 - remove mapping when subclasses are removed and access
+ * HSSFColorPredfined.values() directly (but exclude AUTOMATIC)
+ */
+ @Deprecated
+ @Removal(version="3.18")
+ private static synchronized Map<HSSFColorPredefined,HSSFColor> mapEnumToColorClass() {
+ if (enumList == null) {
+ enumList = new EnumMap<HSSFColorPredefined,HSSFColor>(HSSFColorPredefined.class);
+ // AUTOMATIC is not add to list
+ enumList.put(HSSFColorPredefined.BLACK, new BLACK());
+ enumList.put(HSSFColorPredefined.BROWN, new BROWN());
+ enumList.put(HSSFColorPredefined.OLIVE_GREEN, new OLIVE_GREEN());
+ enumList.put(HSSFColorPredefined.DARK_GREEN, new DARK_GREEN());
+ enumList.put(HSSFColorPredefined.DARK_TEAL, new DARK_TEAL());
+ enumList.put(HSSFColorPredefined.DARK_BLUE, new DARK_BLUE());
+ enumList.put(HSSFColorPredefined.INDIGO, new INDIGO());
+ enumList.put(HSSFColorPredefined.GREY_80_PERCENT, new GREY_80_PERCENT());
+ enumList.put(HSSFColorPredefined.ORANGE, new ORANGE());
+ enumList.put(HSSFColorPredefined.DARK_YELLOW, new DARK_YELLOW());
+ enumList.put(HSSFColorPredefined.GREEN, new GREEN());
+ enumList.put(HSSFColorPredefined.TEAL, new TEAL());
+ enumList.put(HSSFColorPredefined.BLUE, new BLUE());
+ enumList.put(HSSFColorPredefined.BLUE_GREY, new BLUE_GREY());
+ enumList.put(HSSFColorPredefined.GREY_50_PERCENT, new GREY_50_PERCENT());
+ enumList.put(HSSFColorPredefined.RED, new RED());
+ enumList.put(HSSFColorPredefined.LIGHT_ORANGE, new LIGHT_ORANGE());
+ enumList.put(HSSFColorPredefined.LIME, new LIME());
+ enumList.put(HSSFColorPredefined.SEA_GREEN, new SEA_GREEN());
+ enumList.put(HSSFColorPredefined.AQUA, new AQUA());
+ enumList.put(HSSFColorPredefined.LIGHT_BLUE, new LIGHT_BLUE());
+ enumList.put(HSSFColorPredefined.VIOLET, new VIOLET());
+ enumList.put(HSSFColorPredefined.GREY_40_PERCENT, new GREY_40_PERCENT());
+ enumList.put(HSSFColorPredefined.PINK, new PINK());
+ enumList.put(HSSFColorPredefined.GOLD, new GOLD());
+ enumList.put(HSSFColorPredefined.YELLOW, new YELLOW());
+ enumList.put(HSSFColorPredefined.BRIGHT_GREEN, new BRIGHT_GREEN());
+ enumList.put(HSSFColorPredefined.TURQUOISE, new TURQUOISE());
+ enumList.put(HSSFColorPredefined.DARK_RED, new DARK_RED());
+ enumList.put(HSSFColorPredefined.SKY_BLUE, new SKY_BLUE());
+ enumList.put(HSSFColorPredefined.PLUM, new PLUM());
+ enumList.put(HSSFColorPredefined.GREY_25_PERCENT, new GREY_25_PERCENT());
+ enumList.put(HSSFColorPredefined.ROSE, new ROSE());
+ enumList.put(HSSFColorPredefined.LIGHT_YELLOW, new LIGHT_YELLOW());
+ enumList.put(HSSFColorPredefined.LIGHT_GREEN, new LIGHT_GREEN());
+ enumList.put(HSSFColorPredefined.LIGHT_TURQUOISE, new LIGHT_TURQUOISE());
+ enumList.put(HSSFColorPredefined.PALE_BLUE, new PALE_BLUE());
+ enumList.put(HSSFColorPredefined.LAVENDER, new LAVENDER());
+ enumList.put(HSSFColorPredefined.WHITE, new WHITE());
+ enumList.put(HSSFColorPredefined.CORNFLOWER_BLUE, new CORNFLOWER_BLUE());
+ enumList.put(HSSFColorPredefined.LEMON_CHIFFON, new LEMON_CHIFFON());
+ enumList.put(HSSFColorPredefined.MAROON, new MAROON());
+ enumList.put(HSSFColorPredefined.ORCHID, new ORCHID());
+ enumList.put(HSSFColorPredefined.CORAL, new CORAL());
+ enumList.put(HSSFColorPredefined.ROYAL_BLUE, new ROYAL_BLUE());
+ enumList.put(HSSFColorPredefined.LIGHT_CORNFLOWER_BLUE, new LIGHT_CORNFLOWER_BLUE());
+ enumList.put(HSSFColorPredefined.TAN, new TAN());
+ }
+ return enumList;
+ }
+
+ /**
+ * returns color standard palette index
* @return index to the standard palette
*/
- public short getIndex()
- {
- // this will be overridden by the specific color subclass
- return BLACK.index;
+ public short getIndex() {
+ return (short)index;
+ }
+
+ /**
+ * returns alternative color standard palette index
+ * @return alternative index to the standard palette, if -1 this index is not defined
+ */
+
+ public short getIndex2() {
+ return (short)index2;
}
/**
* @return triplet representation like that in Excel
*/
- public short [] getTriplet()
- {
- // this will be overridden by the specific color subclass
- return BLACK.triplet;
+ public short [] getTriplet() {
+ return new short[] { (short)color.getRed(), (short)color.getGreen(), (short)color.getBlue() };
}
/**
* @return a hex string exactly like a gnumeric triplet
*/
- public String getHexString()
- {
- // this will be overridden by the specific color subclass
- return BLACK.hexString;
+ public String getHexString() {
+ return (Integer.toHexString(color.getRed()*0x101) + ":" +
+ Integer.toHexString(color.getGreen()*0x101) + ":" +
+ Integer.toHexString(color.getBlue()*0x101)).toUpperCase(Locale.ROOT);
}
-
+
/**
* Checked type cast <tt>color</tt> to an HSSFColor.
*
}
/**
- * Class BLACK
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class BLACK
- extends HSSFColor
- {
- public final static short index = 0x8;
- public final static short[] triplet =
- {
- 0, 0, 0
- };
- public final static String hexString = "0:0:0";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
+ @Deprecated
+ @Removal(version="3.18")
+ private static class HSSFColorRef extends HSSFColor {
+ HSSFColorRef(HSSFColorPredefined colorEnum) {
+ super(colorEnum.getIndex(), colorEnum.getIndex2(), colorEnum.color.color);
}
}
/**
- * Class BROWN
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class BROWN
- extends HSSFColor
- {
- public final static short index = 0x3c;
- public final static short[] triplet =
- {
- 153, 51, 0
- };
- public final static String hexString = "9999:3333:0";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class BLACK extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.BLACK;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public BLACK() { super(ref); }
}
/**
- * Class OLIVE_GREEN
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public static class OLIVE_GREEN
- extends HSSFColor
- {
- public final static short index = 0x3b;
- public final static short[] triplet =
- {
- 51, 51, 0
- };
- public final static String hexString = "3333:3333:0";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class BROWN extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.BROWN;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public BROWN() { super(ref); }
}
/**
- * Class DARK_GREEN
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class DARK_GREEN
- extends HSSFColor
- {
- public final static short index = 0x3a;
- public final static short[] triplet =
- {
- 0, 51, 0
- };
- public final static String hexString = "0:3333:0";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class OLIVE_GREEN extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.OLIVE_GREEN;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public OLIVE_GREEN() { super(ref); }
}
/**
- * Class DARK_TEAL
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class DARK_TEAL
- extends HSSFColor
- {
- public final static short index = 0x38;
- public final static short[] triplet =
- {
- 0, 51, 102
- };
- public final static String hexString = "0:3333:6666";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class DARK_GREEN extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.DARK_GREEN;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public DARK_GREEN() { super(ref); }
}
/**
- * Class DARK_BLUE
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class DARK_BLUE
- extends HSSFColor
- {
- public final static short index = 0x12;
- public final static short index2 = 0x20;
- public final static short[] triplet =
- {
- 0, 0, 128
- };
- public final static String hexString = "0:0:8080";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class DARK_TEAL extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.DARK_TEAL;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public DARK_TEAL() { super(ref); }
}
/**
- * Class INDIGO
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class INDIGO
- extends HSSFColor
- {
- public final static short index = 0x3e;
- public final static short[] triplet =
- {
- 51, 51, 153
- };
- public final static String hexString = "3333:3333:9999";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class DARK_BLUE extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.DARK_BLUE;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public DARK_BLUE() { super(ref); }
}
/**
- * Class GREY_80_PERCENT
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class GREY_80_PERCENT
- extends HSSFColor
- {
- public final static short index = 0x3f;
- public final static short[] triplet =
- {
- 51, 51, 51
- };
- public final static String hexString = "3333:3333:3333";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class INDIGO extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.INDIGO;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public INDIGO() { super(ref); }
}
/**
- * Class DARK_RED
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class DARK_RED
- extends HSSFColor
- {
- public final static short index = 0x10;
- public final static short index2 = 0x25;
- public final static short[] triplet =
- {
- 128, 0, 0
- };
- public final static String hexString = "8080:0:0";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class GREY_80_PERCENT extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.GREY_80_PERCENT;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public GREY_80_PERCENT() { super(ref); }
}
/**
- * Class ORANGE
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class ORANGE
- extends HSSFColor
- {
- public final static short index = 0x35;
- public final static short[] triplet =
- {
- 255, 102, 0
- };
- public final static String hexString = "FFFF:6666:0";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class DARK_RED extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.DARK_RED;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public DARK_RED() { super(ref); }
}
/**
- * Class DARK_YELLOW
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class DARK_YELLOW
- extends HSSFColor
- {
- public final static short index = 0x13;
- public final static short[] triplet =
- {
- 128, 128, 0
- };
- public final static String hexString = "8080:8080:0";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class ORANGE extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.ORANGE;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public ORANGE() { super(ref); }
}
/**
- * Class GREEN
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class GREEN
- extends HSSFColor
- {
- public final static short index = 0x11;
- public final static short[] triplet =
- {
- 0, 128, 0
- };
- public final static String hexString = "0:8080:0";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class DARK_YELLOW extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.DARK_YELLOW;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public DARK_YELLOW() { super(ref); }
}
/**
- * Class TEAL
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class TEAL
- extends HSSFColor
- {
- public final static short index = 0x15;
- public final static short index2 = 0x26;
- public final static short[] triplet =
- {
- 0, 128, 128
- };
- public final static String hexString = "0:8080:8080";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class GREEN extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.GREEN;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public GREEN() { super(ref); }
}
/**
- * Class BLUE
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class BLUE
- extends HSSFColor
- {
- public final static short index = 0xc;
- public final static short index2 = 0x27;
- public final static short[] triplet =
- {
- 0, 0, 255
- };
- public final static String hexString = "0:0:FFFF";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class TEAL extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.TEAL;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public TEAL() { super(ref); }
}
/**
- * Class BLUE_GREY
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class BLUE_GREY
- extends HSSFColor
- {
- public final static short index = 0x36;
- public final static short[] triplet =
- {
- 102, 102, 153
- };
- public final static String hexString = "6666:6666:9999";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class BLUE extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.BLUE;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public BLUE() { super(ref); }
}
/**
- * Class GREY_50_PERCENT
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class GREY_50_PERCENT
- extends HSSFColor
- {
- public final static short index = 0x17;
- public final static short[] triplet =
- {
- 128, 128, 128
- };
- public final static String hexString = "8080:8080:8080";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class BLUE_GREY extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.BLUE_GREY;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public BLUE_GREY() { super(ref); }
}
/**
- * Class RED
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class RED
- extends HSSFColor
- {
- public final static short index = 0xa;
- public final static short[] triplet =
- {
- 255, 0, 0
- };
- public final static String hexString = "FFFF:0:0";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class GREY_50_PERCENT extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.GREY_50_PERCENT;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public GREY_50_PERCENT() { super(ref); }
}
/**
- * Class LIGHT_ORANGE
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class LIGHT_ORANGE
- extends HSSFColor
- {
- public final static short index = 0x34;
- public final static short[] triplet =
- {
- 255, 153, 0
- };
- public final static String hexString = "FFFF:9999:0";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class RED extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.RED;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public RED() { super(ref); }
}
/**
- * Class LIME
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class LIME
- extends HSSFColor
- {
- public final static short index = 0x32;
- public final static short[] triplet =
- {
- 153, 204, 0
- };
- public final static String hexString = "9999:CCCC:0";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class LIGHT_ORANGE extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.LIGHT_ORANGE;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public LIGHT_ORANGE() { super(ref); }
}
/**
- * Class SEA_GREEN
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class SEA_GREEN
- extends HSSFColor
- {
- public final static short index = 0x39;
- public final static short[] triplet =
- {
- 51, 153, 102
- };
- public final static String hexString = "3333:9999:6666";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class LIME extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.LIME;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public LIME() { super(ref); }
}
/**
- * Class AQUA
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class AQUA
- extends HSSFColor
- {
- public final static short index = 0x31;
- public final static short[] triplet =
- {
- 51, 204, 204
- };
- public final static String hexString = "3333:CCCC:CCCC";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class SEA_GREEN extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.SEA_GREEN;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public SEA_GREEN() { super(ref); }
}
/**
- * Class LIGHT_BLUE
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class LIGHT_BLUE
- extends HSSFColor
- {
- public final static short index = 0x30;
- public final static short[] triplet =
- {
- 51, 102, 255
- };
- public final static String hexString = "3333:6666:FFFF";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class AQUA extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.AQUA;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public AQUA() { super(ref); }
}
/**
- * Class VIOLET
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class VIOLET
- extends HSSFColor
- {
- public final static short index = 0x14;
- public final static short index2 = 0x24;
- public final static short[] triplet =
- {
- 128, 0, 128
- };
- public final static String hexString = "8080:0:8080";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class LIGHT_BLUE extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.LIGHT_BLUE;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public LIGHT_BLUE() { super(ref); }
}
/**
- * Class GREY_40_PERCENT
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class GREY_40_PERCENT
- extends HSSFColor
- {
- public final static short index = 0x37;
- public final static short[] triplet =
- {
- 150, 150, 150
- };
- public final static String hexString = "9696:9696:9696";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class VIOLET extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.VIOLET;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public VIOLET() { super(ref); }
}
/**
- * Class PINK
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class PINK
- extends HSSFColor
- {
- public final static short index = 0xe;
- public final static short index2 = 0x21;
- public final static short[] triplet =
- {
- 255, 0, 255
- };
- public final static String hexString = "FFFF:0:FFFF";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class GREY_40_PERCENT extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.GREY_40_PERCENT;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public GREY_40_PERCENT() { super(ref); }
}
/**
- * Class GOLD
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class GOLD
- extends HSSFColor
- {
- public final static short index = 0x33;
- public final static short[] triplet =
- {
- 255, 204, 0
- };
- public final static String hexString = "FFFF:CCCC:0";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class PINK extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.PINK;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public PINK() { super(ref); }
}
/**
- * Class YELLOW
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class YELLOW
- extends HSSFColor
- {
- public final static short index = 0xd;
- public final static short index2 = 0x22;
- public final static short[] triplet =
- {
- 255, 255, 0
- };
- public final static String hexString = "FFFF:FFFF:0";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class GOLD extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.GOLD;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public GOLD() { super(ref); }
}
/**
- * Class BRIGHT_GREEN
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class BRIGHT_GREEN
- extends HSSFColor
- {
- public final static short index = 0xb;
- public final static short index2 = 0x23;
- public final static short[] triplet =
- {
- 0, 255, 0
- };
- public final static String hexString = "0:FFFF:0";
-
- public short getIndex()
- {
- return index;
- }
-
- public String getHexString()
- {
- return hexString;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class YELLOW extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.YELLOW;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public YELLOW() { super(ref); }
}
/**
- * Class TURQUOISE
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class TURQUOISE
- extends HSSFColor
- {
- public final static short index = 0xf;
- public final static short index2 = 0x23;
- public final static short[] triplet =
- {
- 0, 255, 255
- };
- public final static String hexString = "0:FFFF:FFFF";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class BRIGHT_GREEN extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.BRIGHT_GREEN;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public BRIGHT_GREEN() { super(ref); }
}
/**
- * Class SKY_BLUE
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class SKY_BLUE
- extends HSSFColor
- {
- public final static short index = 0x28;
- public final static short[] triplet =
- {
- 0, 204, 255
- };
- public final static String hexString = "0:CCCC:FFFF";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class TURQUOISE extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.TURQUOISE;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public TURQUOISE() { super(ref); }
}
/**
- * Class PLUM
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class PLUM
- extends HSSFColor
- {
- public final static short index = 0x3d;
- public final static short index2 = 0x19;
- public final static short[] triplet =
- {
- 153, 51, 102
- };
- public final static String hexString = "9999:3333:6666";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class SKY_BLUE extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.SKY_BLUE;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public SKY_BLUE() { super(ref); }
}
/**
- * Class GREY_25_PERCENT
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class GREY_25_PERCENT
- extends HSSFColor
- {
- public final static short index = 0x16;
- public final static short[] triplet =
- {
- 192, 192, 192
- };
- public final static String hexString = "C0C0:C0C0:C0C0";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class PLUM extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.PLUM;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public PLUM() { super(ref); }
}
/**
- * Class ROSE
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class ROSE
- extends HSSFColor
- {
- public final static short index = 0x2d;
- public final static short[] triplet =
- {
- 255, 153, 204
- };
- public final static String hexString = "FFFF:9999:CCCC";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class GREY_25_PERCENT extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.GREY_25_PERCENT;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public GREY_25_PERCENT() { super(ref); }
}
/**
- * Class TAN
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class TAN
- extends HSSFColor
- {
- public final static short index = 0x2f;
- public final static short[] triplet =
- {
- 255, 204, 153
- };
- public final static String hexString = "FFFF:CCCC:9999";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class ROSE extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.ROSE;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public ROSE() { super(ref); }
}
/**
- * Class LIGHT_YELLOW
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class LIGHT_YELLOW
- extends HSSFColor
- {
- public final static short index = 0x2b;
- public final static short[] triplet =
- {
- 255, 255, 153
- };
- public final static String hexString = "FFFF:FFFF:9999";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class TAN extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.TAN;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public TAN() { super(ref); }
}
/**
- * Class LIGHT_GREEN
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class LIGHT_GREEN
- extends HSSFColor
- {
- public final static short index = 0x2a;
- public final static short[] triplet =
- {
- 204, 255, 204
- };
- public final static String hexString = "CCCC:FFFF:CCCC";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class LIGHT_YELLOW extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.LIGHT_YELLOW;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public LIGHT_YELLOW() { super(ref); }
}
/**
- * Class LIGHT_TURQUOISE
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class LIGHT_TURQUOISE
- extends HSSFColor
- {
- public final static short index = 0x29;
- public final static short index2 = 0x1b;
- public final static short[] triplet =
- {
- 204, 255, 255
- };
- public final static String hexString = "CCCC:FFFF:FFFF";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class LIGHT_GREEN extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.LIGHT_GREEN;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public LIGHT_GREEN() { super(ref); }
}
/**
- * Class PALE_BLUE
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class PALE_BLUE
- extends HSSFColor
- {
- public final static short index = 0x2c;
- public final static short[] triplet =
- {
- 153, 204, 255
- };
- public final static String hexString = "9999:CCCC:FFFF";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class LIGHT_TURQUOISE extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.LIGHT_TURQUOISE;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public LIGHT_TURQUOISE() { super(ref); }
}
/**
- * Class LAVENDER
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class LAVENDER
- extends HSSFColor
- {
- public final static short index = 0x2e;
- public final static short[] triplet =
- {
- 204, 153, 255
- };
- public final static String hexString = "CCCC:9999:FFFF";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class PALE_BLUE extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.PALE_BLUE;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public PALE_BLUE() { super(ref); }
}
/**
- * Class WHITE
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
-
- public final static class WHITE
- extends HSSFColor
- {
- public final static short index = 0x9;
- public final static short[] triplet =
- {
- 255, 255, 255
- };
- public final static String hexString = "FFFF:FFFF:FFFF";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class LAVENDER extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.LAVENDER;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public LAVENDER() { super(ref); }
}
/**
- * Class CORNFLOWER_BLUE
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
- public final static class CORNFLOWER_BLUE
- extends HSSFColor
- {
- public final static short index = 0x18;
- public final static short[] triplet =
- {
- 153, 153, 255
- };
- public final static String hexString = "9999:9999:FFFF";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class WHITE extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.WHITE;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public WHITE() { super(ref); }
}
-
/**
- * Class LEMON_CHIFFON
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
- public final static class LEMON_CHIFFON
- extends HSSFColor
- {
- public final static short index = 0x1a;
- public final static short[] triplet =
- {
- 255, 255, 204
- };
- public final static String hexString = "FFFF:FFFF:CCCC";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class CORNFLOWER_BLUE extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.CORNFLOWER_BLUE;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public CORNFLOWER_BLUE() { super(ref); }
}
/**
- * Class MAROON
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
- public final static class MAROON
- extends HSSFColor
- {
- public final static short index = 0x19;
- public final static short[] triplet =
- {
- 127, 0, 0
- };
- public final static String hexString = "8000:0:0";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class LEMON_CHIFFON extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.LEMON_CHIFFON;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public LEMON_CHIFFON() { super(ref); }
}
/**
- * Class ORCHID
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
- public final static class ORCHID
- extends HSSFColor
- {
- public final static short index = 0x1c;
- public final static short[] triplet =
- {
- 102, 0, 102
- };
- public final static String hexString = "6666:0:6666";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class MAROON extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.MAROON;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public MAROON() { super(ref); }
}
/**
- * Class CORAL
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
- public final static class CORAL
- extends HSSFColor
- {
- public final static short index = 0x1d;
- public final static short[] triplet =
- {
- 255, 128, 128
- };
- public final static String hexString = "FFFF:8080:8080";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class ORCHID extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.ORCHID;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public ORCHID() { super(ref); }
}
/**
- * Class ROYAL_BLUE
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
- public final static class ROYAL_BLUE
- extends HSSFColor
- {
- public final static short index = 0x1e;
- public final static short[] triplet =
- {
- 0, 102, 204
- };
- public final static String hexString = "0:6666:CCCC";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class CORAL extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.CORAL;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public CORAL() { super(ref); }
}
/**
- * Class LIGHT_CORNFLOWER_BLUE
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
- public final static class LIGHT_CORNFLOWER_BLUE
- extends HSSFColor
- {
- public final static short index = 0x1f;
- public final static short[] triplet =
- {
- 204, 204, 255
- };
- public final static String hexString = "CCCC:CCCC:FFFF";
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return triplet;
- }
-
- public String getHexString()
- {
- return hexString;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class ROYAL_BLUE extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.ROYAL_BLUE;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public ROYAL_BLUE() { super(ref); }
}
/**
- * Special Default/Normal/Automatic color.
- * <p><i>Note:</i> This class is NOT in the default Map returned by HSSFColor.
- * The index is a special case which is interpreted in the various setXXXColor calls.
- *
- * @author Jason
- *
+ * @deprecated use {@link HSSFColorPredefined} instead
*/
- public final static class AUTOMATIC extends HSSFColor
- {
- private static HSSFColor instance = new AUTOMATIC();
-
- public final static short index = 0x40;
-
- public short getIndex()
- {
- return index;
- }
-
- public short [] getTriplet()
- {
- return BLACK.triplet;
- }
+ @Deprecated
+ @Removal(version="3.18")
+ public static class LIGHT_CORNFLOWER_BLUE extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.LIGHT_CORNFLOWER_BLUE;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public LIGHT_CORNFLOWER_BLUE() { super(ref); }
+ }
- public String getHexString()
- {
- return BLACK.hexString;
- }
+ /**
+ * @deprecated use {@link HSSFColorPredefined} instead
+ */
+ @Deprecated
+ @Removal(version="3.18")
+ public static class AUTOMATIC extends HSSFColorRef {
+ private static final HSSFColorPredefined ref = HSSFColorPredefined.AUTOMATIC;
+ public static final short index = ref.getIndex();
+ public static final int index2 = ref.getIndex2();
+ public static final short[] triplet = ref.getTriplet();
+ public static final String hexString = ref.getHexString();
+ public AUTOMATIC() { super(ref); }
public static HSSFColor getInstance() {
- return instance;
+ return ref.color;
}
}
}