com.hfg.xml.msofficexml.docx.drawingml.DmlShape Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com_hfg Show documentation
Show all versions of com_hfg Show documentation
com.hfg xml, html, svg, and bioinformatics utility library
package com.hfg.xml.msofficexml.docx.drawingml;
import com.hfg.xml.msofficexml.docx.Docx;
import com.hfg.xml.msofficexml.docx.drawingml.text.DmlTextBody;
import com.hfg.xml.msofficexml.docx.wordprocessingml.WmlXMLTag;
public class DmlShape extends WmlXMLTag
{
private DmlNonVisualShapeDrawingProperties mDmlNonVisualShapeDrawingProperties;
private DmlTextBody mTextBox;
//---------------------------------------------------------------------------
public DmlShape(Docx inDocx)
{
super(DmlXML.SHAPE, inDocx);
}
//---------------------------------------------------------------------------
/**
* Returns the non-visual shape drawing properties (<p:nvSpPr>) tag if one exists or else instantiates a new one.
* @return the non-visual shape drawing properties (<p:nvSpPr>) for this shape tag
*/
public DmlNonVisualShapeDrawingProperties getNonVisualShapeDrawingProperties()
{
if (null == mDmlNonVisualShapeDrawingProperties)
{
// Check if it has been added via addSubtag()...
mDmlNonVisualShapeDrawingProperties = getOptionalSubtagByName(DmlXML.NON_VISUAL_SHAPE_DRAWING_PROPS);
if (null == mDmlNonVisualShapeDrawingProperties)
{
mDmlNonVisualShapeDrawingProperties = new DmlNonVisualShapeDrawingProperties(getParentDoc());
addSubtag(mDmlNonVisualShapeDrawingProperties);
}
}
return mDmlNonVisualShapeDrawingProperties;
}
//---------------------------------------------------------------------------
public DmlTextBody getTextBox()
{
if (null == mTextBox)
{
// Check if it has been added via addSubtag()...
mTextBox = getOptionalSubtagByName(DmlXML.TEXT_BODY);
if (null == mTextBox)
{
mTextBox = new DmlTextBody(getParentDoc());
addSubtag(mTextBox);
}
}
return mTextBox;
}
}