]> source.dussan.org Git - poi.git/commitdiff
More CF Icon descriptions and interfaces #58130
authorNick Burch <nick@apache.org>
Tue, 14 Jul 2015 22:43:22 +0000 (22:43 +0000)
committerNick Burch <nick@apache.org>
Tue, 14 Jul 2015 22:43:22 +0000 (22:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1691101 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/ss/usermodel/IconMultiStateFormatting.java

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