Package org.apache.poi.hslf.record

Examples of org.apache.poi.hslf.record.StyleTextPropAtom$BitMaskTextProp


            _txtbox.appendChildRecord(tha);

            TextCharsAtom tca = new TextCharsAtom();
            _txtbox.appendChildRecord(tca);

            StyleTextPropAtom sta = new StyleTextPropAtom(0);
            _txtbox.appendChildRecord(sta);

            _txtrun = new TextRun(tha,tca,sta);
            _txtrun._records = new Record[]{tha, tca, sta};
            _txtrun.setText("");
View Full Code Here


    public TextRun getTextRun(){
        if (null == this._txtrun) initTextRun();
        if (null == this._txtrun && null != this._txtbox) {
          TextHeaderAtom    tha = null;
          TextBytesAtom     tba = null;
          StyleTextPropAtom sta = null;
          Record[] childRecords = this._txtbox.getChildRecords();
          for (Record r : childRecords) {
            if (r instanceof TextHeaderAtom) {
              tha = (TextHeaderAtom) r;
        } else if (r instanceof TextBytesAtom) {
View Full Code Here

    assertEquals(textRuns.length, styleAtoms.length);
    checkSingleRunWrapper(43, styleAtoms[0]);
    checkSingleRunWrapper(67, styleAtoms[1]);
  }
  private void checkSingleRunWrapper(final int exceptedLength, final EscherTextboxWrapper wrapper) {
    final StyleTextPropAtom styleTextPropAtom = wrapper.getStyleTextPropAtom();
    final List<TextPropCollection> textProps = styleTextPropAtom.getCharacterStyles();
    assertEquals(1, textProps.size());
    final TextPropCollection[] props = (TextPropCollection[]) textProps.toArray(new TextPropCollection[textProps.size()]);
    assertEquals(exceptedLength, props[0].getCharactersCovered());
  }
View Full Code Here

    assertEquals("This is a text placeholder that \rfollows the design pattern\rJust a test\rWithout any paragraph\rSecond paragraph first line c) ;\rSecond paragraph second line d) . \r", textRuns[1].getRawText());
   
    final EscherTextboxWrapper[] styleAtoms = s.getTextboxWrappers();
    assertEquals(textRuns.length, styleAtoms.length);
    final EscherTextboxWrapper wrapper =  styleAtoms[1];
    final StyleTextPropAtom styleTextPropAtom = wrapper.getStyleTextPropAtom();
    final List<TextPropCollection> textProps = styleTextPropAtom.getCharacterStyles();
    final TextPropCollection[] props = (TextPropCollection[]) textProps.toArray(new TextPropCollection[textProps.size()]);
    assertEquals(60, props[0].getCharactersCovered());
    assertEquals(34, props[1].getCharactersCovered());
    assertEquals(68, props[2].getCharactersCovered());
  }
View Full Code Here

    assertEquals("This is a text placeholder that \rfollows the design pattern\rJust a test\rWithout any paragraph\rSecond paragraph first line c) ;\rSecond paragraph second line d) . \r", textRuns[1].getRawText());
   
    final EscherTextboxWrapper[] styleAtoms = s.getTextboxWrappers();
    assertEquals(textRuns.length, styleAtoms.length);
    final EscherTextboxWrapper wrapper =  styleAtoms[1];
    final StyleTextPropAtom styleTextPropAtom = wrapper.getStyleTextPropAtom();
    final List<TextPropCollection> textProps = styleTextPropAtom.getCharacterStyles();
   
    final TextPropCollection[] props = (TextPropCollection[]) textProps.toArray(new TextPropCollection[textProps.size()]);
    assertEquals(33, props[0].getCharactersCovered());
    assertEquals(61, props[1].getCharactersCovered());
    assertEquals(68, props[2].getCharactersCovered());
View Full Code Here

    checkSingleRunWrapper(27, styleAtoms[0]);
    checkSingleRunWrapper(67, styleAtoms[1]);
    checkSingleRunWrapper(70, styleAtoms[2]);
  }
  private void checkSingleRunWrapper(final int exceptedLength, final EscherTextboxWrapper wrapper) {
    final StyleTextPropAtom styleTextPropAtom = wrapper.getStyleTextPropAtom();
    final List<TextPropCollection> textProps = styleTextPropAtom.getCharacterStyles();
    assertEquals(1, textProps.size());
    final TextPropCollection[] props = (TextPropCollection[]) textProps.toArray(new TextPropCollection[textProps.size()]);
    assertEquals(exceptedLength, props[0].getCharactersCovered());
  }
View Full Code Here

            int size = (children[j-1] instanceof TextCharsAtom) ?
                    ((TextCharsAtom)children[j-1]).getText().length() :
                    ((TextBytesAtom)children[j-1]).getText().length();

            StyleTextPropAtom tsp = (StyleTextPropAtom)children[j];
            tsp.setParentTextSize(size);

          } else {
            buf.append("Error! Couldn't find preceding TextAtom for style\n");
          }
View Full Code Here

        0x01 , 0x00, 0x01 , 0x00 , 0x00, 0x00 , 0x01 , 0x00 , 0x14 , 0x00
    };
    private int data_d_text_len = 0xA0-1;

    public void testRecordType() throws Exception {
        StyleTextPropAtom stpa = new StyleTextPropAtom(data_a,0,data_a.length);
        StyleTextPropAtom stpb = new StyleTextPropAtom(data_b,0,data_b.length);
        StyleTextPropAtom stpc = new StyleTextPropAtom(data_c,0,data_c.length);
        assertEquals(4001l, stpa.getRecordType());
        assertEquals(4001l, stpb.getRecordType());
        assertEquals(4001l, stpc.getRecordType());
    }
View Full Code Here

        assertEquals(4001l, stpc.getRecordType());
    }


    public void testCharacterStyleCounts() throws Exception {
        StyleTextPropAtom stpa = new StyleTextPropAtom(data_a,0,data_a.length);
        StyleTextPropAtom stpb = new StyleTextPropAtom(data_b,0,data_b.length);

        // Set for the appropriate text sizes
        stpa.setParentTextSize(data_a_text_len);
        stpb.setParentTextSize(data_b_text_len);

        // In case A, there is a single styling of the characters
        assertEquals(3, stpa.getCharacterStyles().size());
        // In case B, there are 5 different stylings
        assertEquals(5, stpb.getCharacterStyles().size());
    }
View Full Code Here

        // In case B, there are 5 different stylings
        assertEquals(5, stpb.getCharacterStyles().size());
    }

    public void testParagraphStyleCounts() throws Exception {
        StyleTextPropAtom stpa = new StyleTextPropAtom(data_a,0,data_a.length);
        StyleTextPropAtom stpb = new StyleTextPropAtom(data_b,0,data_b.length);

        // Set for the appropriate text sizes
        stpa.setParentTextSize(data_a_text_len);
        stpb.setParentTextSize(data_b_text_len);

        // In case A, all has the same spacing and alignment
        assertEquals(1, stpa.getParagraphStyles().size());
        // In case B, all 4 sets have different alignments
        assertEquals(4, stpb.getParagraphStyles().size());
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.hslf.record.StyleTextPropAtom$BitMaskTextProp

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.