Package org.apache.poi.hslf.model.textproperties

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


            return new TextProp[] {
                    new BitMaskTextProp(20xF, "paragraph_flags", new String[] {
                        "bullet", "bullet.hardfont",
                        "bullet.hardcolor", "bullet.hardsize"}
                    ),
                    new TextProp(2, 0x80, "bullet.char"),
                    new TextProp(2, 0x10, "bullet.font"),
                    new TextProp(2, 0x40, "bullet.size"),
                    new TextProp(4, 0x20, "bullet.color"),
                    new TextProp(2, 0xD00, "alignment"),
                    new TextProp(2, 0x1000, "linespacing"),
                    new TextProp(2, 0x2000, "spacebefore"),
                    new TextProp(2, 0x4000, "spaceafter"),
                    new TextProp(2, 0x8000, "text.offset"),
                    new TextProp(2, 0x10000, "bullet.offset"),
                    new TextProp(2, 0x20000, "defaulttab"),
                    new TextProp(2, 0x40000, "para_unknown_2"),
                    new TextProp(2, 0x80000, "para_unknown_3"),
                    new TextProp(2, 0x100000, "para_unknown_4"),
                    new TextProp(2, 0x200000, "para_unknown_5")
            };
        }
    }
View Full Code Here

        if (level != 0 || type >= MAX_INDENT){
            return StyleTextPropAtom.characterTextPropTypes;
        } else
         return new TextProp[] {
        new CharFlagsTextProp(),
        new TextProp(2, 0x10000, "font.index"),
        new TextProp(2, 0x20000, "char_unknown_1"),
        new TextProp(4, 0x40000, "char_unknown_2"),
        new TextProp(2, 0x80000, "font.size"),
        new TextProp(2, 0x100000, "char_unknown_3"),
        new TextProp(4, 0x200000, "font.color"),
        new TextProp(2, 0x800000, "char_unknown_4")
      };
    }
View Full Code Here

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

   * 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

   * 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

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

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

     * Pickup a style attribute from the master.
     * This is the "workhorse" which returns the default style attrubutes.
     */
    public TextProp getStyleAttribute(int txtype, int level, String name, boolean isCharacter) {

        TextProp prop = null;
        for (int i = level; i >= 0; i--) {
            TextPropCollection[] styles =
                    isCharacter ? _txmaster[txtype].getCharacterStyles() : _txmaster[txtype].getParagraphStyles();
            if (i < styles.length) prop = styles[i].findByName(name);
            if (prop != null) break;
View Full Code Here

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

TOP

Related Classes of org.apache.poi.hslf.model.textproperties.TextProp

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.