Create a Paragraph, style it and add the data

@param data
@param stylers
@return
@throws VectorPrintException
331061
public Paragraph createParagraph(Object data, Collection<? extends BaseStyler> stylers) throws VectorPrintException {
      return initTextElementArray(styleHelper.style(new Paragraph(Float.NaN), data, stylers), data, stylers);
   }
923918
private Writer<?> build(Object data) {
        Optional<ExcelDataWriter<?>> dataBuilder = writers.values().parallelStream()
            .filter(excelData -> excelData.writeable(data)).limit(1).findFirst();

        ExcelDataWriter<?> writer = dataBuilder
            .orElseThrow(() -> new UtilsException("数据[" + data + "]没有对应的ExcelDataWriter"));
        return new Writer(writer, data);
    }
941003
@Override
    public void addEmbeddedStylesFromFooterHeader(final StylesContainer stylesContainer) {
        for (final Paragraph par : this.paragraphs)
            par.addEmbeddedStylesFromFooterHeader(stylesContainer);
    }
1316845
public static PlotCanvas plot(double[][] data, Line.Style style, Color color) {
        return plot(null, data, style, color);
    }
536441
def _add_styles(self, add_paragraph=True, add_text=True):
        
        p_styles = self.get_para_styles()
        t_styles = self.get_span_styles()
        for s in self.slide.pending_styles:
            if isinstance(s, ParagraphStyle):
                p_styles.update(s.styles)
            elif isinstance(s, TextStyle):
                t_styles.update(s.styles)

        para = ParagraphStyle(**p_styles)

        if add_paragraph or self.slide.paragraph_attribs:
            p_attrib = {ns("text", "style-name"): para.name}
            p_attrib.update(self.slide.paragraph_attribs)
            if not self._in_tag(ns("text", "p"), p_attrib):
                self.parent_of(ns("text", "p"))
                # Create paragraph style first
                self.slide._preso.add_style(para)
                self.add_node("text:p", attrib=p_attrib)

        # span is only necessary if style changes
        if add_text and t_styles:
            text = TextStyle(**t_styles)
            children = self.cur_node.getchildren()
            if children:
                # if we already are using this text style, reuse the last one
                last = children[-1]
                if (
                    last.tag == ns("text", "span")
                    and last.attrib[ns("text", "style-name")] == text.name
                    and last.tail is None
                ):  # if we have a tail, we can't reuse
                    self.cur_node = children[-1]
                    return

            if not self._is_node(
                ns("text", "span"), {ns("text", "style-name"): text.name}
            ):
                # Create text style
                self.slide._preso.add_style(text)
                self.add_node("text:span", attrib={"text:style-name": text.name})
630731
public ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraph(SEG segment, StyleSpans<S> styles) {
        return addParagraph(segment, styles, null);
    }
609890
protected void setInheritContainerData(Map<String, CmsContainerElementData> elementsData) {

        m_elementData = elementsData.get(getGroupContainerWidget().getId());
        if (m_elementData != null) {
            m_inputDescription.setFormValueAsString(m_elementData.getDescription());
            m_inputTitle.setFormValueAsString(m_elementData.getTitle());
            removeAllChildren();
            CmsContainerpageUtil util = getController().getContainerpageUtil();
            for (CmsInheritanceInfo info : m_elementData.getInheritanceInfos()) {
                if (info.isVisible()) {
                    CmsContainerElementData element = getController().getCachedElement(info.getClientId());
                    try {
                        CmsContainerPageElementPanel elementWidget = util.createElement(
                            element,
                            getGroupContainerWidget(),
                            false);
                        elementWidget.setInheritanceInfo(info);
                        setOptionBar(elementWidget);
                        getGroupContainerWidget().add(elementWidget);
                    } catch (Exception e) {
                        CmsDebugLog.getInstance().printLine(e.getMessage());
                    }
                }
            }
            boolean hasInvisible = false;
            for (CmsInheritanceInfo info : m_elementData.getInheritanceInfos()) {
                if (!info.isVisible()) {
                    CmsContainerElementData element = getController().getCachedElement(info.getClientId());
                    try {
                        CmsContainerPageElementPanel elementWidget = util.createElement(
                            element,
                            getGroupContainerWidget(),
                            false);
                        elementWidget.setInheritanceInfo(info);
                        elementWidget.addStyleName(HIDDEN_ELEMENT_CLASS);
                        setOptionBar(elementWidget);
                        getGroupContainerWidget().add(elementWidget);
                        Element elementOverlay = DOM.createDiv();
                        elementOverlay.setClassName(HIDDEN_ELEMENT_OVERLAY_CLASS);
                        elementWidget.getElement().appendChild(elementOverlay);
                        hasInvisible = true;
                    } catch (Exception e) {
                        CmsDebugLog.getInstance().printLine(e.getMessage());
                    }
                }
            }
            if (hasInvisible) {
                m_showElementsButton.enable();
            }
        }

        getGroupContainerWidget().refreshHighlighting();
        setSaveEnabled(true, null);
    }
352918
def serialize(self, data):
        

        super(Serializer, self).serialize(data)

        self.resp.content_type += '; header=present'
        import pprint
        pprint.PrettyPrinter().pprint(data)
820191
public Chunk createChunk(Object data, Collection<? extends BaseStyler> stylers) throws VectorPrintException {
      Chunk c = styleHelper.style(new Chunk(), data, stylers);

      if (data != null) {
         c.append(formatValue(data));
      }

      if (notDelayedStyle(c, ADV + (++advancedTag), stylers) && debug) {
         c.setGenericTag(String.valueOf(++genericTag));
      }

      return c;
   }
1126383
@Override
  public void add(Object data, Class<?>... typeSpecs) {
    //    if (data == null) return;
    //
    //    typeSpecs = determineTypeSpecs(data, typeSpecs);
    //    if (this.getDefaultDataType() == null) this.setDefaultDataType(typeSpecs);
    //
    //    mReps.put(this.getSpecsAsString(typeSpecs), data);
    Representation representation = new Representation(data, typeSpecs);
    mReps.put(representation.getTypeSpecsString(), representation);
  }
1058648
@Override
   public final void processImage(com.itextpdf.text.Image img) throws VectorPrintException {
      applySettings(img);
      for (BaseStyler bs : stylers) {
         // these stylers are configured in the setup after this importing stylers, apply here
         if (bs.canStyle(img) && bs.shouldStyle(data, img)) {
            bs.style(img, data);
         }
      }
      
      if (getValue(SEPARATE_PAGE, Boolean.class)) {
         if (getValue(FITTOIMAGE, Boolean.class)) {
            getDocument().setPageSize(new Rectangle(img.getScaledWidth(), img.getScaledHeight()));
         } else if (getValue(FITTOPAGE, Boolean.class)) {
            img.scaleToFit(getDocument().getPageSize().getWidth(),getDocument().getPageSize().getHeight());
         }
         if (getValue(NOFOOTER, Boolean.class)) {
            getSettings().put(ReportConstants.PRINTFOOTER, "false");
         }
         getDocument().newPage();
      }
      if (getValue(DRAWDIRECT, Boolean.class)) {
         this.imageBeingProcessed = img;
         drawOnPage(imageBeingProcessed);
         this.imageBeingProcessed = null;
      } else {
         addToDocument(img);
      }
   }
1157876
public VectorSet map(ExampleSet data, FeatureIndex[] index)
            throws IllegalArgumentException {
        // logger.debug("AbstractMapping.map");

        boolean b = (data instanceof SentenceSetCopy);
        if (!b) {
            throw new IllegalArgumentException();
        }

        VectorSet result = new VectorSet();

        //
        for (int i = 0; i < data.size(); i++) {
            Object x = data.x(i);
            Object y = data.y(i);
            Object id = data.id(i);

            //
            Vector[] subspaces = map(x, id, index);

            // merge subspaces
            Vector space = mergeSubspaces(subspaces);

            // normalize feature space
            // space.normalize();

            // add space
            result.add(space, y, id);
        }
        return result;
    }
488732
public void updateForGraphics(NodeData style, Graphics2D g)
    {
        if (style != null) update(style);
        updateGraphics(g);
        fm = g.getFontMetrics();
        
        //update the width units
        //em has been updated in update()
        
        FontRenderContext frc = new FontRenderContext(null, false, false);
        TextLayout layout = new TextLayout("x", font, frc);
        ex = layout.getBounds().getHeight();
        
        ch = fm.charWidth('0');
    }
792381
public Word07Writer addText(ParagraphAlignment align, Font font, String... texts) {
		final XWPFParagraph p = this.doc.createParagraph();
		if (null != align) {
			p.setAlignment(align);
		}
		if (ArrayUtil.isNotEmpty(texts)) {
			XWPFRun run;
			for (String text : texts) {
				run = p.createRun();
				run.setText(text);
				if (null != font) {
					run.setFontFamily(font.getFamily());
					run.setFontSize(font.getSize());
					run.setBold(font.isBold());
					run.setItalic(font.isItalic());
				}
			}
		}
		return this;
	}
617087
public XmlWrapperParser createParser(byte[] data) {		
        try {
        	ByteArrayInputStream inputStream = new ByteArrayInputStream(data);
			return new XmlWrapperParser(this,inputStream, getSupportedFormat());
		} catch (Exception e) {
			e.printStackTrace();
			throw new KriptonRuntimeException(e);
		}
	}
663645
public static PlotCanvas plot(double[][] data, Line.Style style) {
        return plot(null, data, style);
    }
491702
@Override
   public void addToContainer(Element container, Element element) throws DocumentException, VectorPrintException {
      if (container instanceof TextElementArray) {
         if (element instanceof Image) {
            ((TextElementArray) container).add(new Chunk((Image) element, 0, 0, true));
         } else {
            ((TextElementArray) container).add(element);
         }
      } else if (container instanceof PdfPTable) {
         if (element instanceof PdfPCell) {
            ((PdfPTable) container).addCell((PdfPCell) element);
         } else if (element instanceof Phrase) {
            ((PdfPTable) container).addCell((Phrase) element);
         } else if (element instanceof PdfPTable) {
            ((PdfPTable) container).addCell((PdfPTable) element);
         } else if (element instanceof Image) {
            ((PdfPTable) container).addCell((Image) element);
         } else {
            throw new VectorPrintException(String.format("don't know how to add %s to %s", (element == null) ? "null" : element.getClass().getName(), (container == null) ? "null" : container.getClass().getName()));
         }
      } else if (container instanceof PdfPCell) {
         if (element instanceof PdfPTable) {
            throw new VectorPrintException(String.format("use %s.%s if you want to nest tables", CONTAINER_ELEMENT.class.getName(), CONTAINER_ELEMENT.NESTED_TABLE));
         }
         ((PdfPCell) container).addElement(element);
      } else if (container instanceof ColumnText) {
         ((ColumnText) container).addElement(element);
      } else {
         throw new VectorPrintException(String.format("don't know how to add %s to %s", (element == null) ? "null" : element.getClass().getName(), (container == null) ? "null" : container.getClass().getName()));
      }
   }