Examples of CTIntProperty


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

     *
     * @return the font family to use
     * @see org.apache.poi.ss.usermodel.FontFamily
     */
    public int getFamily() {
        CTIntProperty family = _ctFont.sizeOfFamilyArray() == 0 ? _ctFont.addNewFamily() : _ctFont.getFamilyArray(0);
        return family == null ? FontFamily.NOT_APPLICABLE.getValue() : FontFamily.valueOf(family.getVal()).getValue();
    }
View Full Code Here

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

     *
     * @param value - font family
     * @see FontFamily
     */
    public void setFamily(int value) {
        CTIntProperty family = _ctFont.sizeOfFamilyArray() == 0 ? _ctFont.addNewFamily() : _ctFont.getFamilyArray(0);
        family.setVal(value);
    }
View Full Code Here

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

    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

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

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

    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

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

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

    }



    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

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

     /**
      *
      */
    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

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

        }
    }


      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

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

          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
TOP
Copyright © 2018 www.massapi.com. 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.