import org.apache.poi.POIXMLException;
import org.apache.poi.openxml4j.opc.PackagePart;
-import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.util.Internal;
import org.apache.poi.xdgf.exceptions.XDGFException;
import org.apache.poi.xdgf.usermodel.shape.ShapeRenderer;
/**
* Draws the contents of a page onto a Graphics2D object
*
- * @param graphics
+ * @param graphics The context to draw on.
*/
public void draw(Graphics2D graphics) {
visitShapes(new ShapeRenderer(graphics));
}
/**
- * @param cell
+ * @param cell The type of the cell
* @return A value converted to inches
*/
public static Double parseVLength(CellType cell) {
try {
_pageContents = MasterContentsDocument.Factory.parse(getPackagePart().getInputStream()).getMasterContents();
- } catch (XmlException e) {
- throw new POIXMLException(e);
- } catch (IOException e) {
+ } catch (XmlException | IOException e) {
throw new POIXMLException(e);
}
try {
try {
_mastersObject = MastersDocument.Factory.parse(getPackagePart().getInputStream()).getMasters();
- } catch (XmlException e) {
- throw new POIXMLException(e);
- } catch (IOException e) {
+ } catch (XmlException | IOException e) {
throw new POIXMLException(e);
}
try {
try {
_pageContents = PageContentsDocument.Factory.parse(getPackagePart().getInputStream()).getPageContents();
- } catch (XmlException e) {
- throw new POIXMLException(e);
- } catch (IOException e) {
+ } catch (XmlException | IOException e) {
throw new POIXMLException(e);
}
try {
try {
_pagesObject = PagesDocument.Factory.parse(getPackagePart().getInputStream()).getPages();
- } catch (XmlException e) {
- throw new POIXMLException(e);
- } catch (IOException e) {
+ } catch (XmlException | IOException e) {
throw new POIXMLException(e);
}
}
public Color getFontColor() {
- Color fontColor = null;
+ Color fontColor;
if (_character != null) {
fontColor = _character.getFontColor();
}
public Double getFontSize() {
- Double fontSize = null;
+ Double fontSize;
if (_character != null) {
fontSize = _character.getFontSize();
import org.apache.poi.POIXMLDocument;
import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.POIXMLException;
-import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
try {
document = VisioDocumentDocument1.Factory.parse(getPackagePart().getInputStream()).getVisioDocument();
- } catch (XmlException e) {
- throw new POIXMLException(e);
- } catch (IOException e) {
+ } catch (XmlException | IOException e) {
throw new POIXMLException(e);
}
}
@Override
- protected void onDocumentRead() throws IOException {
+ protected void onDocumentRead() {
// by the time this gets called, all other document parts should
// have been loaded, so it's safe to build the document structure
* Not currently implemented
*/
@Override
- public List<PackagePart> getAllEmbedds() throws OpenXML4JException {
+ public List<PackagePart> getAllEmbedds() {
return new ArrayList<>();
}
_sectionTypes.put("Reviewer", GenericSection.class, SectionType.class, XDGFSheet.class);
_sectionTypes.put("Annotation", GenericSection.class, SectionType.class, XDGFSheet.class);
_sectionTypes.put("ActionTag", GenericSection.class, SectionType.class, XDGFSheet.class);
- } catch (NoSuchMethodException e) {
- throw new POIXMLException("Internal error");
- } catch (SecurityException e) {
+ } catch (NoSuchMethodException | SecurityException e) {
throw new POIXMLException("Internal error");
}
if (deleted != null)
return deleted;
- if (_master != null)
- return _master.getDel();
-
- return false;
+ return _master != null && _master.getDel();
}
public Double getX() {
if (deleted != null)
return deleted;
- if (_master != null)
- return _master.getDel();
-
- return false;
+ return _master != null && _master.getDel();
}
public Double getX() {
if (deleted != null)
return deleted;
- if (_master != null)
- return _master.getDel();
-
- return false;
+ return _master != null && _master.getDel();
}
public Double getX() {
_rowTypes.put("RelQuadBezTo", RelQuadBezTo.class, RowType.class);
_rowTypes.put("SplineKnot", SplineKnot.class, RowType.class);
_rowTypes.put("SplineStart", SplineStart.class, RowType.class);
- } catch (NoSuchMethodException e) {
- throw new POIXMLException("Internal error", e);
- } catch (SecurityException e) {
+ } catch (NoSuchMethodException | SecurityException e) {
throw new POIXMLException("Internal error", e);
}
if (deleted != null)
return deleted;
- if (_master != null)
- return _master.getDel();
-
- return false;
+ return _master != null && _master.getDel();
}
public Double getX() {
if (deleted != null)
return deleted;
- if (_master != null)
- return _master.getDel();
-
- return false;
+ return _master != null && _master.getDel();
}
public Double getX() {
if (deleted != null)
return deleted;
- if (_master != null)
- return _master.getDel();
-
- return false;
+ return _master != null && _master.getDel();
}
public Double getX() {
if (deleted != null)
return deleted;
- if (_master != null)
- return _master.getDel();
-
- return false;
+ return _master != null && _master.getDel();
}
public Double getX() {
if (deleted != null)
return deleted;
- if (_master != null)
- return _master.getDel();
-
- return false;
+ return _master != null && _master.getDel();
}
public Double getX() {
if (deleted != null)
return deleted;
- if (_master != null)
- return _master.getDel();
-
- return false;
+ return _master != null && _master.getDel();
}
public Double getX() {
if (deleted != null)
return deleted;
- if (_master != null)
- return _master.getDel();
-
- return false;
+ return _master != null && _master.getDel();
}
public Double getX() {
if (deleted != null)
return deleted;
- if (_master != null)
- return _master.getDel();
-
- return false;
+ return _master != null && _master.getDel();
}
public Double getX() {
if (deleted != null)
return deleted;
- if (_master != null)
- return _master.getDel();
-
- return false;
+ return _master != null && _master.getDel();
}
public Double getX() {
if (deleted != null)
return deleted;
- if (_master != null)
- return _master.getDel();
-
- return false;
+ return _master != null && _master.getDel();
}
public Double getX() {
if (deleted != null)
return deleted;
- if (_master != null)
- return _master.getDel();
-
- return false;
+ return _master != null && _master.getDel();
}
public Double getX() {
if (deleted != null)
return deleted;
- if (_master != null)
- return _master.getDel();
-
- return false;
+ return _master != null && _master.getDel();
}
public Double getX() {