Package org.apache.poi.hslf.record

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


              if(slwtChildren[k] instanceof TextBytesAtom) {
                lastTextLen = ((TextBytesAtom)slwtChildren[k]).getText().length();
              }

              if(slwtChildren[k] instanceof StyleTextPropAtom) {
                StyleTextPropAtom stpa = (StyleTextPropAtom)slwtChildren[k];
                stpa.setParentTextSize(lastTextLen);
                showStyleTextPropAtom(stpa);
              }
            }
          }
        }
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

              if(slwtChildren[k] instanceof TextBytesAtom) {
                lastTextLen = ((TextBytesAtom)slwtChildren[k]).getText().length();
              }

              if(slwtChildren[k] instanceof StyleTextPropAtom) {
                StyleTextPropAtom stpa = (StyleTextPropAtom)slwtChildren[k];
                stpa.setParentTextSize(lastTextLen);
                showStyleTextPropAtom(stpa);
              }
            }
          }
        }
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

        assertEquals(4, stpb.getParagraphStyles().size());
    }


    public void testCharacterStyleLengths() 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);

        // 54 chars, 21 + 17 + 16
        LinkedList a_ch_l = stpa.getCharacterStyles();
        TextPropCollection a_ch_1 = (TextPropCollection)a_ch_l.get(0);
        TextPropCollection a_ch_2 = (TextPropCollection)a_ch_l.get(1);
        TextPropCollection a_ch_3 = (TextPropCollection)a_ch_l.get(2);
        assertEquals(21, a_ch_1.getCharactersCovered());
        assertEquals(17, a_ch_2.getCharactersCovered());
        assertEquals(16, a_ch_3.getCharactersCovered());

        // 179 chars, 30 + 28 + 25
        LinkedList b_ch_l = stpb.getCharacterStyles();
        TextPropCollection b_ch_1 = (TextPropCollection)b_ch_l.get(0);
        TextPropCollection b_ch_2 = (TextPropCollection)b_ch_l.get(1);
        TextPropCollection b_ch_3 = (TextPropCollection)b_ch_l.get(2);
        TextPropCollection b_ch_4 = (TextPropCollection)b_ch_l.get(3);
        assertEquals(30, b_ch_1.getCharactersCovered());
View Full Code Here

        assertEquals(96, b_ch_4.getCharactersCovered());
    }


    public void testCharacterPropOrdering() throws Exception {
        StyleTextPropAtom stpb = new StyleTextPropAtom(data_b,0,data_b.length);
        stpb.setParentTextSize(data_b_text_len);

        LinkedList b_ch_l = stpb.getCharacterStyles();
        TextPropCollection b_ch_1 = (TextPropCollection)b_ch_l.get(0);
        TextPropCollection b_ch_2 = (TextPropCollection)b_ch_l.get(1);
        TextPropCollection b_ch_3 = (TextPropCollection)b_ch_l.get(2);
        TextPropCollection b_ch_4 = (TextPropCollection)b_ch_l.get(3);
View Full Code Here

        assertEquals("font.size", tp_4_3.getName());
        assertEquals(24, tp_4_3.getValue());
    }

    public void testParagraphProps() throws Exception {
        StyleTextPropAtom stpb = new StyleTextPropAtom(data_b,0,data_b.length);
        stpb.setParentTextSize(data_b_text_len);

        LinkedList b_p_l = stpb.getParagraphStyles();
        TextPropCollection b_p_1 = (TextPropCollection)b_p_l.get(0);
        TextPropCollection b_p_2 = (TextPropCollection)b_p_l.get(1);
        TextPropCollection b_p_3 = (TextPropCollection)b_p_l.get(2);
        TextPropCollection b_p_4 = (TextPropCollection)b_p_l.get(3);
View Full Code Here

        assertEquals(0, tp_4_1.getValue());
        assertEquals(80, tp_4_2.getValue());
    }

    public void testCharacterProps() throws Exception {
        StyleTextPropAtom stpb = new StyleTextPropAtom(data_b,0,data_b.length);
        stpb.setParentTextSize(data_b_text_len);

        LinkedList b_ch_l = stpb.getCharacterStyles();
        TextPropCollection b_ch_1 = (TextPropCollection)b_ch_l.get(0);
        TextPropCollection b_ch_2 = (TextPropCollection)b_ch_l.get(1);
        TextPropCollection b_ch_3 = (TextPropCollection)b_ch_l.get(2);
        TextPropCollection b_ch_4 = (TextPropCollection)b_ch_l.get(3);
View Full Code Here

TOP

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

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.