Package org.pptx4j.pml

Examples of org.pptx4j.pml.Shape$NvSpPr


      List<Object> possiblyShapes = getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame();
           
      for (Object o : possiblyShapes) {
       
        if (o instanceof Shape) {
          Shape sp = (Shape)o;
          if (sp.getNvSpPr()!=null
              && sp.getNvSpPr().getNvPr()!=null
                && sp.getNvSpPr().getNvPr().getPh() != null) {
            CTPlaceholder placeholder = sp.getNvSpPr().getNvPr().getPh();
            ShapeWrapper sw = new ShapeWrapper(sp, placeholder.getType().toString(),
                this);
            indexedPlaceHolders.put(sw.getPhType(), sw);
            log.debug("Indexed: " + sw.getPhType() + " in " + sw.getOwner().getPartName().toString() );
          }
View Full Code Here


   
     
      for (Object o : possiblyShapes) {
       
        if (o instanceof Shape) {
          Shape sp = (Shape)o;
          if (sp.getNvSpPr()!=null
              && sp.getNvSpPr().getNvPr()!=null
                && sp.getNvSpPr().getNvPr().getPh() != null) {
            CTPlaceholder placeholder = sp.getNvSpPr().getNvPr().getPh();
            ShapeWrapper sw = new ShapeWrapper(sp, placeholder.getType().toString(),
                this);
            indexedPlaceHolders.put(sw.getPhType(), sw);
           
            String name = "";
            if (sp.getNvSpPr().getCNvPr()!=null) {
              name = sp.getNvSpPr().getCNvPr().getName();
            }
           
            log.debug("Indexed: " + sw.getPhType() + "(" + name + ") in " + sw.getOwner().getPartName().toString() );
          }
        }
View Full Code Here

      System.out.println("Adding slide for shape: " + st.value() );
     
      SlidePart slidePart = createSlidePart(pp, layoutPart, i);
     
      // Create and add shapes
      Shape title = ((Shape)XmlUtils.unmarshalString(
          getSlideTitle(st.value()), Context.jcPML) );
      slidePart.getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().add(title);
     
     
      Shape sample = ((Shape)XmlUtils.unmarshalString(
          getPresetShape(st.value(), noLine), Context.jcPML) );
      slidePart.getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().add(sample);
     
      i++;
    }
View Full Code Here

    // Now handle the placeholders
      List<Object> possiblyShapes = effectiveShapeTree.getSpOrGrpSpOrGraphicFrame();     
      for (Object o : possiblyShapes) {
       
        if (o instanceof Shape) {
          Shape sp = (Shape)o;
          if (sp.getNvSpPr()!=null
              && sp.getNvSpPr().getNvPr()!=null
                && sp.getNvSpPr().getNvPr().getPh() != null) {
            CTPlaceholder placeholder = sp.getNvSpPr().getNvPr().getPh();
          String placeholderType = placeholder.getType().toString();
            log.info("Handling placeholder: " + placeholderType );
            handle(placeholders, placeholderType, sp);
          }
        }
View Full Code Here

   
    return effectiveShapeTree;
  }
 
  private static void handle(Map<String, ShapeWrapper> placeholders, String placeholderType, Shape sp) {
    Shape layoutShape = null;
    if (placeholders.get(placeholderType)!=null) {
      log.debug("Got it..");
      layoutShape = placeholders.get(placeholderType).getSp();
    } else {
      log.debug("Missing..");
      return;
    }
   
    handleNvSpPr( sp.getNvSpPr(), layoutShape.getNvSpPr());
    handleSpPr( sp.getSpPr(), layoutShape.getSpPr());
    handleTxBody( sp.getTxBody(), layoutShape.getTxBody() );
   
    // TODO: other fields
  }
View Full Code Here

    // Slide layout part
    slidePart.addTargetPart(layoutPart);
   
       
    // Create and add shape
    Shape sample = ((Shape)XmlUtils.unmarshalString(SAMPLE_SHAPE, Context.jcPML) );
    slidePart.getContents().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().add(sample);
   
    // All done: save it
    presentationMLPackage.save(new java.io.File(outputfilepath));
View Full Code Here

   
    // Slide layout part
    slidePart.addTargetPart(layoutPart);
       
    // Create and add shape
    Shape sample = ((Shape)XmlUtils.unmarshalString(SAMPLE_SHAPE, Context.jcPML) );
    slidePart.getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().add(sample);
   
    // Now add notes slide.
    // 1. Notes master
    NotesMasterPart nmp = new NotesMasterPart();
View Full Code Here

TOP

Related Classes of org.pptx4j.pml.Shape$NvSpPr

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.