aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/java/org/apache/poi/xssf/util
diff options
context:
space:
mode:
authorYegor Kozlov <yegor@apache.org>2008-09-11 15:11:57 +0000
committerYegor Kozlov <yegor@apache.org>2008-09-11 15:11:57 +0000
commit6d1b247b69deebf1c5eee0d98ab6ffa99a460830 (patch)
tree5cb52099407f9ca2a3f5e631702ca22afde7dfd3 /src/ooxml/java/org/apache/poi/xssf/util
parent5aae8b64f2d4c772e96f80bb629217a73bc47e8c (diff)
downloadpoi-6d1b247b69deebf1c5eee0d98ab6ffa99a460830.tar.gz
poi-6d1b247b69deebf1c5eee0d98ab6ffa99a460830.zip
more ooxml progress from SourseSense developers
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@694288 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi/xssf/util')
-rwxr-xr-xsrc/ooxml/java/org/apache/poi/xssf/util/CTFontWrapper.java176
-rwxr-xr-xsrc/ooxml/java/org/apache/poi/xssf/util/Charset.java27
-rwxr-xr-xsrc/ooxml/java/org/apache/poi/xssf/util/IndexedColors.java16
3 files changed, 219 insertions, 0 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/util/CTFontWrapper.java b/src/ooxml/java/org/apache/poi/xssf/util/CTFontWrapper.java
new file mode 100755
index 0000000000..c772a7566e
--- /dev/null
+++ b/src/ooxml/java/org/apache/poi/xssf/util/CTFontWrapper.java
@@ -0,0 +1,176 @@
+package org.apache.poi.xssf.util;
+
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBooleanProperty;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontName;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontScheme;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontSize;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTIntProperty;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTUnderlineProperty;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTVerticalAlignFontProperty;
+
+/*
+ * The font element in xml is definited like <choice maxOccurs="unbounded">.
+ * So in the java object CTFont all methods get and set returns an array of elements also if there is always defined
+ * only one type of attribute per type.
+ * This class is made to make simple using method get and set instead of getArray() or set(index,object).
+ * We consider always the index 0 like the only one index to refer of CT_Font attribute.
+ *
+ */
+
+
+public class CTFontWrapper{
+
+ private CTFont font;
+
+
+ public CTFontWrapper(CTFont font){
+ this.font=font;
+ }
+
+ public CTFont getCTFont(){
+ return font;
+ }
+
+
+ public CTBooleanProperty getB(){
+ if( font.getBArray().length>0)
+ return font.getBArray(0);
+ else
+ return null;
+ }
+
+
+ public CTIntProperty getCharset(){
+ if(font.getCharsetArray().length>0)
+ return font.getCharsetArray(0);
+ else
+ return null;
+ }
+
+ public CTColor getColor(){
+ if(font.getColorArray().length>0)
+ return font.getColorArray(0);
+ else
+ return null;
+ }
+
+ public CTBooleanProperty getStrike(){
+ if(font.getStrikeArray().length>0)
+ return font.getStrikeArray(0);
+ else
+ return null;
+ }
+
+ public CTVerticalAlignFontProperty getVertAlign() {
+ if(font.getVertAlignArray().length>0)
+ return font.getVertAlignArray(0);
+ else
+ return null;
+ }
+
+ public CTFontName setName(){
+ if(font.getNameArray().length>0)
+ return font.getNameArray(0);
+ else
+ return null;
+ }
+
+ public CTFontSize getSz(){
+ if(font.getSzArray().length>0)
+ return font.getSzArray(0);
+ else
+ return null;
+ }
+
+ public CTBooleanProperty getI(){
+ if(font.getIArray().length>0)
+ return font.getIArray(0);
+ else
+ return null;
+ }
+
+
+
+ public CTUnderlineProperty getU(){
+ if(font.getUArray().length>0)
+ return font.getUArray(0);
+ else
+ return null;
+ }
+
+ public void setB(CTBooleanProperty value){
+ font.setBArray(0,value);
+ }
+
+ public void setCharset(CTIntProperty value){
+ font.setCharsetArray(0, value);
+ }
+
+ public void setColor(CTColor value){
+ font.setColorArray(0,value);
+ }
+
+ public void setFontName(CTFontName value){
+ font.setNameArray(0,value);
+ }
+
+ public void setSz(CTFontSize value){
+ font.setSzArray(0,value);
+ }
+ public void setI(CTBooleanProperty value){
+ font.setIArray(0,value);
+ }
+
+ public void setU(CTUnderlineProperty value){
+ font.setUArray(0,value);
+ }
+
+
+ public void setStrike(CTBooleanProperty value){
+ font.setStrikeArray(0,value);
+ }
+
+
+ public void setVertAlign(CTVerticalAlignFontProperty value){
+ font.setVertAlignArray(0,value);
+ }
+
+
+ public void setName(CTFontName fontName) {
+ font.setNameArray(0,fontName);
+ }
+
+ public CTFontName getName() {
+ return font.getNameArray(0);
+ }
+
+ public CTIntProperty getFamily() {
+ return font.getFamilyArray(0);
+ }
+
+ public void setFamily(CTIntProperty family) {
+ font.setFamilyArray(0,family);
+ }
+
+
+ public void setFontScheme(CTFontScheme ctFontScheme) {
+ font.setSchemeArray(0,ctFontScheme);
+ }
+
+ public CTFontScheme getFontScheme() {
+ return font.getSchemeArray(0);
+ }
+
+ // methods used in FontFormatting
+
+ public CTBooleanProperty getOutline(){
+ return font.getOutlineArray(0);
+ }
+
+
+
+}
+
+ \ No newline at end of file
diff --git a/src/ooxml/java/org/apache/poi/xssf/util/Charset.java b/src/ooxml/java/org/apache/poi/xssf/util/Charset.java
new file mode 100755
index 0000000000..e9bdaa3cd1
--- /dev/null
+++ b/src/ooxml/java/org/apache/poi/xssf/util/Charset.java
@@ -0,0 +1,27 @@
+package org.apache.poi.xssf.util;
+
+public class Charset {
+
+ public static final int ANSI_CHARSET=0;
+ public static final int DEFAULT_CHARSET=1;
+ public static final int SYMBOL_CHARSET=2;
+ public static final int MAC_CHARSET=77;
+ public static final int SHIFTJIS_CHARSET=128;
+ public static final int HANGEUL_CHARSET=129;
+ public static final int HANGUL_CHARSET=129;
+ public static final int JOHAB_CHARSET=130;
+ public static final int GB2312_CHARSET=134;
+ public static final int CHINESEBIG5_CHARSET=136;
+ public static final int GREEK_CHARSET=161;
+ public static final int TURKISH_CHARSET=162;
+ public static final int VIETNAMESE_CHARSET=163;
+ public static final int HEBREW_CHARSET=177;
+ public static final int ARABIC_CHARSET=178;
+ public static final int BALTIC_CHARSET=186;
+ public static final int RUSSIAN_CHARSET=204;
+ public static final int THAI_CHARSET=222;
+ public static final int EASTEUROPE_CHARSET=238;
+ public static final int OEM_CHARSET=255;
+
+
+}
diff --git a/src/ooxml/java/org/apache/poi/xssf/util/IndexedColors.java b/src/ooxml/java/org/apache/poi/xssf/util/IndexedColors.java
new file mode 100755
index 0000000000..b54ee9bae9
--- /dev/null
+++ b/src/ooxml/java/org/apache/poi/xssf/util/IndexedColors.java
@@ -0,0 +1,16 @@
+package org.apache.poi.xssf.util;
+
+public class IndexedColors {
+
+ public static int BLACK=0;
+ public static int WHITE=1;
+ public static int RED=2;
+ public static int GREEN=3;
+ public static int BLUE=4;
+ public static int YELLOW=5;
+ public static int PINK=6;
+
+ public static int LIGHT_GREY=22;
+ public static int DARK_GREY=23;
+
+}