org.apache.poi.hssf.util
Class HSSFColor
- java.lang.Object
-
- org.apache.poi.hssf.util.HSSFColor
-
- All Implemented Interfaces:
- Color
- Direct Known Subclasses:
- HSSFColor.AQUA, HSSFColor.AUTOMATIC, HSSFColor.BLACK, HSSFColor.BLUE, HSSFColor.BLUE_GREY, HSSFColor.BRIGHT_GREEN, HSSFColor.BROWN, HSSFColor.CORAL, HSSFColor.CORNFLOWER_BLUE, HSSFColor.DARK_BLUE, HSSFColor.DARK_GREEN, HSSFColor.DARK_RED, HSSFColor.DARK_TEAL, HSSFColor.DARK_YELLOW, HSSFColor.GOLD, HSSFColor.GREEN, HSSFColor.GREY_25_PERCENT, HSSFColor.GREY_40_PERCENT, HSSFColor.GREY_50_PERCENT, HSSFColor.GREY_80_PERCENT, HSSFColor.INDIGO, HSSFColor.LAVENDER, HSSFColor.LEMON_CHIFFON, HSSFColor.LIGHT_BLUE, HSSFColor.LIGHT_CORNFLOWER_BLUE, HSSFColor.LIGHT_GREEN, HSSFColor.LIGHT_ORANGE, HSSFColor.LIGHT_TURQUOISE, HSSFColor.LIGHT_YELLOW, HSSFColor.LIME, HSSFColor.MAROON, HSSFColor.OLIVE_GREEN, HSSFColor.ORANGE, HSSFColor.ORCHID, HSSFColor.PALE_BLUE, HSSFColor.PINK, HSSFColor.PLUM, HSSFColor.RED, HSSFColor.ROSE, HSSFColor.ROYAL_BLUE, HSSFColor.SEA_GREEN, HSSFColor.SKY_BLUE, HSSFColor.TAN, HSSFColor.TEAL, HSSFColor.TURQUOISE, HSSFColor.VIOLET, HSSFColor.WHITE, HSSFColor.YELLOW
public class HSSFColor extends java.lang.Object implements Color
Intends to provide support for the very evil index to triplet issue and will likely replace the color constants interface for HSSF 2.0. This class contains static inner class members for representing colors. 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 a reasonable one in this case.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classHSSFColor.AQUAClass AQUAstatic classHSSFColor.AUTOMATICSpecial Default/Normal/Automatic color.static classHSSFColor.BLACKClass BLACKstatic classHSSFColor.BLUEClass BLUEstatic classHSSFColor.BLUE_GREYClass BLUE_GREYstatic classHSSFColor.BRIGHT_GREENClass BRIGHT_GREENstatic classHSSFColor.BROWNClass BROWNstatic classHSSFColor.CORALClass CORALstatic classHSSFColor.CORNFLOWER_BLUEClass CORNFLOWER_BLUEstatic classHSSFColor.DARK_BLUEClass DARK_BLUEstatic classHSSFColor.DARK_GREENClass DARK_GREENstatic classHSSFColor.DARK_REDClass DARK_REDstatic classHSSFColor.DARK_TEALClass DARK_TEALstatic classHSSFColor.DARK_YELLOWClass DARK_YELLOWstatic classHSSFColor.GOLDClass GOLDstatic classHSSFColor.GREENClass GREENstatic classHSSFColor.GREY_25_PERCENTClass GREY_25_PERCENTstatic classHSSFColor.GREY_40_PERCENTClass GREY_40_PERCENTstatic classHSSFColor.GREY_50_PERCENTClass GREY_50_PERCENTstatic classHSSFColor.GREY_80_PERCENTClass GREY_80_PERCENTstatic classHSSFColor.INDIGOClass INDIGOstatic classHSSFColor.LAVENDERClass LAVENDERstatic classHSSFColor.LEMON_CHIFFONClass LEMON_CHIFFONstatic classHSSFColor.LIGHT_BLUEClass LIGHT_BLUEstatic classHSSFColor.LIGHT_CORNFLOWER_BLUEClass LIGHT_CORNFLOWER_BLUEstatic classHSSFColor.LIGHT_GREENClass LIGHT_GREENstatic classHSSFColor.LIGHT_ORANGEClass LIGHT_ORANGEstatic classHSSFColor.LIGHT_TURQUOISEClass LIGHT_TURQUOISEstatic classHSSFColor.LIGHT_YELLOWClass LIGHT_YELLOWstatic classHSSFColor.LIMEClass LIMEstatic classHSSFColor.MAROONClass MAROONstatic classHSSFColor.OLIVE_GREENClass OLIVE_GREENstatic classHSSFColor.ORANGEClass ORANGEstatic classHSSFColor.ORCHIDClass ORCHIDstatic classHSSFColor.PALE_BLUEClass PALE_BLUEstatic classHSSFColor.PINKClass PINKstatic classHSSFColor.PLUMClass PLUMstatic classHSSFColor.REDClass REDstatic classHSSFColor.ROSEClass ROSEstatic classHSSFColor.ROYAL_BLUEClass ROYAL_BLUEstatic classHSSFColor.SEA_GREENClass SEA_GREENstatic classHSSFColor.SKY_BLUEClass SKY_BLUEstatic classHSSFColor.TANClass TANstatic classHSSFColor.TEALClass TEALstatic classHSSFColor.TURQUOISEClass TURQUOISEstatic classHSSFColor.VIOLETClass VIOLETstatic classHSSFColor.WHITEClass WHITEstatic classHSSFColor.YELLOWClass YELLOW
-
Constructor Summary
Constructors Constructor and Description HSSFColor()Creates a new instance of HSSFColor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetHexString()shortgetIndex()static java.util.Map<java.lang.Integer,HSSFColor>getIndexHash()This function returns all the colours in an unmodifiable Map.static java.util.Hashtable<java.lang.Integer,HSSFColor>getMutableIndexHash()This function returns all the Colours, stored in a Hashtable that can be edited.short[]getTriplet()static java.util.Hashtable<java.lang.String,HSSFColor>getTripletHash()this function returns all colors in a hastable.
-
-
-
Method Detail
-
getIndexHash
public static final java.util.Map<java.lang.Integer,HSSFColor> getIndexHash()
This function returns all the colours in an unmodifiable Map. The map is cached on first use.- Returns:
- a Map containing all colours keyed by Integer excel-style palette indexes
-
getMutableIndexHash
public static final java.util.Hashtable<java.lang.Integer,HSSFColor> getMutableIndexHash()
This function returns all the Colours, stored in a Hashtable that can be edited. No caching is performed. If you don't need to edit the table, then callgetIndexHash()which returns a statically cached imuatable map of colours.
-
getTripletHash
public static final java.util.Hashtable<java.lang.String,HSSFColor> getTripletHash()
this function returns all colors in a hastable. Its not implemented as a static member/staticly 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.- Returns:
- a hashtable containing all colors keyed by String gnumeric-like triplets
-
getIndex
public short getIndex()
- Returns:
- index to the standard palette
-
getTriplet
public short[] getTriplet()
- Returns:
- triplet representation like that in Excel
-
getHexString
public java.lang.String getHexString()
- Returns:
- a hex string exactly like a gnumeric triplet
-
-
DataMelt 3.0 © DataMelt by jWork.ORG