Package org.openxmlformats.schemas.drawingml.x2006.main

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTPresetLineDashProperties


     * @param lineStyle
     */
    public void setLineStyle( int lineStyle ) {
        CTShapeProperties props = getShapeProperties();
        CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn();
        CTPresetLineDashProperties dashStyle = CTPresetLineDashProperties.Factory.newInstance();
        dashStyle.setVal(STPresetLineDashVal.Enum.forInt(lineStyle+1));
        ln.setPrstDash(dashStyle);
    }
View Full Code Here


        CTShapeProperties spPr = getSpPr();
        if(dash == null) {
            if(spPr.isSetLn()) spPr.getLn().unsetPrstDash();
        }
        else {
            CTPresetLineDashProperties val = CTPresetLineDashProperties.Factory.newInstance();
            val.setVal(STPresetLineDashVal.Enum.forInt(dash.ordinal() + 1));
            CTLineProperties ln = spPr.isSetLn() ? spPr.getLn() : spPr.addNewLn();
            ln.setPrstDash(val);
        }
    }
View Full Code Here

    public LineDash getLineDash(){
        CTShapeProperties spPr = getSpPr();
        CTLineProperties ln = spPr.getLn();
        if(ln == null || !ln.isSetPrstDash()) return null;

        CTPresetLineDashProperties dash = ln.getPrstDash();
        return LineDash.values()[dash.getVal().intValue() - 1];
    }
View Full Code Here

*/
public class TestXSLFColor extends TestCase {

    public void testGetters() {
        CTColor xml = CTColor.Factory.newInstance();
        CTSRgbColor c = xml.addNewSrgbClr();
        c.setVal(new byte[]{(byte)0xFF, 0, 0});

        XSLFColor color = new XSLFColor(xml, null, null);

        assertEquals(-1, color.getAlpha());
        c.addNewAlpha().setVal(50000);
        assertEquals(50, color.getAlpha());

        assertEquals(-1, color.getAlphaMod());
        c.addNewAlphaMod().setVal(50000);
        assertEquals(50, color.getAlphaMod());

        assertEquals(-1, color.getAlphaOff());
        c.addNewAlphaOff().setVal(50000);
        assertEquals(50, color.getAlphaOff());

        assertEquals(-1, color.getLumMod());
        c.addNewLumMod().setVal(50000);
        assertEquals(50, color.getLumMod());

        assertEquals(-1, color.getLumOff());
        c.addNewLumOff().setVal(50000);
        assertEquals(50, color.getLumOff());

        assertEquals(-1, color.getSat());
        c.addNewSat().setVal(50000);
        assertEquals(50, color.getSat());

        assertEquals(-1, color.getSatMod());
        c.addNewSatMod().setVal(50000);
        assertEquals(50, color.getSatMod());

        assertEquals(-1, color.getSatOff());
        c.addNewSatOff().setVal(50000);
        assertEquals(50, color.getSatOff());

        assertEquals(-1, color.getRed());
        c.addNewRed().setVal(50000);
        assertEquals(50, color.getRed());

        assertEquals(-1, color.getGreen());
        c.addNewGreen().setVal(50000);
        assertEquals(50, color.getGreen());

        assertEquals(-1, color.getBlue());
        c.addNewBlue().setVal(50000);
        assertEquals(50, color.getRed());

        assertEquals(-1, color.getShade());
        c.addNewShade().setVal(50000);
        assertEquals(50, color.getShade());

        assertEquals(-1, color.getTint());
        c.addNewTint().setVal(50000);
        assertEquals(50, color.getTint());
    }
View Full Code Here

          CTBlipFillProperties blipFill = pic.addNewBlipFill();
          CTBlip blip = blipFill.addNewBlip();
          blip.setEmbed( picData.getPackageRelationship().getId() );
          blipFill.addNewStretch().addNewFillRect();
         
          CTShapeProperties spPr = pic.addNewSpPr();
          CTTransform2D xfrm = spPr.addNewXfrm();
         
          CTPoint2D off = xfrm.addNewOff();
          off.setX(0);
          off.setY(0);
         
          CTPositiveSize2D ext = xfrm.addNewExt();
          ext.setCx(width);
          ext.setCy(height);
         
          CTPresetGeometry2D prstGeom = spPr.addNewPrstGeom();
          prstGeom.setPrst(STShapeType.RECT);
          prstGeom.addNewAvLst();
         
          // Finish up
          XWPFPicture xwpfPicture = new XWPFPicture(pic, paragraph);
View Full Code Here

            CTBlipFillProperties blip = pic.addNewBlipFill();
            blip.addNewBlip().setEmbed("");
            blip.addNewStretch().addNewFillRect();

            CTShapeProperties sppr = pic.addNewSpPr();
            CTTransform2D t2d = sppr.addNewXfrm();
            CTPositiveSize2D ext = t2d.addNewExt();
            //should be original picture width and height expressed in EMUs
            ext.setCx(0);
            ext.setCy(0);

            CTPoint2D off = t2d.addNewOff();
            off.setX(0);
            off.setY(0);

            CTPresetGeometry2D prstGeom = sppr.addNewPrstGeom();
            prstGeom.setPrst(STShapeType.RECT);
            prstGeom.addNewAvLst();

            prototype = pic;
        }
View Full Code Here

            CTBlipFillProperties blip = pic.addNewBlipFill();
            blip.addNewBlip().setEmbed("");
            blip.addNewStretch().addNewFillRect();

            CTShapeProperties sppr = pic.addNewSpPr();
            CTTransform2D t2d = sppr.addNewXfrm();
            CTPositiveSize2D ext = t2d.addNewExt();
            //should be original picture width and height expressed in EMUs
            ext.setCx(0);
            ext.setCy(0);

            CTPoint2D off = t2d.addNewOff();
            off.setX(0);
            off.setY(0);

            CTPresetGeometry2D prstGeom = sppr.addNewPrstGeom();
            prstGeom.setPrst(STShapeType.RECT);
            prstGeom.addNewAvLst();

            prototype = pic;
        }
View Full Code Here

  }

  private void extractShapeContent(StringBuilder buffy, CTGroupShape gs) {
    CTShape[] shapes = gs.getSpArray();
    for (CTShape shape : shapes) {
      CTTextBody textBody = shape.getTxBody();
      if (textBody != null) {
        CTTextParagraph[] paras = textBody.getPArray();
        for (CTTextParagraph textParagraph : paras) {
          CTRegularTextRun[] textRuns = textParagraph.getRArray();
          for (CTRegularTextRun textRun : textRuns) {
            buffy.append(textRun.getT()).append(' ');
          }
View Full Code Here

    private void extractShapeContent(CTGroupShape gs, XHTMLContentHandler xhtml)
            throws SAXException {
        CTShape[] shapes = gs.getSpArray();
        for (CTShape shape : shapes) {
            CTTextBody textBody = shape.getTxBody();
            if (textBody != null) {
                CTTextParagraph[] paras = textBody.getPArray();
                for (CTTextParagraph textParagraph : paras) {
                    CTRegularTextRun[] textRuns = textParagraph.getRArray();
                    for (CTRegularTextRun textRun : textRuns) {
                        xhtml.element("p", textRun.getT());
                    }
View Full Code Here

      CTNonVisualDrawingProps props = nvGraphic.addNewCNvPr();
      props.setId(0);
      props.setName("Diagramm 1");
      nvGraphic.addNewCNvGraphicFramePr();

      CTTransform2D transform = graphicFrame.addNewXfrm();
      CTPositiveSize2D extPoint = transform.addNewExt();
      CTPoint2D offPoint = transform.addNewOff();

      extPoint.setCx(0);
      extPoint.setCy(0);
      offPoint.setX(0);
      offPoint.setY(0);
View Full Code Here

TOP

Related Classes of org.openxmlformats.schemas.drawingml.x2006.main.CTPresetLineDashProperties

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.