More CF Icon descriptions and interfaces #58130

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1691101 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2015-07-14 22:43:22 +00:00
parent 5fbb76585c
commit 38531825e4

View File

@ -25,42 +25,74 @@ package org.apache.poi.ss.usermodel;
*/ */
public interface IconMultiStateFormatting { public interface IconMultiStateFormatting {
class IconSet { class IconSet {
/** Numeric ID of the icon set */
public final int id; public final int id;
/** How many icons in the set */
public final int num;
/** Name (system) of the set */
public final String name; public final String name;
public String toString() { public String toString() {
return id + " - " + (name==null?"default":name); return id + " - " + (name==null?"default":name);
} }
private IconSet(int id, String name) { private IconSet(int id, int num, String name) {
this.id = id; this.name = name; this.id = id; this.num = num; this.name = name;
} }
} }
/** Green Up / Yellow Side / Red Down arrows */ /** Green Up / Yellow Side / Red Down arrows */
static final IconSet GYR_3_ARROWS = new IconSet(0, "3Arrows"); static final IconSet GYR_3_ARROWS = new IconSet(0, 3, "3Arrows");
/** Grey Up / Side / Down arrows */ /** Grey Up / Side / Down arrows */
static final IconSet GREY_3_ARROWS = new IconSet(1, "3ArrowsGray"); static final IconSet GREY_3_ARROWS = new IconSet(1, 3, "3ArrowsGray");
/** Green / Yellow / Red flags */ /** Green / Yellow / Red flags */
static final IconSet GYR_3_FLAGS = new IconSet(2, "3Flags"); static final IconSet GYR_3_FLAGS = new IconSet(2, 3, "3Flags");
/** Green / Yellow / Red traffic lights (no background) */ /** Green / Yellow / Red traffic lights (no background) */
static final IconSet GYR_3_TRAFFIC_LIGHTS = new IconSet(3, null); static final IconSet GYR_3_TRAFFIC_LIGHTS = new IconSet(3, 3, null);
/** Green Circle / Yellow Triangle / Red Diamond */ /** Green Circle / Yellow Triangle / Red Diamond */
static final IconSet GYR_3_SHAPES = new IconSet(4, "3Signs"); static final IconSet GYR_3_SHAPES = new IconSet(4, 3, "3Signs");
/** Green / Yellow / Red traffic lights on a black square background */ /** Green / Yellow / Red traffic lights on a black square background */
static final IconSet GYR_3_TRAFFIC_LIGHTS_BOX = new IconSet(5, "3TrafficLights2"); static final IconSet GYR_3_TRAFFIC_LIGHTS_BOX = new IconSet(5, 3, "3TrafficLights2");
/** Green Tick / Yellow ! / Red Cross on a circle background */ /** Green Tick / Yellow ! / Red Cross on a circle background */
static final IconSet GYR_3_SYMBOLS_CIRCLE = new IconSet(6, "3Symbols"); static final IconSet GYR_3_SYMBOLS_CIRCLE = new IconSet(6, 3, "3Symbols");
/** Green Tick / Yellow ! / Red Cross (no background) */ /** Green Tick / Yellow ! / Red Cross (no background) */
static final IconSet GYR_3_SYMBOLS = new IconSet(7, "3Symbols2"); static final IconSet GYR_3_SYMBOLS = new IconSet(7, 3, "3Symbols2");
/** Green Up / Yellow NE / Yellow SE / Red Down arrows */ /** Green Up / Yellow NE / Yellow SE / Red Down arrows */
static final IconSet GYR_4_ARROWS = new IconSet(8, "4Arrows"); static final IconSet GYR_4_ARROWS = new IconSet(8, 4, "4Arrows");
/** Grey Up / NE / SE / Down arrows */ /** Grey Up / NE / SE / Down arrows */
static final IconSet GREY_4_ARROWS = new IconSet(9, "4ArrowsGray"); static final IconSet GREY_4_ARROWS = new IconSet(9, 4, "4ArrowsGray");
/** Red / Light Red / Grey / Black traffic lights */ /** Red / Light Red / Grey / Black traffic lights */
static final IconSet RB_4_TRAFFIC_LIGHTS = new IconSet(0xA, "4RedToBlack"); static final IconSet RB_4_TRAFFIC_LIGHTS = new IconSet(0xA, 4, "4RedToBlack");
static final IconSet RATINGS_4 = new IconSet(0xB, "4Rating"); static final IconSet RATINGS_4 = new IconSet(0xB, 4, "4Rating");
/** Green / Yellow / Red / Black traffic lights */ /** Green / Yellow / Red / Black traffic lights */
static final IconSet GYRB_4_TRAFFIC_LIGHTS = new IconSet(0xC, "4TrafficLights"); static final IconSet GYRB_4_TRAFFIC_LIGHTS = new IconSet(0xC, 4, "4TrafficLights");
static final IconSet GYYYR_5_ARROWS = new IconSet(0xD, "5Arrows"); static final IconSet GYYYR_5_ARROWS = new IconSet(0xD, 5, "5Arrows");
static final IconSet GREY_5_ARROWS = new IconSet(0xE, "5ArrowsGray"); static final IconSet GREY_5_ARROWS = new IconSet(0xE, 5, "5ArrowsGray");
static final IconSet RATINGS_5 = new IconSet(0xF, "5Rating"); static final IconSet RATINGS_5 = new IconSet(0xF, 5, "5Rating");
static final IconSet QUARTERS_5 = new IconSet(0x10, "5Quarters"); static final IconSet QUARTERS_5 = new IconSet(0x10, 5, "5Quarters");
/**
* Get the Icon Set used
*/
IconSet getIconSet();
/**
* Changes the Icon Set used
*
* <p>If the new Icon Set has a different number of
* icons to the old one, you <em>must</em> update the
* thresholds before saving!</p>
*/
void setIconSet(IconSet set);
/**
* Should Icon + Value be displayed, or only the Icon?
*/
boolean isIconOnly();
/**
* Control if only the Icon is shown, or Icon + Value
*/
void setIconOnly(boolean only);
boolean isReversed();
void setReversed();
// TODO States
} }