Package com.extentech.formats.XLS

Examples of com.extentech.formats.XLS.BiffRec


      } else if (n.equals("Workbook")) {
        ; //skip
      } else if (n.equals("\1CompObj")) {
        BlockByteReader bytes= s.getBlockReader();
        int len= bytes.getLength();
        BiffRec rec = new com.extentech.formats.XLS.XLSRecord();    // 4 bytes are header ...   
        rec.setByteReader(bytes);
        rec.setLength(len);
        int slen= ByteTools.readInt(rec.getBytesAt(24, 4))// actually position 28
        if (slen >= 0) {
          String ss= new String (rec.getBytesAt(28, slen));    // AnsiUserType= a display name of the linked object or embedded object.
          System.out.println("\tOLE Object:" + ss);
        }
        // AnsiClipboardFormat (variable)
//        System.out.println("\t" + Arrays.toString(rec.getData()));       
      } else if (n.startsWith("000")) {    // pivot cache
        if (s.myblocks!=null) {
          for (int zz= 0; zz < s.myblocks.size(); zz++)
            if ((s.myblocks.get(zz) instanceof com.extentech.formats.LEO.BIGBLOCK))
              System.out.println("\t" + zz + "-" + Arrays.toString(((com.extentech.formats.LEO.BIGBLOCK)s.myblocks.get(zz)).getBytes()));
            else
              System.out.println("\t" + zz + "-" + Arrays.toString(((com.extentech.formats.LEO.SMALLBLOCK)s.myblocks.get(zz)).getBytes()));
        }
        BlockByteReader bytes= s.getBlockReader();
        int len= bytes.getLength();
        for (int z = 0; z <= len - 4;) {
          byte[] headerbytes = bytes.getHeaderBytes(z);
          short opcode = ByteTools.readShort(headerbytes[0], headerbytes[1]);
          int reclen = ByteTools.readShort(headerbytes[2], headerbytes[3]);
          BiffRec rec = XLSRecordFactory.getBiffRecord( opcode );         
          rec.setByteReader(bytes);
          rec.setOffset(z);
          rec.setLength((short) reclen);
          rec.init();
            System.out.println("\t\t" + rec.toString());
          z+=reclen+4;
        }
      } else {     
        if (s.myblocks!=null) {
          for (int zz= 0; zz < s.myblocks.size(); zz++)
View Full Code Here


          Object o = chartArr.get(i);
          if(o instanceof ChartObject){
            ChartObject co = (ChartObject)o;
            outputArr.addAll(co.getRecordArray());
          }else{
              BiffRec b = (BiffRec)o;
                outputArr.add(b)// 20070712 KSC: missed some recs!
          }
           
            if (i==chartArr.size()-1) {
                End e = (End)End.getPrototype();
View Full Code Here

        s.setShape(chartObject.getBarShape());
      series.add(new Object[] {s, Integer.valueOf(nChart)})
      // Update parent chartArr
      ArrayList<XLSRecord> chartArr= s.getParentChart().chartArr;      
        for (int i=0;i<chartArr.size();i++) {
            BiffRec br = (BiffRec)chartArr.get(i);
            BiffRec br2 = null;
            if (i<chartArr.size()-1)br2 = (BiffRec)chartArr.get(i+1);
            if (br!=null && ((br.getOpcode()==XLSConstants.SERIES && br2.getOpcode()!=XLSConstants.SERIES)
                || br.getOpcode()==XLSConstants.FRAME && br2.getOpcode()==XLSConstants.SHTPROPS )) {
                chartArr.add(i+1, s);
                break;
            }
        }
      if (chartObject.getChartType()==STOCKCHART)
View Full Code Here

  public Ptg[] getCellRangePtgs() {
    CompatibleVector locptgs = new CompatibleVector();
    for (int i= 0; i < series.size(); i++) {
           Series s= (Series) ((Object[])series.get(i))[0];
           for (int j= 0; j < s.chartArr.size(); j++) {
             BiffRec br = (BiffRec)s.chartArr.get(j);
             if (br.getOpcode()==XLSConstants.AI) {
               try {
                 Ptg[] ps = ((Ai)br).getCellRangePtgs();              
                 for(int t=0;t<ps.length;t++)locptgs.add(ps[t]);
               } catch (Exception e) {      }
             }
View Full Code Here

  public HashMap getSeriesPtgs(){
    HashMap seriesPtgs= new HashMap();
    for (int i= 0; i < series.size(); i++) {
           Series s= (Series) ((Object[])series.get(i))[0];
           for (int j= 0; j < s.chartArr.size(); j++) {
             BiffRec br = (BiffRec)s.chartArr.get(j);
             if (br.getOpcode()==XLSConstants.AI) {
               if (((Ai)br).getType()==Ai.TYPE_VALS) {
                 try {
                   Ptg[] ps = ((Ai)br).getCellRangePtgs();
                   seriesPtgs.put(s, ps);
                   break// we're done, move onto next
View Full Code Here

    /**
     * @return the type of this TextDisp (X, Y, Z axis, title, data series ...
     */
    public int getType() {
        for (int i=0;i<chartArr.size();i++) {
            BiffRec b = (BiffRec)chartArr.get(i);
            if (b.getOpcode()==OBJECTLINK) {   
              return ((ObjectLink)b).getType();
            }
        }
        return -1;
    }
View Full Code Here

     * @return FontX id
     */
    public int getFontId() {
      int ret= 0;
    for (int i= 0; i < chartArr.size(); i++) {
      BiffRec b= (BiffRec) chartArr.get(i);
      if (b.getOpcode()==FONTX) {
        ret= ((Fontx) b).getIfnt();
        break;
      }
    }
    return ret;
View Full Code Here

    /**
     * set the id of the Fontx associated with this TextDisp
     */
    public void setFontId(int id) {
    for (int i= 0; i < chartArr.size(); i++) {
      BiffRec b= (BiffRec) chartArr.get(i);
      if (b.getOpcode()==FONTX) {
        ((Fontx)b).setIfnt(id);
        break;
      }
    }     
    }
View Full Code Here

     * Return the string value of the specified option
     */
    public String getChartOption(String op) {
      if (op.equalsIgnoreCase("Label")) {
            for (int i=0;i<chartArr.size();i++) {
                BiffRec b = (BiffRec)chartArr.get(i);
                if (b.getOpcode()==SERIESTEXT) {
                    SeriesText st = (SeriesText) b;
                    return st.toString();
                }
            }
      } else if (op.equalsIgnoreCase("ShowKey")) {
View Full Code Here

     *
     * @return
     */
    protected boolean isChartTitle() {
        for (int i=0;i<chartArr.size();i++) {
            BiffRec b = (BiffRec)chartArr.get(i);
            if (b.getOpcode()==OBJECTLINK) {
                ObjectLink ol = (ObjectLink) b;
                return ol.isChartTitle();
            }
        }
        return false;
View Full Code Here

TOP

Related Classes of com.extentech.formats.XLS.BiffRec

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.