Package org.openxmlformats.schemas.spreadsheetml.x2006.main

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTIntProperty


    assertEquals(IndexedColors.RED.getIndex(),ctFont.getColorArray(0).getTheme());
  }

  public void testFamily() {
    CTFont ctFont=CTFont.Factory.newInstance();
    CTIntProperty family=ctFont.addNewFamily();
    family.setVal(FontFamily.MODERN.getValue());
    ctFont.setFamilyArray(0,family);

    XSSFFont xssfFont=new XSSFFont(ctFont);
    assertEquals(FontFamily.MODERN.getValue(),xssfFont.getFamily());
  }
View Full Code Here


    assertEquals(true, ctFont.getBArray(0).getVal());
  }

  public void testCharSet() {
    CTFont ctFont=CTFont.Factory.newInstance();
    CTIntProperty prop=ctFont.addNewCharset();
    prop.setVal(FontCharset.ANSI.getValue());

    ctFont.setCharsetArray(0,prop);
    XSSFFont xssfFont=new XSSFFont(ctFont);
    assertEquals(Font.ANSI_CHARSET,xssfFont.getCharSet());
View Full Code Here

    assertEquals(IndexedColors.RED.getIndex(),ctFont.getColorArray(0).getTheme());
  }

  public void testFamily() {
    CTFont ctFont=CTFont.Factory.newInstance();
    CTIntProperty family=ctFont.addNewFamily();
    family.setVal(FontFamily.MODERN.getValue());
    ctFont.setFamilyArray(0,family);

    XSSFFont xssfFont=new XSSFFont(ctFont);
    assertEquals(FontFamily.MODERN.getValue(),xssfFont.getFamily());
  }
View Full Code Here

    }



    public byte getCharSet() {
         CTIntProperty charset= ctFont.sizeOfCharsetArray() == 0?null:ctFont.getCharsetArray(0);
        if(charset!=null){
            //this value must be set -- can't be null
            switch (charset.getVal()) {
            case Charset.ANSI_CHARSET:
                return Font.ANSI_CHARSET;

            case Charset.DEFAULT_CHARSET:
                return Font.DEFAULT_CHARSET;

            case Charset.SYMBOL_CHARSET:
                return Font.SYMBOL_CHARSET;

            default://maight be correct to return this byte value???
                return Byte.parseByte(Integer.toString(charset.getVal()));
            }
        }
        else
            return Font.ANSI_CHARSET;
    }
View Full Code Here

     /**
      *
      */
    public void setCharSet(byte charset) {
         CTIntProperty charsetProperty=ctFont.sizeOfCharsetArray()==0?ctFont.addNewCharset():ctFont.getCharsetArray(0);
        switch (charset) {
        case Font.ANSI_CHARSET:
            charsetProperty.setVal(Charset.ANSI_CHARSET);
            break;
        case Font.SYMBOL_CHARSET:
            charsetProperty.setVal(Charset.SYMBOL_CHARSET);
            break;
        case Font.DEFAULT_CHARSET:
            charsetProperty.setVal(Charset.DEFAULT_CHARSET);
            break;
        default:
            throw new RuntimeException("Attention: an attempt to set a type of unknow charset and charset");
        }
    }
View Full Code Here

        }
    }


      public int getFamily(){
         CTIntProperty family=ctFont.sizeOfFamilyArray()==0?ctFont.addNewFamily():ctFont.getFamilyArray(0);
         if(family!=null)
             return family.getVal();
          else
              return XSSFFont.FONT_FAMILY_SWISS;
      }
View Full Code Here

          else
              return XSSFFont.FONT_FAMILY_SWISS;
      }

      public void setFamily(int value){
         CTIntProperty family=ctFont.sizeOfFamilyArray()==0?ctFont.addNewFamily():ctFont.getFamilyArray(0);
          family.setVal(value);
     }
View Full Code Here

    assertEquals(true, ctFont.getBArray(0).getVal());
  }

  public void testCharSet(){
    CTFont ctFont=CTFont.Factory.newInstance();
    CTIntProperty prop=ctFont.addNewCharset();
    prop.setVal(Charset.ANSI_CHARSET);

    ctFont.setCharsetArray(0,prop);
    XSSFFont xssfFont=new XSSFFont(ctFont);
    assertEquals(Font.ANSI_CHARSET,xssfFont.getCharSet());
View Full Code Here

    assertEquals(,ctFont.getColorArray(0).getTint());
  }
*/
  public void testFamily(){
    CTFont ctFont=CTFont.Factory.newInstance();
    CTIntProperty family=ctFont.addNewFamily();
    family.setVal(XSSFFont.FONT_FAMILY_MODERN);
    ctFont.setFamilyArray(0,family);

    XSSFFont xssfFont=new XSSFFont(ctFont);
    assertEquals(XSSFFont.FONT_FAMILY_MODERN,xssfFont.getFamily());
  }
View Full Code Here

    // Formats
    CTNumFmts formats = CTNumFmts.Factory.newInstance();
    formats.setCount(numberFormats.size());
    for (Entry<Integer, String> fmt : numberFormats.entrySet()) {
      CTNumFmt ctFmt = formats.addNewNumFmt();
      ctFmt.setNumFmtId(fmt.getKey());
      ctFmt.setFormatCode(fmt.getValue());
    }
    styleSheet.setNumFmts(formats);

    int idx;
    // Fonts
View Full Code Here

TOP

Related Classes of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTIntProperty

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.