diff options
Diffstat (limited to 'src/ooxml/java/org/apache/poi/xslf')
15 files changed, 25 insertions, 25 deletions
diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java index c3fbac9dae..8f13332af2 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java @@ -126,8 +126,8 @@ implements SlideShow<XSLFShape,XSLFTextParagraph> { PresentationDocument.Factory.parse(getCorePart().getInputStream(), DEFAULT_XML_OPTIONS); _presentation = doc.getPresentation(); - Map<String, XSLFSlideMaster> masterMap = new HashMap<String, XSLFSlideMaster>(); - Map<String, XSLFSlide> shIdMap = new HashMap<String, XSLFSlide>(); + Map<String, XSLFSlideMaster> masterMap = new HashMap<>(); + Map<String, XSLFSlide> shIdMap = new HashMap<>(); for (RelationPart rp : getRelationParts()) { POIXMLDocumentPart p = rp.getDocumentPart(); if (p instanceof XSLFSlide) { @@ -143,13 +143,13 @@ implements SlideShow<XSLFShape,XSLFTextParagraph> { } } - _masters = new ArrayList<XSLFSlideMaster>(masterMap.size()); + _masters = new ArrayList<>(masterMap.size()); for (CTSlideMasterIdListEntry masterId : _presentation.getSldMasterIdLst().getSldMasterIdList()) { XSLFSlideMaster master = masterMap.get(masterId.getId2()); _masters.add(master); } - _slides = new ArrayList<XSLFSlide>(shIdMap.size()); + _slides = new ArrayList<>(shIdMap.size()); if (_presentation.isSetSldIdLst()) { for (CTSlideIdListEntry slId : _presentation.getSldIdLst().getSldIdList()) { XSLFSlide sh = shIdMap.get(slId.getId2()); @@ -187,7 +187,7 @@ implements SlideShow<XSLFShape,XSLFTextParagraph> { public List<XSLFPictureData> getPictureData() { if(_pictures == null){ List<PackagePart> mediaParts = getPackage().getPartsByName(Pattern.compile("/ppt/media/.*?")); - _pictures = new ArrayList<XSLFPictureData>(mediaParts.size()); + _pictures = new ArrayList<>(mediaParts.size()); for(PackagePart part : mediaParts){ XSLFPictureData pd = new XSLFPictureData(part); pd.setIndex(_pictures.size()); @@ -354,7 +354,7 @@ implements SlideShow<XSLFShape,XSLFTextParagraph> { Integer themeIndex = 1; // TODO: check if that list can be replaced by idx = Math.max(idx,themeIdx) - List<Integer> themeIndexList = new ArrayList<Integer>(); + List<Integer> themeIndexList = new ArrayList<>(); for (POIXMLDocumentPart p : getRelations()) { if (p instanceof XSLFTheme) { themeIndexList.add(XSLFRelation.THEME.getFileNameIndex(p)); diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java index 2fd3365431..347eaf9f57 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFCommonSlideData.java @@ -54,7 +54,7 @@ public class XSLFCommonSlideData { public List<DrawingTextBody> getDrawingText() { CTGroupShape gs = data.getSpTree(); - List<DrawingTextBody> out = new ArrayList<DrawingTextBody>(); + List<DrawingTextBody> out = new ArrayList<>(); processShape(gs, out); @@ -97,7 +97,7 @@ public class XSLFCommonSlideData { return out; } public List<DrawingParagraph> getText() { - List<DrawingParagraph> paragraphs = new ArrayList<DrawingParagraph>(); + List<DrawingParagraph> paragraphs = new ArrayList<>(); for(DrawingTextBody textBody : getDrawingText()) { paragraphs.addAll(Arrays.asList(textBody.getParagraphs())); } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java index 7084082f44..3c6ae88e0b 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java @@ -391,7 +391,7 @@ implements XSLFShapeContainer, GroupShape<XSLFShape,XSLFTextParagraph> { */ @Override public void clear() { - List<XSLFShape> shapes = new ArrayList<XSLFShape>(getShapes()); + List<XSLFShape> shapes = new ArrayList<>(getShapes()); for(XSLFShape shape : shapes){ removeShape(shape); } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java index 5472011c06..180659a061 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java @@ -99,7 +99,7 @@ implements Notes<XSLFShape,XSLFTextParagraph> { @Override public List<List<XSLFTextParagraph>> getTextParagraphs() { - List<List<XSLFTextParagraph>> tp = new ArrayList<List<XSLFTextParagraph>>(); + List<List<XSLFTextParagraph>> tp = new ArrayList<>(); for (XSLFShape sh : super.getShapes()) { if (sh instanceof XSLFTextShape) { XSLFTextShape txt = (XSLFTextShape)sh; diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFRelation.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFRelation.java index f3f59b918a..3285b67382 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFRelation.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFRelation.java @@ -30,7 +30,7 @@ public class XSLFRelation extends POIXMLRelation { /** * A map to lookup POIXMLRelation by its relation type */ - private static final Map<String, XSLFRelation> _table = new HashMap<String, XSLFRelation>(); + private static final Map<String, XSLFRelation> _table = new HashMap<>(); public static final XSLFRelation MAIN = new XSLFRelation( "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml", diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java index d3af46bff7..6b0734f257 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java @@ -94,7 +94,7 @@ implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> { } protected static List<XSLFShape> buildShapes(CTGroupShape spTree, XSLFSheet sheet){ - List<XSLFShape> shapes = new ArrayList<XSLFShape>(); + List<XSLFShape> shapes = new ArrayList<>(); XmlCursor cur = spTree.newCursor(); try { for (boolean b=cur.toFirstChild();b;b=cur.toNextSibling()) { @@ -324,7 +324,7 @@ implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> { */ @Override public void clear() { - List<XSLFShape> shapes = new ArrayList<XSLFShape>(getShapes()); + List<XSLFShape> shapes = new ArrayList<>(getShapes()); for(XSLFShape shape : shapes){ removeShape(shape); } @@ -472,9 +472,9 @@ implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph> { void initPlaceholders() { if(_placeholders == null) { - _placeholders = new ArrayList<XSLFTextShape>(); - _placeholderByIdMap = new HashMap<Integer, XSLFSimpleShape>(); - _placeholderByTypeMap = new HashMap<Integer, XSLFSimpleShape>(); + _placeholders = new ArrayList<>(); + _placeholderByIdMap = new HashMap<>(); + _placeholderByTypeMap = new HashMap<>(); for(XSLFShape sh : getShapes()){ if(sh instanceof XSLFTextShape){ diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java index eefa79e3b5..cdf034aafb 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java @@ -96,7 +96,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.SldMasterDocument; private Map<String, XSLFSlideLayout> getLayouts(){ if(_layouts == null){ - _layouts = new HashMap<String, XSLFSlideLayout>(); + _layouts = new HashMap<>(); for (POIXMLDocumentPart p : getRelations()) { if (p instanceof XSLFSlideLayout){ XSLFSlideLayout layout = (XSLFSlideLayout)p; diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideShow.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideShow.java index 8a49e39435..c2e6086902 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideShow.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideShow.java @@ -77,7 +77,7 @@ public class XSLFSlideShow extends POIXMLDocument { presentationDoc = PresentationDocument.Factory.parse(getCorePart().getInputStream(), DEFAULT_XML_OPTIONS); - embedds = new LinkedList<PackagePart>(); + embedds = new LinkedList<>(); for (CTSlideIdListEntry ctSlide : getSlideReferences().getSldIdArray()) { PackagePart corePart = getCorePart(); PackagePart slidePart = corePart.getRelatedPart(corePart.getRelationship(ctSlide.getId2())); diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java index 484fa5f66f..f1269a7995 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTable.java @@ -78,7 +78,7 @@ public class XSLFTable extends XSLFGraphicFrame implements Iterable<XSLFTableRow _table = (CTTable)xo; xc.dispose(); - _rows = new ArrayList<XSLFTableRow>(_table.sizeOfTrArray()); + _rows = new ArrayList<>(_table.sizeOfTrArray()); for(CTTableRow row : _table.getTrArray()) { _rows.add(new XSLFTableRow(row, this)); } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableRow.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableRow.java index a49d5a9242..835b4438a7 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableRow.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableRow.java @@ -40,7 +40,7 @@ public class XSLFTableRow implements Iterable<XSLFTableCell> { _row = row; _table = table; CTTableCell[] tcArray = _row.getTcArray(); - _cells = new ArrayList<XSLFTableCell>(tcArray.length); + _cells = new ArrayList<>(tcArray.length); for(CTTableCell cell : tcArray) { _cells.add(new XSLFTableCell(cell, table)); } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableStyles.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableStyles.java index 487b339643..7773883b44 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableStyles.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableStyles.java @@ -51,7 +51,7 @@ public class XSLFTableStyles extends POIXMLDocumentPart implements Iterable<XSLF is.close(); _tblStyleLst = styleDoc.getTblStyleLst(); CTTableStyle[] tblStyleArray = _tblStyleLst.getTblStyleArray(); - _styles = new ArrayList<XSLFTableStyle>(tblStyleArray.length); + _styles = new ArrayList<>(tblStyleArray.length); for(CTTableStyle c : tblStyleArray){ _styles.add(new XSLFTableStyle(c)); } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java index 0944d542ee..4c535cfc04 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java @@ -69,7 +69,7 @@ public class XSLFTextParagraph implements TextParagraph<XSLFShape,XSLFTextParagr XSLFTextParagraph(CTTextParagraph p, XSLFTextShape shape){ _p = p; - _runs = new ArrayList<XSLFTextRun>(); + _runs = new ArrayList<>(); _shape = shape; XmlCursor c = _p.newCursor(); diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextShape.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextShape.java index 502d2b6d04..86aa0b7c88 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextShape.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextShape.java @@ -59,7 +59,7 @@ public abstract class XSLFTextShape extends XSLFSimpleShape /*package*/ XSLFTextShape(XmlObject shape, XSLFSheet sheet) { super(shape, sheet); - _paragraphs = new ArrayList<XSLFTextParagraph>(); + _paragraphs = new ArrayList<>(); CTTextBody txBody = getTextBody(false); if (txBody != null) { for (CTTextParagraph p : txBody.getPArray()) { diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTheme.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTheme.java index d3bd3a847c..dce8a2a026 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTheme.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTheme.java @@ -75,7 +75,7 @@ public class XSLFTheme extends POIXMLDocumentPart { CTBaseStyles elems = _theme.getThemeElements(); CTColorScheme scheme = elems.getClrScheme(); // The color scheme is responsible for defining a list of twelve colors. - _schemeColors = new HashMap<String, CTColor>(12); + _schemeColors = new HashMap<>(12); for(XmlObject o : scheme.selectPath("*")){ CTColor c = (CTColor)o; String name = c.getDomNode().getLocalName(); diff --git a/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java b/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java index 31475410df..938e966a68 100644 --- a/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java +++ b/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java @@ -174,7 +174,7 @@ public class PPTX2PNG { } private static Set<Integer> slideIndexes(final int slideCount, String range) { - Set<Integer> slideIdx = new TreeSet<Integer>(); + Set<Integer> slideIdx = new TreeSet<>(); if ("-1".equals(range)) { for (int i=0; i<slideCount; i++) { slideIdx.add(i); |