remove deprecated inner classes from HSFColor

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808432 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2017-09-15 08:29:31 +00:00
parent 19d58f3657
commit 7863d0b312
2 changed files with 82 additions and 747 deletions

View File

@ -179,7 +179,7 @@ public class HSSFColor implements Color {
* This function returns all the Colours, stored in a Map that
* can be edited. No caching is performed. If you don't need to edit
* the table, then call {@link #getIndexHash()} which returns a
* statically cached imuatable map of colours.
* statically cached immutable map of colours.
*/
public static final Map<Integer,HSSFColor> getMutableIndexHash() {
return createColorsByIndexMap();
@ -203,8 +203,8 @@ public class HSSFColor implements Color {
}
/**
* this function returns all colors in a hastable. Its not implemented as a
* static member/staticly initialized because that would be dirty in a
* this function returns all colors in a hastable. It's not implemented as a
* static member/statically initialized because that would be dirty in a
* server environment as it is intended. This means you'll eat the time
* it takes to create it once per request but you will not hold onto it
* if you have none of those requests.
@ -230,10 +230,10 @@ public class HSSFColor implements Color {
}
/**
* Maps the Enums to the HSSFColor subclasses, in cases of user code evaluating the classname
* Maps the Enums to the HSSFColor, 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)
* HSSFColorPredefined.values() directly (but exclude AUTOMATIC)
*/
@Deprecated
@Removal(version="3.18")
@ -241,57 +241,61 @@ public class HSSFColor implements Color {
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());
addHSSFColorPredefined(HSSFColorPredefined.BLACK);
addHSSFColorPredefined(HSSFColorPredefined.BROWN);
addHSSFColorPredefined(HSSFColorPredefined.OLIVE_GREEN);
addHSSFColorPredefined(HSSFColorPredefined.DARK_GREEN);
addHSSFColorPredefined(HSSFColorPredefined.DARK_TEAL);
addHSSFColorPredefined(HSSFColorPredefined.DARK_BLUE);
addHSSFColorPredefined(HSSFColorPredefined.INDIGO);
addHSSFColorPredefined(HSSFColorPredefined.GREY_80_PERCENT);
addHSSFColorPredefined(HSSFColorPredefined.ORANGE);
addHSSFColorPredefined(HSSFColorPredefined.DARK_YELLOW);
addHSSFColorPredefined(HSSFColorPredefined.GREEN);
addHSSFColorPredefined(HSSFColorPredefined.TEAL);
addHSSFColorPredefined(HSSFColorPredefined.BLUE);
addHSSFColorPredefined(HSSFColorPredefined.BLUE_GREY);
addHSSFColorPredefined(HSSFColorPredefined.GREY_50_PERCENT);
addHSSFColorPredefined(HSSFColorPredefined.RED);
addHSSFColorPredefined(HSSFColorPredefined.LIGHT_ORANGE);
addHSSFColorPredefined(HSSFColorPredefined.LIME);
addHSSFColorPredefined(HSSFColorPredefined.SEA_GREEN);
addHSSFColorPredefined(HSSFColorPredefined.AQUA);
addHSSFColorPredefined(HSSFColorPredefined.LIGHT_BLUE);
addHSSFColorPredefined(HSSFColorPredefined.VIOLET);
addHSSFColorPredefined(HSSFColorPredefined.GREY_40_PERCENT);
addHSSFColorPredefined(HSSFColorPredefined.PINK);
addHSSFColorPredefined(HSSFColorPredefined.GOLD);
addHSSFColorPredefined(HSSFColorPredefined.YELLOW);
addHSSFColorPredefined(HSSFColorPredefined.BRIGHT_GREEN);
addHSSFColorPredefined(HSSFColorPredefined.TURQUOISE);
addHSSFColorPredefined(HSSFColorPredefined.DARK_RED);
addHSSFColorPredefined(HSSFColorPredefined.SKY_BLUE);
addHSSFColorPredefined(HSSFColorPredefined.PLUM);
addHSSFColorPredefined(HSSFColorPredefined.GREY_25_PERCENT);
addHSSFColorPredefined(HSSFColorPredefined.ROSE);
addHSSFColorPredefined(HSSFColorPredefined.LIGHT_YELLOW);
addHSSFColorPredefined(HSSFColorPredefined.LIGHT_GREEN);
addHSSFColorPredefined(HSSFColorPredefined.LIGHT_TURQUOISE);
addHSSFColorPredefined(HSSFColorPredefined.PALE_BLUE);
addHSSFColorPredefined(HSSFColorPredefined.LAVENDER);
addHSSFColorPredefined(HSSFColorPredefined.WHITE);
addHSSFColorPredefined(HSSFColorPredefined.CORNFLOWER_BLUE);
addHSSFColorPredefined(HSSFColorPredefined.LEMON_CHIFFON);
addHSSFColorPredefined(HSSFColorPredefined.MAROON);
addHSSFColorPredefined(HSSFColorPredefined.ORCHID);
addHSSFColorPredefined(HSSFColorPredefined.CORAL);
addHSSFColorPredefined(HSSFColorPredefined.ROYAL_BLUE);
addHSSFColorPredefined(HSSFColorPredefined.LIGHT_CORNFLOWER_BLUE);
addHSSFColorPredefined(HSSFColorPredefined.TAN);
}
return enumList;
}
private static void addHSSFColorPredefined(HSSFColorPredefined color) {
enumList.put(color, color.getColor());
}
/**
* returns color standard palette index
* @return index to the standard palette
@ -330,6 +334,26 @@ public class HSSFColor implements Color {
Integer.toHexString(color.getBlue()*0x101)).toUpperCase(Locale.ROOT);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
HSSFColor hssfColor = (HSSFColor) o;
if (index != hssfColor.index) return false;
if (index2 != hssfColor.index2) return false;
return color != null ? color.equals(hssfColor.color) : hssfColor.color == null;
}
@Override
public int hashCode() {
int result = color != null ? color.hashCode() : 0;
result = 31 * result + index;
result = 31 * result + index2;
return result;
}
/**
* Checked type cast <tt>color</tt> to an HSSFColor.
*
@ -346,691 +370,4 @@ public class HSSFColor implements Color {
}
return (HSSFColor)color;
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@Deprecated
@Removal(version="3.18")
private static class HSSFColorRef extends HSSFColor {
HSSFColorRef(HSSFColorPredefined colorEnum) {
super(colorEnum.getIndex(), colorEnum.getIndex2(), colorEnum.color.color);
}
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @deprecated use {@link HSSFColorPredefined} instead
*/
@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); }
}
/**
* @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 ref.color;
}
}
}

View File

@ -18,7 +18,6 @@
package org.apache.poi.hssf.util;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.Map;
@ -29,7 +28,6 @@ import org.junit.Test;
public final class TestHSSFColor {
@Test
public void testBasics() {
assertNotNull(HSSFColor.YELLOW.class);
assertTrue(HSSFColorPredefined.YELLOW.getIndex() > 0);
assertTrue(HSSFColorPredefined.YELLOW.getIndex2() > 0);
}
@ -46,16 +44,16 @@ public final class TestHSSFColor {
}
@Test
public void testTrippletHash() {
Map<String, HSSFColor> tripplets = HSSFColor.getTripletHash();
public void testTripletHash() {
Map<String, HSSFColor> triplets = HSSFColor.getTripletHash();
assertEquals(
HSSFColor.MAROON.class,
tripplets.get(HSSFColorPredefined.MAROON.getHexString()).getClass()
HSSFColorPredefined.MAROON.getColor(),
triplets.get(HSSFColorPredefined.MAROON.getHexString())
);
assertEquals(
HSSFColor.YELLOW.class,
tripplets.get(HSSFColorPredefined.YELLOW.getHexString()).getClass()
HSSFColorPredefined.YELLOW.getColor(),
triplets.get(HSSFColorPredefined.YELLOW.getHexString())
);
}
}