Examples of TextProp


Examples of org.apache.poi.hslf.model.textproperties.TextProp

   * Returns -1 if that TextProp isn't present.
   * If the TextProp isn't present, the value from the appropriate
   *  Master Sheet will apply.
   */
  private int getParaTextPropVal(String propName) {
        TextProp prop = null;
        if (paragraphStyle != null){
            prop = paragraphStyle.findByName(propName);
        }
        if (prop == null){
            Sheet sheet = parentRun.getSheet();
            int txtype = parentRun.getRunType();
            MasterSheet master = sheet.getMasterSheet();
            if (master != null)
                prop = master.getStyleAttribute(txtype, getIndentLevel(), propName, false);
        }

    return prop == null ? -1 : prop.getValue();
  }
View Full Code Here

Examples of org.apache.poi.hslf.model.textproperties.TextProp

    if(paragraphStyle == null) {
      parentRun.ensureStyleAtomPresent();
      // paragraphStyle will now be defined
    }
   
    TextProp tp = fetchOrAddTextProp(paragraphStyle, propName);
    tp.setValue(val);
  }
View Full Code Here

Examples of org.apache.poi.hslf.model.textproperties.TextProp

    if(characterStyle == null) {
      parentRun.ensureStyleAtomPresent();
      // characterStyle will now be defined
    }
   
    TextProp tp = fetchOrAddTextProp(characterStyle, propName);
    tp.setValue(val);
  }
View Full Code Here

Examples of org.apache.poi.hslf.model.textproperties.TextProp

        out.append("Paragraph properties\n");
        for (Iterator it1 = getParagraphStyles().iterator(); it1.hasNext();) {
            TextPropCollection pr = (TextPropCollection)it1.next();
            out.append("  chars covered: " + pr.getCharactersCovered() + "\n");
            for (Iterator it2 = pr.getTextPropList().iterator(); it2.hasNext(); ) {
                TextProp p = (TextProp)it2.next();
                out.append("    " + p.getName() + " = " + p.getValue() + "\n");
            }
        }

        out.append("Character properties\n");
        for (Iterator it1 = getCharacterStyles().iterator(); it1.hasNext();) {
            TextPropCollection pr = (TextPropCollection)it1.next();
            out.append("  chars covered: " + pr.getCharactersCovered() + "\n");
            for (Iterator it2 = pr.getTextPropList().iterator(); it2.hasNext(); ) {
                TextProp p = (TextProp)it2.next();
                out.append("    " + p.getName() + " = " + p.getValue() + "\n");
            }
        }

        return out.toString();
    }
View Full Code Here

Examples of org.apache.poi.hslf.model.textproperties.TextProp

  public static void showTextProps(TextPropCollection tpc) {
    LinkedList textProps = tpc.getTextPropList();
    System.out.println("    Contains " + textProps.size() + " TextProps");
    for(int i=0; i<textProps.size(); i++) {
      TextProp tp = (TextProp)textProps.get(i);
      System.out.println("      " + i + " - " + tp.getName());
      System.out.println("          = " + tp.getValue());
      System.out.println("          @ " + tp.getMask());

      if(tp instanceof BitMaskTextProp) {
        BitMaskTextProp bmtp = (BitMaskTextProp)tp;
        String[] subPropNames = bmtp.getSubPropNames();
        boolean[] subPropMatches = bmtp.getSubPropMatches();
View Full Code Here

Examples of org.apache.poi.hslf.model.textproperties.TextProp

    TextPropCollection b_ch_3 = (TextPropCollection)b_ch_l.get(2);
    TextPropCollection b_ch_4 = (TextPropCollection)b_ch_l.get(3);
   
    // In first set, we get a CharFlagsTextProp and a font.size
    assertEquals(2,b_ch_1.getTextPropList().size());
    TextProp tp_1_1 = (TextProp)b_ch_1.getTextPropList().get(0);
    TextProp tp_1_2 = (TextProp)b_ch_1.getTextPropList().get(1);
    assertEquals(true, tp_1_1 instanceof CharFlagsTextProp);
    assertEquals(true, tp_1_2 instanceof TextProp);
    assertEquals("font.size", tp_1_2.getName());
    assertEquals(20, tp_1_2.getValue());
   
    // In second set, we get a CharFlagsTextProp and a font.size and a font.color
    assertEquals(3,b_ch_2.getTextPropList().size());
    TextProp tp_2_1 = (TextProp)b_ch_2.getTextPropList().get(0);
    TextProp tp_2_2 = (TextProp)b_ch_2.getTextPropList().get(1);
    TextProp tp_2_3 = (TextProp)b_ch_2.getTextPropList().get(2);
    assertEquals(true, tp_2_1 instanceof CharFlagsTextProp);
    assertEquals(true, tp_2_2 instanceof TextProp);
    assertEquals(true, tp_2_3 instanceof TextProp);
    assertEquals("font.size", tp_2_2.getName());
    assertEquals("font.color", tp_2_3.getName());
    assertEquals(20, tp_2_2.getValue());
   
    // In third set, it's just a font.size and a font.color
    assertEquals(2,b_ch_3.getTextPropList().size());
    TextProp tp_3_1 = (TextProp)b_ch_3.getTextPropList().get(0);
    TextProp tp_3_2 = (TextProp)b_ch_3.getTextPropList().get(1);
    assertEquals(true, tp_3_1 instanceof TextProp);
    assertEquals(true, tp_3_2 instanceof TextProp);
    assertEquals("font.size", tp_3_1.getName());
    assertEquals("font.color", tp_3_2.getName());
    assertEquals(20, tp_3_1.getValue());
   
    // In fourth set, we get a CharFlagsTextProp and a font.index and a font.size
    assertEquals(3,b_ch_4.getTextPropList().size());
    TextProp tp_4_1 = (TextProp)b_ch_4.getTextPropList().get(0);
    TextProp tp_4_2 = (TextProp)b_ch_4.getTextPropList().get(1);
    TextProp tp_4_3 = (TextProp)b_ch_4.getTextPropList().get(2);
    assertEquals(true, tp_4_1 instanceof CharFlagsTextProp);
    assertEquals(true, tp_4_2 instanceof TextProp);
    assertEquals(true, tp_4_3 instanceof TextProp);
    assertEquals("font.index", tp_4_2.getName());
    assertEquals("font.size", tp_4_3.getName());
    assertEquals(24, tp_4_3.getValue());
  }
View Full Code Here

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

   * @param textPropCol The TextPropCollection to fetch from / add into
   * @param textPropName The name of the TextProp to fetch/add
   */
  private TextProp fetchOrAddTextProp(TextPropCollection textPropCol, String textPropName) {
    // Fetch / Add the TextProp
    TextProp tp = textPropCol.findByName(textPropName);
    if(tp == null) {
      tp = textPropCol.addWithName(textPropName);
    }
    return tp;
  }
View Full Code Here

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

   * Returns -1 if that TextProp isn't present.
   * If the TextProp isn't present, the value from the appropriate
   *  Master Sheet will apply.
   */
  private int getCharTextPropVal(String propName) {
        TextProp prop = null;
        if (characterStyle != null){
            prop = characterStyle.findByName(propName);
        }

        if (prop == null){
            Sheet sheet = parentRun.getSheet();
            int txtype = parentRun.getRunType();
            SlideMaster master = (SlideMaster)sheet.getMasterSheet();
            prop = master.getStyleAttribute(txtype, getIndentLevel(), propName, true);
        }
    return prop == null ? -1 : prop.getValue();
  }
View Full Code Here

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

   * Returns -1 if that TextProp isn't present.
   * If the TextProp isn't present, the value from the appropriate
   *  Master Sheet will apply.
   */
  private int getParaTextPropVal(String propName) {
        TextProp prop = null;
        if (paragraphStyle != null){
            prop = paragraphStyle.findByName(propName);
        }
        if (prop == null){
            Sheet sheet = parentRun.getSheet();
            int txtype = parentRun.getRunType();
            SlideMaster master = (SlideMaster)sheet.getMasterSheet();
            prop = master.getStyleAttribute(txtype, getIndentLevel(), propName, false);
        }

    return prop == null ? -1 : prop.getValue();
  }
View Full Code Here

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

    if(paragraphStyle == null) {
      parentRun.ensureStyleAtomPresent();
      // paragraphStyle will now be defined
    }
   
    TextProp tp = fetchOrAddTextProp(paragraphStyle, propName);
    tp.setValue(val);
  }
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.