Tabnine Logo
CTGraphicalObject
Code IndexAdd Tabnine to your IDE (free)

How to use
CTGraphicalObject
in
org.openxmlformats.schemas.drawingml.x2006.main

Best Java code snippets using org.openxmlformats.schemas.drawingml.x2006.main.CTGraphicalObject (Showing top 20 results out of 315)

origin: org.apache.poi/poi-ooxml

/**
 * Assign a DrawingML chart to the graphic frame.
 */
protected void setChart(XSSFChart chart, String relId) {
  CTGraphicalObjectData data = graphicFrame.getGraphic().addNewGraphicData();
  appendChartElement(data, relId);
  chart.setGraphicFrame(this);
}
origin: org.apache.poi/poi-ooxml

private static String getUri(CTGraphicalObjectFrame shape) {
  final CTGraphicalObject g = shape.getGraphic();
  if (g == null) {
    return null;
  }
  CTGraphicalObjectData gd = g.getGraphicData();
  return (gd == null) ? null : gd.getUri();
}
origin: org.apache.poi/poi-ooxml

/**
 * Construct a new XSSFGraphicFrame object.
 *
 * @param drawing the XSSFDrawing that owns this frame
 * @param ctGraphicFrame the XML bean that stores this frame content
 */
protected XSSFGraphicFrame(XSSFDrawing drawing, CTGraphicalObjectFrame ctGraphicFrame) {
  this.drawing = drawing; // protected field on XSSFShape
  this.graphicFrame = ctGraphicFrame;
  // TODO: there may be a better way to delegate this
  CTGraphicalObjectData graphicData = graphicFrame.getGraphic().getGraphicData();
  if (graphicData != null) {
    NodeList nodes = graphicData.getDomNode().getChildNodes();
    for (int i = 0; i < nodes.getLength(); i++) {
      final Node node = nodes.item(i);
      // if the frame references a chart, associate the chart with this instance
      if (node.getNodeName().equals("c:chart")) {
        // this better succeed or the document is invalid
        POIXMLDocumentPart relation = drawing.getRelationById(node.getAttributes().getNamedItem("r:id").getNodeValue());
        // Do XWPF charts need similar treatment?
        if (relation instanceof XSSFChart) {
          ((XSSFChart) relation).setGraphicFrame(this);
        }
      }
    }
  }
}
origin: org.apache.poi/poi-ooxml

static CTGraphicalObjectFrame prototype(int shapeId){
  CTGraphicalObjectFrame frame = CTGraphicalObjectFrame.Factory.newInstance();
  CTGraphicalObjectFrameNonVisual nvGr = frame.addNewNvGraphicFramePr();
  CTNonVisualDrawingProps cnv = nvGr.addNewCNvPr();
  cnv.setName("Table " + shapeId);
  cnv.setId(shapeId);
  nvGr.addNewCNvGraphicFramePr().addNewGraphicFrameLocks().setNoGrp(true);
  nvGr.addNewNvPr();
  frame.addNewXfrm();
  CTGraphicalObjectData gr = frame.addNewGraphic().addNewGraphicData();
  XmlCursor grCur = gr.newCursor();
  grCur.toNextToken();
  grCur.beginElement(new QName(XSLFRelation.NS_DRAWINGML, "tbl"));
  
  CTTable tbl = CTTable.Factory.newInstance();
  tbl.addNewTblPr();
  tbl.addNewTblGrid();
  XmlCursor tblCur = tbl.newCursor();
  
  tblCur.moveXmlContents(grCur);
  tblCur.dispose();
  grCur.dispose();
  gr.setUri(TABLE_URI);
  return frame;
}
origin: org.apache.poi/poi-ooxml

@Override
void copy(XSLFShape sh){
  super.copy(sh);
  CTGraphicalObjectData data = ((CTGraphicalObjectFrame)getXmlObject()).getGraphic().getGraphicData();
  String uri = data.getUri();
  if(uri.equals("http://schemas.openxmlformats.org/drawingml/2006/diagram")){
    copyDiagram(data, (XSLFGraphicFrame)sh);
  } if(uri.equals("http://schemas.openxmlformats.org/drawingml/2006/chart")){
    copyChart(data, (XSLFGraphicFrame)sh);
  } else {
    // TODO  support other types of objects
  }
}
origin: org.apache.poi/poi-ooxml

CTGraphicalObjectData gr = frame.addNewGraphic().addNewGraphicData();
gr.setUri(OLE_URI);
XmlCursor grCur = gr.newCursor();
origin: org.apache.poi/poi-ooxml

/*package*/ XSLFObjectShape(CTGraphicalObjectFrame shape, XSLFSheet sheet){
  super(shape, sheet);
  CTGraphicalObjectData god = shape.getGraphic().getGraphicData();
  XmlCursor xc = god.newCursor();
  // select oleObj potentially under AlternateContent
  // usually the mc:Choice element will be selected first
  xc.selectPath("declare namespace p='"+PML_NS+"' .//p:oleObj");
  try {
    if (!xc.toNextSelection()) {
      throw new IllegalStateException("p:oleObj element was not found in\n " + god);
    }
    XmlObject xo = xc.getObject();
    // Pesky XmlBeans bug - see Bugzilla #49934
    // it never happens when using the full ooxml-schemas jar but may happen with the abridged poi-ooxml-schemas
    if (xo instanceof XmlAnyTypeImpl){
      String errStr =
        "Schemas (*.xsb) for CTOleObject can't be loaded - usually this happens when OSGI " +
        "loading is used and the thread context classloader has no reference to " +
        "the xmlbeans classes - use POIXMLTypeLoader.setClassLoader() to set the loader, " +
        "e.g. with CTOleObject.class.getClassLoader()"
      ;
      throw new IllegalStateException(errStr);
    }
    _oleObject = (CTOleObject)xo;
  } finally {
    xc.dispose();
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Assign a DrawingML chart to the graphic frame.
 */
protected void setChart(XSSFChart chart, String relId) {
  CTGraphicalObjectData data = graphicFrame.getGraphic().addNewGraphicData();
  appendChartElement(data, relId);
  chart.setGraphicFrame(this);
}
origin: org.apache.poi/poi-ooxml

/*package*/ XSLFTable(CTGraphicalObjectFrame shape, XSLFSheet sheet){
  super(shape, sheet);
  CTGraphicalObjectData god = shape.getGraphic().getGraphicData();
  XmlCursor xc = god.newCursor();
  try {
    if (!xc.toChild(XSLFRelation.NS_DRAWINGML, "tbl")) {
      throw new IllegalStateException("a:tbl element was not found in\n " + god);
    }

    XmlObject xo = xc.getObject();
    // Pesky XmlBeans bug - see Bugzilla #49934
    // it never happens when using the full ooxml-schemas jar but may happen with the abridged poi-ooxml-schemas
    if (xo instanceof XmlAnyTypeImpl){
      String errStr =
        "Schemas (*.xsb) for CTTable can't be loaded - usually this happens when OSGI " +
        "loading is used and the thread context classloader has no reference to " +
        "the xmlbeans classes"
      ;
      throw new IllegalStateException(errStr);
    }
    _table = (CTTable)xo;
  } finally {
    xc.dispose();
  }
  _rows = new ArrayList<>(_table.sizeOfTrArray());
  for(CTTableRow row : _table.getTrList()) {
    _rows.add(new XSLFTableRow(row, this));
  }
  updateRowColIndexes();
}
origin: org.openl.rules/org.openl.lib.poi.dev

/**
 * Assign a DrawingML chart to the graphic frame.
 */
protected void setChart(XSSFChart chart, String relId) {
  CTGraphicalObjectData data = graphicFrame.getGraphic().addNewGraphicData();
  appendChartElement(data, relId);
  chart.setGraphicFrame(this);
  return;
}
origin: org.apache.poi/poi-ooxml

CTGraphicalObjectData graphicData = graphic.getGraphicData();
CTPicture pic = getCTPictures(graphicData).get(0);
origin: com.arsframework/ars-core

  .append("\"/></a:xfrm><a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic>")
  .toString();
inline.addNewGraphic().addNewGraphicData();
try {
  XmlToken xmlToken = XmlToken.Factory.parse(picXml);
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

private static String getUri(CTGraphicalObjectFrame shape) {
  final CTGraphicalObject g = shape.getGraphic();
  if (g == null) {
    return null;
  }
  CTGraphicalObjectData gd = g.getGraphicData();
  return (gd == null) ? null : gd.getUri();
}
origin: org.openl.rules/org.openl.lib.poi.dev

static CTGraphicalObjectFrame prototype(int shapeId){
  CTGraphicalObjectFrame frame = CTGraphicalObjectFrame.Factory.newInstance();
  CTGraphicalObjectFrameNonVisual nvGr = frame.addNewNvGraphicFramePr();
  CTNonVisualDrawingProps cnv = nvGr.addNewCNvPr();
  cnv.setName("Table " + shapeId);
  cnv.setId(shapeId + 1);
  nvGr.addNewCNvGraphicFramePr().addNewGraphicFrameLocks().setNoGrp(true);
  nvGr.addNewNvPr();
  frame.addNewXfrm();
  CTGraphicalObjectData gr = frame.addNewGraphic().addNewGraphicData();
  XmlCursor cursor = gr.newCursor();
  cursor.toNextToken();
  cursor.beginElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tbl"));
  cursor.beginElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tblPr"));
  cursor.toNextToken();
  cursor.beginElement(new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tblGrid"));
  cursor.dispose();
  gr.setUri(TABLE_URI);
  return frame;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Construct a new XSSFGraphicFrame object.
 *
 * @param drawing the XSSFDrawing that owns this frame
 * @param ctGraphicFrame the XML bean that stores this frame content
 */
protected XSSFGraphicFrame(XSSFDrawing drawing, CTGraphicalObjectFrame ctGraphicFrame) {
  this.drawing = drawing; // protected field on XSSFShape
  this.graphicFrame = ctGraphicFrame;
  // TODO: there may be a better way to delegate this
  CTGraphicalObjectData graphicData = graphicFrame.getGraphic().getGraphicData();
  if (graphicData != null) {
    NodeList nodes = graphicData.getDomNode().getChildNodes();
    for (int i = 0; i < nodes.getLength(); i++) {
      final Node node = nodes.item(i);
      // if the frame references a chart, associate the chart with this instance
      if (node.getNodeName().equals("c:chart")) {
        // this better succeed or the document is invalid
        POIXMLDocumentPart relation = drawing.getRelationById(node.getAttributes().getNamedItem("r:id").getNodeValue());
        // Do XWPF charts need similar treatment?
        if (relation instanceof XSSFChart) {
          ((XSSFChart) relation).setGraphicFrame(this);
        }
      }
    }
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

static CTGraphicalObjectFrame prototype(int shapeId){
  CTGraphicalObjectFrame frame = CTGraphicalObjectFrame.Factory.newInstance();
  CTGraphicalObjectFrameNonVisual nvGr = frame.addNewNvGraphicFramePr();
  CTNonVisualDrawingProps cnv = nvGr.addNewCNvPr();
  cnv.setName("Table " + shapeId);
  cnv.setId(shapeId);
  nvGr.addNewCNvGraphicFramePr().addNewGraphicFrameLocks().setNoGrp(true);
  nvGr.addNewNvPr();
  frame.addNewXfrm();
  CTGraphicalObjectData gr = frame.addNewGraphic().addNewGraphicData();
  XmlCursor grCur = gr.newCursor();
  grCur.toNextToken();
  grCur.beginElement(new QName(XSLFRelation.NS_DRAWINGML, "tbl"));
  
  CTTable tbl = CTTable.Factory.newInstance();
  tbl.addNewTblPr();
  tbl.addNewTblGrid();
  XmlCursor tblCur = tbl.newCursor();
  
  tblCur.moveXmlContents(grCur);
  tblCur.dispose();
  grCur.dispose();
  gr.setUri(TABLE_URI);
  return frame;
}
origin: org.openl.rules/org.openl.lib.poi.dev

static XSLFGraphicFrame create(CTGraphicalObjectFrame shape, XSLFSheet sheet){
  String uri = shape.getGraphic().getGraphicData().getUri();
  if(XSLFTable.TABLE_URI.equals(uri)){
    return new XSLFTable(shape, sheet);
  } else {
    return new XSLFGraphicFrame(shape, sheet);
  }
}
origin: com.github.nic-luo/rober-office

    + "   </a:graphicData>" + "</a:graphic>";  
inline.addNewGraphic().addNewGraphicData();  
XmlToken xmlToken = null;  
xmlToken = XmlToken.Factory.parse(picXml);  
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

@Override
void copy(XSLFShape sh){
  super.copy(sh);
  CTGraphicalObjectData data = ((CTGraphicalObjectFrame)getXmlObject()).getGraphic().getGraphicData();
  String uri = data.getUri();
  if(uri.equals("http://schemas.openxmlformats.org/drawingml/2006/diagram")){
    copyDiagram(data, (XSLFGraphicFrame)sh);
  } if(uri.equals("http://schemas.openxmlformats.org/drawingml/2006/chart")){
    copyChart(data, (XSLFGraphicFrame)sh);
  } else {
    // TODO  support other types of objects
  }
}
origin: imalexyang/ExamStack

inline.addNewGraphic().addNewGraphicData();
XmlToken xmlToken = null;
try {
org.openxmlformats.schemas.drawingml.x2006.mainCTGraphicalObject

Most used methods

  • addNewGraphicData
  • getGraphicData

Popular in Java

  • Parsing JSON documents to java classes using gson
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getContentResolver (Context)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JTable (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now