From 996c9dd93c1213fa7b324ca95df49b7622303000 Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Sat, 21 Feb 2015 10:56:03 +0000 Subject: [PATCH] initial commit - still lots of errors, but I need to switch to a clean trunk for releasing and testing git-svn-id: https://svn.apache.org/repos/asf/poi/branches/common_sl@1661322 13f79535-47bb-0310-9956-ffa450edef68 --- build.xml | 40 +- .../poi/hslf/examples/ApacheconEU08.java | 3 +- .../apache/poi/xslf/usermodel/Tutorial4.java | 2 + .../poi/hssf/usermodel/HSSFPatriarch.java | 2 +- src/java/org/apache/poi/util/Units.java | 25 +- .../poi/xslf/model/PropertyFetcher.java | 4 +- .../poi/xslf/model/geom/PresetGeometries.java | 67 - .../apache/poi/xslf/usermodel/LineDash.java | 34 - .../poi/xslf/usermodel/RenderableShape.java | 2 + .../apache/poi/xslf/usermodel/TextAlign.java | 50 - .../poi/xslf/usermodel/TextAutofit.java | 59 - .../poi/xslf/usermodel/TextDirection.java | 48 - .../poi/xslf/usermodel/TextFragment.java | 90 - .../poi/xslf/usermodel/XMLSlideShow.java | 30 +- .../poi/xslf/usermodel/XSLFAutoShape.java | 3 +- .../poi/xslf/usermodel/XSLFBackground.java | 19 +- .../apache/poi/xslf/usermodel/XSLFColor.java | 210 +- .../poi/xslf/usermodel/XSLFGraphicFrame.java | 6 +- .../poi/xslf/usermodel/XSLFGroupShape.java | 30 +- .../apache/poi/xslf/usermodel/XSLFNotes.java | 21 +- .../poi/xslf/usermodel/XSLFNotesMaster.java | 5 +- .../apache/poi/xslf/usermodel/XSLFShadow.java | 3 +- .../apache/poi/xslf/usermodel/XSLFShape.java | 540 +- .../xslf/usermodel/XSLFShapeContainer.java | 25 +- .../poi/xslf/usermodel/XSLFShapeType.java | 236 - .../apache/poi/xslf/usermodel/XSLFSheet.java | 28 +- .../poi/xslf/usermodel/XSLFSimpleShape.java | 281 +- .../apache/poi/xslf/usermodel/XSLFSlide.java | 46 +- .../poi/xslf/usermodel/XSLFSlideLayout.java | 3 +- .../poi/xslf/usermodel/XSLFSlideMaster.java | 6 +- .../poi/xslf/usermodel/XSLFTableCell.java | 1 + .../poi/xslf/usermodel/XSLFTextParagraph.java | 340 +- .../poi/xslf/usermodel/XSLFTextRun.java | 3 +- .../poi/xslf/usermodel/XSLFTextShape.java | 163 +- .../poi/xslf/usermodel/TestXSLFAutoShape.java | 12 +- .../usermodel/TestXSLFConnectorShape.java | 6 +- .../xslf/usermodel/TestXSLFSimpleShape.java | 2 + .../poi/xslf/usermodel/TestXSLFTable.java | 2 + .../xslf/usermodel/TestXSLFTextParagraph.java | 3 + .../poi/xslf/usermodel/TestXSLFTextShape.java | 3 + .../poi/sl/draw/presetShapeDefinitions.xml | 19906 ++++++++++++++++ .../apache/poi/hslf/model/ActiveXShape.java | 6 +- .../org/apache/poi/hslf/model/AutoShape.java | 12 +- .../org/apache/poi/hslf/model/AutoShapes.java | 45 +- .../org/apache/poi/hslf/model/Background.java | 22 +- .../org/apache/poi/hslf/model/Freeform.java | 10 +- .../org/apache/poi/hslf/model/Hyperlink.java | 6 +- .../src/org/apache/poi/hslf/model/Line.java | 8 +- .../org/apache/poi/hslf/model/MovieShape.java | 5 +- .../org/apache/poi/hslf/model/OLEShape.java | 5 +- .../apache/poi/hslf/model/PPGraphics2D.java | 7 +- .../org/apache/poi/hslf/model/Picture.java | 10 +- .../apache/poi/hslf/model/Placeholder.java | 5 +- .../org/apache/poi/hslf/model/Polygon.java | 10 +- .../src/org/apache/poi/hslf/model/Shape.java | 79 +- .../apache/poi/hslf/model/ShapeFactory.java | 20 +- .../org/apache/poi/hslf/model/ShapeGroup.java | 80 +- .../org/apache/poi/hslf/model/ShapeTypes.java | 57 - .../src/org/apache/poi/hslf/model/Sheet.java | 78 +- .../apache/poi/hslf/model/SimpleShape.java | 19 +- .../src/org/apache/poi/hslf/model/Slide.java | 8 +- .../src/org/apache/poi/hslf/model/Table.java | 33 +- .../org/apache/poi/hslf/model/TableCell.java | 16 +- .../org/apache/poi/hslf/model/TextBox.java | 8 +- .../org/apache/poi/hslf/model/TextShape.java | 19 +- .../org/apache/poi/hslf/record/PPDrawing.java | 16 +- .../org/apache/poi/sl/draw/DrawAutoShape.java | 10 + .../org/apache/poi/sl/draw/DrawFactory.java | 96 + .../apache/poi/sl/draw/DrawFontManager.java} | 21 +- .../apache/poi/sl/draw/DrawFreeformShape.java | 9 + .../apache/poi/sl/draw/DrawMasterSheet.java | 22 + .../src/org/apache/poi/sl/draw/DrawPaint.java | 448 + .../src/org/apache/poi/sl/draw/DrawShape.java | 109 + .../src/org/apache/poi/sl/draw/DrawSheet.java | 72 + .../apache/poi/sl/draw/DrawSimpleShape.java | 391 + .../org/apache/poi/sl/draw/DrawTextBox.java | 9 + .../apache/poi/sl/draw/DrawTextFragment.java | 94 + .../apache/poi/sl/draw/DrawTextParagraph.java | 381 + .../org/apache/poi/sl/draw/DrawTextShape.java | 140 + .../src/org/apache/poi/sl/draw/Drawable.java | 123 + .../org/apache/poi/sl/draw/ImageRenderer.java | 155 + .../poi/sl/draw/binding/CTAdjPoint2D.java | 126 + .../sl/draw/binding/CTAdjustHandleList.java | 116 + .../apache/poi/sl/draw/binding/CTAngle.java | 86 + .../apache/poi/sl/draw/binding/CTColor.java | 254 + .../poi/sl/draw/binding/CTColorMRU.java | 123 + .../draw/binding/CTComplementTransform.java | 62 + .../poi/sl/draw/binding/CTConnection.java | 112 + .../poi/sl/draw/binding/CTConnectionSite.java | 131 + .../sl/draw/binding/CTConnectionSiteList.java | 110 + .../sl/draw/binding/CTCustomGeometry2D.java | 259 + .../draw/binding/CTEmbeddedWAVAudioFile.java | 169 + .../sl/draw/binding/CTFixedPercentage.java | 86 + .../poi/sl/draw/binding/CTGammaTransform.java | 62 + .../poi/sl/draw/binding/CTGeomGuide.java | 129 + .../poi/sl/draw/binding/CTGeomGuideList.java | 110 + .../poi/sl/draw/binding/CTGeomRect.java | 188 + .../sl/draw/binding/CTGrayscaleTransform.java | 62 + .../sl/draw/binding/CTGroupTransform2D.java | 313 + .../poi/sl/draw/binding/CTHslColor.java | 237 + .../poi/sl/draw/binding/CTHyperlink.java | 420 + .../draw/binding/CTInverseGammaTransform.java | 62 + .../sl/draw/binding/CTInverseTransform.java | 62 + .../sl/draw/binding/CTOfficeArtExtension.java | 139 + .../binding/CTOfficeArtExtensionList.java | 110 + .../apache/poi/sl/draw/binding/CTPath2D.java | 320 + .../poi/sl/draw/binding/CTPath2DArcTo.java | 187 + .../poi/sl/draw/binding/CTPath2DClose.java | 62 + .../draw/binding/CTPath2DCubicBezierTo.java | 109 + .../poi/sl/draw/binding/CTPath2DLineTo.java | 98 + .../poi/sl/draw/binding/CTPath2DList.java | 110 + .../poi/sl/draw/binding/CTPath2DMoveTo.java | 98 + .../sl/draw/binding/CTPath2DQuadBezierTo.java | 109 + .../poi/sl/draw/binding/CTPercentage.java | 86 + .../apache/poi/sl/draw/binding/CTPoint2D.java | 110 + .../apache/poi/sl/draw/binding/CTPoint3D.java | 133 + .../sl/draw/binding/CTPolarAdjustHandle.java | 289 + .../sl/draw/binding/CTPositiveFixedAngle.java | 86 + .../binding/CTPositiveFixedPercentage.java | 86 + .../sl/draw/binding/CTPositivePercentage.java | 86 + .../poi/sl/draw/binding/CTPositiveSize2D.java | 110 + .../poi/sl/draw/binding/CTPresetColor.java | 199 + .../sl/draw/binding/CTPresetGeometry2D.java | 131 + .../sl/draw/binding/CTPresetTextShape.java | 131 + .../apache/poi/sl/draw/binding/CTRatio.java | 110 + .../poi/sl/draw/binding/CTRelativeRect.java | 220 + .../poi/sl/draw/binding/CTSRgbColor.java | 202 + .../poi/sl/draw/binding/CTScRgbColor.java | 237 + .../apache/poi/sl/draw/binding/CTScale2D.java | 131 + .../poi/sl/draw/binding/CTSchemeColor.java | 199 + .../poi/sl/draw/binding/CTSphereCoords.java | 133 + .../poi/sl/draw/binding/CTSystemColor.java | 235 + .../poi/sl/draw/binding/CTTransform2D.java | 249 + .../poi/sl/draw/binding/CTVector3D.java | 133 + .../poi/sl/draw/binding/CTXYAdjustHandle.java | 289 + .../poi/sl/draw/binding/ObjectFactory.java | 2023 ++ .../poi/sl/draw/binding/STBlackWhiteMode.java | 149 + .../poi/sl/draw/binding/STPathFillMode.java | 109 + .../poi/sl/draw/binding/STPresetColorVal.java | 1181 + .../poi/sl/draw/binding/STRectAlignment.java | 133 + .../poi/sl/draw/binding/STSchemeColorVal.java | 197 + .../poi/sl/draw/binding/STShapeType.java | 1557 ++ .../poi/sl/draw/binding/STTextShapeType.java | 389 + .../poi/sl/draw}/geom/AbsExpression.java | 2 +- .../sl/draw}/geom/AddDivideExpression.java | 2 +- .../sl/draw}/geom/AddSubtractExpression.java | 2 +- .../apache/poi/sl/draw}/geom/AdjustValue.java | 4 +- .../poi/sl/draw}/geom/ArcTanExpression.java | 2 +- .../poi/sl/draw}/geom/ArcToCommand.java | 4 +- .../poi/sl/draw}/geom/ClosePathCommand.java | 2 +- .../org/apache/poi/sl/draw}/geom/Context.java | 2 +- .../poi/sl/draw}/geom/CosExpression.java | 2 +- .../sl/draw}/geom/CosineArcTanExpression.java | 2 +- .../poi/sl/draw}/geom/CurveToCommand.java | 4 +- .../poi/sl/draw}/geom/CustomGeometry.java | 40 +- .../apache/poi/sl/draw}/geom/Expression.java | 2 +- .../poi/sl/draw}/geom/ExpressionParser.java | 2 +- .../org/apache/poi/sl/draw}/geom/Formula.java | 2 +- .../org/apache/poi/sl/draw}/geom/Guide.java | 4 +- .../poi/sl/draw}/geom/IAdjustableShape.java | 2 +- .../poi/sl/draw}/geom/IfElseExpression.java | 2 +- .../poi/sl/draw}/geom/LineToCommand.java | 4 +- .../sl/draw}/geom/LiteralValueExpression.java | 2 +- .../poi/sl/draw}/geom/MaxExpression.java | 2 +- .../poi/sl/draw}/geom/MinExpression.java | 2 +- .../poi/sl/draw}/geom/ModExpression.java | 2 +- .../poi/sl/draw}/geom/MoveToCommand.java | 4 +- .../draw}/geom/MultiplyDivideExpression.java | 2 +- .../org/apache/poi/sl/draw}/geom/Outline.java | 2 +- .../org/apache/poi/sl/draw}/geom/Path.java | 22 +- .../apache/poi/sl/draw}/geom/PathCommand.java | 2 +- .../poi/sl/draw}/geom/PinExpression.java | 2 +- .../poi/sl/draw/geom/PresetGeometries.java | 114 + .../poi/sl/draw}/geom/QuadToCommand.java | 4 +- .../sl/draw}/geom/SinArcTanExpression.java | 2 +- .../poi/sl/draw}/geom/SinExpression.java | 2 +- .../poi/sl/draw}/geom/SqrtExpression.java | 2 +- .../poi/sl/draw}/geom/TanExpression.java | 2 +- .../apache/poi/sl/usermodel/AutoShape.java | 2 +- .../apache/poi/sl/usermodel/ColorStyle.java | 69 + .../{LineStyle.java => FillStyle.java} | 43 +- .../poi/sl/usermodel/FreeformShape.java} | 43 +- .../poi/sl/usermodel/GradientPaint.java | 32 + .../org/apache/poi/sl/usermodel/Insets2D.java | 146 + .../poi/sl/usermodel/LineDecoration.java | 69 + .../usermodel/{Fill.java => PaintStyle.java} | 6 +- .../poi/sl/usermodel/PlaceableShape.java | 39 + .../org/apache/poi/sl/usermodel/Shadow.java | 47 + .../org/apache/poi/sl/usermodel/Shape.java | 60 +- .../poi/sl/usermodel/ShapeContainer.java | 22 +- .../apache/poi/sl/usermodel/ShapeType.java | 295 + .../apache/poi/sl/usermodel/ShapeTypes.java | 224 - .../org/apache/poi/sl/usermodel/Sheet.java | 14 +- .../apache/poi/sl/usermodel/SimpleShape.java | 14 +- .../apache/poi/sl/usermodel/SlideShow.java | 18 +- .../apache/poi/sl/usermodel/SolidPaint.java} | 47 +- .../apache/poi/sl/usermodel/StrokeStyle.java | 59 + .../poi/sl/usermodel/TextParagraph.java | 132 + .../org/apache/poi/sl/usermodel/TextRun.java | 28 +- .../apache/poi/sl/usermodel/TextShape.java | 116 + .../poi/sl/usermodel/TexturePaint.java} | 31 +- .../poi/sl}/usermodel/VerticalAlignment.java | 2 +- .../apache/poi/hslf/model/TestBackground.java | 11 +- .../org/apache/poi/hslf/model/TestShapes.java | 5 +- .../apache/poi/hslf/model/TestTextShape.java | 73 +- .../apache/poi/hslf/usermodel/TestBugs.java | 2 +- src/types/definitions/dml-shapeGeometry.xjb | 7 + 207 files changed, 38606 insertions(+), 2271 deletions(-) delete mode 100644 src/ooxml/java/org/apache/poi/xslf/model/geom/PresetGeometries.java delete mode 100644 src/ooxml/java/org/apache/poi/xslf/usermodel/LineDash.java delete mode 100644 src/ooxml/java/org/apache/poi/xslf/usermodel/TextAlign.java delete mode 100644 src/ooxml/java/org/apache/poi/xslf/usermodel/TextAutofit.java delete mode 100644 src/ooxml/java/org/apache/poi/xslf/usermodel/TextDirection.java delete mode 100644 src/ooxml/java/org/apache/poi/xslf/usermodel/TextFragment.java delete mode 100644 src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShapeType.java create mode 100644 src/resources/scratchpad/org/apache/poi/sl/draw/presetShapeDefinitions.xml delete mode 100644 src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/DrawAutoShape.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/DrawFactory.java rename src/{ooxml/java/org/apache/poi/xslf/usermodel/TextCap.java => scratchpad/src/org/apache/poi/sl/draw/DrawFontManager.java} (64%) create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/DrawFreeformShape.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/DrawMasterSheet.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/DrawPaint.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/DrawShape.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/DrawSheet.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/DrawSimpleShape.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/DrawTextBox.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/DrawTextFragment.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/Drawable.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/ImageRenderer.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAdjPoint2D.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAdjustHandleList.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAngle.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTColor.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTColorMRU.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTComplementTransform.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnection.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnectionSite.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnectionSiteList.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTCustomGeometry2D.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTEmbeddedWAVAudioFile.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTFixedPercentage.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGammaTransform.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomGuide.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomGuideList.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomRect.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGrayscaleTransform.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGroupTransform2D.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTHslColor.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTHyperlink.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTInverseGammaTransform.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTInverseTransform.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTOfficeArtExtension.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTOfficeArtExtensionList.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2D.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DArcTo.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DClose.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DCubicBezierTo.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DLineTo.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DList.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DMoveTo.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DQuadBezierTo.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPercentage.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPoint2D.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPoint3D.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPolarAdjustHandle.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveFixedAngle.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveFixedPercentage.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositivePercentage.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveSize2D.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetColor.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetGeometry2D.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetTextShape.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTRatio.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTRelativeRect.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSRgbColor.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTScRgbColor.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTScale2D.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSchemeColor.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSphereCoords.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSystemColor.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTTransform2D.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTVector3D.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/CTXYAdjustHandle.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/ObjectFactory.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/STBlackWhiteMode.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/STPathFillMode.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/STPresetColorVal.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/STRectAlignment.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/STSchemeColorVal.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/STShapeType.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/binding/STTextShapeType.java rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/AbsExpression.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/AddDivideExpression.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/AddSubtractExpression.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/AdjustValue.java (93%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/ArcTanExpression.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/ArcToCommand.java (95%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/ClosePathCommand.java (96%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/Context.java (98%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/CosExpression.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/CosineArcTanExpression.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/CurveToCommand.java (94%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/CustomGeometry.java (69%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/Expression.java (96%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/ExpressionParser.java (98%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/Formula.java (99%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/Guide.java (93%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/IAdjustableShape.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/IfElseExpression.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/LineToCommand.java (93%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/LiteralValueExpression.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/MaxExpression.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/MinExpression.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/ModExpression.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/MoveToCommand.java (93%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/MultiplyDivideExpression.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/Outline.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/Path.java (87%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/PathCommand.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/PinExpression.java (97%) create mode 100644 src/scratchpad/src/org/apache/poi/sl/draw/geom/PresetGeometries.java rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/QuadToCommand.java (93%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/SinArcTanExpression.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/SinExpression.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/SqrtExpression.java (97%) rename src/{ooxml/java/org/apache/poi/xslf/model => scratchpad/src/org/apache/poi/sl/draw}/geom/TanExpression.java (97%) create mode 100644 src/scratchpad/src/org/apache/poi/sl/usermodel/ColorStyle.java rename src/scratchpad/src/org/apache/poi/sl/usermodel/{LineStyle.java => FillStyle.java} (92%) rename src/{java/org/apache/poi/common/usermodel/LineStyle.java => scratchpad/src/org/apache/poi/sl/usermodel/FreeformShape.java} (89%) create mode 100644 src/scratchpad/src/org/apache/poi/sl/usermodel/GradientPaint.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/usermodel/Insets2D.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/usermodel/LineDecoration.java rename src/scratchpad/src/org/apache/poi/sl/usermodel/{Fill.java => PaintStyle.java} (93%) create mode 100644 src/scratchpad/src/org/apache/poi/sl/usermodel/PlaceableShape.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/usermodel/Shadow.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeType.java delete mode 100644 src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeTypes.java rename src/{java/org/apache/poi/common/usermodel/Fill.java => scratchpad/src/org/apache/poi/sl/usermodel/SolidPaint.java} (86%) create mode 100644 src/scratchpad/src/org/apache/poi/sl/usermodel/StrokeStyle.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/usermodel/TextParagraph.java create mode 100644 src/scratchpad/src/org/apache/poi/sl/usermodel/TextShape.java rename src/{ooxml/java/org/apache/poi/xslf/usermodel/LineCap.java => scratchpad/src/org/apache/poi/sl/usermodel/TexturePaint.java} (72%) rename src/{ooxml/java/org/apache/poi/xslf => scratchpad/src/org/apache/poi/sl}/usermodel/VerticalAlignment.java (95%) create mode 100644 src/types/definitions/dml-shapeGeometry.xjb diff --git a/build.xml b/build.xml index cfa95666e..f2d6630f5 100644 --- a/build.xml +++ b/build.xml @@ -103,6 +103,12 @@ under the License. + + + + + + @@ -371,6 +377,7 @@ under the License. + @@ -690,7 +697,38 @@ under the License. - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [MS-OSHARED] - 2.2.1.6 FixedPoint */ - public static double fixedPointToDecimal(int fixedPoint) { + public static double fixedPointToDouble(int fixedPoint) { int i = (fixedPoint >> 16); int f = (fixedPoint >> 0) & 0xFFFF; - double decimal = (i + f/65536.0); - return decimal; + double floatPoint = (i + f/65536d); + return floatPoint; + } + + /** + * Converts a value of type floating point to a FixedPoint + * + * @param floatPoint + * @return fixedPoint + * + * @see [MS-OSHARED] - 2.2.1.6 FixedPoint + */ + public static int doubleToFixedPoint(double floatPoint) { + int i = (int)Math.floor(floatPoint); + int f = (int)((floatPoint % 1d)*65536d); + int fixedPoint = (i << 16) | (f & 0xFFFF); + return fixedPoint; } } diff --git a/src/ooxml/java/org/apache/poi/xslf/model/PropertyFetcher.java b/src/ooxml/java/org/apache/poi/xslf/model/PropertyFetcher.java index d446ccedd..ddb3f0745 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/PropertyFetcher.java +++ b/src/ooxml/java/org/apache/poi/xslf/model/PropertyFetcher.java @@ -19,8 +19,8 @@ package org.apache.poi.xslf.model; -import org.apache.poi.xslf.usermodel.XSLFSimpleShape; import org.apache.poi.util.Internal; +import org.apache.poi.xslf.usermodel.XSLFShape; /** * Used internally to navigate the PresentationML text style hierarchy and fetch properties @@ -36,7 +36,7 @@ public abstract class PropertyFetcher { * @param shape the shape being examined * @return true if the desired property was fetched */ - public abstract boolean fetch(XSLFSimpleShape shape) ; + public abstract boolean fetch(XSLFShape shape) ; public T getValue(){ return _value; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/PresetGeometries.java b/src/ooxml/java/org/apache/poi/xslf/model/geom/PresetGeometries.java deleted file mode 100644 index 62accc42f..000000000 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/PresetGeometries.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ==================================================================== - */ - -package org.apache.poi.xslf.model.geom; - -import org.apache.poi.xslf.usermodel.XMLSlideShow; -import org.apache.xmlbeans.XmlObject; -import org.openxmlformats.schemas.drawingml.x2006.main.CTCustomGeometry2D; - -import java.io.InputStream; -import java.util.LinkedHashMap; - -/** - * Date: 10/25/11 - * - * @author Yegor Kozlov - */ -public class PresetGeometries extends LinkedHashMap { - private static PresetGeometries _inst; - - private PresetGeometries(){ - try { - InputStream is = - XMLSlideShow.class.getResourceAsStream("presetShapeDefinitions.xml"); - read(is); - } catch (Exception e){ - throw new RuntimeException(e); - } - } - - private void read(InputStream is) throws Exception { - XmlObject obj = XmlObject.Factory.parse(is); - for (XmlObject def : obj.selectPath("*/*")) { - - String name = def.getDomNode().getLocalName(); - CTCustomGeometry2D geom = CTCustomGeometry2D.Factory.parse(def.toString()); - - if(containsKey(name)) { - System.out.println("Duplicate definoition of " + name) ; - } - put(name, new CustomGeometry(geom)); - } - } - - public static PresetGeometries getInstance(){ - if(_inst == null) _inst = new PresetGeometries(); - - return _inst; - } - -} diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/LineDash.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/LineDash.java deleted file mode 100644 index 71891f841..000000000 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/LineDash.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ -package org.apache.poi.xslf.usermodel; - -/** - * @author Yegor Kozlov - */ -public enum LineDash { - SOLID, - DOT, - DASH, - LG_DASH, - DASH_DOT, - LG_DASH_DOT, - LG_DASH_DOT_DOT, - SYS_DASH, - SYS_DOT, - SYS_DASH_DOT, - SYS_DASH_DOT_DOT; -} diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/RenderableShape.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/RenderableShape.java index 053ccd491..8a11c1cd1 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/RenderableShape.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/RenderableShape.java @@ -40,6 +40,8 @@ import java.util.Comparator; import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackageRelationship; +import org.apache.poi.sl.usermodel.LineCap; +import org.apache.poi.sl.usermodel.LineDash; import org.apache.poi.util.Internal; import org.apache.poi.util.Units; import org.apache.poi.xslf.model.PropertyFetcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/TextAlign.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/TextAlign.java deleted file mode 100644 index 2570e6cfc..000000000 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/TextAlign.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ==================================================================== - */ -package org.apache.poi.xslf.usermodel; - -/** - * Specified a list of text alignment types - * - * @author Yegor Kozlov - */ -public enum TextAlign { - /** - * Align text to the left margin. - */ - LEFT, - /** - * Align text in the center. - */ - CENTER, - - /** - * Align text to the right margin. - */ - RIGHT, - - /** - * Align text so that it is justified across the whole line. It - * is smart in the sense that it will not justify sentences - * which are short - */ - JUSTIFY, - JUSTIFY_LOW, - DIST, - THAI_DIST -} diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/TextAutofit.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/TextAutofit.java deleted file mode 100644 index 94d6b2435..000000000 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/TextAutofit.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ==================================================================== - */ -package org.apache.poi.xslf.usermodel; - -/** - * Specifies alist of auto-fit types. - *

- * Autofit specofies that a shape should be auto-fit to fully contain the text described within it. - * Auto-fitting is when text within a shape is scaled in order to contain all the text inside - *

- * - * @author Yegor Kozlov - */ -public enum TextAutofit { - /** - * Specifies that text within the text body should not be auto-fit to the bounding box. - * Auto-fitting is when text within a text box is scaled in order to remain inside - * the text box. - */ - NONE, - /** - * Specifies that text within the text body should be normally auto-fit to the bounding box. - * Autofitting is when text within a text box is scaled in order to remain inside the text box. - * - *

- * Example: Consider the situation where a user is building a diagram and needs - * to have the text for each shape that they are using stay within the bounds of the shape. - * An easy way this might be done is by using NORMAL autofit - *

- */ - NORMAL, - /** - * Specifies that a shape should be auto-fit to fully contain the text described within it. - * Auto-fitting is when text within a shape is scaled in order to contain all the text inside. - * - *

- * Example: Consider the situation where a user is building a diagram and needs to have - * the text for each shape that they are using stay within the bounds of the shape. - * An easy way this might be done is by using SHAPE autofit - *

- */ - SHAPE -} diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/TextDirection.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/TextDirection.java deleted file mode 100644 index 3f35ec23a..000000000 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/TextDirection.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ==================================================================== - */ -package org.apache.poi.xslf.usermodel; - -/** - * Vertical Text Types - */ -public enum TextDirection { - /** - * Horizontal text. This should be default. - */ - HORIZONTAL, - /** - * Vertical orientation. - * (each line is 90 degrees rotated clockwise, so it goes - * from top to bottom; each next line is to the left from - * the previous one). - */ - VERTICAL, - /** - * Vertical orientation. - * (each line is 270 degrees rotated clockwise, so it goes - * from bottom to top; each next line is to the right from - * the previous one). - */ - VERTICAL_270, - /** - * Determines if all of the text is vertical - * ("one letter on top of another"). - */ - STACKED; -} diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/TextFragment.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/TextFragment.java deleted file mode 100644 index 1114b8944..000000000 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/TextFragment.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ==================================================================== - */ - -package org.apache.poi.xslf.usermodel; - -import java.awt.*; -import java.awt.font.TextLayout; -import java.text.AttributedCharacterIterator; -import java.text.AttributedString; -import java.text.CharacterIterator; - -/** - * a renderable text fragment -*/ -class TextFragment { - final TextLayout _layout; - final AttributedString _str; - - TextFragment(TextLayout layout, AttributedString str){ - _layout = layout; - _str = str; - } - - void draw(Graphics2D graphics, double x, double y){ - if(_str == null) { - return; - } - - double yBaseline = y + _layout.getAscent(); - - Integer textMode = (Integer)graphics.getRenderingHint(XSLFRenderingHint.TEXT_RENDERING_MODE); - if(textMode != null && textMode == XSLFRenderingHint.TEXT_AS_SHAPES){ - _layout.draw(graphics, (float)x, (float)yBaseline); - } else { - graphics.drawString(_str.getIterator(), (float)x, (float)yBaseline ); - } - } - - /** - * @return full height of this text run which is sum of ascent, descent and leading - */ - public float getHeight(){ - double h = Math.ceil(_layout.getAscent()) + Math.ceil(_layout.getDescent()) + _layout.getLeading(); - return (float)h; - } - - /** - * - * @return width if this text run - */ - public float getWidth(){ - return _layout.getAdvance(); - } - - /** - * - * @return the string to be painted - */ - public String getString(){ - if(_str == null) return ""; - - AttributedCharacterIterator it = _str.getIterator(); - StringBuffer buf = new StringBuffer(); - for (char c = it.first(); c != CharacterIterator.DONE; c = it.next()) { - buf.append(c); - } - return buf.toString(); - } - - @Override - public String toString(){ - return "[" + getClass().getSimpleName() + "] " + getString(); - } -} 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 b1c6be457..1c5f855db 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java @@ -20,7 +20,11 @@ import java.awt.Dimension; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.regex.Pattern; import org.apache.poi.POIXMLDocument; @@ -32,6 +36,9 @@ import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackagePartName; import org.apache.poi.openxml4j.opc.TargetMode; +import org.apache.poi.sl.usermodel.MasterSheet; +import org.apache.poi.sl.usermodel.Resources; +import org.apache.poi.sl.usermodel.SlideShow; import org.apache.poi.util.Beta; import org.apache.poi.util.IOUtils; import org.apache.poi.util.Internal; @@ -53,6 +60,10 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideIdListEntry; import org.openxmlformats.schemas.presentationml.x2006.main.CTSlideSize; import org.openxmlformats.schemas.presentationml.x2006.main.PresentationDocument; +import sun.reflect.generics.reflectiveObjects.NotImplementedException; + +import com.sun.org.apache.xml.internal.utils.UnImplNode; + /** * High level representation of a ooxml slideshow. * This is the first object most users will construct whether @@ -60,7 +71,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.PresentationDocument * top level object for creating new slides/etc. */ @Beta -public class XMLSlideShow extends POIXMLDocument { +public class XMLSlideShow extends POIXMLDocument implements SlideShow { private static POILogger _logger = POILogFactory.getLogger(XMLSlideShow.class); private CTPresentation _presentation; @@ -437,7 +448,7 @@ public class XMLSlideShow extends POIXMLDocument { */ public int addPicture(byte[] pictureData, int format) { XSLFPictureData img = findPictureData(pictureData); - POIXMLRelation relDesc = XSLFPictureData.RELATIONS[format]; + // POIXMLRelation relDesc = XSLFPictureData.RELATIONS[format]; if(img == null) { int imageNumber = _pictures.size(); @@ -485,4 +496,17 @@ public class XMLSlideShow extends POIXMLDocument { return null; } + public MasterSheet[] getMasterSheet() { + return getSlideMasters(); + } + + public MasterSheet createMasterSheet() throws IOException { + // TODO: implement! + throw new UnsupportedOperationException(); + } + + public Resources getResources() { + // TODO: implement! + throw new UnsupportedOperationException(); + } } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFAutoShape.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFAutoShape.java index 1ee8f6f55..47bcace2f 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFAutoShape.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFAutoShape.java @@ -19,6 +19,7 @@ package org.apache.poi.xslf.usermodel; +import org.apache.poi.sl.usermodel.AutoShape; import org.apache.poi.util.Beta; import org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps; import org.openxmlformats.schemas.drawingml.x2006.main.CTPresetGeometry2D; @@ -35,7 +36,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTShapeNonVisual; * @author Yegor Kozlov */ @Beta -public class XSLFAutoShape extends XSLFTextShape { +public class XSLFAutoShape extends XSLFTextShape implements AutoShape { /*package*/ XSLFAutoShape(CTShape shape, XSLFSheet sheet) { super(shape, sheet); diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFBackground.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFBackground.java index 604c9dff3..80c6a1acb 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFBackground.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFBackground.java @@ -17,25 +17,20 @@ package org.apache.poi.xslf.usermodel; -import org.apache.xmlbeans.XmlObject; -import org.openxmlformats.schemas.drawingml.x2006.main.CTBackgroundFillStyleList; -import org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor; -import org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReference; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D; -import org.openxmlformats.schemas.presentationml.x2006.main.CTBackground; - -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics2D; -import java.awt.Paint; +import java.awt.*; import java.awt.geom.Rectangle2D; +import org.apache.poi.sl.usermodel.Background; +import org.apache.xmlbeans.XmlObject; +import org.openxmlformats.schemas.drawingml.x2006.main.*; +import org.openxmlformats.schemas.presentationml.x2006.main.CTBackground; + /** * Background shape * * @author Yegor Kozlov */ -public class XSLFBackground extends XSLFSimpleShape { +public class XSLFBackground extends XSLFSimpleShape implements Background { /* package */XSLFBackground(CTBackground shape, XSLFSheet sheet) { super(shape, sheet); diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFColor.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFColor.java index c0f4762c7..527cef781 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFColor.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFColor.java @@ -18,22 +18,18 @@ */ package org.apache.poi.xslf.usermodel; -import org.apache.poi.util.Beta; -import org.apache.poi.util.Internal; -import org.apache.xmlbeans.XmlObject; -import org.openxmlformats.schemas.drawingml.x2006.main.CTColor; -import org.openxmlformats.schemas.drawingml.x2006.main.CTHslColor; -import org.openxmlformats.schemas.drawingml.x2006.main.CTPresetColor; -import org.openxmlformats.schemas.drawingml.x2006.main.CTSRgbColor; -import org.openxmlformats.schemas.drawingml.x2006.main.CTScRgbColor; -import org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor; -import org.openxmlformats.schemas.drawingml.x2006.main.CTSystemColor; -import org.w3c.dom.Node; - import java.awt.Color; import java.util.HashMap; import java.util.Map; +import org.apache.poi.sl.draw.DrawPaint; +import org.apache.poi.sl.usermodel.ColorStyle; +import org.apache.poi.util.Beta; +import org.apache.poi.util.Internal; +import org.apache.xmlbeans.XmlObject; +import org.openxmlformats.schemas.drawingml.x2006.main.*; +import org.w3c.dom.Node; + /** * Encapsulates logic to read color definitions from DrawingML and convert them to java.awt.Color * @@ -63,40 +59,37 @@ public class XSLFColor { * If not color information was found in the supplied xml object then a null is returned. */ public Color getColor() { - return _color == null ? null : applyColorTransform(_color); + return DrawPaint.applyColorTransform(getColorStyle()); } - private Color applyColorTransform(Color color){ - Color result = color; + public ColorStyle getColorStyle() { + return new ColorStyle() { + public Color getColor() { + return _color; + } - int alpha = getAlpha(); - if(alpha != -1){ - result = new Color( - result.getRed(), result.getGreen(), result.getBlue(), - Math.round(255 * alpha * 0.01f)); - } + public int getAlpha() { + return getRawValue("alpha"); + } - int lumOff = getLumOff(); - int lumMod = getLumMod(); - if(lumMod != -1 || lumOff != -1){ - result = modulateLuminanace(result, - lumMod == -1 ? 100 : lumMod, - lumOff == -1 ? 0 : lumOff); - } + public int getLumOff() { + return getRawValue("lumOff"); + } - int shade = getShade(); - if(shade != -1){ - result = shade(result, shade); - } + public int getLumMod() { + return getRawValue("lumMod"); + } - int tint = getTint(); - if(tint != -1){ - result = tint(result, tint); - } + public int getShade() { + return getRawValue("shade"); + } - return result; + public int getTint() { + return getRawValue("tint"); + } + }; } - + Color toColor(XmlObject obj, XSLFTheme theme) { Color color = null; for (XmlObject ch : obj.selectPath("*")) { @@ -140,6 +133,7 @@ public class XSLFColor { color = new Color(0xFF & val[0], 0xFF & val[1], 0xFF & val[2]); } else { // YK: color is a string like "menuText" or "windowText", we return black for such cases + @SuppressWarnings("unused") String colorName = sys.getVal().toString(); color = Color.black; } @@ -150,6 +144,33 @@ public class XSLFColor { return color; } + private int getRawValue(String elem) { + String query = "declare namespace a='http://schemas.openxmlformats.org/drawingml/2006/main' $this//a:" + elem; + + XmlObject[] obj; + + // first ask the context color and if not found, ask the actual color bean + if (_phClr != null){ + obj = _phClr.selectPath(query); + if (obj.length == 1){ + Node attr = obj[0].getDomNode().getAttributes().getNamedItem("val"); + if(attr != null) { + return Integer.parseInt(attr.getNodeValue()); + } + } + } + + obj = _xmlObject.selectPath(query); + if (obj.length == 1){ + Node attr = obj[0].getDomNode().getAttributes().getNamedItem("val"); + if(attr != null) { + return Integer.parseInt(attr.getNodeValue()); + } + } + + return -1; + } + /** * Read a perecentage value from the supplied xml bean. * Example: @@ -160,56 +181,13 @@ public class XSLFColor { * @return the percentage value in the range [0 .. 100] */ private int getPercentageValue(String elem){ - String query = "declare namespace a='http://schemas.openxmlformats.org/drawingml/2006/main' $this//a:" + elem; - - XmlObject[] obj; - - // first ask the context color and if not found, ask the actual color bean - if(_phClr != null){ - obj = _phClr.selectPath(query); - if(obj.length == 1){ - Node attr = obj[0].getDomNode().getAttributes().getNamedItem("val"); - if(attr != null) { - return Integer.parseInt(attr.getNodeValue()) / 1000; - } - } - } - - obj = _xmlObject.selectPath(query); - if(obj.length == 1){ - Node attr = obj[0].getDomNode().getAttributes().getNamedItem("val"); - if(attr != null) { - return Integer.parseInt(attr.getNodeValue()) / 1000; - } - } - - - return -1; + int val = getRawValue(elem); + return (val == -1) ? val : (val / 1000); } private int getAngleValue(String elem){ - String color = "declare namespace a='http://schemas.openxmlformats.org/drawingml/2006/main' $this//a:" + elem; - XmlObject[] obj; - - // first ask the context color and if not found, ask the actual color bean - if(_phClr != null){ - obj = _xmlObject.selectPath( color ); - if(obj.length == 1){ - Node attr = obj[0].getDomNode().getAttributes().getNamedItem("val"); - if(attr != null) { - return Integer.parseInt(attr.getNodeValue()) / 60000; - } - } - } - - obj = _xmlObject.selectPath( color ); - if(obj.length == 1){ - Node attr = obj[0].getDomNode().getAttributes().getNamedItem("val"); - if(attr != null) { - return Integer.parseInt(attr.getNodeValue()) / 60000; - } - } - return -1; + int val = getRawValue(elem); + return (val == -1) ? val : (val / 60000); } /** @@ -387,7 +365,7 @@ public class XSLFColor { * percentage with 0% indicating minimal shade and 100% indicating maximum * or -1 if the value is not set */ - int getShade(){ + public int getShade(){ return getPercentageValue("shade"); } @@ -399,69 +377,11 @@ public class XSLFColor { * percentage with 0% indicating minimal tint and 100% indicating maximum * or -1 if the value is not set */ - int getTint(){ + public int getTint(){ return getPercentageValue("tint"); } - /** - * Apply lumMod / lumOff adjustments - * - * @param c the color to modify - * @param lumMod luminance modulation in the range [0..100] - * @param lumOff luminance offset in the range [0..100] - * @return modified color - */ - private static Color modulateLuminanace(Color c, int lumMod, int lumOff) { - Color color; - if (lumOff > 0) { - color = new Color( - (int) (Math.round((255 - c.getRed()) * (100.0 - lumMod) / 100.0 + c.getRed())), - (int) (Math.round((255 - c.getGreen()) * lumOff / 100.0 + c.getGreen())), - (int) (Math.round((255 - c.getBlue()) * lumOff / 100.0 + c.getBlue())), - c.getAlpha() - ); - } else { - color = new Color( - (int) (Math.round(c.getRed() * lumMod / 100.0)), - (int) (Math.round(c.getGreen() * lumMod / 100.0)), - (int) (Math.round(c.getBlue() * lumMod / 100.0)), - c.getAlpha() - ); - } - return color; - } - - /** - * This algorithm returns result different from PowerPoint. - * TODO: revisit and improve - */ - private static Color shade(Color c, int shade) { - return new Color( - (int)(c.getRed() * shade * 0.01), - (int)(c.getGreen() * shade * 0.01), - (int)(c.getBlue() * shade * 0.01), - c.getAlpha()); - } - - /** - * This algorithm returns result different from PowerPoint. - * TODO: revisit and improve - */ - private static Color tint(Color c, int tint) { - int r = c.getRed(); - int g = c.getGreen(); - int b = c.getBlue(); - - float ftint = tint / 100.0f; - - int red = Math.round(ftint * r + (1 - ftint) * 255); - int green = Math.round(ftint * g + (1 - ftint) * 255); - int blue = Math.round(ftint * b + (1 - ftint) * 255); - - return new Color(red, green, blue); - } - /** * Preset colors defined in DrawingML */ diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGraphicFrame.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGraphicFrame.java index 529bacf73..514c1bc90 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGraphicFrame.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGraphicFrame.java @@ -23,6 +23,7 @@ import org.apache.poi.POIXMLException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackageRelationship; +import org.apache.poi.sl.usermodel.ShapeType; import org.apache.poi.util.Beta; import org.apache.poi.util.Units; import org.apache.xmlbeans.XmlCursor; @@ -34,6 +35,7 @@ import org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D; import org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrame; import javax.xml.namespace.QName; + import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; @@ -58,8 +60,8 @@ public class XSLFGraphicFrame extends XSLFShape { return _sheet; } - public int getShapeType(){ - throw new RuntimeException("NotImplemented"); + public ShapeType getShapeType(){ + throw new UnsupportedOperationException(); } public int getShapeId(){ 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 2ad699b40..f93fc803f 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java @@ -19,9 +19,17 @@ package org.apache.poi.xslf.usermodel; +import java.awt.Graphics2D; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.util.Iterator; +import java.util.List; +import java.util.regex.Pattern; + import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackageRelationship; import org.apache.poi.openxml4j.opc.TargetMode; +import org.apache.poi.sl.usermodel.ShapeType; import org.apache.poi.util.Beta; import org.apache.poi.util.Units; import org.apache.xmlbeans.XmlObject; @@ -35,13 +43,6 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape; import org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShapeNonVisual; import org.openxmlformats.schemas.presentationml.x2006.main.CTShape; -import java.awt.Graphics2D; -import java.awt.geom.AffineTransform; -import java.awt.geom.Rectangle2D; -import java.util.Iterator; -import java.util.List; -import java.util.regex.Pattern; - /** * Represents a group shape that consists of many shapes grouped together. * @@ -207,30 +208,35 @@ public class XSLFGroupShape extends XSLFShape implements XSLFShapeContainer { public XSLFAutoShape createAutoShape(){ XSLFAutoShape sh = getDrawing().createAutoShape(); _shapes.add(sh); + sh.setParent(this); return sh; } public XSLFFreeformShape createFreeform(){ XSLFFreeformShape sh = getDrawing().createFreeform(); _shapes.add(sh); + sh.setParent(this); return sh; } public XSLFTextBox createTextBox(){ XSLFTextBox sh = getDrawing().createTextBox(); _shapes.add(sh); + sh.setParent(this); return sh; } public XSLFConnectorShape createConnector(){ XSLFConnectorShape sh = getDrawing().createConnector(); _shapes.add(sh); + sh.setParent(this); return sh; } public XSLFGroupShape createGroup(){ XSLFGroupShape sh = getDrawing().createGroup(); _shapes.add(sh); + sh.setParent(this); return sh; } @@ -251,6 +257,7 @@ public class XSLFGroupShape extends XSLFShape implements XSLFShapeContainer { XSLFPictureShape sh = getDrawing().createPicture(rel.getId()); sh.resize(); _shapes.add(sh); + sh.setParent(this); return sh; } @@ -343,4 +350,13 @@ public class XSLFGroupShape extends XSLFShape implements XSLFShapeContainer { } } + public ShapeType getShapeType(){ + return null; + } + + public void addShape(XSLFShape shape) { + throw new UnsupportedOperationException( + "Adding a shape from a different container is not supported -" + + " create it from scratch witht XSLFGroupShape.create* methods"); + } } \ No newline at end of file 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 0a33132e2..62f9cc4ad 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java @@ -21,6 +21,8 @@ import java.io.IOException; import org.apache.poi.POIXMLDocumentPart; import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackageRelationship; +import org.apache.poi.sl.usermodel.Notes; +import org.apache.poi.sl.usermodel.TextRun; import org.apache.poi.util.Beta; import org.apache.xmlbeans.XmlException; import org.openxmlformats.schemas.presentationml.x2006.main.CTCommonSlideData; @@ -28,7 +30,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTNotesSlide; import org.openxmlformats.schemas.presentationml.x2006.main.NotesDocument; @Beta -public final class XSLFNotes extends XSLFSheet { +public final class XSLFNotes extends XSLFSheet implements Notes { private CTNotesSlide _notes; /** @@ -80,7 +82,6 @@ public final class XSLFNotes extends XSLFSheet { return getMasterSheet().getTheme(); } - @Override public XSLFNotesMaster getMasterSheet() { for (POIXMLDocumentPart p : getRelations()) { if (p instanceof XSLFNotesMaster){ @@ -89,4 +90,20 @@ public final class XSLFNotes extends XSLFSheet { } return null; } + + public TextRun getTextRun() { + for (XSLFShape sh : super.getShapes()) { + if (sh instanceof XSLFTextShape) { + XSLFTextShape txt = (XSLFTextShape)sh; + for (XSLFTextParagraph p : txt.getTextParagraphs()) { + for (XSLFTextRun r : p.getTextRuns()) { + return r; + } + } + } + } + return null; + } + + } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotesMaster.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotesMaster.java index 40937e878..c5de53767 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotesMaster.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotesMaster.java @@ -23,6 +23,7 @@ import org.apache.poi.POIXMLDocumentPart; import org.apache.poi.POIXMLException; import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackageRelationship; +import org.apache.poi.sl.usermodel.MasterSheet; import org.apache.poi.util.Beta; import org.apache.xmlbeans.XmlException; import org.openxmlformats.schemas.drawingml.x2006.main.CTColorMapping; @@ -46,7 +47,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.NotesMasterDocument; * @author Yegor Kozlov */ @Beta - public class XSLFNotesMaster extends XSLFSheet { + public class XSLFNotesMaster extends XSLFSheet implements MasterSheet { private CTNotesMaster _slide; private XSLFTheme _theme; @@ -93,7 +94,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.NotesMasterDocument; } @Override - public XSLFSheet getMasterSheet() { + public MasterSheet getMasterSheet() { return null; } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java index 42dc360cd..fa4b192ec 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java @@ -17,6 +17,7 @@ package org.apache.poi.xslf.usermodel; +import org.apache.poi.sl.usermodel.Shadow; import org.apache.poi.util.Units; import org.openxmlformats.schemas.drawingml.x2006.main.CTOuterShadowEffect; import org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor; @@ -31,7 +32,7 @@ import java.awt.geom.Rectangle2D; * * @author Yegor Kozlov */ -public class XSLFShadow extends XSLFSimpleShape { +public class XSLFShadow extends XSLFSimpleShape implements Shadow { private XSLFSimpleShape _parent; diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java index 82addf7dd..aa6e2c712 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java @@ -19,13 +19,25 @@ package org.apache.poi.xslf.usermodel; -import java.awt.Graphics2D; -import java.awt.geom.AffineTransform; +import java.awt.Color; import java.awt.geom.Rectangle2D; +import java.io.IOException; +import java.io.InputStream; +import java.util.Arrays; +import java.util.Comparator; -import org.apache.poi.util.Beta; -import org.apache.poi.util.Internal; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.poi.openxml4j.opc.PackagePart; +import org.apache.poi.openxml4j.opc.PackageRelationship; +import org.apache.poi.sl.draw.DrawPaint; +import org.apache.poi.sl.draw.geom.CustomGeometry; +import org.apache.poi.sl.usermodel.*; +import org.apache.poi.util.*; +import org.apache.poi.xslf.model.PropertyFetcher; import org.apache.xmlbeans.XmlObject; +import org.openxmlformats.schemas.drawingml.x2006.main.*; +import org.openxmlformats.schemas.presentationml.x2006.main.CTPlaceholder; +import org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderType; /** * Base super-class class for all shapes in PresentationML @@ -33,25 +45,43 @@ import org.apache.xmlbeans.XmlObject; * @author Yegor Kozlov */ @Beta -public abstract class XSLFShape { +public abstract class XSLFShape implements Shape { + protected final XmlObject _shape; + protected final XSLFSheet _sheet; + protected XSLFShapeContainer _parent; - /** - * @return the position of this shape within the drawing canvas. - * The coordinates are expressed in points - */ - public abstract Rectangle2D getAnchor(); + private CTShapeProperties _spPr; + private CTShapeStyle _spStyle; + private CTNonVisualDrawingProps _nvPr; + private CTPlaceholder _ph; - /** - * @param anchor the position of this shape within the drawing canvas. - * The coordinates are expressed in points - */ - public abstract void setAnchor(Rectangle2D anchor); + private static final PaintStyle TRANSPARENT_PAINT = new SolidPaint() { + public ColorStyle getSolidColor() { + return new ColorStyle(){ + public Color getColor() { return DrawPaint.NO_PAINT; } + public int getAlpha() { return -1; } + public int getLumOff() { return -1; } + public int getLumMod() { return -1; } + public int getShade() { return -1; } + public int getTint() { return -1; } + }; + } + }; + + + protected XSLFShape(XmlObject shape, XSLFSheet sheet) { + _shape = shape; + _sheet = sheet; + } + /** * @return the xml bean holding this shape's data */ - public abstract XmlObject getXmlObject(); - + public XmlObject getXmlObject() { + return _shape; + } + /** * @return human-readable name of this shape, e.g. "Rectange 3" */ @@ -118,84 +148,6 @@ public abstract class XSLFShape { */ public abstract boolean getFlipVertical(); - /** - * Draw this shape into the supplied canvas - * - * @param graphics the graphics to draw into - */ - public abstract void draw(Graphics2D graphics); - - /** - * Apply 2-D transforms before drawing this shape. This includes rotation and flipping. - * - * @param graphics the graphics whos transform matrix will be modified - */ - protected void applyTransform(Graphics2D graphics) { - Rectangle2D anchor = getAnchor(); - AffineTransform tx = (AffineTransform)graphics.getRenderingHint(XSLFRenderingHint.GROUP_TRANSFORM); - if(tx != null) { - anchor = tx.createTransformedShape(anchor).getBounds2D(); - } - - // rotation - double rotation = getRotation(); - if (rotation != 0.) { - // PowerPoint rotates shapes relative to the geometric center - double centerX = anchor.getCenterX(); - double centerY = anchor.getCenterY(); - - // normalize rotation - rotation = (360.+(rotation%360.))%360.; - int quadrant = (((int)rotation+45)/90)%4; - double scaleX = 1.0, scaleY = 1.0; - - // scale to bounding box (bug #53176) - if (quadrant == 1 || quadrant == 3) { - // In quadrant 1 and 3, which is basically a shape in a more or less portrait orientation - // (45-135 degrees and 225-315 degrees), we need to first rotate the shape by a multiple - // of 90 degrees and then resize the bounding box to its original bbox. After that we can - // rotate the shape to the exact rotation amount. - // It's strange that you'll need to rotate the shape back and forth again, but you can - // think of it, as if you paint the shape on a canvas. First you rotate the canvas, which might - // be already (differently) scaled, so you can paint the shape in its default orientation - // and later on, turn it around again to compare it with its original size ... - AffineTransform txg = new AffineTransform(); // graphics coordinate space - AffineTransform txs = new AffineTransform(tx); // shape coordinate space - txg.translate(centerX, centerY); - txg.rotate(Math.toRadians(quadrant*90)); - txg.translate(-centerX, -centerY); - txs.translate(centerX, centerY); - txs.rotate(Math.toRadians(-quadrant*90)); - txs.translate(-centerX, -centerY); - txg.concatenate(txs); - Rectangle2D anchor2 = txg.createTransformedShape(getAnchor()).getBounds2D(); - scaleX = anchor.getWidth() == 0. ? 1.0 : anchor.getWidth() / anchor2.getWidth(); - scaleY = anchor.getHeight() == 0. ? 1.0 : anchor.getHeight() / anchor2.getHeight(); - } - - // transformation is applied reversed ... - graphics.translate(centerX, centerY); - graphics.rotate(Math.toRadians(rotation-(double)(quadrant*90))); - graphics.scale(scaleX, scaleY); - graphics.rotate(Math.toRadians(quadrant*90)); - graphics.translate(-centerX, -centerY); - } - - //flip horizontal - if (getFlipHorizontal()) { - graphics.translate(anchor.getX() + anchor.getWidth(), anchor.getY()); - graphics.scale(-1, 1); - graphics.translate(-anchor.getX(), -anchor.getY()); - } - - //flip vertical - if (getFlipVertical()) { - graphics.translate(anchor.getX(), anchor.getY() + anchor.getHeight()); - graphics.scale(1, -1); - graphics.translate(-anchor.getX(), -anchor.getY()); - } - } - /** * Set the contents of this shape to be a copy of the source shape. * This method is called recursively for each shape when merging slides @@ -212,4 +164,402 @@ public abstract class XSLFShape { setAnchor(sh.getAnchor()); } + + public void setParent(XSLFShapeContainer parent) { + this._parent = parent; + } + + public XSLFShapeContainer getParent() { + return this._parent; + } + + public boolean isPlaceholder() { + return false; + } + + public StrokeStyle getStrokeStyle() { + // TODO Auto-generated method stub + return null; + } + + public CustomGeometry getGeometry() { + // TODO Auto-generated method stub + return null; + } + + public ShapeType getShapeType() { + // TODO Auto-generated method stub + return null; + } + + public XSLFSheet getSheet() { + // TODO Auto-generated method stub + return null; + } + + /** + * fetch shape fill as a java.awt.Paint + * + * @return either Color or GradientPaint or TexturePaint or null + */ + @Override + public FillStyle getFillStyle() { + return new FillStyle() { + public PaintStyle getPaint() { + PropertyFetcher fetcher = new PropertyFetcher() { + public boolean fetch(XSLFShape shape) { + CTShapeProperties spPr = shape.getSpPr(); + if (spPr.isSetNoFill()) { + setValue(TRANSPARENT_PAINT); + return true; + } + + PaintStyle paint = null; + for (XmlObject obj : spPr.selectPath("*")) { + paint = selectPaint(obj, null, getSheet().getPackagePart()); + if (paint != null) break; + } + + if (paint == null) return false; + + setValue(paint); + return true; + } + }; + fetchShapeProperty(fetcher); + + PaintStyle paint = fetcher.getValue(); + + if (paint != null) return paint; + + // fill color was not found, check if it is defined in the theme + CTShapeStyle style = getSpStyle(); + if (style != null) { + // get a reference to a fill style within the style matrix. + CTStyleMatrixReference fillRef = style.getFillRef(); + // The idx attribute refers to the index of a fill style or + // background fill style within the presentation's style matrix, defined by the fmtScheme element. + // value of 0 or 1000 indicates no background, + // values 1-999 refer to the index of a fill style within the fillStyleLst element + // values 1001 and above refer to the index of a background fill style within the bgFillStyleLst element. + int idx = (int)fillRef.getIdx(); + CTSchemeColor phClr = fillRef.getSchemeClr(); + XSLFSheet sheet = _sheet; + XSLFTheme theme = sheet.getTheme(); + XmlObject fillProps = null; + CTStyleMatrix matrix = theme.getXmlObject().getThemeElements().getFmtScheme(); + if(idx >= 1 && idx <= 999){ + fillProps = matrix.getFillStyleLst().selectPath("*")[idx - 1]; + } else if (idx >= 1001 ){ + fillProps = matrix.getBgFillStyleLst().selectPath("*")[idx - 1001]; + } + if(fillProps != null) { + paint = selectPaint(fillProps, phClr, sheet.getPackagePart()); + } + } + return paint == RenderableShape.NO_PAINT ? null : paint; + } + }; + } + + /** + * Walk up the inheritance tree and fetch shape properties. + * + * The following order of inheritance is assumed: + *

+ * slide <-- slideLayout <-- slideMaster + *

+ * + * @param visitor the object that collects the desired property + * @return true if the property was fetched + */ + protected boolean fetchShapeProperty(PropertyFetcher visitor) { + boolean ok = visitor.fetch(this); + + XSLFSimpleShape masterShape; + XSLFSheet masterSheet = (XSLFSheet)getSheet().getMasterSheet(); + CTPlaceholder ph = getCTPlaceholder(); + + if (masterSheet != null && ph != null) { + if (!ok) { + masterShape = masterSheet.getPlaceholder(ph); + if (masterShape != null) { + ok = visitor.fetch(masterShape); + } + } + + // try slide master + if (!ok ) { + int textType; + if ( !ph.isSetType()) textType = STPlaceholderType.INT_BODY; + else { + switch (ph.getType().intValue()) { + case STPlaceholderType.INT_TITLE: + case STPlaceholderType.INT_CTR_TITLE: + textType = STPlaceholderType.INT_TITLE; + break; + case STPlaceholderType.INT_FTR: + case STPlaceholderType.INT_SLD_NUM: + case STPlaceholderType.INT_DT: + textType = ph.getType().intValue(); + break; + default: + textType = STPlaceholderType.INT_BODY; + break; + } + } + XSLFSheet master = (XSLFSheet)masterSheet.getMasterSheet(); + if (master != null) { + masterShape = master.getPlaceholderByType(textType); + if (masterShape != null) { + ok = visitor.fetch(masterShape); + } + } + } + } + return ok; + } + + protected CTPlaceholder getCTPlaceholder() { + if (_ph == null) { + XmlObject[] obj = _shape.selectPath( + "declare namespace p='http://schemas.openxmlformats.org/presentationml/2006/main' .//*/p:nvPr/p:ph"); + if (obj.length == 1) { + _ph = (CTPlaceholder) obj[0]; + } + } + return _ph; + } + + protected CTShapeStyle getSpStyle() { + if (_spStyle == null) { + for (XmlObject obj : _shape.selectPath("*")) { + if (obj instanceof CTShapeStyle) { + _spStyle = (CTShapeStyle) obj; + } + } + } + return _spStyle; + } + + protected CTNonVisualDrawingProps getNvPr() { + if (_nvPr == null) { + XmlObject[] rs = _shape + .selectPath("declare namespace p='http://schemas.openxmlformats.org/presentationml/2006/main' .//*/p:cNvPr"); + if (rs.length != 0) { + _nvPr = (CTNonVisualDrawingProps) rs[0]; + } + } + return _nvPr; + } + + protected CTShapeProperties getSpPr() { + if (_spPr == null) { + for (XmlObject obj : _shape.selectPath("*")) { + if (obj instanceof CTShapeProperties) { + _spPr = (CTShapeProperties) obj; + } + } + } + if (_spPr == null) { + throw new IllegalStateException("CTShapeProperties was not found."); + } + return _spPr; + } + + CTTransform2D getXfrm() { + PropertyFetcher fetcher = new PropertyFetcher() { + public boolean fetch(XSLFShape shape) { + CTShapeProperties pr = shape.getSpPr(); + if (pr.isSetXfrm()) { + setValue(pr.getXfrm()); + return true; + } + return false; + } + }; + fetchShapeProperty(fetcher); + return fetcher.getValue(); + } + + /** + * @return the position of this shape within the drawing canvas. + * The coordinates are expressed in points + */ + public Rectangle2D getAnchor() { + CTTransform2D xfrm = getXfrm(); + if (xfrm == null) return null; + + CTPoint2D off = xfrm.getOff(); + long x = off.getX(); + long y = off.getY(); + CTPositiveSize2D ext = xfrm.getExt(); + long cx = ext.getCx(); + long cy = ext.getCy(); + return new Rectangle2D.Double( + Units.toPoints(x), Units.toPoints(y), + Units.toPoints(cx), Units.toPoints(cy)); + } + + /** + * @param anchor the position of this shape within the drawing canvas. + * The coordinates are expressed in points + */ + public void setAnchor(Rectangle2D anchor) { + CTShapeProperties spPr = getSpPr(); + if (spPr == null) return; + + CTTransform2D xfrm = spPr.isSetXfrm() ? spPr.getXfrm() : spPr.addNewXfrm(); + CTPoint2D off = xfrm.isSetOff() ? xfrm.getOff() : xfrm.addNewOff(); + long x = Units.toEMU(anchor.getX()); + long y = Units.toEMU(anchor.getY()); + off.setX(x); + off.setY(y); + CTPositiveSize2D ext = xfrm.isSetExt() ? xfrm.getExt() : xfrm + .addNewExt(); + long cx = Units.toEMU(anchor.getWidth()); + long cy = Units.toEMU(anchor.getHeight()); + ext.setCx(cx); + ext.setCy(cy); + } + + /** + * Convert shape fill into java.awt.Paint. The result is either Color or + * TexturePaint or GradientPaint or null + * + * @param graphics the target graphics + * @param obj the xml to read. Must contain elements from the EG_ColorChoice group: + * + * a:scrgbClr RGB Color Model - Percentage Variant + * a:srgbClr RGB Color Model - Hex Variant + * a:hslClr Hue, Saturation, Luminance Color Model + * a:sysClr System Color + * a:schemeClr Scheme Color + * a:prstClr Preset Color + * + * + * @param phClr context color + * @param parentPart the parent package part. Any external references (images, etc.) are resolved relative to it. + * + * @return the applied Paint or null if none was applied + */ + protected PaintStyle selectPaint(XmlObject obj, final CTSchemeColor phClr, final PackagePart parentPart) { + final XSLFTheme theme = getSheet().getTheme(); + + if (obj instanceof CTNoFillProperties) { + return TRANSPARENT_PAINT; + } + + if (obj instanceof CTSolidColorFillProperties) { + CTSolidColorFillProperties solidFill = (CTSolidColorFillProperties) obj; + final XSLFColor c = new XSLFColor(solidFill, theme, phClr); + return new SolidPaint() { + public ColorStyle getSolidColor() { + return c.getColorStyle(); + } + }; + } + + if (obj instanceof CTBlipFillProperties) { + CTBlipFillProperties blipFill = (CTBlipFillProperties)obj; + final CTBlip blip = blipFill.getBlip(); + return new TexturePaint() { + private PackagePart getPart() { + try { + String blipId = blip.getEmbed(); + PackageRelationship rel = parentPart.getRelationship(blipId); + return parentPart.getRelatedPart(rel); + } catch (InvalidFormatException e) { + throw new RuntimeException(e); + } + } + + public InputStream getImageData() { + try { + return getPart().getInputStream(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public String getContentType() { + /* TOOD: map content-type */ + return getPart().getContentType(); + } + + public int getAlpha() { + return (blip.sizeOfAlphaModFixArray() > 0) + ? blip.getAlphaModFixArray(0).getAmt() + : 0; + } + }; + } + + if (obj instanceof CTGradientFillProperties) { + final CTGradientFillProperties gradFill = (CTGradientFillProperties) obj; + + @SuppressWarnings("deprecation") + final CTGradientStop[] gs = gradFill.getGsLst().getGsArray(); + + Arrays.sort(gs, new Comparator() { + public int compare(CTGradientStop o1, CTGradientStop o2) { + Integer pos1 = o1.getPos(); + Integer pos2 = o2.getPos(); + return pos1.compareTo(pos2); + } + }); + + final ColorStyle cs[] = new ColorStyle[gs.length]; + final float fractions[] = new float[gs.length]; + + int i=0; + for (CTGradientStop cgs : gs) { + cs[i] = new XSLFColor(cgs, theme, phClr).getColorStyle(); + fractions[i] = cgs.getPos() / 100000.f; + } + + return new GradientPaint() { + + public double getGradientAngle() { + return (gradFill.isSetLin()) + ? gradFill.getLin().getAng() / 60000.d + : 0; + } + + public ColorStyle[] getGradientColors() { + return cs; + } + + public float[] getGradientFractions() { + return fractions; + } + + public boolean isRotatedWithShape() { + // TODO: is this correct??? + return (gradFill.isSetRotWithShape() || !gradFill.getRotWithShape()); + } + + public GradientType getGradientType() { + if (gradFill.isSetLin()) { + return GradientType.linear; + } + + if (gradFill.isSetPath()) { + /* TODO: handle rect path */ + STPathShadeType.Enum ps = gradFill.getPath().getPath(); + if (ps == STPathShadeType.CIRCLE) { + return GradientType.circular; + } else if (ps == STPathShadeType.SHAPE) { + return GradientType.shape; + } + } + + return GradientType.linear; + } + }; + } + + return TRANSPARENT_PAINT; + } + } \ No newline at end of file diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShapeContainer.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShapeContainer.java index 3a2089184..d839a49d3 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShapeContainer.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShapeContainer.java @@ -19,10 +19,12 @@ package org.apache.poi.xslf.usermodel; +import org.apache.poi.sl.usermodel.ShapeContainer; + /** * Common interface for shape containers, e.g. sheets or groups of shapes */ -public interface XSLFShapeContainer extends Iterable { +public interface XSLFShapeContainer extends ShapeContainer { /** * create a new shape with a predefined geometry and add it to this shape container @@ -55,27 +57,6 @@ public interface XSLFShapeContainer extends Iterable { */ XSLFPictureShape createPicture(int pictureIndex); - /** - * Returns an array containing all of the elements in this container in proper - * sequence (from first to last element). - * - * @return an array containing all of the elements in this container in proper - * sequence - */ - XSLFShape[] getShapes(); - - /** - * Removes the specified shape from this sheet, if it is present - * (optional operation). If this sheet does not contain the element, - * it is unchanged. - * - * @param xShape shape to be removed from this sheet, if present - * @return true if this sheet contained the specified element - * @throws IllegalArgumentException if the type of the specified shape - * is incompatible with this sheet (optional) - */ - boolean removeShape(XSLFShape xShape) ; - /** * Removes all of the elements from this container (optional operation). * The container will be empty after this call returns. diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShapeType.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShapeType.java deleted file mode 100644 index 57163ff74..000000000 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShapeType.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ==================================================================== - */ - -package org.apache.poi.xslf.usermodel; - -/** - * known preset shape geometries in PresentationML - * - * @author Yegor Kozlov - */ -public enum XSLFShapeType { - LINE(1), - LINE_INV(2), - TRIANGLE(3), - RT_TRIANGLE(4), - RECT(5), - DIAMOND(6), - PARALLELOGRAM(7), - TRAPEZOID(8), - NON_ISOSCELES_TRAPEZOID(9), - PENTAGON(10), - HEXAGON(11), - HEPTAGON(12), - OCTAGON(13), - DECAGON(14), - DODECAGON(15), - STAR_4(16), - STAR_5(17), - STAR_6(18), - STAR_7(19), - STAR_8(20), - STAR_10(21), - STAR_12(22), - STAR_16(23), - STAR_24(24), - STAR_32(25), - ROUND_RECT(26), - ROUND_1_RECT(27), - ROUND_2_SAME_RECT(28), - ROUND_2_DIAG_RECT(29), - SNIP_ROUND_RECT(30), - SNIP_1_RECT(31), - SNIP_2_SAME_RECT(32), - SNIP_2_DIAG_RECT(33), - PLAQUE(34), - ELLIPSE(35), - TEARDROP(36), - HOME_PLATE(37), - CHEVRON(38), - PIE_WEDGE(39), - PIE(40), - BLOCK_ARC(41), - DONUT(42), - NO_SMOKING(43), - RIGHT_ARROW(44), - LEFT_ARROW(45), - UP_ARROW(46), - DOWN_ARROW(47), - STRIPED_RIGHT_ARROW(48), - NOTCHED_RIGHT_ARROW(49), - BENT_UP_ARROW(50), - LEFT_RIGHT_ARROW(51), - UP_DOWN_ARROW(52), - LEFT_UP_ARROW(53), - LEFT_RIGHT_UP_ARROW(54), - QUAD_ARROW(55), - LEFT_ARROW_CALLOUT(56), - RIGHT_ARROW_CALLOUT(57), - UP_ARROW_CALLOUT(58), - DOWN_ARROW_CALLOUT(59), - LEFT_RIGHT_ARROW_CALLOUT(60), - UP_DOWN_ARROW_CALLOUT(61), - QUAD_ARROW_CALLOUT(62), - BENT_ARROW(63), - UTURN_ARROW(64), - CIRCULAR_ARROW(65), - LEFT_CIRCULAR_ARROW(66), - LEFT_RIGHT_CIRCULAR_ARROW(67), - CURVED_RIGHT_ARROW(68), - CURVED_LEFT_ARROW(69), - CURVED_UP_ARROW(70), - CURVED_DOWN_ARROW(71), - SWOOSH_ARROW(72), - CUBE(73), - CAN(74), - LIGHTNING_BOLT(75), - HEART(76), - SUN(77), - MOON(78), - SMILEY_FACE(79), - IRREGULAR_SEAL_1(80), - IRREGULAR_SEAL_2(81), - FOLDED_CORNER(82), - BEVEL(83), - FRAME(84), - HALF_FRAME(85), - CORNER(86), - DIAG_STRIPE(87), - CHORD(88), - ARC(89), - LEFT_BRACKET(90), - RIGHT_BRACKET(91), - LEFT_BRACE(92), - RIGHT_BRACE(93), - BRACKET_PAIR(94), - BRACE_PAIR(95), - STRAIGHT_CONNECTOR_1(96), - BENT_CONNECTOR_2(97), - BENT_CONNECTOR_3(98), - BENT_CONNECTOR_4(99), - BENT_CONNECTOR_5(100), - CURVED_CONNECTOR_2(101), - CURVED_CONNECTOR_3(102), - CURVED_CONNECTOR_4(103), - CURVED_CONNECTOR_5(104), - CALLOUT_1(105), - CALLOUT_2(106), - CALLOUT_3(107), - ACCENT_CALLOUT_1(108), - ACCENT_CALLOUT_2(109), - ACCENT_CALLOUT_3(110), - BORDER_CALLOUT_1(111), - BORDER_CALLOUT_2(112), - BORDER_CALLOUT_3(113), - ACCENT_BORDER_CALLOUT_1(114), - ACCENT_BORDER_CALLOUT_2(115), - ACCENT_BORDER_CALLOUT_3(116), - WEDGE_RECT_CALLOUT(117), - WEDGE_ROUND_RECT_CALLOUT(118), - WEDGE_ELLIPSE_CALLOUT(119), - CLOUD_CALLOUT(120), - CLOUD(121), - RIBBON(122), - RIBBON_2(123), - ELLIPSE_RIBBON(124), - ELLIPSE_RIBBON_2(125), - LEFT_RIGHT_RIBBON(126), - VERTICAL_SCROLL(127), - HORIZONTAL_SCROLL(128), - WAVE(129), - DOUBLE_WAVE(130), - PLUS(131), - FLOW_CHART_PROCESS(132), - FLOW_CHART_DECISION(133), - FLOW_CHART_INPUT_OUTPUT(134), - FLOW_CHART_PREDEFINED_PROCESS(135), - FLOW_CHART_INTERNAL_STORAGE(136), - FLOW_CHART_DOCUMENT(137), - FLOW_CHART_MULTIDOCUMENT(138), - FLOW_CHART_TERMINATOR(139), - FLOW_CHART_PREPARATION(140), - FLOW_CHART_MANUAL_INPUT(141), - FLOW_CHART_MANUAL_OPERATION(142), - FLOW_CHART_CONNECTOR(143), - FLOW_CHART_PUNCHED_CARD(144), - FLOW_CHART_PUNCHED_TAPE(145), - FLOW_CHART_SUMMING_JUNCTION(146), - FLOW_CHART_OR(147), - FLOW_CHART_COLLATE(148), - FLOW_CHART_SORT(149), - FLOW_CHART_EXTRACT(150), - FLOW_CHART_MERGE(151), - FLOW_CHART_OFFLINE_STORAGE(152), - FLOW_CHART_ONLINE_STORAGE(153), - FLOW_CHART_MAGNETIC_TAPE(154), - FLOW_CHART_MAGNETIC_DISK(155), - FLOW_CHART_MAGNETIC_DRUM(156), - FLOW_CHART_DISPLAY(157), - FLOW_CHART_DELAY(158), - FLOW_CHART_ALTERNATE_PROCESS(159), - FLOW_CHART_OFFPAGE_CONNECTOR(160), - ACTION_BUTTON_BLANK(161), - ACTION_BUTTON_HOME(162), - ACTION_BUTTON_HELP(163), - ACTION_BUTTON_INFORMATION(164), - ACTION_BUTTON_FORWARD_NEXT(165), - ACTION_BUTTON_BACK_PREVIOUS(166), - ACTION_BUTTON_END(167), - ACTION_BUTTON_BEGINNING(168), - ACTION_BUTTON_RETURN(169), - ACTION_BUTTON_DOCUMENT(170), - ACTION_BUTTON_SOUND(171), - ACTION_BUTTON_MOVIE(172), - GEAR_6(173), - GEAR_9(174), - FUNNEL(175), - MATH_PLUS(176), - MATH_MINUS(177), - MATH_MULTIPLY(178), - MATH_DIVIDE(179), - MATH_EQUAL(180), - MATH_NOT_EQUAL(181), - CORNER_TABS(182), - SQUARE_TABS(183), - PLAQUE_TABS(184), - CHART_X(185), - CHART_STAR(186), - CHART_PLUS(187); - - private int _idx; - - XSLFShapeType(int idx){ - _idx = idx; - } - - /** - * - * @return index in the STShapeType enum - */ - int getIndex(){ - return _idx; - } - - static XSLFShapeType forInt(int idx){ - for(XSLFShapeType t : values()){ - if(t._idx == idx) return t; - } - throw new IllegalArgumentException("Unknown shape type: " + idx); - } -} 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 35100d119..c9694e218 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java @@ -23,6 +23,8 @@ import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackageRelationship; import org.apache.poi.openxml4j.opc.TargetMode; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.poi.sl.usermodel.MasterSheet; +import org.apache.poi.sl.usermodel.Sheet; import org.apache.poi.util.Beta; import org.apache.poi.util.IOUtils; import org.apache.poi.util.Internal; @@ -37,7 +39,10 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTPicture; import org.openxmlformats.schemas.presentationml.x2006.main.CTPlaceholder; import org.openxmlformats.schemas.presentationml.x2006.main.CTShape; +import com.sun.org.apache.xml.internal.utils.UnImplNode; + import javax.xml.namespace.QName; + import java.awt.Graphics2D; import java.awt.geom.AffineTransform; import java.io.IOException; @@ -51,7 +56,7 @@ import java.util.Map; import java.util.regex.Pattern; @Beta -public abstract class XSLFSheet extends POIXMLDocumentPart implements XSLFShapeContainer { +public abstract class XSLFSheet extends POIXMLDocumentPart implements XSLFShapeContainer, Sheet { private XSLFCommonSlideData _commonSlideData; private XSLFDrawing _drawing; private List _shapes; @@ -142,6 +147,7 @@ public abstract class XSLFSheet extends POIXMLDocumentPart implements XSLFShapeC List shapes = getShapeList(); XSLFAutoShape sh = getDrawing().createAutoShape(); shapes.add(sh); + sh.setParent(this); return sh; } @@ -149,6 +155,7 @@ public abstract class XSLFSheet extends POIXMLDocumentPart implements XSLFShapeC List shapes = getShapeList(); XSLFFreeformShape sh = getDrawing().createFreeform(); shapes.add(sh); + sh.setParent(this); return sh; } @@ -156,6 +163,7 @@ public abstract class XSLFSheet extends POIXMLDocumentPart implements XSLFShapeC List shapes = getShapeList(); XSLFTextBox sh = getDrawing().createTextBox(); shapes.add(sh); + sh.setParent(this); return sh; } @@ -163,6 +171,7 @@ public abstract class XSLFSheet extends POIXMLDocumentPart implements XSLFShapeC List shapes = getShapeList(); XSLFConnectorShape sh = getDrawing().createConnector(); shapes.add(sh); + sh.setParent(this); return sh; } @@ -170,6 +179,7 @@ public abstract class XSLFSheet extends POIXMLDocumentPart implements XSLFShapeC List shapes = getShapeList(); XSLFGroupShape sh = getDrawing().createGroup(); shapes.add(sh); + sh.setParent(this); return sh; } @@ -191,6 +201,7 @@ public abstract class XSLFSheet extends POIXMLDocumentPart implements XSLFShapeC sh.resize(); getShapeList().add(sh); + sh.setParent(this); return sh; } @@ -198,6 +209,7 @@ public abstract class XSLFSheet extends POIXMLDocumentPart implements XSLFShapeC List shapes = getShapeList(); XSLFTable sh = getDrawing().createTable(); shapes.add(sh); + sh.setParent(this); return sh; } @@ -219,6 +231,12 @@ public abstract class XSLFSheet extends POIXMLDocumentPart implements XSLFShapeC return getShapeList().iterator(); } + public void addShape(XSLFShape shape) { + throw new UnsupportedOperationException( + "Adding a shape from a different container is not supported -" + + " create it from scratch witht XSLFSheet.create* methods"); + } + /** * Removes the specified shape from this sheet, if it is present * (optional operation). If this sheet does not contain the element, @@ -370,12 +388,6 @@ public abstract class XSLFSheet extends POIXMLDocumentPart implements XSLFShapeC return null; } - /** - * - * @return master of this sheet. - */ - public abstract XSLFSheet getMasterSheet(); - protected XSLFTextShape getTextShapeByType(Placeholder type){ for(XSLFShape shape : this.getShapes()){ if(shape instanceof XSLFTextShape) { @@ -486,7 +498,7 @@ public abstract class XSLFSheet extends POIXMLDocumentPart implements XSLFShapeC * @param graphics */ public void draw(Graphics2D graphics){ - XSLFSheet master = getMasterSheet(); + XSLFSheet master = (XSLFSheet)getMasterSheet(); if(getFollowMasterGraphics() && master != null) master.draw(graphics); graphics.setRenderingHint(XSLFRenderingHint.GROUP_TRANSFORM, new AffineTransform()); diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java index d6cfa7fba..ca548dd63 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java @@ -19,26 +19,25 @@ package org.apache.poi.xslf.usermodel; +import java.awt.*; +import java.awt.Shape; +import java.awt.geom.*; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; + +import org.apache.poi.sl.draw.geom.*; +import org.apache.poi.sl.usermodel.*; +import org.apache.poi.sl.usermodel.StrokeStyle.LineCap; +import org.apache.poi.sl.usermodel.StrokeStyle.LineDash; import org.apache.poi.util.Beta; import org.apache.poi.util.Units; import org.apache.poi.xslf.model.PropertyFetcher; -import org.apache.poi.xslf.model.geom.CustomGeometry; -import org.apache.poi.xslf.model.geom.Outline; -import org.apache.poi.xslf.model.geom.Path; -import org.apache.poi.xslf.model.geom.PresetGeometries; import org.apache.xmlbeans.XmlObject; import org.openxmlformats.schemas.drawingml.x2006.main.*; -import org.openxmlformats.schemas.presentationml.x2006.main.CTPlaceholder; -import org.openxmlformats.schemas.presentationml.x2006.main.CTShape; -import org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderType; - -import java.awt.*; -import java.awt.geom.AffineTransform; -import java.awt.geom.Ellipse2D; -import java.awt.geom.GeneralPath; -import java.awt.geom.Rectangle2D; -import java.util.ArrayList; -import java.util.List; +import org.openxmlformats.schemas.presentationml.x2006.main.*; /** * Represents a single (non-group) shape in a .pptx slide show @@ -46,24 +45,11 @@ import java.util.List; * @author Yegor Kozlov */ @Beta -public abstract class XSLFSimpleShape extends XSLFShape { +public abstract class XSLFSimpleShape extends XSLFShape implements SimpleShape { private static CTOuterShadowEffect NO_SHADOW = CTOuterShadowEffect.Factory.newInstance(); - private final XmlObject _shape; - private final XSLFSheet _sheet; - private CTShapeProperties _spPr; - private CTShapeStyle _spStyle; - private CTNonVisualDrawingProps _nvPr; - private CTPlaceholder _ph; - /* package */XSLFSimpleShape(XmlObject shape, XSLFSheet sheet) { - _shape = shape; - _sheet = sheet; - } - - @Override - public XmlObject getXmlObject() { - return _shape; + super(shape,sheet); } /** @@ -78,16 +64,16 @@ public abstract class XSLFSimpleShape extends XSLFShape { * * @param type */ - public void setShapeType(XSLFShapeType type){ + public void setShapeType(ShapeType type){ CTShape shape = (CTShape) getXmlObject(); - STShapeType.Enum geom = STShapeType.Enum.forInt(type.getIndex()); + STShapeType.Enum geom = STShapeType.Enum.forInt(type.ooxmlId); shape.getSpPr().getPrstGeom().setPrst(geom); } - public XSLFShapeType getShapeType(){ + public ShapeType getShapeType(){ CTShape shape = (CTShape) getXmlObject(); STShapeType.Enum geom = shape.getSpPr().getPrstGeom().getPrst(); - return XSLFShapeType.forInt(geom.intValue()); + return ShapeType.forId(geom.intValue(), true); } @Override @@ -100,101 +86,6 @@ public abstract class XSLFSimpleShape extends XSLFShape { return (int) getNvPr().getId(); } - protected CTNonVisualDrawingProps getNvPr() { - if (_nvPr == null) { - XmlObject[] rs = _shape - .selectPath("declare namespace p='http://schemas.openxmlformats.org/presentationml/2006/main' .//*/p:cNvPr"); - if (rs.length != 0) { - _nvPr = (CTNonVisualDrawingProps) rs[0]; - } - } - return _nvPr; - } - - protected CTShapeProperties getSpPr() { - if (_spPr == null) { - for (XmlObject obj : _shape.selectPath("*")) { - if (obj instanceof CTShapeProperties) { - _spPr = (CTShapeProperties) obj; - } - } - } - if (_spPr == null) { - throw new IllegalStateException("CTShapeProperties was not found."); - } - return _spPr; - } - - protected CTShapeStyle getSpStyle() { - if (_spStyle == null) { - for (XmlObject obj : _shape.selectPath("*")) { - if (obj instanceof CTShapeStyle) { - _spStyle = (CTShapeStyle) obj; - } - } - } - return _spStyle; - } - - protected CTPlaceholder getCTPlaceholder() { - if (_ph == null) { - XmlObject[] obj = _shape.selectPath( - "declare namespace p='http://schemas.openxmlformats.org/presentationml/2006/main' .//*/p:nvPr/p:ph"); - if (obj.length == 1) { - _ph = (CTPlaceholder) obj[0]; - } - } - return _ph; - } - - CTTransform2D getXfrm() { - PropertyFetcher fetcher = new PropertyFetcher() { - public boolean fetch(XSLFSimpleShape shape) { - CTShapeProperties pr = shape.getSpPr(); - if (pr.isSetXfrm()) { - setValue(pr.getXfrm()); - return true; - } - return false; - } - }; - fetchShapeProperty(fetcher); - return fetcher.getValue(); - } - - @Override - public Rectangle2D getAnchor() { - - CTTransform2D xfrm = getXfrm(); - - CTPoint2D off = xfrm.getOff(); - long x = off.getX(); - long y = off.getY(); - CTPositiveSize2D ext = xfrm.getExt(); - long cx = ext.getCx(); - long cy = ext.getCy(); - return new Rectangle2D.Double( - Units.toPoints(x), Units.toPoints(y), - Units.toPoints(cx), Units.toPoints(cy)); - } - - @Override - public void setAnchor(Rectangle2D anchor) { - CTShapeProperties spPr = getSpPr(); - CTTransform2D xfrm = spPr.isSetXfrm() ? spPr.getXfrm() : spPr.addNewXfrm(); - CTPoint2D off = xfrm.isSetOff() ? xfrm.getOff() : xfrm.addNewOff(); - long x = Units.toEMU(anchor.getX()); - long y = Units.toEMU(anchor.getY()); - off.setX(x); - off.setY(y); - CTPositiveSize2D ext = xfrm.isSetExt() ? xfrm.getExt() : xfrm - .addNewExt(); - long cx = Units.toEMU(anchor.getWidth()); - long cy = Units.toEMU(anchor.getHeight()); - ext.setCx(cx); - ext.setCy(cy); - } - @Override public void setRotation(double theta) { CTShapeProperties spPr = getSpPr(); @@ -314,7 +205,7 @@ public abstract class XSLFSimpleShape extends XSLFShape { */ public double getLineWidth() { PropertyFetcher fetcher = new PropertyFetcher() { - public boolean fetch(XSLFSimpleShape shape) { + public boolean fetch(XSLFShape shape) { CTShapeProperties spPr = shape.getSpPr(); CTLineProperties ln = spPr.getLn(); if (ln != null) { @@ -371,7 +262,7 @@ public abstract class XSLFSimpleShape extends XSLFShape { public LineDash getLineDash() { PropertyFetcher fetcher = new PropertyFetcher() { - public boolean fetch(XSLFSimpleShape shape) { + public boolean fetch(XSLFShape shape) { CTShapeProperties spPr = shape.getSpPr(); CTLineProperties ln = spPr.getLn(); if (ln != null) { @@ -421,7 +312,7 @@ public abstract class XSLFSimpleShape extends XSLFShape { */ public LineCap getLineCap() { PropertyFetcher fetcher = new PropertyFetcher() { - public boolean fetch(XSLFSimpleShape shape) { + public boolean fetch(XSLFShape shape) { CTShapeProperties spPr = shape.getSpPr(); CTLineProperties ln = spPr.getLn(); if (ln != null) { @@ -499,7 +390,7 @@ public abstract class XSLFSimpleShape extends XSLFShape { */ public XSLFShadow getShadow() { PropertyFetcher fetcher = new PropertyFetcher() { - public boolean fetch(XSLFSimpleShape shape) { + public boolean fetch(XSLFShape shape) { CTShapeProperties spPr = shape.getSpPr(); if (spPr.isSetEffectLst()) { CTOuterShadowEffect obj = spPr.getEffectLst().getOuterShdw(); @@ -528,90 +419,11 @@ public abstract class XSLFSimpleShape extends XSLFShape { return (obj == null || obj == NO_SHADOW) ? null : new XSLFShadow(obj, this); } - @Override - public void draw(Graphics2D graphics) { - RenderableShape rShape = new RenderableShape(this); - rShape.render(graphics); - - // draw line decorations - Color lineColor = getLineColor(); - if(lineColor != null) { - graphics.setPaint(lineColor); - for(Outline o : getDecorationOutlines(graphics)){ - if(o.getPath().isFilled()){ - graphics.fill(o.getOutline()); - } - if(o.getPath().isStroked()){ - graphics.draw(o.getOutline()); - } - } - } - } - - - /** - * Walk up the inheritance tree and fetch shape properties. - * - * The following order of inheritance is assumed: - *

- * slide <-- slideLayout <-- slideMaster - *

- * - * @param visitor the object that collects the desired property - * @return true if the property was fetched - */ - boolean fetchShapeProperty(PropertyFetcher visitor) { - boolean ok = visitor.fetch(this); - - XSLFSimpleShape masterShape; - XSLFSheet masterSheet = getSheet().getMasterSheet(); - CTPlaceholder ph = getCTPlaceholder(); - - if (masterSheet != null && ph != null) { - if (!ok) { - masterShape = masterSheet.getPlaceholder(ph); - if (masterShape != null) { - ok = visitor.fetch(masterShape); - } - } - - // try slide master - if (!ok ) { - int textType; - if ( !ph.isSetType()) textType = STPlaceholderType.INT_BODY; - else { - switch (ph.getType().intValue()) { - case STPlaceholderType.INT_TITLE: - case STPlaceholderType.INT_CTR_TITLE: - textType = STPlaceholderType.INT_TITLE; - break; - case STPlaceholderType.INT_FTR: - case STPlaceholderType.INT_SLD_NUM: - case STPlaceholderType.INT_DT: - textType = ph.getType().intValue(); - break; - default: - textType = STPlaceholderType.INT_BODY; - break; - } - } - XSLFSheet master = masterSheet.getMasterSheet(); - if (master != null) { - masterShape = master.getPlaceholderByType(textType); - if (masterShape != null) { - ok = visitor.fetch(masterShape); - } - } - } - } - return ok; - } - /** * * @return definition of the shape geometry */ - CustomGeometry getGeometry(){ + public CustomGeometry getGeometry(){ CTShapeProperties spPr = getSpPr(); CustomGeometry geom; PresetGeometries dict = PresetGeometries.getInstance(); @@ -622,23 +434,16 @@ public abstract class XSLFSimpleShape extends XSLFShape { throw new IllegalStateException("Unknown shape geometry: " + name); } } else if (spPr.isSetCustGeom()){ - geom = new CustomGeometry(spPr.getCustGeom()); + XMLStreamReader staxReader = spPr.getCustGeom().newXMLStreamReader(); + geom = PresetGeometries.convertCustomGeometry(staxReader); + try { staxReader.close(); } + catch (XMLStreamException e) {} } else { geom = dict.get("rect"); } return geom; } - - - /** - * draw any content within this shape (image, text, etc.). - * - * @param graphics the graphics to draw into - */ - public void drawContent(Graphics2D graphics){ - - } - + @Override void copy(XSLFShape sh){ super.copy(sh); @@ -943,4 +748,30 @@ public abstract class XSLFSimpleShape extends XSLFShape { return lst; } + public boolean isPlaceholder() { + CTPlaceholder ph = getCTPlaceholder(); + return ph != null; + } + + public Hyperlink getHyperlink() { + // TODO Auto-generated method stub + return null; + } + + public void setHyperlink(Hyperlink hyperlink) { + // TODO Auto-generated method stub + + } + + public Guide getAdjustValue(String name) { + // TODO Auto-generated method stub + return null; + } + + public org.apache.poi.sl.usermodel.LineDecoration getLineDecoration() { + // TODO Auto-generated method stub + return null; + } + + } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlide.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlide.java index f2d4b6eff..af80a57ff 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlide.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlide.java @@ -16,29 +16,31 @@ ==================================================================== */ package org.apache.poi.xslf.usermodel; +import java.awt.Graphics2D; +import java.io.IOException; + import org.apache.poi.POIXMLDocumentPart; import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackageRelationship; +import org.apache.poi.sl.usermodel.Notes; +import org.apache.poi.sl.usermodel.Slide; import org.apache.poi.util.Beta; import org.apache.xmlbeans.XmlException; +import org.openxmlformats.schemas.drawingml.x2006.main.CTBlip; import org.openxmlformats.schemas.drawingml.x2006.main.CTGroupShapeProperties; import org.openxmlformats.schemas.drawingml.x2006.main.CTGroupTransform2D; import org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps; import org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D; import org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D; -import org.openxmlformats.schemas.drawingml.x2006.main.CTBlip; +import org.openxmlformats.schemas.presentationml.x2006.main.CTBackground; import org.openxmlformats.schemas.presentationml.x2006.main.CTCommonSlideData; import org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape; import org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShapeNonVisual; import org.openxmlformats.schemas.presentationml.x2006.main.CTSlide; import org.openxmlformats.schemas.presentationml.x2006.main.SldDocument; -import org.openxmlformats.schemas.presentationml.x2006.main.CTBackground; - -import java.awt.Graphics2D; -import java.io.IOException; @Beta -public final class XSLFSlide extends XSLFSheet { +public final class XSLFSlide extends XSLFSheet implements Slide { private final CTSlide _slide; private XSLFSlideLayout _layout; private XSLFComments _comments; @@ -111,7 +113,6 @@ public final class XSLFSlide extends XSLFSheet { return "sld"; } - @Override public XSLFSlideLayout getMasterSheet(){ return getSlideLayout(); } @@ -211,6 +212,15 @@ public final class XSLFSlide extends XSLFSheet { } + public boolean getFollowMasterObjects() { + return getFollowMasterGraphics(); + } + + public void setFollowMasterObjects(boolean follow) { + setFollowMasterGraphics(follow); + } + + @Override public void draw(Graphics2D graphics){ @@ -239,4 +249,26 @@ public final class XSLFSlide extends XSLFSheet { return this; } + public boolean getFollowMasterBackground() { + return false; + } + + public void setFollowMasterBackground(boolean follow) { + // not implemented ... also not in the specs + throw new UnsupportedOperationException(); + } + + public boolean getFollowMasterColourScheme() { + return false; + } + + public void setFollowMasterColourScheme(boolean follow) { + // not implemented ... only for OLE objects in the specs + throw new UnsupportedOperationException(); + } + + public void setNotes(Notes notes) { + // TODO Auto-generated method stub + + } } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideLayout.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideLayout.java index f8cd23ccd..237364135 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideLayout.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideLayout.java @@ -19,6 +19,7 @@ package org.apache.poi.xslf.usermodel; import org.apache.poi.POIXMLDocumentPart; import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackageRelationship; +import org.apache.poi.sl.usermodel.MasterSheet; import org.apache.poi.util.Beta; import org.apache.poi.util.Internal; import org.apache.xmlbeans.XmlException; @@ -30,7 +31,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.SldLayoutDocument; import java.io.IOException; @Beta -public class XSLFSlideLayout extends XSLFSheet { +public class XSLFSlideLayout extends XSLFSheet implements MasterSheet { private CTSlideLayout _layout; private XSLFSlideMaster _master; 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 d4383c4d9..ebeec01ef 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java @@ -19,6 +19,7 @@ package org.apache.poi.xslf.usermodel; import org.apache.poi.POIXMLDocumentPart; import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackageRelationship; +import org.apache.poi.sl.usermodel.MasterSheet; import org.apache.poi.util.Beta; import org.apache.xmlbeans.XmlException; import org.openxmlformats.schemas.drawingml.x2006.main.CTColorMapping; @@ -53,7 +54,7 @@ import java.util.Map; * @author Yegor Kozlov */ @Beta - public class XSLFSlideMaster extends XSLFSheet { + public class XSLFSlideMaster extends XSLFSheet implements MasterSheet { private CTSlideMaster _slide; private Map _layouts; private XSLFTheme _theme; @@ -82,7 +83,7 @@ import java.util.Map; } @Override - public XSLFSheet getMasterSheet() { + public MasterSheet getMasterSheet() { return null; } @@ -177,5 +178,4 @@ import java.util.Map; return null; } } - } \ No newline at end of file diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableCell.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableCell.java index a3671ab63..a21b9d5e3 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableCell.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableCell.java @@ -21,6 +21,7 @@ package org.apache.poi.xslf.usermodel; import java.awt.Color; +import org.apache.poi.sl.usermodel.VerticalAlignment; import org.apache.poi.util.Units; import org.openxmlformats.schemas.drawingml.x2006.main.CTLineEndProperties; import org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties; 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 e0b383a76..869421e5c 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java @@ -18,42 +18,14 @@ package org.apache.poi.xslf.usermodel; import java.awt.Color; import java.awt.Graphics2D; -import java.awt.font.LineBreakMeasurer; -import java.awt.font.TextAttribute; -import java.awt.font.TextLayout; import java.awt.geom.Rectangle2D; -import java.text.AttributedCharacterIterator; -import java.text.AttributedString; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; +import java.util.*; -import org.apache.poi.hslf.model.TextPainter; -import org.apache.poi.util.Beta; -import org.apache.poi.util.Internal; -import org.apache.poi.util.Units; +import org.apache.poi.sl.usermodel.TextParagraph; +import org.apache.poi.util.*; import org.apache.poi.xslf.model.ParagraphPropertyFetcher; import org.apache.xmlbeans.XmlObject; -import org.openxmlformats.schemas.drawingml.x2006.main.CTColor; -import org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun; -import org.openxmlformats.schemas.drawingml.x2006.main.CTSRgbColor; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextAutonumberBullet; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextBulletSizePercent; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextBulletSizePoint; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharBullet; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextField; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextFont; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextLineBreak; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextNormalAutofit; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextSpacing; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextTabStop; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextTabStopList; -import org.openxmlformats.schemas.drawingml.x2006.main.STTextAlignType; -import org.openxmlformats.schemas.drawingml.x2006.main.STTextAutonumberScheme; +import org.openxmlformats.schemas.drawingml.x2006.main.*; import org.openxmlformats.schemas.presentationml.x2006.main.CTPlaceholder; import org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderType; @@ -65,16 +37,10 @@ import org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderType; * @since POI-3.8 */ @Beta -public class XSLFTextParagraph implements Iterable{ +public class XSLFTextParagraph implements TextParagraph { private final CTTextParagraph _p; private final List _runs; private final XSLFTextShape _shape; - private List _lines; - private TextFragment _bullet; - /** - * the highest line in this paragraph. Used for line spacing. - */ - private double _maxLineHeight; XSLFTextParagraph(CTTextParagraph p, XSLFTextShape shape){ _p = p; @@ -122,7 +88,7 @@ public class XSLFTextParagraph implements Iterable{ return _p; } - XSLFTextShape getParentShape() { + public XSLFTextShape getParentShape() { return _shape; } @@ -194,7 +160,7 @@ public class XSLFTextParagraph implements Iterable{ /** * Specifies the alignment that is to be applied to the paragraph. * Possible values for this include left, right, centered, justified and distributed, - * see {@link org.apache.poi.xslf.usermodel.TextAlign}. + * see {@link org.apache.poi.sl.usermodel.TextAlign}. * * @param align text align */ @@ -408,6 +374,26 @@ public class XSLFTextParagraph implements Iterable{ return fetcher.getValue() == null ? 0 : fetcher.getValue(); } + /** + * + * @return the right margin of the paragraph + */ + public double getRightMargin(){ + ParagraphPropertyFetcher fetcher = new ParagraphPropertyFetcher(getLevel()){ + public boolean fetch(CTTextParagraphProperties props){ + if(props.isSetMarR()){ + double val = Units.toPoints(props.getMarR()); + setValue(val); + return true; + } + return false; + } + }; + fetchParagraphProperty(fetcher); + // if the marL attribute is omitted, then a value of 347663 is implied + return fetcher.getValue() == null ? 0 : fetcher.getValue(); + } + /** * * @return the default size for a tab character within this paragraph in points @@ -711,10 +697,6 @@ public class XSLFTextParagraph implements Iterable{ return "[" + getClass() + "]" + getText(); } - List getTextLines(){ - return _lines; - } - /** * Returns wrapping width to break lines in this paragraph * @@ -754,244 +736,6 @@ public class XSLFTextParagraph implements Iterable{ return width; } - public double draw(Graphics2D graphics, double x, double y){ - double leftInset = _shape.getLeftInset(); - double rightInset = _shape.getRightInset(); - RenderableShape rShape = new RenderableShape(_shape); - Rectangle2D anchor = rShape.getAnchor(graphics); - double penY = y; - - double leftMargin = getLeftMargin(); - boolean firstLine = true; - double indent = getIndent(); - - //The vertical line spacing - double spacing = getLineSpacing(); - for(TextFragment line : _lines){ - double penX = x + leftMargin; - - if(firstLine) { - if(_bullet != null){ - if(indent < 0) { - // a negative value means "Hanging" indentation and - // indicates the position of the actual bullet character. - // (the bullet is shifted to right relative to the text) - _bullet.draw(graphics, penX + indent, penY); - } else if(indent > 0){ - // a positive value means the "First Line" indentation: - // the first line is indented and other lines start at the bullet ofset - _bullet.draw(graphics, penX, penY); - penX += indent; - } else { - // a zero indent means that the bullet and text have the same offset - _bullet.draw(graphics, penX, penY); - - // don't let text overlay the bullet and advance by the bullet width - penX += _bullet._layout.getAdvance() + 1; - } - } else { - penX += indent; - } - } - - - switch (getTextAlign()) { - case CENTER: - penX += (anchor.getWidth() - leftMargin - line.getWidth() - leftInset - rightInset) / 2; - break; - case RIGHT: - penX += (anchor.getWidth() - line.getWidth() - leftInset - rightInset); - break; - default: - break; - } - - line.draw(graphics, penX, penY); - - if(spacing > 0) { - // If linespacing >= 0, then linespacing is a percentage of normal line height. - penY += spacing*0.01* line.getHeight(); - } else { - // positive value means absolute spacing in points - penY += -spacing; - } - - firstLine = false; - } - - return penY - y; - } - - AttributedString getAttributedString(Graphics2D graphics){ - - String text = getRenderableText(); - - AttributedString string = new AttributedString(text); - - XSLFFontManager fontHandler = (XSLFFontManager)graphics.getRenderingHint(XSLFRenderingHint.FONT_HANDLER); - - int startIndex = 0; - for (XSLFTextRun run : _runs){ - int length = run.getRenderableText().length(); - if(length == 0) { - // skip empty runs - continue; - } - int endIndex = startIndex + length; - - string.addAttribute(TextAttribute.FOREGROUND, run.getFontColor(), startIndex, endIndex); - - // user can pass an custom object to convert fonts - String fontFamily = run.getFontFamily(); - @SuppressWarnings("unchecked") - Map fontMap = (Map)graphics.getRenderingHint(TextPainter.KEY_FONTMAP); - if (fontMap != null && fontMap.containsKey(fontFamily)) { - fontFamily = fontMap.get(fontFamily); - } - if(fontHandler != null) { - fontFamily = fontHandler.getRendererableFont(fontFamily, run.getPitchAndFamily()); - } - string.addAttribute(TextAttribute.FAMILY, fontFamily, startIndex, endIndex); - - float fontSz = (float)run.getFontSize(); - string.addAttribute(TextAttribute.SIZE, fontSz , startIndex, endIndex); - - if(run.isBold()) { - string.addAttribute(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD, startIndex, endIndex); - } - if(run.isItalic()) { - string.addAttribute(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE, startIndex, endIndex); - } - if(run.isUnderline()) { - string.addAttribute(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON, startIndex, endIndex); - string.addAttribute(TextAttribute.INPUT_METHOD_UNDERLINE, TextAttribute.UNDERLINE_LOW_TWO_PIXEL, startIndex, endIndex); - } - if(run.isStrikethrough()) { - string.addAttribute(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON, startIndex, endIndex); - } - if(run.isSubscript()) { - string.addAttribute(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUB, startIndex, endIndex); - } - if(run.isSuperscript()) { - string.addAttribute(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUPER, startIndex, endIndex); - } - - - startIndex = endIndex; - } - - return string; - } - - /** - * ensure that the paragraph contains at least one character. - * We need this trick to correctly measure text - */ - private void ensureNotEmpty(){ - XSLFTextRun r = addNewTextRun(); - r.setText(" "); - CTTextCharacterProperties endPr = _p.getEndParaRPr(); - if(endPr != null) { - if(endPr.isSetSz()) r.setFontSize(endPr.getSz() / 100); - } - } - - /** - * break text into lines - * - * @param graphics - * @return array of text fragments, - * each representing a line of text that fits in the wrapping width - */ - List breakText(Graphics2D graphics){ - _lines = new ArrayList(); - - // does this paragraph contain text? - boolean emptyParagraph = _runs.size() == 0; - - // ensure that the paragraph contains at least one character - if(_runs.size() == 0) ensureNotEmpty(); - - String text = getRenderableText(); - if(text.length() == 0) return _lines; - - AttributedString at = getAttributedString(graphics); - AttributedCharacterIterator it = at.getIterator(); - LineBreakMeasurer measurer = new LineBreakMeasurer(it, graphics.getFontRenderContext()) ; - for (;;) { - int startIndex = measurer.getPosition(); - - double wrappingWidth = getWrappingWidth(_lines.size() == 0, graphics) + 1; // add a pixel to compensate rounding errors - // shape width can be smaller that the sum of insets (this was proved by a test file) - if(wrappingWidth < 0) wrappingWidth = 1; - - int nextBreak = text.indexOf('\n', startIndex + 1); - if(nextBreak == -1) nextBreak = it.getEndIndex(); - - TextLayout layout = measurer.nextLayout((float)wrappingWidth, nextBreak, true); - if (layout == null) { - // layout can be null if the entire word at the current position - // does not fit within the wrapping width. Try with requireNextWord=false. - layout = measurer.nextLayout((float)wrappingWidth, nextBreak, false); - } - - if(layout == null) { - // exit if can't break any more - break; - } - - int endIndex = measurer.getPosition(); - // skip over new line breaks (we paint 'clear' text runs not starting or ending with \n) - if(endIndex < it.getEndIndex() && text.charAt(endIndex) == '\n'){ - measurer.setPosition(endIndex + 1); - } - - TextAlign hAlign = getTextAlign(); - if(hAlign == TextAlign.JUSTIFY || hAlign == TextAlign.JUSTIFY_LOW) { - layout = layout.getJustifiedLayout((float)wrappingWidth); - } - - AttributedString str = new AttributedString(it, startIndex, endIndex); - TextFragment line = new TextFragment( - layout, // we will not paint empty paragraphs - emptyParagraph ? null : str); - _lines.add(line); - - _maxLineHeight = Math.max(_maxLineHeight, line.getHeight()); - - if(endIndex == it.getEndIndex()) break; - - } - - if(isBullet() && !emptyParagraph) { - String buCharacter = getBulletCharacter(); - String buFont = getBulletFont(); - if(buFont == null) buFont = getTextRuns().get(0).getFontFamily(); - if(buCharacter != null && buFont != null && _lines.size() > 0) { - AttributedString str = new AttributedString(buCharacter); - - TextFragment firstLine = _lines.get(0); - AttributedCharacterIterator bit = firstLine._str.getIterator(); - - Color buColor = getBulletFontColor(); - str.addAttribute(TextAttribute.FOREGROUND, buColor == null ? - bit.getAttribute(TextAttribute.FOREGROUND) : buColor); - str.addAttribute(TextAttribute.FAMILY, buFont); - - float fontSize = (Float)bit.getAttribute(TextAttribute.SIZE); - float buSz = (float)getBulletFontSize(); - if(buSz > 0) fontSize *= buSz* 0.01; - else fontSize = -buSz; - - str.addAttribute(TextAttribute.SIZE, fontSize); - - TextLayout layout = new TextLayout(str.getIterator(), graphics.getFontRenderContext()); - _bullet = new TextFragment(layout, str); - } - } - return _lines; - } - CTTextParagraphProperties getDefaultMasterStyle(){ CTPlaceholder ph = _shape.getCTPlaceholder(); String defaultStyleSelector; @@ -1017,7 +761,7 @@ public class XSLFTextParagraph implements Iterable{ // wind up and find the root master sheet which must be slide master XSLFSheet masterSheet = _shape.getSheet(); while (masterSheet.getMasterSheet() != null){ - masterSheet = masterSheet.getMasterSheet(); + masterSheet = (XSLFSheet)masterSheet.getMasterSheet(); } XmlObject[] o = masterSheet.getXmlObject().selectPath( @@ -1130,4 +874,32 @@ public class XSLFTextParagraph implements Iterable{ } } + public double getDefaultFontSize() { + CTTextCharacterProperties endPr = _p.getEndParaRPr(); + return (endPr == null || !endPr.isSetSz()) ? 12 : (endPr.getSz() / 100); + } + + public String getDefaultFontFamily() { + return (_runs.isEmpty() ? "Arial" : _runs.get(0).getFontFamily()); + } + + public BulletStyle getBulletStyle() { + return new BulletStyle(){ + public String getBulletCharacter() { + return XSLFTextParagraph.this.getBulletCharacter(); + } + + public String getBulletFont() { + return XSLFTextParagraph.this.getBulletFont(); + } + + public double getBulletFontSize() { + return XSLFTextParagraph.this.getBulletFontSize(); + } + + public Color getBulletFontColor() { + return XSLFTextParagraph.this.getBulletFontColor(); + } + }; + } } diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextRun.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextRun.java index 16d0e803b..0a6daf6ce 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextRun.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextRun.java @@ -22,6 +22,7 @@ import java.awt.font.TextAttribute; import java.awt.font.TextLayout; import java.text.AttributedString; +import org.apache.poi.sl.usermodel.TextRun; import org.apache.poi.util.Beta; import org.apache.poi.xslf.model.CharacterPropertyFetcher; import org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun; @@ -45,7 +46,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTPlaceholder; * @author Yegor Kozlov */ @Beta -public class XSLFTextRun { +public class XSLFTextRun implements TextRun { private final CTRegularTextRun _r; private final XSLFTextParagraph _p; 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 d5ae1a252..b4308c46c 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextShape.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextShape.java @@ -23,26 +23,20 @@ import java.awt.Graphics2D; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; +import java.util.*; import org.apache.poi.POIXMLException; +import org.apache.poi.sl.draw.DrawFactory; +import org.apache.poi.sl.draw.geom.Guide; +import org.apache.poi.sl.usermodel.*; +import org.apache.poi.sl.usermodel.LineDecoration; import org.apache.poi.util.Beta; import org.apache.poi.util.Units; import org.apache.poi.xslf.model.PropertyFetcher; import org.apache.poi.xslf.model.TextBodyPropertyFetcher; import org.apache.xmlbeans.XmlObject; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextBodyProperties; -import org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph; -import org.openxmlformats.schemas.drawingml.x2006.main.STTextAnchoringType; -import org.openxmlformats.schemas.drawingml.x2006.main.STTextVerticalType; -import org.openxmlformats.schemas.drawingml.x2006.main.STTextWrappingType; -import org.openxmlformats.schemas.presentationml.x2006.main.CTApplicationNonVisualDrawingProps; -import org.openxmlformats.schemas.presentationml.x2006.main.CTPlaceholder; -import org.openxmlformats.schemas.presentationml.x2006.main.CTShape; -import org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderType; +import org.openxmlformats.schemas.drawingml.x2006.main.*; +import org.openxmlformats.schemas.presentationml.x2006.main.*; /** * Represents a shape that can hold text. @@ -50,7 +44,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderType; * @author Yegor Kozlov */ @Beta -public abstract class XSLFTextShape extends XSLFSimpleShape implements Iterable{ +public abstract class XSLFTextShape extends XSLFSimpleShape implements TextShape { private final List _paragraphs; /** @@ -338,7 +332,13 @@ public abstract class XSLFTextShape extends XSLFSimpleShape implements Iterable< } } - + @Override + public Insets2D getInsets() { + Insets2D insets = new Insets2D(getTopInset(), getLeftInset(), getBottomInset(), getRightInset()); + return insets; + } + + /** * @return whether to wrap words within the bounding rectangle */ @@ -453,6 +453,9 @@ public abstract class XSLFTextShape extends XSLFSimpleShape implements Iterable< // dry-run in a 1x1 image and return the vertical advance BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = img.createGraphics(); + DrawFactory fact = DrawFactory.getInstance(graphics); + fact.getDrawable(this); + breakText(graphics); return drawParagraphs(graphics, 0, 0); } @@ -475,121 +478,6 @@ public abstract class XSLFTextShape extends XSLFSimpleShape implements Iterable< return anchor; } - /** - * break the contained text into lines - */ - private void breakText(Graphics2D graphics){ - if(!_isTextBroken) { - for(XSLFTextParagraph p : _paragraphs) p.breakText(graphics); - - _isTextBroken = true; - } - } - - @Override - public void drawContent(Graphics2D graphics) { - breakText(graphics); - - RenderableShape rShape = new RenderableShape(this); - Rectangle2D anchor = rShape.getAnchor(graphics); - double x = anchor.getX() + getLeftInset(); - double y = anchor.getY(); - - // remember the initial transform - AffineTransform tx = graphics.getTransform(); - - // Transform of text in flipped shapes is special. - // At this point the flip and rotation transform is already applied - // (see XSLFShape#applyTransform ), but we need to restore it to avoid painting "upside down". - // See Bugzilla 54210. - - if(getFlipVertical()){ - graphics.translate(anchor.getX(), anchor.getY() + anchor.getHeight()); - graphics.scale(1, -1); - graphics.translate(-anchor.getX(), -anchor.getY()); - - // text in vertically flipped shapes is rotated by 180 degrees - double centerX = anchor.getX() + anchor.getWidth()/2; - double centerY = anchor.getY() + anchor.getHeight()/2; - graphics.translate(centerX, centerY); - graphics.rotate(Math.toRadians(180)); - graphics.translate(-centerX, -centerY); - } - - // Horizontal flipping applies only to shape outline and not to the text in the shape. - // Applying flip second time restores the original not-flipped transform - if(getFlipHorizontal()){ - graphics.translate(anchor.getX() + anchor.getWidth(), anchor.getY()); - graphics.scale(-1, 1); - graphics.translate(-anchor.getX() , -anchor.getY()); - } - - - // first dry-run to calculate the total height of the text - double textHeight = getTextHeight(); - - switch (getVerticalAlignment()){ - case TOP: - y += getTopInset(); - break; - case BOTTOM: - y += anchor.getHeight() - textHeight - getBottomInset(); - break; - default: - case MIDDLE: - double delta = anchor.getHeight() - textHeight - - getTopInset() - getBottomInset(); - y += getTopInset() + delta/2; - break; - } - - drawParagraphs(graphics, x, y); - - // restore the transform - graphics.setTransform(tx); - } - - - /** - * paint the paragraphs starting from top left (x,y) - * - * @return the vertical advance, i.e. the cumulative space occupied by the text - */ - private double drawParagraphs(Graphics2D graphics, double x, double y) { - double y0 = y; - for(int i = 0; i < _paragraphs.size(); i++){ - XSLFTextParagraph p = _paragraphs.get(i); - List lines = p.getTextLines(); - - if(i > 0 && lines.size() > 0) { - // the amount of vertical white space before the paragraph - double spaceBefore = p.getSpaceBefore(); - if(spaceBefore > 0) { - // positive value means percentage spacing of the height of the first line, e.g. - // the higher the first line, the bigger the space before the paragraph - y += spaceBefore*0.01*lines.get(0).getHeight(); - } else { - // negative value means the absolute spacing in points - y += -spaceBefore; - } - } - - y += p.draw(graphics, x, y); - - if(i < _paragraphs.size() - 1) { - double spaceAfter = p.getSpaceAfter(); - if(spaceAfter > 0) { - // positive value means percentage spacing of the height of the last line, e.g. - // the higher the last line, the bigger the space after the paragraph - y += spaceAfter*0.01*lines.get(lines.size() - 1).getHeight(); - } else { - // negative value means the absolute spacing in points - y += -spaceAfter; - } - } - } - return y - y0; - } @Override void copy(XSLFShape sh){ @@ -633,4 +521,19 @@ public abstract class XSLFTextShape extends XSLFSimpleShape implements Iterable< } } + + public LineDecoration getLineDecoration() { + // TODO Auto-generated method stub + return null; + } + + public FillStyle getFillStyle() { + // TODO Auto-generated method stub + return null; + } + + public Guide getAdjustValue(String name) { + // TODO Auto-generated method stub + return null; + } } \ No newline at end of file diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFAutoShape.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFAutoShape.java index 922d25f83..e3dad561b 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFAutoShape.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFAutoShape.java @@ -17,6 +17,10 @@ package org.apache.poi.xslf.usermodel; import junit.framework.TestCase; + +import org.apache.poi.sl.usermodel.ShapeType; +import org.apache.poi.sl.usermodel.TextAlign; +import org.apache.poi.sl.usermodel.VerticalAlignment; import org.apache.poi.util.Units; import org.openxmlformats.schemas.drawingml.x2006.main.STTextStrikeType; import org.openxmlformats.schemas.drawingml.x2006.main.STTextUnderlineType; @@ -270,12 +274,12 @@ public class TestXSLFAutoShape extends TestCase { XSLFSlide slide = ppt.createSlide(); XSLFAutoShape shape = slide.createAutoShape(); - assertEquals(XSLFShapeType.RECT, shape.getShapeType()); + assertEquals(ShapeType.RECT, shape.getShapeType()); - shape.setShapeType(XSLFShapeType.TRIANGLE); - assertEquals(XSLFShapeType.TRIANGLE, shape.getShapeType()); + shape.setShapeType(ShapeType.TRIANGLE); + assertEquals(ShapeType.TRIANGLE, shape.getShapeType()); - for(XSLFShapeType tp : XSLFShapeType.values()) { + for(ShapeType tp : ShapeType.values()) { shape.setShapeType(tp); assertEquals(tp, shape.getShapeType()); } diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFConnectorShape.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFConnectorShape.java index 98240b0ff..ae7de8d5c 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFConnectorShape.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFConnectorShape.java @@ -17,6 +17,8 @@ package org.apache.poi.xslf.usermodel; import junit.framework.TestCase; + +import org.apache.poi.sl.usermodel.ShapeType; import org.openxmlformats.schemas.drawingml.x2006.main.*; import org.openxmlformats.schemas.presentationml.x2006.main.CTConnector; @@ -112,12 +114,12 @@ public class TestXSLFConnectorShape extends TestCase { XSLFSlide slide = pptx.createSlide(); XSLFAutoShape rect1 = slide.createAutoShape(); - rect1.setShapeType(XSLFShapeType.RECT); + rect1.setShapeType(ShapeType.RECT); rect1.setAnchor(new Rectangle(100, 100, 100, 100)); rect1.setFillColor(Color.blue); XSLFAutoShape rect2 = slide.createAutoShape(); - rect2.setShapeType(XSLFShapeType.RECT); + rect2.setShapeType(ShapeType.RECT); rect2.setAnchor(new Rectangle(300, 300, 100, 100)); rect2.setFillColor(Color.red); diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java index 838db8137..2153ceb26 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java @@ -20,6 +20,8 @@ import java.awt.Color; import junit.framework.TestCase; +import org.apache.poi.sl.usermodel.LineCap; +import org.apache.poi.sl.usermodel.LineDash; import org.apache.poi.util.Units; import org.apache.poi.xslf.XSLFTestDataSamples; import org.openxmlformats.schemas.drawingml.x2006.main.CTEffectStyleItem; diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTable.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTable.java index 0ded02a5a..505703bca 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTable.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTable.java @@ -17,6 +17,8 @@ package org.apache.poi.xslf.usermodel; import junit.framework.TestCase; + +import org.apache.poi.sl.usermodel.VerticalAlignment; import org.apache.poi.xslf.XSLFTestDataSamples; import org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrame; diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java index 00b4cbdcc..45bc30286 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java @@ -17,6 +17,9 @@ package org.apache.poi.xslf.usermodel; import junit.framework.TestCase; + +import org.apache.poi.sl.draw.TextFragment; +import org.apache.poi.sl.usermodel.TextAlign; import org.apache.poi.util.POILogFactory; import org.apache.poi.util.POILogger; import org.apache.poi.xslf.XSLFTestDataSamples; diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java index 79063a308..f217c5827 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java @@ -17,6 +17,9 @@ package org.apache.poi.xslf.usermodel; import junit.framework.TestCase; + +import org.apache.poi.sl.usermodel.TextAlign; +import org.apache.poi.sl.usermodel.VerticalAlignment; import org.apache.poi.xslf.XSLFTestDataSamples; import org.openxmlformats.schemas.drawingml.x2006.main.CTTextBodyProperties; import org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties; diff --git a/src/resources/scratchpad/org/apache/poi/sl/draw/presetShapeDefinitions.xml b/src/resources/scratchpad/org/apache/poi/sl/draw/presetShapeDefinitions.xml new file mode 100644 index 000000000..4a3a0701d --- /dev/null +++ b/src/resources/scratchpad/org/apache/poi/sl/draw/presetShapeDefinitions.xml @@ -0,0 +1,19906 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/ActiveXShape.java b/src/scratchpad/src/org/apache/poi/hslf/model/ActiveXShape.java index 525f673c3..803669528 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/ActiveXShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/ActiveXShape.java @@ -34,6 +34,8 @@ import org.apache.poi.hslf.record.ExObjList; import org.apache.poi.hslf.record.OEShapeAtom; import org.apache.poi.hslf.record.Record; import org.apache.poi.hslf.record.RecordTypes; +import org.apache.poi.sl.usermodel.ShapeContainer; +import org.apache.poi.sl.usermodel.ShapeType; import org.apache.poi.util.LittleEndian; import org.apache.poi.util.StringUtil; @@ -63,7 +65,7 @@ public final class ActiveXShape extends Picture { * this picture in the Slide * @param parent the parent shape of this picture */ - protected ActiveXShape(EscherContainerRecord escherRecord, Shape parent){ + protected ActiveXShape(EscherContainerRecord escherRecord, ShapeContainer parent){ super(escherRecord, parent); } @@ -78,7 +80,7 @@ public final class ActiveXShape extends Picture { EscherSpRecord spRecord = _escherContainer.getChildById(EscherSpRecord.RECORD_ID); spRecord.setFlags(EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE | EscherSpRecord.FLAG_OLESHAPE); - setShapeType(ShapeTypes.HostControl); + setShapeType(ShapeType.HOST_CONTROL); setEscherProperty(EscherProperties.BLIP__PICTUREID, idx); setEscherProperty(EscherProperties.LINESTYLE__COLOR, 0x8000001); setEscherProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x80008); diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/AutoShape.java b/src/scratchpad/src/org/apache/poi/hslf/model/AutoShape.java index 1b8e7dde6..ccb302d71 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/AutoShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/AutoShape.java @@ -18,6 +18,8 @@ package org.apache.poi.hslf.model; import org.apache.poi.ddf.*; +import org.apache.poi.sl.usermodel.ShapeContainer; +import org.apache.poi.sl.usermodel.ShapeType; import org.apache.poi.util.POILogger; import java.awt.geom.Rectangle2D; @@ -33,20 +35,20 @@ import java.awt.geom.Rectangle2D; */ public class AutoShape extends TextShape { - protected AutoShape(EscherContainerRecord escherRecord, Shape parent){ + protected AutoShape(EscherContainerRecord escherRecord, ShapeContainer parent){ super(escherRecord, parent); } - public AutoShape(int type, Shape parent){ + public AutoShape(ShapeType type, ShapeContainer parent){ super(null, parent); _escherContainer = createSpContainer(type, parent instanceof ShapeGroup); } - public AutoShape(int type){ + public AutoShape(ShapeType type){ this(type, null); } - protected EscherContainerRecord createSpContainer(int shapeType, boolean isChild){ + protected EscherContainerRecord createSpContainer(ShapeType shapeType, boolean isChild){ _escherContainer = super.createSpContainer(isChild); setShapeType(shapeType); @@ -110,7 +112,7 @@ public class AutoShape extends TextShape { ShapeOutline outline = AutoShapes.getShapeOutline(getShapeType()); Rectangle2D anchor = getLogicalAnchor2D(); if(outline == null){ - logger.log(POILogger.WARN, "Outline not found for " + ShapeTypes.typeName(getShapeType())); + logger.log(POILogger.WARN, "Outline not found for " + getShapeType().nativeName); return anchor; } java.awt.Shape shape = outline.getOutline(this); diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/AutoShapes.java b/src/scratchpad/src/org/apache/poi/hslf/model/AutoShapes.java index 02b20fbe2..25a68dfcd 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/AutoShapes.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/AutoShapes.java @@ -26,6 +26,7 @@ import java.awt.geom.Rectangle2D; import java.awt.geom.RoundRectangle2D; import org.apache.poi.ddf.EscherProperties; +import org.apache.poi.sl.usermodel.ShapeType; /** * Stores definition of auto-shapes. @@ -45,8 +46,8 @@ public final class AutoShapes { * * @return the shape outline */ - public static ShapeOutline getShapeOutline(int type){ - ShapeOutline outline = shapes[type]; + public static ShapeOutline getShapeOutline(ShapeType type){ + ShapeOutline outline = shapes[type.nativeId]; return outline; } @@ -68,14 +69,14 @@ public final class AutoShapes { static { shapes = new ShapeOutline[255]; - shapes[ShapeTypes.Rectangle] = new ShapeOutline(){ + shapes[ShapeType.RECT.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ Rectangle2D path = new Rectangle2D.Float(0, 0, 21600, 21600); return path; } }; - shapes[ShapeTypes.RoundRectangle] = new ShapeOutline(){ + shapes[ShapeType.ROUND_RECT.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ int adjval = shape.getEscherProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 5400); RoundRectangle2D path = new RoundRectangle2D.Float(0, 0, 21600, 21600, adjval, adjval); @@ -83,14 +84,14 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.Ellipse] = new ShapeOutline(){ + shapes[ShapeType.ELLIPSE.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ Ellipse2D path = new Ellipse2D.Float(0, 0, 21600, 21600); return path; } }; - shapes[ShapeTypes.Diamond] = new ShapeOutline(){ + shapes[ShapeType.DIAMOND.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ GeneralPath path = new GeneralPath(); path.moveTo(10800, 0); @@ -103,7 +104,7 @@ public final class AutoShapes { }; //m@0,l,21600r21600 - shapes[ShapeTypes.IsocelesTriangle] = new ShapeOutline(){ + shapes[ShapeType.TRIANGLE.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ int adjval = shape.getEscherProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 10800); GeneralPath path = new GeneralPath(); @@ -115,7 +116,7 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.RightTriangle] = new ShapeOutline(){ + shapes[ShapeType.RT_TRIANGLE.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ GeneralPath path = new GeneralPath(); path.moveTo(0, 0); @@ -126,7 +127,7 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.Parallelogram] = new ShapeOutline(){ + shapes[ShapeType.PARALLELOGRAM.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ int adjval = shape.getEscherProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 5400); @@ -140,7 +141,7 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.Trapezoid] = new ShapeOutline(){ + shapes[ShapeType.TRAPEZOID.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ int adjval = shape.getEscherProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 5400); @@ -154,7 +155,7 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.Hexagon] = new ShapeOutline(){ + shapes[ShapeType.HEXAGON.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ int adjval = shape.getEscherProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 5400); @@ -170,7 +171,7 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.Octagon] = new ShapeOutline(){ + shapes[ShapeType.OCTAGON.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ int adjval = shape.getEscherProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 6326); @@ -188,7 +189,7 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.Plus] = new ShapeOutline(){ + shapes[ShapeType.PLUS.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ int adjval = shape.getEscherProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 5400); @@ -210,7 +211,7 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.Pentagon] = new ShapeOutline(){ + shapes[ShapeType.PENTAGON.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ GeneralPath path = new GeneralPath(); @@ -224,7 +225,7 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.DownArrow] = new ShapeOutline(){ + shapes[ShapeType.DOWN_ARROW.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ //m0@0 l@1@0 @1,0 @2,0 @2@0,21600@0,10800,21600xe int adjval = shape.getEscherProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 16200); @@ -242,7 +243,7 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.UpArrow] = new ShapeOutline(){ + shapes[ShapeType.UP_ARROW.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ //m0@0 l@1@0 @1,21600@2,21600@2@0,21600@0,10800,xe int adjval = shape.getEscherProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 5400); @@ -260,7 +261,7 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.Arrow] = new ShapeOutline(){ + shapes[ShapeType.RIGHT_ARROW.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ //m@0, l@0@1 ,0@1,0@2@0@2@0,21600,21600,10800xe int adjval = shape.getEscherProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 16200); @@ -278,7 +279,7 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.LeftArrow] = new ShapeOutline(){ + shapes[ShapeType.LEFT_ARROW.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ //m@0, l@0@1,21600@1,21600@2@0@2@0,21600,,10800xe int adjval = shape.getEscherProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 5400); @@ -296,7 +297,7 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.Can] = new ShapeOutline(){ + shapes[ShapeType.CAN.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ //m10800,qx0@1l0@2qy10800,21600,21600@2l21600@1qy10800,xem0@1qy10800@0,21600@1nfe int adjval = shape.getEscherProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 5400); @@ -320,7 +321,7 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.LeftBrace] = new ShapeOutline(){ + shapes[ShapeType.LEFT_BRACE.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ //m21600,qx10800@0l10800@2qy0@11,10800@3l10800@1qy21600,21600e int adjval = shape.getEscherProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 1800); @@ -348,7 +349,7 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.RightBrace] = new ShapeOutline(){ + shapes[ShapeType.RIGHT_BRACE.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ //m,qx10800@0 l10800@2qy21600@11,10800@3l10800@1qy,21600e int adjval = shape.getEscherProperty(EscherProperties.GEOMETRY__ADJUSTVALUE, 1800); @@ -376,7 +377,7 @@ public final class AutoShapes { } }; - shapes[ShapeTypes.StraightConnector1] = new ShapeOutline(){ + shapes[ShapeType.STRAIGHT_CONNECTOR_1.nativeId] = new ShapeOutline(){ public java.awt.Shape getOutline(Shape shape){ return new Line2D.Float(0, 0, 21600, 21600); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/Background.java b/src/scratchpad/src/org/apache/poi/hslf/model/Background.java index 531f2da19..12070cdf6 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/Background.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/Background.java @@ -17,16 +17,22 @@ package org.apache.poi.hslf.model; -import org.apache.poi.ddf.EscherContainerRecord; -import org.apache.poi.hslf.usermodel.PictureData; -import org.apache.poi.hslf.blip.Bitmap; -import org.apache.poi.util.POILogger; - -import javax.imageio.ImageIO; -import java.awt.*; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Rectangle; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; +import javax.imageio.ImageIO; + +import org.apache.poi.ddf.EscherContainerRecord; +import org.apache.poi.hslf.blip.Bitmap; +import org.apache.poi.hslf.usermodel.PictureData; +import org.apache.poi.sl.usermodel.ShapeContainer; +import org.apache.poi.util.POILogger; + /** * Background shape * @@ -34,7 +40,7 @@ import java.io.ByteArrayInputStream; */ public final class Background extends Shape { - protected Background(EscherContainerRecord escherRecord, Shape parent) { + protected Background(EscherContainerRecord escherRecord, ShapeContainer parent) { super(escherRecord, parent); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/Freeform.java b/src/scratchpad/src/org/apache/poi/hslf/model/Freeform.java index 82f46b5e1..187bfd0ca 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/Freeform.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/Freeform.java @@ -31,6 +31,8 @@ import org.apache.poi.ddf.EscherContainerRecord; import org.apache.poi.ddf.EscherOptRecord; import org.apache.poi.ddf.EscherProperties; import org.apache.poi.ddf.EscherSimpleProperty; +import org.apache.poi.sl.usermodel.ShapeContainer; +import org.apache.poi.sl.usermodel.ShapeType; import org.apache.poi.util.LittleEndian; import org.apache.poi.util.POILogger; @@ -60,7 +62,7 @@ public final class Freeform extends AutoShape { * @param escherRecord EscherSpContainer container which holds information about this shape * @param parent the parent of the shape */ - protected Freeform(EscherContainerRecord escherRecord, Shape parent){ + protected Freeform(EscherContainerRecord escherRecord, ShapeContainer parent){ super(escherRecord, parent); } @@ -71,9 +73,9 @@ public final class Freeform extends AutoShape { * @param parent the parent of this Shape. For example, if this text box is a cell * in a table then the parent is Table. */ - public Freeform(Shape parent){ - super(null, parent); - _escherContainer = createSpContainer(ShapeTypes.NotPrimitive, parent instanceof ShapeGroup); + public Freeform(ShapeContainer parent){ + super((EscherContainerRecord)null, parent); + _escherContainer = createSpContainer(ShapeType.NOT_PRIMITIVE, parent instanceof ShapeGroup); } /** diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/Hyperlink.java b/src/scratchpad/src/org/apache/poi/hslf/model/Hyperlink.java index fbdd2e7ae..d317b6ad5 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/Hyperlink.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/Hyperlink.java @@ -152,7 +152,7 @@ public final class Hyperlink { * @return found hyperlinks or null if not found */ protected static Hyperlink[] find(TextRun run){ - ArrayList lst = new ArrayList(); + List lst = new ArrayList(); SlideShow ppt = run.getSheet().getSlideShow(); //document-level container which stores info about all links in a presentation ExObjList exobj = ppt.getDocumentRecord().getExObjList(); @@ -177,7 +177,7 @@ public final class Hyperlink { * @return found hyperlink or null */ protected static Hyperlink find(Shape shape){ - ArrayList lst = new ArrayList(); + List lst = new ArrayList(); SlideShow ppt = shape.getSheet().getSlideShow(); //document-level container which stores info about all links in a presentation ExObjList exobj = ppt.getDocumentRecord().getExObjList(); @@ -198,7 +198,7 @@ public final class Hyperlink { return lst.size() == 1 ? (Hyperlink)lst.get(0) : null; } - private static void find(Record[] records, ExObjList exobj, List out){ + private static void find(Record[] records, ExObjList exobj, List out){ for (int i = 0; i < records.length; i++) { //see if we have InteractiveInfo in the textrun's records if( records[i] instanceof InteractiveInfo){ diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/Line.java b/src/scratchpad/src/org/apache/poi/hslf/model/Line.java index 2a23d2481..3c078ec5a 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/Line.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/Line.java @@ -18,6 +18,8 @@ package org.apache.poi.hslf.model; import org.apache.poi.ddf.*; +import org.apache.poi.sl.usermodel.ShapeContainer; +import org.apache.poi.sl.usermodel.ShapeType; import java.awt.geom.Rectangle2D; import java.awt.geom.Line2D; @@ -95,11 +97,11 @@ public final class Line extends SimpleShape { public static final int LINE_TRIPLE = 4; - protected Line(EscherContainerRecord escherRecord, Shape parent){ + protected Line(EscherContainerRecord escherRecord, ShapeContainer parent){ super(escherRecord, parent); } - public Line(Shape parent){ + public Line(ShapeContainer parent){ super(null, parent); _escherContainer = createSpContainer(parent instanceof ShapeGroup); } @@ -112,7 +114,7 @@ public final class Line extends SimpleShape { _escherContainer = super.createSpContainer(isChild); EscherSpRecord spRecord = _escherContainer.getChildById(EscherSpRecord.RECORD_ID); - short type = (ShapeTypes.Line << 4) | 0x2; + short type = (short)((ShapeType.LINE.nativeId << 4) | 0x2); spRecord.setOptions(type); //set default properties for a line diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/MovieShape.java b/src/scratchpad/src/org/apache/poi/hslf/model/MovieShape.java index 93e8a124f..6b5225e92 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/MovieShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/MovieShape.java @@ -25,6 +25,7 @@ import org.apache.poi.ddf.EscherProperties; import org.apache.poi.hslf.exceptions.HSLFException; import org.apache.poi.hslf.record.*; import org.apache.poi.hslf.usermodel.SlideShow; +import org.apache.poi.sl.usermodel.ShapeContainer; /** * Represents a movie in a PowerPoint document. @@ -54,7 +55,7 @@ public final class MovieShape extends Picture { * @param idx the index of the picture * @param parent the parent shape */ - public MovieShape(int movieIdx, int idx, Shape parent) { + public MovieShape(int movieIdx, int idx, ShapeContainer parent) { super(idx, parent); setMovieIndex(movieIdx); } @@ -66,7 +67,7 @@ public final class MovieShape extends Picture { * this picture in the Slide * @param parent the parent shape of this picture */ - protected MovieShape(EscherContainerRecord escherRecord, Shape parent){ + protected MovieShape(EscherContainerRecord escherRecord, ShapeContainer parent){ super(escherRecord, parent); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/OLEShape.java b/src/scratchpad/src/org/apache/poi/hslf/model/OLEShape.java index 659b340e1..c4e560a91 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/OLEShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/OLEShape.java @@ -24,6 +24,7 @@ import org.apache.poi.hslf.record.ExObjList; import org.apache.poi.hslf.record.Record; import org.apache.poi.hslf.record.ExEmbed; import org.apache.poi.hslf.record.RecordTypes; +import org.apache.poi.sl.usermodel.ShapeContainer; import org.apache.poi.util.LittleEndian; import org.apache.poi.util.POILogger; @@ -51,7 +52,7 @@ public final class OLEShape extends Picture { * @param idx the index of the picture * @param parent the parent shape */ - public OLEShape(int idx, Shape parent) { + public OLEShape(int idx, ShapeContainer parent) { super(idx, parent); } @@ -62,7 +63,7 @@ public final class OLEShape extends Picture { * this picture in the Slide * @param parent the parent shape of this picture */ - protected OLEShape(EscherContainerRecord escherRecord, Shape parent){ + protected OLEShape(EscherContainerRecord escherRecord, ShapeContainer parent){ super(escherRecord, parent); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java b/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java index 99acb335b..e592d77f8 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java @@ -1456,7 +1456,7 @@ public final class PPGraphics2D extends Graphics2D implements Cloneable { * @param hints the rendering hints to be set * @see RenderingHints */ - public void addRenderingHints(Map hints){ + public void addRenderingHints(Map hints){ this._hints.putAll(hints); } @@ -1581,8 +1581,9 @@ public final class PPGraphics2D extends Graphics2D implements Cloneable { * @param hints the rendering hints to be set * @see RenderingHints */ - public void setRenderingHints(Map hints){ - this._hints = new RenderingHints(hints); + public void setRenderingHints(Map hints){ + this._hints = new RenderingHints(null); + this._hints.putAll(hints); } /** diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/Picture.java b/src/scratchpad/src/org/apache/poi/hslf/model/Picture.java index eda9d2505..f57ced0ac 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/Picture.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/Picture.java @@ -39,6 +39,8 @@ import org.apache.poi.hslf.blip.Bitmap; import org.apache.poi.hslf.record.Document; import org.apache.poi.hslf.usermodel.PictureData; import org.apache.poi.hslf.usermodel.SlideShow; +import org.apache.poi.sl.usermodel.ShapeContainer; +import org.apache.poi.sl.usermodel.ShapeType; import org.apache.poi.util.POILogger; import org.apache.poi.util.StringUtil; import org.apache.poi.util.Units; @@ -96,7 +98,7 @@ public class Picture extends SimpleShape { * @param idx the index of the picture * @param parent the parent shape */ - public Picture(int idx, Shape parent) { + public Picture(int idx, ShapeContainer parent) { super(null, parent); _escherContainer = createSpContainer(idx, parent instanceof ShapeGroup); } @@ -108,7 +110,7 @@ public class Picture extends SimpleShape { * this picture in the Slide * @param parent the parent shape of this picture */ - protected Picture(EscherContainerRecord escherRecord, Shape parent){ + protected Picture(EscherContainerRecord escherRecord, ShapeContainer parent){ super(escherRecord, parent); } @@ -136,7 +138,7 @@ public class Picture extends SimpleShape { _escherContainer.setOptions((short)15); EscherSpRecord spRecord = _escherContainer.getChildById(EscherSpRecord.RECORD_ID); - spRecord.setOptions((short)((ShapeTypes.PictureFrame << 4) | 0x2)); + spRecord.setOptions((short)((ShapeType.FRAME.nativeId << 4) | 0x2)); //set default properties for a picture EscherOptRecord opt = getEscherOptRecord(); @@ -295,6 +297,6 @@ public class Picture extends SimpleShape { EscherSimpleProperty prop = getEscherProperty(opt, propertyId); if (prop == null) return 0; int fixedPoint = prop.getPropertyValue(); - return Units.fixedPointToDecimal(fixedPoint); + return Units.fixedPointToDouble(fixedPoint); } } \ No newline at end of file diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/Placeholder.java b/src/scratchpad/src/org/apache/poi/hslf/model/Placeholder.java index a3eb1b978..4b30c110e 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/Placeholder.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/Placeholder.java @@ -20,6 +20,7 @@ package org.apache.poi.hslf.model; import org.apache.poi.ddf.*; import org.apache.poi.hslf.record.OEPlaceholderAtom; import org.apache.poi.hslf.exceptions.HSLFException; +import org.apache.poi.sl.usermodel.ShapeContainer; import java.io.ByteArrayOutputStream; @@ -30,11 +31,11 @@ import java.io.ByteArrayOutputStream; */ public final class Placeholder extends TextBox { - protected Placeholder(EscherContainerRecord escherRecord, Shape parent){ + protected Placeholder(EscherContainerRecord escherRecord, ShapeContainer parent){ super(escherRecord, parent); } - public Placeholder(Shape parent){ + public Placeholder(ShapeContainer parent){ super(parent); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/Polygon.java b/src/scratchpad/src/org/apache/poi/hslf/model/Polygon.java index 09637a65e..b7ea9c835 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/Polygon.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/Polygon.java @@ -18,6 +18,8 @@ package org.apache.poi.hslf.model; import org.apache.poi.ddf.*; +import org.apache.poi.sl.usermodel.ShapeContainer; +import org.apache.poi.sl.usermodel.ShapeType; import org.apache.poi.util.LittleEndian; import java.awt.geom.Point2D; @@ -34,7 +36,7 @@ public final class Polygon extends AutoShape { * @param escherRecord EscherSpContainer container which holds information about this shape * @param parent the parent of the shape */ - protected Polygon(EscherContainerRecord escherRecord, Shape parent){ + protected Polygon(EscherContainerRecord escherRecord, ShapeContainer parent){ super(escherRecord, parent); } @@ -45,9 +47,9 @@ public final class Polygon extends AutoShape { * @param parent the parent of this Shape. For example, if this text box is a cell * in a table then the parent is Table. */ - public Polygon(Shape parent){ - super(null, parent); - _escherContainer = createSpContainer(ShapeTypes.NotPrimitive, parent instanceof ShapeGroup); + public Polygon(ShapeContainer parent){ + super((EscherContainerRecord)null, parent); + _escherContainer = createSpContainer(ShapeType.NOT_PRIMITIVE, parent instanceof ShapeGroup); } /** diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java b/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java index 4a136611c..67da50097 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java @@ -19,6 +19,8 @@ package org.apache.poi.hslf.model; import org.apache.poi.ddf.*; import org.apache.poi.hslf.record.ColorSchemeAtom; +import org.apache.poi.sl.usermodel.ShapeContainer; +import org.apache.poi.sl.usermodel.ShapeType; import org.apache.poi.util.POILogger; import org.apache.poi.util.POILogFactory; import org.apache.poi.util.Units; @@ -43,7 +45,7 @@ import java.awt.geom.Rectangle2D; * * @author Yegor Kozlov */ -public abstract class Shape { +public abstract class Shape implements org.apache.poi.sl.usermodel.Shape { // For logging protected POILogger logger = POILogFactory.getLogger(this.getClass()); @@ -83,7 +85,7 @@ public abstract class Shape { * Parent of this shape. * null for the topmost shapes. */ - protected Shape _parent; + protected ShapeContainer _parent; /** * The Sheet this shape belongs to @@ -101,7 +103,7 @@ public abstract class Shape { * @param escherRecord EscherSpContainer container which holds information about this shape * @param parent the parent of this Shape */ - protected Shape(EscherContainerRecord escherRecord, Shape parent){ + protected Shape(EscherContainerRecord escherRecord, ShapeContainer parent){ _escherContainer = escherRecord; _parent = parent; } @@ -114,7 +116,7 @@ public abstract class Shape { /** * @return the parent of this shape */ - public Shape getParent(){ + public ShapeContainer getParent(){ return _parent; } @@ -122,25 +124,25 @@ public abstract class Shape { * @return name of the shape. */ public String getShapeName(){ - return ShapeTypes.typeName(getShapeType()); + return getShapeType().nativeName; } /** * @return type of the shape. * @see org.apache.poi.hslf.record.RecordTypes */ - public int getShapeType(){ + public ShapeType getShapeType(){ EscherSpRecord spRecord = getEscherChild(EscherSpRecord.RECORD_ID); - return spRecord.getShapeType(); + return ShapeType.forId(spRecord.getShapeType(), false); } /** * @param type type of the shape. * @see org.apache.poi.hslf.record.RecordTypes */ - public void setShapeType(int type){ + public void setShapeType(ShapeType type){ EscherSpRecord spRecord = getEscherChild(EscherSpRecord.RECORD_ID); - spRecord.setShapeType( (short) type ); + spRecord.setShapeType( (short) type.nativeId ); spRecord.setVersion( (short) 0x2 ); } @@ -395,7 +397,7 @@ public abstract class Shape { EscherSimpleProperty op = getEscherProperty(opt, opacityProperty); int defaultOpacity = 0x00010000; int opacity = (op == null) ? defaultOpacity : op.getPropertyValue(); - double alpha = Units.fixedPointToDecimal(opacity)*255.0; + double alpha = Units.fixedPointToDouble(opacity)*255.0; return new Color(rgb[0], rgb[1], rgb[2], (int)alpha); } @@ -456,7 +458,7 @@ public abstract class Shape { * @return the hyperlink assigned to this shape * or null if not found. */ - public Hyperlink getHyperlink(){ + public Hyperlink getHyperlink(){ return Hyperlink.find(this); } @@ -477,44 +479,47 @@ public abstract class Shape { return getEscherChild(EscherOptRecord.RECORD_ID); } - /** - * Whether the shape is horizontally flipped - * - * @return whether the shape is horizontally flipped - */ - public boolean getFlipHorizontal(){ + @Override + public boolean getFlipHorizontal(){ EscherSpRecord spRecord = getEscherChild(EscherSpRecord.RECORD_ID); return (spRecord.getFlags()& EscherSpRecord.FLAG_FLIPHORIZ) != 0; } + + @Override + public void setFlipHorizontal(boolean flip) { + EscherSpRecord spRecord = getEscherChild(EscherSpRecord.RECORD_ID); + int flag = spRecord.getFlags() | EscherSpRecord.FLAG_FLIPHORIZ; + spRecord.setFlags(flag); + } - /** - * Whether the shape is vertically flipped - * - * @return whether the shape is vertically flipped - */ + @Override public boolean getFlipVertical(){ EscherSpRecord spRecord = getEscherChild(EscherSpRecord.RECORD_ID); return (spRecord.getFlags()& EscherSpRecord.FLAG_FLIPVERT) != 0; } + + @Override + public void setFlipVertical(boolean flip) { + EscherSpRecord spRecord = getEscherChild(EscherSpRecord.RECORD_ID); + int flag = spRecord.getFlags() | EscherSpRecord.FLAG_FLIPVERT; + spRecord.setFlags(flag); + } - /** - * Rotation angle in degrees - * - * @return rotation angle in degrees - */ - public int getRotation(){ + @Override + public double getRotation(){ int rot = getEscherProperty(EscherProperties.TRANSFORM__ROTATION); - int angle = (rot >> 16) % 360; - + double angle = Units.fixedPointToDouble(rot) % 360.0; return angle; } + + @Override + public void setRotation(double theta){ + int rot = Units.doubleToFixedPoint(theta % 360.0); + setEscherProperty(EscherProperties.TRANSFORM__ROTATION, rot); + } - /** - * Rotate this shape - * - * @param theta the rotation angle in degrees - */ - public void setRotation(int theta){ - setEscherProperty(EscherProperties.TRANSFORM__ROTATION, (theta << 16)); + @Override + public boolean isPlaceholder() { + return false; } } diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/ShapeFactory.java b/src/scratchpad/src/org/apache/poi/hslf/model/ShapeFactory.java index c3843c291..e9c217264 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/ShapeFactory.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/ShapeFactory.java @@ -34,6 +34,8 @@ import org.apache.poi.hslf.record.InteractiveInfoAtom; import org.apache.poi.hslf.record.OEShapeAtom; import org.apache.poi.hslf.record.Record; import org.apache.poi.hslf.record.RecordTypes; +import org.apache.poi.sl.usermodel.ShapeContainer; +import org.apache.poi.sl.usermodel.ShapeType; import org.apache.poi.util.POILogFactory; import org.apache.poi.util.POILogger; @@ -49,14 +51,14 @@ public final class ShapeFactory { /** * Create a new shape from the data provided. */ - public static Shape createShape(EscherContainerRecord spContainer, Shape parent){ + public static Shape createShape(EscherContainerRecord spContainer, ShapeContainer parent){ if (spContainer.getRecordId() == EscherContainerRecord.SPGR_CONTAINER){ return createShapeGroup(spContainer, parent); } return createSimpeShape(spContainer, parent); } - public static ShapeGroup createShapeGroup(EscherContainerRecord spContainer, Shape parent){ + public static ShapeGroup createShapeGroup(EscherContainerRecord spContainer, ShapeContainer parent){ ShapeGroup group = null; EscherRecord opt = Shape.getEscherChild((EscherContainerRecord)spContainer.getChild(0), (short)0xF122); if(opt != null){ @@ -80,17 +82,17 @@ public final class ShapeFactory { return group; } - public static Shape createSimpeShape(EscherContainerRecord spContainer, Shape parent){ + public static Shape createSimpeShape(EscherContainerRecord spContainer, ShapeContainer parent){ Shape shape = null; EscherSpRecord spRecord = spContainer.getChildById(EscherSpRecord.RECORD_ID); - int type = spRecord.getShapeType(); + ShapeType type = ShapeType.forId(spRecord.getShapeType(), false); switch (type){ - case ShapeTypes.TextBox: + case TEXT_BOX: shape = new TextBox(spContainer, parent); break; - case ShapeTypes.HostControl: - case ShapeTypes.PictureFrame: { + case HOST_CONTROL: + case FRAME: { InteractiveInfo info = getClientDataRecord(spContainer, RecordTypes.InteractiveInfo.typeID); OEShapeAtom oes = getClientDataRecord(spContainer, RecordTypes.OEShapeAtom.typeID); if(info != null && info.getInteractiveInfoAtom() != null){ @@ -111,10 +113,10 @@ public final class ShapeFactory { if(shape == null) shape = new Picture(spContainer, parent); break; } - case ShapeTypes.Line: + case LINE: shape = new Line(spContainer, parent); break; - case ShapeTypes.NotPrimitive: { + case NOT_PRIMITIVE: { EscherOptRecord opt = Shape.getEscherChild(spContainer, EscherOptRecord.RECORD_ID); EscherProperty prop = Shape.getEscherProperty(opt, EscherProperties.GEOMETRY__VERTICES); if(prop != null) diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/ShapeGroup.java b/src/scratchpad/src/org/apache/poi/hslf/model/ShapeGroup.java index 796b248ac..f18701a0e 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/ShapeGroup.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/ShapeGroup.java @@ -30,6 +30,8 @@ import org.apache.poi.ddf.EscherContainerRecord; import org.apache.poi.ddf.EscherRecord; import org.apache.poi.ddf.EscherSpRecord; import org.apache.poi.ddf.EscherSpgrRecord; +import org.apache.poi.sl.usermodel.ShapeContainer; +import org.apache.poi.sl.usermodel.ShapeType; import org.apache.poi.util.LittleEndian; import org.apache.poi.util.POILogger; @@ -38,7 +40,7 @@ import org.apache.poi.util.POILogger; * * @author Yegor Kozlov */ -public class ShapeGroup extends Shape{ +public class ShapeGroup extends Shape implements ShapeContainer { /** * Create a new ShapeGroup. This constructor is used when a new shape is created. @@ -55,7 +57,7 @@ public class ShapeGroup extends Shape{ * @param escherRecord EscherSpContainer container which holds information about this shape * @param parent the parent of the shape */ - protected ShapeGroup(EscherContainerRecord escherRecord, Shape parent){ + protected ShapeGroup(EscherContainerRecord escherRecord, ShapeContainer parent){ super(escherRecord, parent); } @@ -63,31 +65,7 @@ public class ShapeGroup extends Shape{ * @return the shapes contained in this group container */ public Shape[] getShapes() { - // Out escher container record should contain several - // SpContainers, the first of which is the group shape itself - Iterator iter = _escherContainer.getChildIterator(); - - // Don't include the first SpContainer, it is always NotPrimitive - if (iter.hasNext()) { - iter.next(); - } - List shapeList = new ArrayList(); - while (iter.hasNext()) { - EscherRecord r = iter.next(); - if(r instanceof EscherContainerRecord) { - // Create the Shape for it - EscherContainerRecord container = (EscherContainerRecord)r; - Shape shape = ShapeFactory.createShape(container, this); - shape.setSheet(getSheet()); - shapeList.add( shape ); - } else { - // Should we do anything special with these non - // Container records? - logger.log(POILogger.ERROR, "Shape contained non container escher record, was " + r.getClass().getName()); - } - } - - // Put the shapes into an array, and return + List shapeList = getShapeList(); Shape[] shapes = shapeList.toArray(new Shape[shapeList.size()]); return shapes; } @@ -179,7 +157,7 @@ public class ShapeGroup extends Shape{ spcont.addChildRecord(spg); EscherSpRecord sp = new EscherSpRecord(); - short type = (ShapeTypes.NotPrimitive << 4) + 2; + short type = (short)((ShapeType.NOT_PRIMITIVE.nativeId << 4) + 2); sp.setOptions(type); sp.setFlags(EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_GROUP); spcont.addChildRecord(sp); @@ -260,9 +238,10 @@ public class ShapeGroup extends Shape{ * * @return type of the shape. */ - public int getShapeType(){ + public ShapeType getShapeType(){ EscherSpRecord spRecord = getEscherChild(EscherSpRecord.RECORD_ID); - return spRecord.getOptions() >> 4; + int nativeId = spRecord.getOptions() >> 4; + return ShapeType.forId(nativeId, false); } /** @@ -291,4 +270,45 @@ public class ShapeGroup extends Shape{ EscherContainerRecord groupInfoContainer = (EscherContainerRecord)_escherContainer.getChild(0); return groupInfoContainer.getChildById((short)recordId); } + + public Iterator iterator() { + return getShapeList().iterator(); + } + + public boolean removeShape(Shape shape) { + // TODO: implement! + throw new UnsupportedOperationException(); + } + + /** + * @return the shapes contained in this group container + */ + protected List getShapeList() { + // Out escher container record should contain several + // SpContainers, the first of which is the group shape itself + Iterator iter = _escherContainer.getChildIterator(); + + // Don't include the first SpContainer, it is always NotPrimitive + if (iter.hasNext()) { + iter.next(); + } + List shapeList = new ArrayList(); + while (iter.hasNext()) { + EscherRecord r = iter.next(); + if(r instanceof EscherContainerRecord) { + // Create the Shape for it + EscherContainerRecord container = (EscherContainerRecord)r; + Shape shape = ShapeFactory.createShape(container, this); + shape.setSheet(getSheet()); + shapeList.add( shape ); + } else { + // Should we do anything special with these non + // Container records? + logger.log(POILogger.ERROR, "Shape contained non container escher record, was " + r.getClass().getName()); + } + } + + return shapeList; + } + } diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java b/src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java deleted file mode 100644 index 4840c9313..000000000 --- a/src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ - -package org.apache.poi.hslf.model; - -import java.lang.reflect.Field; -import java.util.HashMap; - -import org.apache.poi.hslf.exceptions.HSLFException; - -/** - * Contains all known shape types in PowerPoint - * - * @author Yegor Kozlov - */ -public final class ShapeTypes implements org.apache.poi.sl.usermodel.ShapeTypes { - /** - * Return name of the shape by id - * @param type - the id of the shape, one of the static constants defined in this class - * @return the name of the shape - */ - public static String typeName(int type) { - String name = (String)types.get(Integer.valueOf(type)); - return name; - } - - public static final HashMap types; - static { - types = new HashMap(); - try { - Field[] f = org.apache.poi.sl.usermodel.ShapeTypes.class.getFields(); - for (int i = 0; i < f.length; i++){ - Object val = f[i].get(null); - if (val instanceof Integer) { - types.put(val, f[i].getName()); - } - } - } catch (IllegalAccessException e){ - throw new HSLFException("Failed to initialize shape types"); - } - } - -} diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java b/src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java index c5256b1d2..c3383f4d6 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java @@ -45,6 +45,7 @@ import org.apache.poi.hslf.record.TextHeaderAtom; import org.apache.poi.hslf.record.TextRulerAtom; import org.apache.poi.hslf.record.TextSpecInfoAtom; import org.apache.poi.hslf.usermodel.SlideShow; +import org.apache.poi.sl.usermodel.ShapeContainer; import org.apache.poi.util.POILogFactory; import org.apache.poi.util.POILogger; @@ -56,7 +57,7 @@ import org.apache.poi.util.POILogger; * @author Yegor Kozlov */ -public abstract class Sheet { +public abstract class Sheet implements ShapeContainer { private static POILogger logger = POILogFactory.getLogger(Sheet.class); /** @@ -272,36 +273,8 @@ public abstract class Sheet { * @return all shapes contained in this Sheet (Slide or Notes) */ public Shape[] getShapes() { - PPDrawing ppdrawing = getPPDrawing(); - - EscherContainerRecord dg = (EscherContainerRecord) ppdrawing.getEscherRecords()[0]; - EscherContainerRecord spgr = null; - - for (Iterator it = dg.getChildIterator(); it.hasNext();) { - EscherRecord rec = it.next(); - if (rec.getRecordId() == EscherContainerRecord.SPGR_CONTAINER) { - spgr = (EscherContainerRecord) rec; - break; - } - } - if (spgr == null) { - throw new IllegalStateException("spgr not found"); - } - - List shapes = new ArrayList(); - Iterator it = spgr.getChildIterator(); - if (it.hasNext()) { - // skip first item - it.next(); - } - for (; it.hasNext();) { - EscherContainerRecord sp = (EscherContainerRecord) it.next(); - Shape sh = ShapeFactory.createShape(sp, null); - sh.setSheet(this); - shapes.add(sh); - } - - return shapes.toArray(new Shape[shapes.size()]); + List shapeList = getShapeList(); + return shapeList.toArray(new Shape[shapeList.size()]); } /** @@ -524,4 +497,47 @@ public abstract class Sheet { } + public Iterator iterator() { + return getShapeList().iterator(); + } + + + /** + * Returns all shapes contained in this Sheet + * + * @return all shapes contained in this Sheet (Slide or Notes) + */ + protected List getShapeList() { + PPDrawing ppdrawing = getPPDrawing(); + + EscherContainerRecord dg = (EscherContainerRecord) ppdrawing.getEscherRecords()[0]; + EscherContainerRecord spgr = null; + + for (Iterator it = dg.getChildIterator(); it.hasNext();) { + EscherRecord rec = it.next(); + if (rec.getRecordId() == EscherContainerRecord.SPGR_CONTAINER) { + spgr = (EscherContainerRecord) rec; + break; + } + } + if (spgr == null) { + throw new IllegalStateException("spgr not found"); + } + + List shapeList = new ArrayList(); + Iterator it = spgr.getChildIterator(); + if (it.hasNext()) { + // skip first item + it.next(); + } + for (; it.hasNext();) { + EscherContainerRecord sp = (EscherContainerRecord) it.next(); + Shape sh = ShapeFactory.createShape(sp, null); + sh.setSheet(this); + shapeList.add(sh); + } + + return shapeList; + } + } diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/SimpleShape.java b/src/scratchpad/src/org/apache/poi/hslf/model/SimpleShape.java index 34db62095..7694cacba 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/SimpleShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/SimpleShape.java @@ -38,6 +38,7 @@ import org.apache.poi.hslf.exceptions.HSLFException; import org.apache.poi.hslf.record.InteractiveInfo; import org.apache.poi.hslf.record.InteractiveInfoAtom; import org.apache.poi.hslf.record.Record; +import org.apache.poi.sl.usermodel.ShapeContainer; import org.apache.poi.util.LittleEndian; /** @@ -62,7 +63,7 @@ public abstract class SimpleShape extends Shape { * @param escherRecord EscherSpContainer container which holds information about this shape * @param parent the parent of the shape */ - protected SimpleShape(EscherContainerRecord escherRecord, Shape parent){ + protected SimpleShape(EscherContainerRecord escherRecord, ShapeContainer parent){ super(escherRecord, parent); } @@ -191,7 +192,7 @@ public abstract class SimpleShape extends Shape { * * @return style of the line. */ - public int getLineStyle(){ + public int getStrokeStyle(){ EscherOptRecord opt = getEscherOptRecord(); EscherSimpleProperty prop = getEscherProperty(opt, EscherProperties.LINESTYLE__LINESTYLE); return prop == null ? Line.LINE_SIMPLE : prop.getPropertyValue(); @@ -221,12 +222,14 @@ public abstract class SimpleShape extends Shape { Rectangle2D anchor = getAnchor2D(); //if it is a groupped shape see if we need to transform the coordinates - if (_parent != null){ + if (getParent() != null){ ArrayList lst = new ArrayList(); - for (Shape top=this; (top = top.getParent()) != null; ) { - lst.add(0, (ShapeGroup)top); + for (ShapeContainer parent=this.getParent(); + parent instanceof ShapeGroup; + parent = ((ShapeGroup)parent).getParent()) { + lst.add(0, (ShapeGroup)parent); } - + AffineTransform tx = new AffineTransform(); for(ShapeGroup prnt : lst) { Rectangle2D exterior = prnt.getAnchor2D(); @@ -243,8 +246,8 @@ public abstract class SimpleShape extends Shape { anchor = tx.createTransformedShape(anchor).getBounds2D(); } - int angle = getRotation(); - if(angle != 0){ + double angle = getRotation(); + if(angle != 0.){ double centerX = anchor.getX() + anchor.getWidth()/2; double centerY = anchor.getY() + anchor.getHeight()/2; diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/Slide.java b/src/scratchpad/src/org/apache/poi/hslf/model/Slide.java index 9e040c167..f5342534a 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/Slide.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/Slide.java @@ -34,9 +34,10 @@ import org.apache.poi.hslf.record.RecordContainer; import org.apache.poi.hslf.record.RecordTypes; import org.apache.poi.hslf.record.SSSlideInfoAtom; import org.apache.poi.hslf.record.SlideAtom; +import org.apache.poi.hslf.record.SlideListWithText.SlideAtomsSet; import org.apache.poi.hslf.record.StyleTextProp9Atom; import org.apache.poi.hslf.record.TextHeaderAtom; -import org.apache.poi.hslf.record.SlideListWithText.SlideAtomsSet; +import org.apache.poi.sl.usermodel.ShapeType; /** * This class represents a slide in a PowerPoint Document. It allows @@ -47,8 +48,7 @@ import org.apache.poi.hslf.record.SlideListWithText.SlideAtomsSet; * @author Yegor Kozlov */ -public final class Slide extends Sheet -{ +public final class Slide extends Sheet { private int _slideNo; private SlideAtomsSet _atomSet; private TextRun[] _runs; @@ -180,7 +180,7 @@ public final class Slide extends Sheet */ public TextBox addTitle() { Placeholder pl = new Placeholder(); - pl.setShapeType(ShapeTypes.Rectangle); + pl.setShapeType(ShapeType.RECT); pl.getTextRun().setRunType(TextHeaderAtom.TITLE_TYPE); pl.setText("Click to edit title"); pl.setAnchor(new java.awt.Rectangle(54, 48, 612, 90)); diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/Table.java b/src/scratchpad/src/org/apache/poi/hslf/model/Table.java index c49478991..266e6d913 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/Table.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/Table.java @@ -18,6 +18,7 @@ package org.apache.poi.hslf.model; import org.apache.poi.ddf.*; +import org.apache.poi.sl.usermodel.ShapeContainer; import org.apache.poi.util.LittleEndian; import java.util.*; @@ -92,7 +93,7 @@ public final class Table extends ShapeGroup { * @param escherRecord EscherSpContainer container which holds information about this shape * @param parent the parent of the shape */ - public Table(EscherContainerRecord escherRecord, Shape parent) { + public Table(EscherContainerRecord escherRecord, ShapeContainer parent) { super(escherRecord, parent); } @@ -125,7 +126,7 @@ public final class Table extends ShapeGroup { TableCell cell = cells[i][0]; int rowHeight = cell.getAnchor().height*MASTER_DPI/POINT_DPI; byte[] val = new byte[4]; - LittleEndian.putInt(val, rowHeight); + LittleEndian.putInt(val, 0, rowHeight); p.setElement(i, val); for (int j = 0; j < cells[i].length; j++) { TableCell c = cells[i][j]; @@ -149,11 +150,11 @@ public final class Table extends ShapeGroup { } protected void initTable(){ - Shape[] sh = getShapes(); - Arrays.sort(sh, new Comparator(){ - public int compare( Object o1, Object o2 ) { - Rectangle anchor1 = ((Shape)o1).getAnchor(); - Rectangle anchor2 = ((Shape)o2).getAnchor(); + List shapeList = getShapeList(); + Collections.sort(shapeList, new Comparator(){ + public int compare( Shape o1, Shape o2 ) { + Rectangle anchor1 = o1.getAnchor(); + Rectangle anchor2 = o2.getAnchor(); int delta = anchor1.y - anchor2.y; if(delta == 0) delta = anchor1.x - anchor2.x; return delta; @@ -161,23 +162,23 @@ public final class Table extends ShapeGroup { }); int y0 = -1; int maxrowlen = 0; - ArrayList lst = new ArrayList(); - ArrayList row = null; - for (int i = 0; i < sh.length; i++) { - if(sh[i] instanceof TextShape){ - Rectangle anchor = sh[i].getAnchor(); + List> lst = new ArrayList>(); + List row = null; + for (Shape sh : shapeList) { + if(sh instanceof TextShape){ + Rectangle anchor = sh.getAnchor(); if(anchor.y != y0){ y0 = anchor.y; - row = new ArrayList(); + row = new ArrayList(); lst.add(row); } - row.add(sh[i]); + row.add(sh); maxrowlen = Math.max(maxrowlen, row.size()); } } cells = new TableCell[lst.size()][maxrowlen]; for (int i = 0; i < lst.size(); i++) { - row = (ArrayList)lst.get(i); + row = lst.get(i); for (int j = 0; j < row.size(); j++) { TextShape tx = (TextShape)row.get(j); cells[i][j] = new TableCell(tx.getSpContainer(), getParent()); @@ -318,7 +319,7 @@ public final class Table extends ShapeGroup { private Line cloneBorder(Line line){ Line border = createBorder(); border.setLineWidth(line.getLineWidth()); - border.setLineStyle(line.getLineStyle()); + border.setLineStyle(line.getStrokeStyle()); border.setLineDashing(line.getLineDashing()); border.setLineColor(line.getLineColor()); return border; diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/TableCell.java b/src/scratchpad/src/org/apache/poi/hslf/model/TableCell.java index 864d55eae..15854bb50 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/TableCell.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/TableCell.java @@ -17,9 +17,13 @@ package org.apache.poi.hslf.model; -import org.apache.poi.ddf.*; +import java.awt.Rectangle; -import java.awt.*; +import org.apache.poi.ddf.EscherContainerRecord; +import org.apache.poi.ddf.EscherOptRecord; +import org.apache.poi.ddf.EscherProperties; +import org.apache.poi.sl.usermodel.ShapeContainer; +import org.apache.poi.sl.usermodel.ShapeType; /** * Represents a cell in a ppt table @@ -38,10 +42,10 @@ public final class TableCell extends TextBox { /** * Create a TableCell object and initialize it from the supplied Record container. * - * @param escherRecord EscherSpContainer container which holds information about this shape + * @param escherRecord {@link EscherSpContainer} container which holds information about this shape * @param parent the parent of the shape */ - protected TableCell(EscherContainerRecord escherRecord, Shape parent){ + protected TableCell(EscherContainerRecord escherRecord, ShapeContainer parent){ super(escherRecord, parent); } @@ -51,10 +55,10 @@ public final class TableCell extends TextBox { * @param parent the parent of this Shape. For example, if this text box is a cell * in a table then the parent is Table. */ - public TableCell(Shape parent){ + public TableCell(ShapeContainer parent){ super(parent); - setShapeType(ShapeTypes.Rectangle); + setShapeType(ShapeType.RECT); //_txtrun.setRunType(TextHeaderAtom.HALF_BODY_TYPE); //_txtrun.getRichTextRuns()[0].setFlag(false, 0, false); } diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/TextBox.java b/src/scratchpad/src/org/apache/poi/hslf/model/TextBox.java index 46e080eb5..267102aa5 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/TextBox.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/TextBox.java @@ -18,6 +18,8 @@ package org.apache.poi.hslf.model; import org.apache.poi.ddf.*; +import org.apache.poi.sl.usermodel.ShapeContainer; +import org.apache.poi.sl.usermodel.ShapeType; /** * Represents a TextFrame shape in PowerPoint. @@ -36,7 +38,7 @@ public class TextBox extends TextShape { * @param escherRecord EscherSpContainer container which holds information about this shape * @param parent the parent of the shape */ - protected TextBox(EscherContainerRecord escherRecord, Shape parent){ + protected TextBox(EscherContainerRecord escherRecord, ShapeContainer parent){ super(escherRecord, parent); } @@ -47,7 +49,7 @@ public class TextBox extends TextShape { * @param parent the parent of this Shape. For example, if this text box is a cell * in a table then the parent is Table. */ - public TextBox(Shape parent){ + public TextBox(ShapeContainer parent){ super(parent); } @@ -67,7 +69,7 @@ public class TextBox extends TextShape { protected EscherContainerRecord createSpContainer(boolean isChild){ _escherContainer = super.createSpContainer(isChild); - setShapeType(ShapeTypes.TextBox); + setShapeType(ShapeType.TEXT_BOX); //set default properties for a TextBox setEscherProperty(EscherProperties.FILL__FILLCOLOR, 0x8000004); diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/TextShape.java b/src/scratchpad/src/org/apache/poi/hslf/model/TextShape.java index b585d61e1..e1e053e39 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/TextShape.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/TextShape.java @@ -41,12 +41,14 @@ import org.apache.poi.hslf.record.OutlineTextRefAtom; import org.apache.poi.hslf.record.PPDrawing; import org.apache.poi.hslf.record.Record; import org.apache.poi.hslf.record.RecordTypes; +import org.apache.poi.hslf.record.RoundTripHFPlaceholder12; import org.apache.poi.hslf.record.StyleTextPropAtom; import org.apache.poi.hslf.record.TextBytesAtom; import org.apache.poi.hslf.record.TextCharsAtom; import org.apache.poi.hslf.record.TextHeaderAtom; import org.apache.poi.hslf.record.TxInteractiveInfoAtom; import org.apache.poi.hslf.usermodel.RichTextRun; +import org.apache.poi.sl.usermodel.ShapeContainer; import org.apache.poi.util.POILogger; /** @@ -109,7 +111,7 @@ public abstract class TextShape extends SimpleShape { * @param escherRecord EscherSpContainer container which holds information about this shape * @param parent the parent of the shape */ - protected TextShape(EscherContainerRecord escherRecord, Shape parent){ + protected TextShape(EscherContainerRecord escherRecord, ShapeContainer parent){ super(escherRecord, parent); } @@ -120,7 +122,7 @@ public abstract class TextShape extends SimpleShape { * @param parent the parent of this Shape. For example, if this text box is a cell * in a table then the parent is Table. */ - public TextShape(Shape parent){ + public TextShape(ShapeContainer parent){ super(null, parent); _escherContainer = createSpContainer(parent instanceof ShapeGroup); } @@ -623,4 +625,17 @@ public abstract class TextShape extends SimpleShape { } + @Override + public boolean isPlaceholder() { + OEPlaceholderAtom oep = getPlaceholderAtom(); + if (oep != null) return true; + + //special case for files saved in Office 2007 + RoundTripHFPlaceholder12 hldr = getClientDataRecord(RecordTypes.RoundTripHFPlaceholder12.typeID); + if (hldr != null) return true; + + return false; + } + + } diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java b/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java index 8b8146f13..38535ecf0 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java @@ -37,7 +37,7 @@ import org.apache.poi.ddf.EscherSpRecord; import org.apache.poi.ddf.EscherSpgrRecord; import org.apache.poi.ddf.EscherTextboxRecord; import org.apache.poi.ddf.UnknownEscherRecord; -import org.apache.poi.hslf.model.ShapeTypes; +import org.apache.poi.sl.usermodel.ShapeType; import org.apache.poi.util.LittleEndian; import org.apache.poi.util.POILogger; @@ -95,7 +95,7 @@ public final class PPDrawing extends RecordAtom { final DefaultEscherRecordFactory erf = new DefaultEscherRecordFactory(); final List escherChildren = new ArrayList(); findEscherChildren(erf, contents, 8, len-8, escherChildren); - this.childRecords = (EscherRecord[]) escherChildren.toArray(new EscherRecord[escherChildren.size()]); + this.childRecords = escherChildren.toArray(new EscherRecord[escherChildren.size()]); if (1 == this.childRecords.length && (short)0xf002 == this.childRecords[0].getRecordId() && this.childRecords[0] instanceof EscherContainerRecord) { this.textboxWrappers = findInDgContainer((EscherContainerRecord) this.childRecords[0]); @@ -103,7 +103,7 @@ public final class PPDrawing extends RecordAtom { // Find and EscherTextboxRecord's, and wrap them up final List textboxes = new ArrayList(); findEscherTextboxRecord(childRecords, textboxes); - this.textboxWrappers = (EscherTextboxWrapper[]) textboxes.toArray(new EscherTextboxWrapper[textboxes.size()]); + this.textboxWrappers = textboxes.toArray(new EscherTextboxWrapper[textboxes.size()]); } } private EscherTextboxWrapper[] findInDgContainer(final EscherContainerRecord escherContainerF002) { @@ -131,7 +131,7 @@ public final class PPDrawing extends RecordAtom { found.add(w); } } - return (EscherTextboxWrapper[]) found.toArray(new EscherTextboxWrapper[found.size()]); + return found.toArray(new EscherTextboxWrapper[found.size()]); } private StyleTextProp9Atom findInSpContainer(final EscherContainerRecord spContainer) { final EscherContainerRecord escherContainerF011 = findFirstEscherContainerRecordOfType((short)0xf011, spContainer); @@ -301,7 +301,7 @@ public final class PPDrawing extends RecordAtom { spContainer.addChildRecord(spgr); EscherSpRecord sp = new EscherSpRecord(); - sp.setOptions((short)((ShapeTypes.NotPrimitive << 4) + 2)); + sp.setOptions((short)((ShapeType.NOT_PRIMITIVE.nativeId << 4) + 2)); sp.setFlags(EscherSpRecord.FLAG_PATRIARCH | EscherSpRecord.FLAG_GROUP); spContainer.addChildRecord(sp); spgrContainer.addChildRecord(spContainer); @@ -311,7 +311,7 @@ public final class PPDrawing extends RecordAtom { spContainer.setOptions((short)15); spContainer.setRecordId(EscherContainerRecord.SP_CONTAINER); sp = new EscherSpRecord(); - sp.setOptions((short)((ShapeTypes.Rectangle << 4) + 2)); + sp.setOptions((short)((ShapeType.RECT.nativeId << 4) + 2)); sp.setFlags(EscherSpRecord.FLAG_BACKGROUND | EscherSpRecord.FLAG_HASSHAPETYPE); spContainer.addChildRecord(sp); @@ -393,7 +393,7 @@ public final class PPDrawing extends RecordAtom { result.add(child); } } - return (EscherContainerRecord[]) result.toArray(new EscherContainerRecord[result.size()]); + return result.toArray(new EscherContainerRecord[result.size()]); } protected Record buildFromUnknownEscherRecord(UnknownEscherRecord unknown) { byte[] bingo = unknown.getData(); @@ -436,6 +436,6 @@ public final class PPDrawing extends RecordAtom { } } } - return (StyleTextProp9Atom[]) result.toArray(new StyleTextProp9Atom[result.size()]); + return result.toArray(new StyleTextProp9Atom[result.size()]); } } diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawAutoShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawAutoShape.java new file mode 100644 index 000000000..a8dcca595 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawAutoShape.java @@ -0,0 +1,10 @@ +package org.apache.poi.sl.draw; + +import org.apache.poi.sl.usermodel.*; + + +public class DrawAutoShape extends DrawTextShape { + public DrawAutoShape(T shape) { + super(shape); + } +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawFactory.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawFactory.java new file mode 100644 index 000000000..9270091a1 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawFactory.java @@ -0,0 +1,96 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw; + +import static org.apache.poi.sl.draw.Drawable.DRAW_FACTORY; + +import java.awt.Graphics2D; +import java.awt.font.TextLayout; +import java.text.AttributedString; + +import org.apache.poi.sl.usermodel.*; + +public class DrawFactory { + protected static ThreadLocal defaultFactory = new ThreadLocal(); + + /** + * Set a custom draw factory for the current thread. + * This is a fallback, for operations where usercode can't set a graphics context. + * Preferably use the rendering hint {@link Drawable#DRAW_FACTORY} to set the factory. + * + * @param factory + */ + public static void setDefaultFactory(DrawFactory factory) { + defaultFactory.set(factory); + } + + public static DrawFactory getInstance(Graphics2D graphics) { + // first try to find the factory over the rendering hing + DrawFactory factory = (DrawFactory)graphics.getRenderingHint(DRAW_FACTORY); + // secondly try the thread local default + if (factory == null) { + factory = defaultFactory.get(); + } + // and at last, use the default factory + if (factory == null) { + factory = new DrawFactory(); + graphics.setRenderingHint(DRAW_FACTORY, factory); + } + return factory; + } + + public Drawable getDrawable(Sheet sheet) { + return new DrawSheet(sheet); + } + + public Drawable getDrawable(MasterSheet sheet) { + return new DrawMasterSheet(sheet); + } + + @SuppressWarnings("unchecked") + public Drawable getDrawable(Shape shape) { + if (shape instanceof TextBox) { + return getDrawable((TextBox)shape); + } else if (shape instanceof FreeformShape) { + return getDrawable((FreeformShape)shape); + } + + throw new IllegalArgumentException("Unsupported shape type: "+shape.getClass()); + } + + public DrawTextBox getDrawable(T shape) { + return new DrawTextBox(shape); + } + + public DrawFreeformShape getDrawable(T shape) { + return new DrawFreeformShape(shape); + } + + + public DrawTextParagraph getDrawable(TextParagraph paragraph) { + return new DrawTextParagraph(paragraph); + } + + public DrawTextFragment getTextFragment(TextLayout layout, AttributedString str) { + return new DrawTextFragment(layout, str); + } + + public DrawPaint getPaint(PlaceableShape shape) { + return new DrawPaint(shape); + } +} diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/TextCap.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawFontManager.java similarity index 64% rename from src/ooxml/java/org/apache/poi/xslf/usermodel/TextCap.java rename to src/scratchpad/src/org/apache/poi/sl/draw/DrawFontManager.java index c4ad6255d..9c49489ff 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/TextCap.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawFontManager.java @@ -17,13 +17,22 @@ * ==================================================================== */ -package org.apache.poi.xslf.usermodel; +package org.apache.poi.sl.draw; /** - * @author Yegor Kozlov + * Manages fonts when rendering slides. + * + * Use this class to handle unknown / missing fonts or to substitute fonts */ -public enum TextCap { - NONE, - SMALL, - ALL +public interface DrawFontManager { + + /** + * select a font to be used to paint text + * + * @param typeface the font family as defined in the .pptx file. + * This can be unknown or missing in the graphic environment. + * + * @return the font to be used to paint text + */ + String getRendererableFont(String typeface, int pitchFamily); } diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawFreeformShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawFreeformShape.java new file mode 100644 index 000000000..666b85a1c --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawFreeformShape.java @@ -0,0 +1,9 @@ +package org.apache.poi.sl.draw; + +import org.apache.poi.sl.usermodel.*; + +public class DrawFreeformShape extends DrawAutoShape { + public DrawFreeformShape(T shape) { + super(shape); + } +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawMasterSheet.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawMasterSheet.java new file mode 100644 index 000000000..c4afeb35e --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawMasterSheet.java @@ -0,0 +1,22 @@ +package org.apache.poi.sl.draw; + +import org.apache.poi.sl.usermodel.MasterSheet; +import org.apache.poi.sl.usermodel.Shape; + + +public class DrawMasterSheet extends DrawSheet { + + public DrawMasterSheet(MasterSheet sheet) { + super(sheet); + } + + /** + * Checks if this sheet displays the specified shape. + * + * Subclasses can override it and skip certain shapes from drawings, + * for instance, slide masters and layouts don't display placeholders + */ + protected boolean canDraw(Shape shape){ + return !shape.isPlaceholder(); + } +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawPaint.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawPaint.java new file mode 100644 index 000000000..c608ec3b0 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawPaint.java @@ -0,0 +1,448 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw; + +import java.awt.*; +import java.awt.MultipleGradientPaint.ColorSpaceType; +import java.awt.MultipleGradientPaint.CycleMethod; +import java.awt.Shape; +import java.awt.geom.*; +import java.awt.image.*; +import java.io.IOException; +import java.io.InputStream; + +import org.apache.poi.sl.usermodel.*; +import org.apache.poi.sl.usermodel.GradientPaint; +import org.apache.poi.sl.usermodel.TexturePaint; +import org.apache.poi.util.POILogFactory; +import org.apache.poi.util.POILogger; + + +public class DrawPaint { + public final static Color NO_PAINT = new Color(0xFF, 0xFF, 0xFF, 0); + private final static POILogger LOG = POILogFactory.getLogger(DrawPaint.class); + + protected PlaceableShape shape; + + public DrawPaint(PlaceableShape shape) { + this.shape = shape; + } + + public Paint getPaint(Graphics2D graphics, PaintStyle paint) { + if (paint instanceof SolidPaint) { + return getSolidPaint((SolidPaint)paint, graphics); + } else if (paint instanceof GradientPaint) { + return getGradientPaint((GradientPaint)paint, graphics); + } else if (paint instanceof TexturePaint) { + return getTexturePaint((TexturePaint)paint, graphics); + } + return null; + } + + protected Paint getSolidPaint(SolidPaint fill, Graphics2D graphics) { + return applyColorTransform(fill.getSolidColor()); + } + + protected Paint getGradientPaint(GradientPaint fill, Graphics2D graphics) { + switch (fill.getGradientType()) { + case linear: + return createLinearGradientPaint(fill, graphics); + case circular: + return createRadialGradientPaint(fill, graphics); + case shape: + return createPathGradientPaint(fill, graphics); + default: + throw new UnsupportedOperationException("gradient fill of type "+fill+" not supported."); + } + } + + protected Paint getTexturePaint(TexturePaint fill, Graphics2D graphics) { + InputStream is = fill.getImageData(); + if (is == null) return NO_PAINT; + assert(graphics != null); + + ImageRenderer renderer = (ImageRenderer)graphics.getRenderingHint(Drawable.IMAGE_RENDERER); + if (renderer == null) renderer = new ImageRenderer(); + + try { + renderer.loadImage(fill.getImageData(), fill.getContentType()); + } catch (IOException e) { + LOG.log(POILogger.ERROR, "Can't load image data - using transparent color", e); + return NO_PAINT; + } + + int alpha = fill.getAlpha(); + if (alpha != -1) { + renderer.setAlpha(fill.getAlpha()/100000.f); + } + + Dimension dim = renderer.getDimension(); + Rectangle2D textAnchor = new Rectangle2D.Double(0, 0, dim.getWidth(), dim.getHeight()); + Paint paint = new java.awt.TexturePaint(renderer.getImage(), textAnchor); + + return paint; + } + + /** + * Convert color transformations in {@link ColorStyle} to a {@link Color} instance + */ + public static Color applyColorTransform(ColorStyle color){ + Color result = color.getColor(); + + if (result == null || color.getAlpha() == 100) return NO_PAINT; + + result = applyAlpha(result, color); + result = applyLuminanace(result, color); + result = applyShade(result, color); + result = applyTint(result, color); + + return result; + } + + protected static Color applyAlpha(Color c, ColorStyle fc) { + int alpha = c.getAlpha(); + return (alpha == 0 || alpha == -1) ? c : new Color(c.getRed(), c.getGreen(), c.getBlue(), alpha); + } + + /** + * Apply lumMod / lumOff adjustments + * + * @param c the color to modify + * @param lumMod luminance modulation in the range [0..100000] + * @param lumOff luminance offset in the range [0..100000] + * @return modified color + */ + protected static Color applyLuminanace(Color c, ColorStyle fc) { + int lumMod = fc.getLumMod(); + if (lumMod == -1) lumMod = 100000; + + int lumOff = fc.getLumOff(); + if (lumOff == -1) lumOff = 0; + + if (lumMod == 100000 && lumOff == 0) return c; + + int r = c.getRed(); + int g = c.getGreen(); + int b = c.getBlue(); + + float red,green,blue; + + Color color; + if (lumOff > 0) { + float flumOff = lumOff / 100000.f; + red = (255.f - r) * (1.f - flumOff) + r; + green = (255.f - g) * flumOff + g; + blue = (255.f - b) * flumOff + b; + } else { + float flumMod = lumMod / 100000.f; + red = r * lumMod; + green = g * lumMod; + blue = b * lumMod; + } + return new Color(Math.round(red), Math.round(green), Math.round(blue), c.getAlpha()); + } + + /** + * This algorithm returns result different from PowerPoint. + * TODO: revisit and improve + */ + protected static Color applyShade(Color c, ColorStyle fc) { + int shade = fc.getShade(); + if (shade == -1) return c; + + float fshade = shade / 100000.f; + + float red = c.getRed() * fshade; + float green = c.getGreen() * fshade; + float blue = c.getGreen() * fshade; + + return new Color(Math.round(red), Math.round(green), Math.round(blue), c.getAlpha()); + } + + /** + * This algorithm returns result different from PowerPoint. + * TODO: revisit and improve + */ + protected static Color applyTint(Color c, ColorStyle fc) { + int tint = fc.getTint(); + if (tint == -1) return c; + + float ftint = tint / 100000.f; + + float red = ftint * c.getRed() + (1.f - ftint) * 255.f; + float green = ftint * c.getGreen() + (1.f - ftint) * 255.f; + float blue = ftint * c.getBlue() + (1.f - ftint) * 255.f; + + return new Color(Math.round(red), Math.round(green), Math.round(blue), c.getAlpha()); + } + + + protected Paint createLinearGradientPaint(GradientPaint fill, Graphics2D graphics) { + double angle = fill.getGradientAngle(); + Rectangle2D anchor = DrawShape.getAnchor(graphics, shape); + + AffineTransform at = AffineTransform.getRotateInstance( + Math.toRadians(angle), + anchor.getX() + anchor.getWidth() / 2, + anchor.getY() + anchor.getHeight() / 2); + + double diagonal = Math.sqrt(anchor.getHeight() * anchor.getHeight() + anchor.getWidth() * anchor.getWidth()); + Point2D p1 = new Point2D.Double(anchor.getX() + anchor.getWidth() / 2 - diagonal / 2, + anchor.getY() + anchor.getHeight() / 2); + p1 = at.transform(p1, null); + + Point2D p2 = new Point2D.Double(anchor.getX() + anchor.getWidth(), anchor.getY() + anchor.getHeight() / 2); + p2 = at.transform(p2, null); + + snapToAnchor(p1, anchor); + snapToAnchor(p2, anchor); + + float[] fractions = fill.getGradientFractions(); + Color[] colors = new Color[fractions.length]; + + int i = 0; + for (ColorStyle fc : fill.getGradientColors()) { + colors[i++] = applyColorTransform(fc); + } + + AffineTransform grAt = new AffineTransform(); + if(fill.isRotatedWithShape()) { + double rotation = shape.getRotation(); + if (rotation != 0.) { + double centerX = anchor.getX() + anchor.getWidth() / 2; + double centerY = anchor.getY() + anchor.getHeight() / 2; + + grAt.translate(centerX, centerY); + grAt.rotate(Math.toRadians(-rotation)); + grAt.translate(-centerX, -centerY); + } + } + + return new LinearGradientPaint + (p1, p2, fractions, colors, CycleMethod.NO_CYCLE, ColorSpaceType.SRGB, grAt); + } + + protected Paint createRadialGradientPaint(GradientPaint fill, Graphics2D graphics) { + Rectangle2D anchor = DrawShape.getAnchor(graphics, shape); + + Point2D pCenter = new Point2D.Double(anchor.getX() + anchor.getWidth()/2, + anchor.getY() + anchor.getHeight()/2); + + float radius = (float)Math.max(anchor.getWidth(), anchor.getHeight()); + + float[] fractions = fill.getGradientFractions(); + Color[] colors = new Color[fractions.length]; + + int i=0; + for (ColorStyle fc : fill.getGradientColors()) { + colors[i++] = applyColorTransform(fc); + } + + return new RadialGradientPaint(pCenter, radius, fractions, colors); + } + + protected Paint createPathGradientPaint(GradientPaint fill, Graphics2D graphics) { + // currently we ignore an eventually center setting + + float[] fractions = fill.getGradientFractions(); + Color[] colors = new Color[fractions.length]; + + int i=0; + for (ColorStyle fc : fill.getGradientColors()) { + colors[i++] = applyColorTransform(fc); + } + + return new PathGradientPaint(colors, fractions); + } + + protected void snapToAnchor(Point2D p, Rectangle2D anchor) { + if (p.getX() < anchor.getX()) { + p.setLocation(anchor.getX(), p.getY()); + } else if (p.getX() > (anchor.getX() + anchor.getWidth())) { + p.setLocation(anchor.getX() + anchor.getWidth(), p.getY()); + } + + if (p.getY() < anchor.getY()) { + p.setLocation(p.getX(), anchor.getY()); + } else if (p.getY() > (anchor.getY() + anchor.getHeight())) { + p.setLocation(p.getX(), anchor.getY() + anchor.getHeight()); + } + } + + public static class PathGradientPaint implements Paint { + + // http://asserttrue.blogspot.de/2010/01/how-to-iimplement-custom-paint-in-50.html + protected final Color colors[]; + protected final float fractions[]; + protected final int capStyle; + protected final int joinStyle; + protected final int transparency; + + + public PathGradientPaint(Color colors[], float fractions[]) { + this(colors,fractions,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND); + } + + public PathGradientPaint(Color colors[], float fractions[], int capStyle, int joinStyle) { + this.colors = colors; + this.fractions = fractions; + this.capStyle = capStyle; + this.joinStyle = joinStyle; + + // determine transparency + boolean opaque = true; + for (int i = 0; i < colors.length; i++){ + opaque = opaque && (colors[i].getAlpha() == 0xff); + } + this.transparency = opaque ? OPAQUE : TRANSLUCENT; + } + + public PaintContext createContext(ColorModel cm, + Rectangle deviceBounds, + Rectangle2D userBounds, + AffineTransform transform, + RenderingHints hints) { + return new PathGradientContext(cm, deviceBounds, userBounds, transform, hints); + } + + public int getTransparency() { + return transparency; + } + + class PathGradientContext implements PaintContext { + protected final Rectangle deviceBounds; + protected final Rectangle2D userBounds; + protected final AffineTransform xform; + protected final RenderingHints hints; + + /** + * for POI: the shape will be only known when the subclasses determines the concrete implementation + * in the draw/-content method, so we need to postpone the setting/creation as long as possible + **/ + protected final Shape shape; + protected final PaintContext pCtx; + protected final int gradientSteps; + WritableRaster raster; + + public PathGradientContext( + ColorModel cm + , Rectangle deviceBounds + , Rectangle2D userBounds + , AffineTransform xform + , RenderingHints hints + ) { + shape = (Shape)hints.get(Drawable.GRADIENT_SHAPE); + if (shape == null) { + throw new IllegalPathStateException("PathGradientPaint needs a shape to be set via the rendering hint PathGradientPaint.GRADIANT_SHAPE."); + } + + this.deviceBounds = deviceBounds; + this.userBounds = userBounds; + this.xform = xform; + this.hints = hints; + + gradientSteps = getGradientSteps(shape); + + Point2D start = new Point2D.Double(0, 0); + Point2D end = new Point2D.Double(gradientSteps, 0); + LinearGradientPaint gradientPaint = new LinearGradientPaint(start, end, fractions, colors, CycleMethod.NO_CYCLE, ColorSpaceType.SRGB, new AffineTransform()); + + Rectangle bounds = new Rectangle(0, 0, gradientSteps, 1); + pCtx = gradientPaint.createContext(cm, bounds, bounds, new AffineTransform(), hints); + } + + public void dispose() {} + + public ColorModel getColorModel() { + return pCtx.getColorModel(); + } + + public Raster getRaster(int xOffset, int yOffset, int w, int h) { + ColorModel cm = getColorModel(); + if (raster == null) createRaster(); + + // TODO: eventually use caching here + WritableRaster childRaster = cm.createCompatibleWritableRaster(w, h); + Rectangle2D childRect = new Rectangle2D.Double(xOffset, yOffset, w, h); + if (!childRect.intersects(deviceBounds)) { + // usually doesn't happen ... + return childRaster; + } + + Rectangle2D destRect = new Rectangle2D.Double(); + Rectangle2D.intersect(childRect, deviceBounds, destRect); + int dx = (int)(destRect.getX()-deviceBounds.getX()); + int dy = (int)(destRect.getY()-deviceBounds.getY()); + int dw = (int)destRect.getWidth(); + int dh = (int)destRect.getHeight(); + Object data = raster.getDataElements(dx, dy, dw, dh, null); + dx = (int)(destRect.getX()-childRect.getX()); + dy = (int)(destRect.getY()-childRect.getY()); + childRaster.setDataElements(dx, dy, dw, dh, data); + + return childRaster; + } + + protected int getGradientSteps(Shape shape) { + Rectangle rect = shape.getBounds(); + int lower = 1; + int upper = (int)(Math.max(rect.getWidth(),rect.getHeight())/2.0); + while (lower < upper-1) { + int mid = lower + (upper - lower) / 2; + BasicStroke bs = new BasicStroke(mid, capStyle, joinStyle); + Area area = new Area(bs.createStrokedShape(shape)); + if (area.isSingular()) { + upper = mid; + } else { + lower = mid; + } + } + return upper; + } + + + + protected void createRaster() { + ColorModel cm = getColorModel(); + raster = cm.createCompatibleWritableRaster((int)deviceBounds.getWidth(), (int)deviceBounds.getHeight()); + BufferedImage img = new BufferedImage(cm, raster, false, null); + Graphics2D graphics = img.createGraphics(); + graphics.setRenderingHints(hints); + graphics.translate(-deviceBounds.getX(), -deviceBounds.getY()); + graphics.transform(xform); + + Raster img2 = pCtx.getRaster(0, 0, gradientSteps, 1); + int rgb[] = new int[cm.getNumComponents()]; + + for (int i = gradientSteps-1; i>=0; i--) { + img2.getPixel(i, 0, rgb); + Color c = new Color(rgb[0],rgb[1],rgb[2]); + if (rgb.length == 4) { + // it doesn't work to use just a color with transparency ... + graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC, rgb[3]/255.0f)); + } + graphics.setStroke(new BasicStroke(i+1, capStyle, joinStyle)); + graphics.setColor(c); + graphics.draw(shape); + } + + graphics.dispose(); + } + } + } +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawShape.java new file mode 100644 index 000000000..f2510a0cc --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawShape.java @@ -0,0 +1,109 @@ +package org.apache.poi.sl.draw; + +import java.awt.Graphics2D; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; + +import org.apache.poi.sl.usermodel.PlaceableShape; +import org.apache.poi.sl.usermodel.Shape; + + +public class DrawShape implements Drawable { + + protected final T shape; + + public DrawShape(T shape) { + this.shape = shape; + } + + /** + * Apply 2-D transforms before drawing this shape. This includes rotation and flipping. + * + * @param graphics the graphics whos transform matrix will be modified + */ + public void applyTransform(Graphics2D graphics) { + Rectangle2D anchor = shape.getAnchor(); + AffineTransform tx = (AffineTransform)graphics.getRenderingHint(Drawable.GROUP_TRANSFORM); + if(tx != null) { + anchor = tx.createTransformedShape(anchor).getBounds2D(); + } + + // rotation + double rotation = shape.getRotation(); + if (rotation != 0.) { + // PowerPoint rotates shapes relative to the geometric center + double centerX = anchor.getCenterX(); + double centerY = anchor.getCenterY(); + + // normalize rotation + rotation = (360.+(rotation%360.))%360.; + int quadrant = (((int)rotation+45)/90)%4; + double scaleX = 1.0, scaleY = 1.0; + + // scale to bounding box (bug #53176) + if (quadrant == 1 || quadrant == 3) { + // In quadrant 1 and 3, which is basically a shape in a more or less portrait orientation + // (45-135 degrees and 225-315 degrees), we need to first rotate the shape by a multiple + // of 90 degrees and then resize the bounding box to its original bbox. After that we can + // rotate the shape to the exact rotation amount. + // It's strange that you'll need to rotate the shape back and forth again, but you can + // think of it, as if you paint the shape on a canvas. First you rotate the canvas, which might + // be already (differently) scaled, so you can paint the shape in its default orientation + // and later on, turn it around again to compare it with its original size ... + AffineTransform txg = new AffineTransform(); // graphics coordinate space + AffineTransform txs = new AffineTransform(tx); // shape coordinate space + txg.translate(centerX, centerY); + txg.rotate(Math.toRadians(quadrant*90)); + txg.translate(-centerX, -centerY); + txs.translate(centerX, centerY); + txs.rotate(Math.toRadians(-quadrant*90)); + txs.translate(-centerX, -centerY); + txg.concatenate(txs); + Rectangle2D anchor2 = txg.createTransformedShape(shape.getAnchor()).getBounds2D(); + scaleX = anchor.getWidth() == 0. ? 1.0 : anchor.getWidth() / anchor2.getWidth(); + scaleY = anchor.getHeight() == 0. ? 1.0 : anchor.getHeight() / anchor2.getHeight(); + } + + // transformation is applied reversed ... + graphics.translate(centerX, centerY); + graphics.rotate(Math.toRadians(rotation-quadrant*90.)); + graphics.scale(scaleX, scaleY); + graphics.rotate(Math.toRadians(quadrant*90)); + graphics.translate(-centerX, -centerY); + } + + //flip horizontal + if (shape.getFlipHorizontal()) { + graphics.translate(anchor.getX() + anchor.getWidth(), anchor.getY()); + graphics.scale(-1, 1); + graphics.translate(-anchor.getX(), -anchor.getY()); + } + + //flip vertical + if (shape.getFlipVertical()) { + graphics.translate(anchor.getX(), anchor.getY() + anchor.getHeight()); + graphics.scale(1, -1); + graphics.translate(-anchor.getX(), -anchor.getY()); + } + } + + + public void draw(Graphics2D graphics) { + } + + public void drawContent(Graphics2D context) { + } + + public static Rectangle2D getAnchor(Graphics2D graphics, PlaceableShape shape) { + Rectangle2D anchor = shape.getAnchor(); + if(graphics == null) { + return anchor; + } + + AffineTransform tx = (AffineTransform)graphics.getRenderingHint(Drawable.GROUP_TRANSFORM); + if(tx != null) { + anchor = tx.createTransformedShape(anchor).getBounds2D(); + } + return anchor; + } +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawSheet.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawSheet.java new file mode 100644 index 000000000..7598d2142 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawSheet.java @@ -0,0 +1,72 @@ +package org.apache.poi.sl.draw; + +import java.awt.Graphics2D; +import java.awt.geom.AffineTransform; + +import org.apache.poi.sl.usermodel.MasterSheet; +import org.apache.poi.sl.usermodel.Shape; +import org.apache.poi.sl.usermodel.Sheet; + + +public class DrawSheet implements Drawable { + + protected final Sheet sheet; + + public DrawSheet(Sheet sheet) { + this.sheet = sheet; + } + + public void applyTransform(Graphics2D context) { + // TODO Auto-generated method stub + + } + + public void draw(Graphics2D graphics) { + DrawFactory drawFact = DrawFactory.getInstance(graphics); + MasterSheet master = sheet.getMasterSheet(); + + if(sheet.getFollowMasterGraphics() && master != null) { + Drawable drawer = drawFact.getDrawable(master); + drawer.draw(graphics); + } + + graphics.setRenderingHint(Drawable.GROUP_TRANSFORM, new AffineTransform()); + + for (Shape shape : sheet.getShapes()) { + if(!canDraw(shape)) continue; + + // remember the initial transform and restore it after we are done with drawing + AffineTransform at = graphics.getTransform(); + + // concrete implementations can make sense of this hint, + // for example PSGraphics2D or PDFGraphics2D would call gsave() / grestore + graphics.setRenderingHint(Drawable.GSAVE, true); + + // apply rotation and flipping + Drawable drawer = drawFact.getDrawable(shape); + drawer.applyTransform(graphics); + // draw stuff + drawer.draw(graphics); + + // restore the coordinate system + graphics.setTransform(at); + + graphics.setRenderingHint(Drawable.GRESTORE, true); + } + } + + public void drawContent(Graphics2D context) { + // TODO Auto-generated method stub + + } + + /** + * Checks if this sheet displays the specified shape. + * + * Subclasses can override it and skip certain shapes from drawings, + * for instance, slide masters and layouts don't display placeholders + */ + protected boolean canDraw(Shape shape){ + return true; + } +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawSimpleShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawSimpleShape.java new file mode 100644 index 000000000..5bb6f34c3 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawSimpleShape.java @@ -0,0 +1,391 @@ +package org.apache.poi.sl.draw; + +import java.awt.*; +import java.awt.geom.*; +import java.io.*; +import java.nio.charset.Charset; +import java.util.*; +import java.util.List; + +import javax.xml.bind.*; +import javax.xml.stream.*; +import javax.xml.stream.EventFilter; +import javax.xml.stream.events.StartElement; +import javax.xml.stream.events.XMLEvent; + +import org.apache.poi.sl.draw.binding.CTCustomGeometry2D; +import org.apache.poi.sl.draw.geom.*; +import org.apache.poi.sl.usermodel.*; +import org.apache.poi.sl.usermodel.LineDecoration.DecorationSize; +import org.apache.poi.sl.usermodel.StrokeStyle.LineDash; +import org.apache.poi.util.Units; + + +public class DrawSimpleShape extends DrawShape { + + public DrawSimpleShape(T shape) { + super(shape); + } + + @Override + public void draw(Graphics2D graphics) { +// RenderableShape rShape = new RenderableShape(this); +// rShape.render(graphics); + + DrawPaint drawPaint = DrawFactory.getInstance(graphics).getPaint(shape); + Paint fill = drawPaint.getPaint(graphics, shape.getFillStyle().getPaint()); + Paint line = drawPaint.getPaint(graphics, shape.getStrokeStyle().getPaint()); + BasicStroke stroke = getStroke(); // the stroke applies both to the shadow and the shape + graphics.setStroke(stroke); + + Collection elems = computeOutlines(graphics); + + // first paint the shadow + drawShadow(graphics, elems, fill, line); + + // then fill the shape interior + if (fill != null) { + graphics.setPaint(fill); + for (Outline o : elems) { + if (o.getPath().isFilled()){ + java.awt.Shape s = o.getOutline(); + graphics.setRenderingHint(Drawable.GRADIENT_SHAPE, s); + graphics.fill(s); + } + } + } + + // then draw any content within this shape (text, image, etc.) + drawContent(graphics); + + // then stroke the shape outline + if(line != null) { + graphics.setPaint(line); + for(Outline o : elems){ + if(o.getPath().isStroked()){ + java.awt.Shape s = o.getOutline(); + graphics.setRenderingHint(Drawable.GRADIENT_SHAPE, s); + graphics.draw(s); + } + } + } + + // draw line decorations + drawDecoration(graphics, line, stroke); + } + + protected void drawDecoration(Graphics2D graphics, Paint line, BasicStroke stroke) { + if(line == null) return; + graphics.setPaint(line); + + List lst = new ArrayList(); + LineDecoration deco = shape.getLineDecoration(); + Outline head = getHeadDecoration(graphics, deco, stroke); + if (head != null) lst.add(head); + Outline tail = getTailDecoration(graphics, deco, stroke); + if (tail != null) lst.add(tail); + + + for(Outline o : lst){ + java.awt.Shape s = o.getOutline(); + Path p = o.getPath(); + graphics.setRenderingHint(Drawable.GRADIENT_SHAPE, s); + + if(p.isFilled()) graphics.fill(s); + if(p.isStroked()) graphics.draw(s); + } + } + + protected Outline getTailDecoration(Graphics2D graphics, LineDecoration deco, BasicStroke stroke) { + DecorationSize tailLength = deco.getTailLength(); + DecorationSize tailWidth = deco.getTailWidth(); + + double lineWidth = Math.max(2.5, stroke.getLineWidth()); + + Rectangle2D anchor = getAnchor(graphics, shape); + double x2 = anchor.getX() + anchor.getWidth(), + y2 = anchor.getY() + anchor.getHeight(); + + double alpha = Math.atan(anchor.getHeight() / anchor.getWidth()); + + AffineTransform at = new AffineTransform(); + java.awt.Shape shape = null; + Path p = null; + Rectangle2D bounds; + double scaleY = Math.pow(2, tailWidth.ordinal()); + double scaleX = Math.pow(2, tailLength.ordinal()); + switch (deco.getTailShape()) { + case OVAL: + p = new Path(); + shape = new Ellipse2D.Double(0, 0, lineWidth * scaleX, lineWidth * scaleY); + bounds = shape.getBounds2D(); + at.translate(x2 - bounds.getWidth() / 2, y2 - bounds.getHeight() / 2); + at.rotate(alpha, bounds.getX() + bounds.getWidth() / 2, bounds.getY() + bounds.getHeight() / 2); + break; + case ARROW: + p = new Path(); + GeneralPath arrow = new GeneralPath(); + arrow.moveTo((float) (-lineWidth * 3), (float) (-lineWidth * 2)); + arrow.lineTo(0, 0); + arrow.lineTo((float) (-lineWidth * 3), (float) (lineWidth * 2)); + shape = arrow; + at.translate(x2, y2); + at.rotate(alpha); + break; + case TRIANGLE: + p = new Path(); + scaleY = tailWidth.ordinal() + 1; + scaleX = tailLength.ordinal() + 1; + GeneralPath triangle = new GeneralPath(); + triangle.moveTo((float) (-lineWidth * scaleX), (float) (-lineWidth * scaleY / 2)); + triangle.lineTo(0, 0); + triangle.lineTo((float) (-lineWidth * scaleX), (float) (lineWidth * scaleY / 2)); + triangle.closePath(); + shape = triangle; + at.translate(x2, y2); + at.rotate(alpha); + break; + default: + break; + } + + if (shape != null) { + shape = at.createTransformedShape(shape); + } + return shape == null ? null : new Outline(shape, p); + } + + Outline getHeadDecoration(Graphics2D graphics, LineDecoration deco, BasicStroke stroke) { + DecorationSize headLength = deco.getHeadLength(); + DecorationSize headWidth = deco.getHeadWidth(); + + double lineWidth = Math.max(2.5, stroke.getLineWidth()); + + Rectangle2D anchor = getAnchor(graphics, shape); + double x1 = anchor.getX(), + y1 = anchor.getY(); + + double alpha = Math.atan(anchor.getHeight() / anchor.getWidth()); + + AffineTransform at = new AffineTransform(); + java.awt.Shape shape = null; + Path p = null; + Rectangle2D bounds; + double scaleY = 1; + double scaleX = 1; + switch (deco.getHeadShape()) { + case OVAL: + p = new Path(); + shape = new Ellipse2D.Double(0, 0, lineWidth * scaleX, lineWidth * scaleY); + bounds = shape.getBounds2D(); + at.translate(x1 - bounds.getWidth() / 2, y1 - bounds.getHeight() / 2); + at.rotate(alpha, bounds.getX() + bounds.getWidth() / 2, bounds.getY() + bounds.getHeight() / 2); + break; + case STEALTH: + case ARROW: + p = new Path(false, true); + GeneralPath arrow = new GeneralPath(); + arrow.moveTo((float) (lineWidth * 3 * scaleX), (float) (-lineWidth * scaleY * 2)); + arrow.lineTo(0, 0); + arrow.lineTo((float) (lineWidth * 3 * scaleX), (float) (lineWidth * scaleY * 2)); + shape = arrow; + at.translate(x1, y1); + at.rotate(alpha); + break; + case TRIANGLE: + p = new Path(); + scaleY = headWidth.ordinal() + 1; + scaleX = headLength.ordinal() + 1; + GeneralPath triangle = new GeneralPath(); + triangle.moveTo((float) (lineWidth * scaleX), (float) (-lineWidth * scaleY / 2)); + triangle.lineTo(0, 0); + triangle.lineTo((float) (lineWidth * scaleX), (float) (lineWidth * scaleY / 2)); + triangle.closePath(); + shape = triangle; + at.translate(x1, y1); + at.rotate(alpha); + break; + default: + break; + } + + if (shape != null) { + shape = at.createTransformedShape(shape); + } + return shape == null ? null : new Outline(shape, p); + } + + public BasicStroke getStroke() { + StrokeStyle strokeStyle = shape.getStrokeStyle(); + + float lineWidth = (float) strokeStyle.getLineWidth(); + if (lineWidth == 0.0f) lineWidth = 0.25f; // Both PowerPoint and OOo draw zero-length lines as 0.25pt + + LineDash lineDash = strokeStyle.getLineDash(); + int dashPatI[] = lineDash.pattern; + float[] dashPatF = new float[dashPatI.length]; + final float dash_phase = 0; + for (int i=0; i outlines + , Paint fill + , Paint line + ) { + Shadow shadow = shape.getShadow(); + if (shadow == null || (fill == null && line == null)) return; + + double shapeRotation = shape.getRotation(); + if(shape.getFlipVertical()) { + shapeRotation += 180; + } + double angle = shadow.getAngle() - shapeRotation; + double dist = shadow.getDistance(); + double dx = dist * Math.cos(Math.toRadians(angle)); + double dy = dist * Math.sin(Math.toRadians(angle)); + + graphics.translate(dx, dy); + + for(Outline o : outlines){ + java.awt.Shape s = o.getOutline(); + Path p = o.getPath(); + graphics.setRenderingHint(Drawable.GRADIENT_SHAPE, s); + + if(fill != null && p.isFilled()){ + graphics.setPaint(fill); + graphics.fill(s); + } else if (line != null && p.isStroked()) { + graphics.setPaint(line); + graphics.draw(s); + } + } + + graphics.translate(-dx, -dy); + } + + protected static CustomGeometry getCustomGeometry(String name) { + return getCustomGeometry(name, null); + } + + protected static CustomGeometry getCustomGeometry(String name, Graphics2D graphics) { + @SuppressWarnings("unchecked") + Map presets = (graphics == null) + ? null + : (Map)graphics.getRenderingHint(Drawable.PRESET_GEOMETRY_CACHE); + + if (presets == null) { + presets = new HashMap(); + if (graphics != null) { + graphics.setRenderingHint(Drawable.PRESET_GEOMETRY_CACHE, presets); + } + + String packageName = "org.apache.poi.sl.draw.binding"; + InputStream presetIS = Drawable.class.getResourceAsStream("presetShapeDefinitions.xml"); + Reader xml = new InputStreamReader( presetIS, Charset.forName("UTF-8") ); + + // StAX: + EventFilter startElementFilter = new EventFilter() { + @Override + public boolean accept(XMLEvent event) { + return event.isStartElement(); + } + }; + + try { + XMLInputFactory staxFactory = XMLInputFactory.newInstance(); + XMLEventReader staxReader = staxFactory.createXMLEventReader(xml); + XMLEventReader staxFiltRd = staxFactory.createFilteredReader(staxReader, startElementFilter); + // Ignore StartElement: + staxFiltRd.nextEvent(); + // JAXB: + JAXBContext jaxbContext = JAXBContext.newInstance(packageName); + Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); + + while (staxFiltRd.peek() != null) { + StartElement evRoot = (StartElement)staxFiltRd.peek(); + String cusName = evRoot.getName().getLocalPart(); + // XMLEvent ev = staxReader.nextEvent(); + JAXBElement el = unmarshaller.unmarshal(staxReader, CTCustomGeometry2D.class); + CTCustomGeometry2D cusGeom = el.getValue(); + + presets.put(cusName, new CustomGeometry(cusGeom)); + } + } catch (Exception e) { + throw new RuntimeException("Unable to load preset geometries.", e); + } + } + + return presets.get(name); + } + + protected Collection computeOutlines(Graphics2D graphics) { + + List lst = new ArrayList(); + CustomGeometry geom = shape.getGeometry(); + if(geom == null) { + return lst; + } + + Rectangle2D anchor = getAnchor(graphics, shape); + for (Path p : geom) { + + double w = p.getW() == -1 ? anchor.getWidth() * Units.EMU_PER_POINT : p.getW(); + double h = p.getH() == -1 ? anchor.getHeight() * Units.EMU_PER_POINT : p.getH(); + + // the guides in the shape definitions are all defined relative to each other, + // so we build the path starting from (0,0). + final Rectangle2D pathAnchor = new Rectangle2D.Double(0,0,w,h); + + Context ctx = new Context(geom, pathAnchor, shape); + + java.awt.Shape gp = p.getPath(ctx); + + // translate the result to the canvas coordinates in points + AffineTransform at = new AffineTransform(); + at.translate(anchor.getX(), anchor.getY()); + + double scaleX, scaleY; + if (p.getW() != -1) { + scaleX = anchor.getWidth() / p.getW(); + } else { + scaleX = 1.0 / Units.EMU_PER_POINT; + } + if (p.getH() != -1) { + scaleY = anchor.getHeight() / p.getH(); + } else { + scaleY = 1.0 / Units.EMU_PER_POINT; + } + + at.scale(scaleX, scaleY); + + java.awt.Shape canvasShape = at.createTransformedShape(gp); + + lst.add(new Outline(canvasShape, p)); + } + + return lst; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextBox.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextBox.java new file mode 100644 index 000000000..42f531644 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextBox.java @@ -0,0 +1,9 @@ +package org.apache.poi.sl.draw; + +import org.apache.poi.sl.usermodel.*; + +public class DrawTextBox extends DrawAutoShape { + public DrawTextBox(T shape) { + super(shape); + } +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextFragment.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextFragment.java new file mode 100644 index 000000000..c9bf1f408 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextFragment.java @@ -0,0 +1,94 @@ +package org.apache.poi.sl.draw; + +import java.awt.Graphics2D; +import java.awt.font.TextLayout; +import java.text.*; + +import org.apache.poi.xslf.usermodel.XSLFRenderingHint; + +public class DrawTextFragment implements Drawable { + final TextLayout layout; + final AttributedString str; + double x, y; + + public DrawTextFragment(TextLayout layout, AttributedString str) { + this.layout = layout; + this.str = str; + } + + public void setPosition(double x, double y) { + // TODO: replace it, by applyTransform???? + this.x = x; + this.y = y; + } + + public void draw(Graphics2D graphics){ + if(str == null) { + return; + } + + double yBaseline = y + layout.getAscent(); + + Integer textMode = (Integer)graphics.getRenderingHint(XSLFRenderingHint.TEXT_RENDERING_MODE); + if(textMode != null && textMode == XSLFRenderingHint.TEXT_AS_SHAPES){ + layout.draw(graphics, (float)x, (float)yBaseline); + } else { + graphics.drawString(str.getIterator(), (float)x, (float)yBaseline ); + } + } + + public void applyTransform(Graphics2D graphics) { + // TODO Auto-generated method stub + + } + + public void drawContent(Graphics2D graphics) { + // TODO Auto-generated method stub + + } + + public TextLayout getLayout() { + return layout; + } + + public AttributedString getAttributedString() { + return str; + } + + /** + * @return full height of this text run which is sum of ascent, descent and leading + */ + public float getHeight(){ + double h = Math.ceil(layout.getAscent()) + Math.ceil(layout.getDescent()) + layout.getLeading(); + return (float)h; + } + + /** + * + * @return width if this text run + */ + public float getWidth(){ + return layout.getAdvance(); + } + + /** + * + * @return the string to be painted + */ + public String getString(){ + if (str == null) return ""; + + AttributedCharacterIterator it = str.getIterator(); + StringBuilder buf = new StringBuilder(); + for (char c = it.first(); c != CharacterIterator.DONE; c = it.next()) { + buf.append(c); + } + return buf.toString(); + } + + @Override + public String toString(){ + return "[" + getClass().getSimpleName() + "] " + getString(); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java new file mode 100644 index 000000000..f116f1b5b --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java @@ -0,0 +1,381 @@ +package org.apache.poi.sl.draw; + +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.font.*; +import java.awt.geom.Rectangle2D; +import java.text.*; +import java.text.AttributedCharacterIterator.Attribute; +import java.util.*; + +import org.apache.poi.sl.usermodel.*; +import org.apache.poi.sl.usermodel.TextParagraph.BulletStyle; +import org.apache.poi.sl.usermodel.TextRun.TextCap; +import org.apache.poi.sl.usermodel.TextParagraph.TextAlign; + +public class DrawTextParagraph implements Drawable { + protected TextParagraph paragraph; + double x, y; + protected Insets2D insets = new Insets2D(0,0,0,0); + protected List lines = new ArrayList(); + protected String rawText; + protected DrawTextFragment bullet; + + /** + * the highest line in this paragraph. Used for line spacing. + */ + protected double maxLineHeight; + + public DrawTextParagraph(TextParagraph paragraph) { + this.paragraph = paragraph; + } + + public Insets2D getInsets() { + return insets; + } + + public void setInsets(Insets2D insets) { + this.insets.set(insets.top, insets.left, insets.bottom, insets.right); + } + + public void setPosition(double x, double y) { + // TODO: replace it, by applyTransform???? + this.x = x; + this.y = y; + } + + public double getY() { + return y; + } + + public void draw(Graphics2D graphics){ + if (lines.isEmpty()) return; + + double leftInset = insets.left; + double rightInset = insets.right; + double penY = y; + + double leftMargin = paragraph.getLeftMargin(); + boolean firstLine = true; + double indent = paragraph.getIndent(); + + //The vertical line spacing + double spacing = paragraph.getLineSpacing(); + for(DrawTextFragment line : lines){ + double penX = x + leftMargin; + + if(firstLine) { + if (!isEmptyParagraph()) { + bullet = getBullet(graphics, line.getAttributedString().getIterator()); + } + + if(bullet != null){ + if (indent < 0) { + // a negative value means "Hanging" indentation and + // indicates the position of the actual bullet character. + // (the bullet is shifted to right relative to the text) + bullet.setPosition(penX + indent, penY); + } else if(indent > 0){ + // a positive value means the "First Line" indentation: + // the first line is indented and other lines start at the bullet ofset + bullet.setPosition(penX, penY); + penX += indent; + } else { + // a zero indent means that the bullet and text have the same offset + bullet.setPosition(penX, penY); + + // don't let text overlay the bullet and advance by the bullet width + penX += bullet.getLayout().getAdvance() + 1; + } + + bullet.draw(graphics); + } else { + penX += indent; + } + } + + Rectangle2D anchor = DrawShape.getAnchor(graphics, paragraph.getParentShape()); + + switch (paragraph.getTextAlign()) { + case CENTER: + penX += (anchor.getWidth() - leftMargin - line.getWidth() - leftInset - rightInset) / 2; + break; + case RIGHT: + penX += (anchor.getWidth() - line.getWidth() - leftInset - rightInset); + break; + default: + break; + } + + line.setPosition(penX, penY); + line.draw(graphics); + + if(spacing > 0) { + // If linespacing >= 0, then linespacing is a percentage of normal line height. + penY += spacing*0.01* line.getHeight(); + } else { + // positive value means absolute spacing in points + penY += -spacing; + } + + firstLine = false; + } + + y = penY - y; + } + + public float getFirstLineHeight() { + return (lines.isEmpty()) ? 0 : lines.get(0).getHeight(); + } + + public float getLastLineHeight() { + return (lines.isEmpty()) ? 0 : lines.get(lines.size()-1).getHeight(); + } + + public boolean isEmptyParagraph() { + return (lines.isEmpty() || rawText.trim().isEmpty()); + } + + public void applyTransform(Graphics2D graphics) { + } + + public void drawContent(Graphics2D graphics) { + } + + /** + * break text into lines, each representing a line of text that fits in the wrapping width + * + * @param graphics + */ + protected void breakText(Graphics2D graphics){ + lines.clear(); + + DrawFactory fact = DrawFactory.getInstance(graphics); + StringBuilder text = new StringBuilder(); + AttributedString at = getAttributedString(graphics, text); + boolean emptyParagraph = ("".equals(text.toString().trim())); + + AttributedCharacterIterator it = at.getIterator(); + LineBreakMeasurer measurer = new LineBreakMeasurer(it, graphics.getFontRenderContext()); + for (;;) { + int startIndex = measurer.getPosition(); + + double wrappingWidth = getWrappingWidth(lines.size() == 0, graphics) + 1; // add a pixel to compensate rounding errors + // shape width can be smaller that the sum of insets (this was proved by a test file) + if(wrappingWidth < 0) wrappingWidth = 1; + + int nextBreak = text.indexOf("\n", startIndex + 1); + if(nextBreak == -1) nextBreak = it.getEndIndex(); + + TextLayout layout = measurer.nextLayout((float)wrappingWidth, nextBreak, true); + if (layout == null) { + // layout can be null if the entire word at the current position + // does not fit within the wrapping width. Try with requireNextWord=false. + layout = measurer.nextLayout((float)wrappingWidth, nextBreak, false); + } + + if(layout == null) { + // exit if can't break any more + break; + } + + int endIndex = measurer.getPosition(); + // skip over new line breaks (we paint 'clear' text runs not starting or ending with \n) + if(endIndex < it.getEndIndex() && text.charAt(endIndex) == '\n'){ + measurer.setPosition(endIndex + 1); + } + + TextAlign hAlign = paragraph.getTextAlign(); + if(hAlign == TextAlign.JUSTIFY || hAlign == TextAlign.JUSTIFY_LOW) { + layout = layout.getJustifiedLayout((float)wrappingWidth); + } + + AttributedString str = (emptyParagraph) + ? null // we will not paint empty paragraphs + : new AttributedString(it, startIndex, endIndex); + DrawTextFragment line = fact.getTextFragment(layout, str); + lines.add(line); + + maxLineHeight = Math.max(maxLineHeight, line.getHeight()); + + if(endIndex == it.getEndIndex()) break; + } + + rawText = text.toString(); + } + + protected DrawTextFragment getBullet(Graphics2D graphics, AttributedCharacterIterator firstLineAttr) { + BulletStyle bulletStyle = paragraph.getBulletStyle(); + if (bulletStyle == null) return null; + + String buCharacter = bulletStyle.getBulletCharacter(); + if (buCharacter == null) return null; + + String buFont = bulletStyle.getBulletFont(); + if (buFont == null) buFont = paragraph.getDefaultFontFamily(); + assert(buFont != null); + + Color buColor = bulletStyle.getBulletFontColor(); + if (buColor == null) buColor = (Color)firstLineAttr.getAttribute(TextAttribute.FOREGROUND); + + float fontSize = (Float)firstLineAttr.getAttribute(TextAttribute.SIZE); + float buSz = (float)bulletStyle.getBulletFontSize(); + if(buSz > 0) fontSize *= buSz* 0.01; + else fontSize = -buSz; + + + AttributedString str = new AttributedString(buCharacter); + str.addAttribute(TextAttribute.FOREGROUND, buColor); + str.addAttribute(TextAttribute.FAMILY, buFont); + str.addAttribute(TextAttribute.SIZE, fontSize); + + TextLayout layout = new TextLayout(str.getIterator(), graphics.getFontRenderContext()); + DrawFactory fact = DrawFactory.getInstance(graphics); + return fact.getTextFragment(layout, str); + } + + protected String getRenderableText(TextRun tr) { + StringBuilder buf = new StringBuilder(); + TextCap cap = tr.getTextCap(); + for (char c : tr.getText().toCharArray()) { + if(c == '\t') { + // TODO: finish support for tabs + buf.append(" "); + continue; + } + + switch (cap) { + case ALL: c = Character.toUpperCase(c); break; + case SMALL: c = Character.toLowerCase(c); break; + case NONE: break; + } + + buf.append(c); + } + + return buf.toString(); + } + + /** + * Returns wrapping width to break lines in this paragraph + * + * @param firstLine whether the first line is breaking + * + * @return wrapping width in points + */ + protected double getWrappingWidth(boolean firstLine, Graphics2D graphics){ + // internal margins for the text box + + double leftInset = insets.left; + double rightInset = insets.right; + + Rectangle2D anchor = DrawShape.getAnchor(graphics, paragraph.getParentShape()); + + double leftMargin = paragraph.getLeftMargin(); + double indent = paragraph.getIndent(); + + double width; + TextShape ts = paragraph.getParentShape(); + if (!ts.getWordWrap()) { + // if wordWrap == false then we return the advance to the right border of the sheet + width = ts.getSheet().getSlideShow().getPageSize().getWidth() - anchor.getX(); + } else { + width = anchor.getWidth() - leftInset - rightInset - leftMargin; + if (firstLine) { + if (bullet != null){ + if (indent > 0) width -= indent; + } else { + if (indent > 0) width -= indent; // first line indentation + else if (indent < 0) { // hanging indentation: the first line start at the left margin + width += leftMargin; + } + } + } + } + + return width; + } + + private static class AttributedStringData { + Attribute attribute; + Object value; + int beginIndex, endIndex; + AttributedStringData(Attribute attribute, Object value, int beginIndex, int endIndex) { + this.attribute = attribute; + this.value = value; + this.beginIndex = beginIndex; + this.endIndex = endIndex; + } + } + + protected AttributedString getAttributedString(Graphics2D graphics, StringBuilder text){ + List attList = new ArrayList(); + if (text == null) text = new StringBuilder(); + + DrawFontManager fontHandler = (DrawFontManager)graphics.getRenderingHint(Drawable.FONT_HANDLER); + + for (TextRun run : paragraph){ + String runText = getRenderableText(run); + // skip empty runs + if (runText.isEmpty()) continue; + + int beginIndex = text.length(); + text.append(runText); + int endIndex = text.length(); + + attList.add(new AttributedStringData(TextAttribute.FOREGROUND, run.getFontColor(), beginIndex, endIndex)); + + // user can pass an custom object to convert fonts + String fontFamily = run.getFontFamily(); + @SuppressWarnings("unchecked") + Map fontMap = (Map)graphics.getRenderingHint(Drawable.FONT_MAP); + if (fontMap != null && fontMap.containsKey(fontFamily)) { + fontFamily = fontMap.get(fontFamily); + } + if(fontHandler != null) { + fontFamily = fontHandler.getRendererableFont(fontFamily, run.getPitchAndFamily()); + } + attList.add(new AttributedStringData(TextAttribute.FAMILY, fontFamily, beginIndex, endIndex)); + + float fontSz = (float)run.getFontSize(); + attList.add(new AttributedStringData(TextAttribute.SIZE, fontSz, beginIndex, endIndex)); + + if(run.isBold()) { + attList.add(new AttributedStringData(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD, beginIndex, endIndex)); + } + if(run.isItalic()) { + attList.add(new AttributedStringData(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE, beginIndex, endIndex)); + } + if(run.isUnderline()) { + attList.add(new AttributedStringData(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON, beginIndex, endIndex)); + attList.add(new AttributedStringData(TextAttribute.INPUT_METHOD_UNDERLINE, TextAttribute.UNDERLINE_LOW_TWO_PIXEL, beginIndex, endIndex)); + } + if(run.isStrikethrough()) { + attList.add(new AttributedStringData(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON, beginIndex, endIndex)); + } + if(run.isSubscript()) { + attList.add(new AttributedStringData(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUB, beginIndex, endIndex)); + } + if(run.isSuperscript()) { + attList.add(new AttributedStringData(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUPER, beginIndex, endIndex)); + } + } + + // ensure that the paragraph contains at least one character + // We need this trick to correctly measure text + if (text.length() == 0) { + float fontSz = (float)paragraph.getDefaultFontSize(); + text.append(" "); + attList.add(new AttributedStringData(TextAttribute.SIZE, fontSz, 0, 1)); + } + + AttributedString string = new AttributedString(text.toString()); + for (AttributedStringData asd : attList) { + string.addAttribute(asd.attribute, asd.value, asd.beginIndex, asd.endIndex); + } + + return string; + } + + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java new file mode 100644 index 000000000..c71c1082d --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java @@ -0,0 +1,140 @@ +package org.apache.poi.sl.draw; + +import java.awt.Graphics2D; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.util.Iterator; + +import org.apache.poi.sl.usermodel.*; + +public class DrawTextShape extends DrawSimpleShape { + + public DrawTextShape(T shape) { + super(shape); + } + + @Override + public void drawContent(Graphics2D graphics) { + Rectangle2D anchor = DrawShape.getAnchor(graphics, shape); + Insets2D insets = shape.getInsets(); + double x = anchor.getX() + insets.left; + double y = anchor.getY(); + + // remember the initial transform + AffineTransform tx = graphics.getTransform(); + + // Transform of text in flipped shapes is special. + // At this point the flip and rotation transform is already applied + // (see XSLFShape#applyTransform ), but we need to restore it to avoid painting "upside down". + // See Bugzilla 54210. + + if(shape.getFlipVertical()){ + graphics.translate(anchor.getX(), anchor.getY() + anchor.getHeight()); + graphics.scale(1, -1); + graphics.translate(-anchor.getX(), -anchor.getY()); + + // text in vertically flipped shapes is rotated by 180 degrees + double centerX = anchor.getX() + anchor.getWidth()/2; + double centerY = anchor.getY() + anchor.getHeight()/2; + graphics.translate(centerX, centerY); + graphics.rotate(Math.toRadians(180)); + graphics.translate(-centerX, -centerY); + } + + // Horizontal flipping applies only to shape outline and not to the text in the shape. + // Applying flip second time restores the original not-flipped transform + if(shape.getFlipHorizontal()){ + graphics.translate(anchor.getX() + anchor.getWidth(), anchor.getY()); + graphics.scale(-1, 1); + graphics.translate(-anchor.getX() , -anchor.getY()); + } + + + // first dry-run to calculate the total height of the text + double textHeight = shape.getTextHeight(); + + switch (shape.getVerticalAlignment()){ + case TOP: + y += insets.top; + break; + case BOTTOM: + y += anchor.getHeight() - textHeight - insets.bottom; + break; + default: + case MIDDLE: + double delta = anchor.getHeight() - textHeight - insets.top - insets.bottom; + y += insets.top + delta/2; + break; + } + + drawParagraphs(graphics, x, y); + + // restore the transform + graphics.setTransform(tx); + } + + /** + * paint the paragraphs starting from top left (x,y) + * + * @return the vertical advance, i.e. the cumulative space occupied by the text + */ + public double drawParagraphs(Graphics2D graphics, double x, double y) { + DrawFactory fact = DrawFactory.getInstance(graphics); + Insets2D shapePadding = shape.getInsets(); + + double y0 = y; + Iterator paragraphs = shape.iterator(); + + boolean isFirstLine = true; + while (paragraphs.hasNext()){ + TextParagraph p = paragraphs.next(); + DrawTextParagraph dp = fact.getDrawable(p); + dp.setInsets(shapePadding); + dp.breakText(graphics); + + if (!isFirstLine) { + // the amount of vertical white space before the paragraph + double spaceBefore = p.getSpaceBefore(); + if(spaceBefore > 0) { + // positive value means percentage spacing of the height of the first line, e.g. + // the higher the first line, the bigger the space before the paragraph + y += spaceBefore*0.01*dp.getFirstLineHeight(); + } else { + // negative value means the absolute spacing in points + y += -spaceBefore; + } + isFirstLine = false; + } + + dp.setPosition(x, y); + dp.draw(graphics); + y += dp.getY(); + + if (paragraphs.hasNext()) { + double spaceAfter = p.getSpaceAfter(); + if(spaceAfter > 0) { + // positive value means percentage spacing of the height of the last line, e.g. + // the higher the last line, the bigger the space after the paragraph + y += spaceAfter*0.01*dp.getLastLineHeight(); + } else { + // negative value means the absolute spacing in points + y += -spaceAfter; + } + } + } + return y - y0; + } + + /** + * Compute the cumulative height occupied by the text + */ + protected double getTextHeight(){ + // dry-run in a 1x1 image and return the vertical advance + BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); + Graphics2D graphics = img.createGraphics(); + return drawParagraphs(graphics, 0, 0); + } + + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/Drawable.java b/src/scratchpad/src/org/apache/poi/sl/draw/Drawable.java new file mode 100644 index 000000000..8789082af --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/Drawable.java @@ -0,0 +1,123 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw; + +import java.awt.Graphics2D; +import java.awt.RenderingHints; + +import org.apache.poi.util.Internal; + + +public interface Drawable { + class DrawableHint extends RenderingHints.Key { + protected DrawableHint(int id) { + super(id); + } + + public boolean isCompatibleValue(Object val) { + return true; + } + } + + /** + * {@link DrawFactory} which will be used to draw objects into this graphics context + */ + DrawableHint DRAW_FACTORY = new DrawableHint(1); + + /** + * Key will be internally used to store affine transformation temporarily within group shapes + */ + @Internal + DrawableHint GROUP_TRANSFORM = new DrawableHint(2); + + /** + * Use a custom image renderer of an instance of {@link ImageRenderer} + */ + DrawableHint IMAGE_RENDERER = new DrawableHint(3); + + /** + * how to render text: + * + * {@link #TEXT_AS_CHARACTERS} (default) means to draw via + * {@link java.awt.Graphics2D#drawString(java.text.AttributedCharacterIterator, float, float)}. + * This mode draws text as characters. Use it if the target graphics writes the actual + * character codes instead of glyph outlines (PDFGraphics2D, SVGGraphics2D, etc.) + * + * {@link #TEXT_AS_SHAPES} means to render via + * {@link java.awt.font.TextLayout#draw(java.awt.Graphics2D, float, float)}. + * This mode draws glyphs as shapes and provides some advanced capabilities such as + * justification and font substitution. Use it if the target graphics is an image. + * + */ + DrawableHint TEXT_RENDERING_MODE = new DrawableHint(4); + + /** + * PathGradientPaint needs the shape to be set. + * It will be achieved through setting it in the rendering hints + */ + DrawableHint GRADIENT_SHAPE = new DrawableHint(5); + + + /** + * Internal key for caching the preset geometries + */ + DrawableHint PRESET_GEOMETRY_CACHE = new DrawableHint(6); + + /** + * draw text via {@link java.awt.Graphics2D#drawString(java.text.AttributedCharacterIterator, float, float)} + */ + int TEXT_AS_CHARACTERS = 1; + + /** + * draw text via {@link java.awt.font.TextLayout#draw(java.awt.Graphics2D, float, float)} + */ + int TEXT_AS_SHAPES = 2; + + /** + * Use this object to resolve unknown / missing fonts when rendering slides + */ + DrawableHint FONT_HANDLER = new DrawableHint(7); + DrawableHint FONT_FALLBACK = new DrawableHint(8); + DrawableHint FONT_MAP = new DrawableHint(9); + + DrawableHint GSAVE = new DrawableHint(10); + DrawableHint GRESTORE = new DrawableHint(11); + + + + /** + * Apply 2-D transforms before drawing this shape. This includes rotation and flipping. + * + * @param graphics the graphics whos transform matrix will be modified + */ + void applyTransform(Graphics2D graphics); + + /** + * Draw this shape into the supplied canvas + * + * @param graphics the graphics to draw into + */ + void draw(Graphics2D graphics); + + /** + * draw any content within this shape (image, text, etc.). + * + * @param graphics the graphics to draw into + */ + void drawContent(Graphics2D graphics); +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/ImageRenderer.java b/src/scratchpad/src/org/apache/poi/sl/draw/ImageRenderer.java new file mode 100644 index 000000000..74ac997ab --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/ImageRenderer.java @@ -0,0 +1,155 @@ +/* + * ==================================================================== + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ==================================================================== + */ +package org.apache.poi.sl.draw; + +import java.awt.*; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.RescaleOp; +import java.io.IOException; +import java.io.InputStream; + +import javax.imageio.ImageIO; + +/** + * For now this class renders only images supported by the javax.imageio.ImageIO + * framework. Subclasses can override this class to support other formats, for + * example, Use Apache batik to render WMF: + * + *
+ * 
+ * public class MyImageRendener extends ImageRendener {
+ *
+ *     public boolean drawImage(Graphics2D graphics,Rectangle2D anchor,Insets clip) {
+ *         // draw image
+ *     }
+ *
+ *     public void loadImage(InputStream data, String contentType) throws IOException {
+ *         if ("image/wmf".equals(contentType)) {
+ *             // use Apache Batik to handle WMF
+ *         } else {
+ *             super.loadImage(data,contentType);
+ *         }
+ *     }
+ * }
+ * 
+ * 
+ * + * and then pass this class to your instance of java.awt.Graphics2D: + * + *
+ * 
+ * graphics.setRenderingHint(Drawable.IMAGE_RENDERER, new MyImageRendener());
+ * 
+ * 
+ */ +public class ImageRenderer { + protected BufferedImage img; + + /** + * Load and buffer the image + * + * @param data the raw image stream + * @param contentType the content type + */ + public void loadImage(InputStream data, String contentType) throws IOException { + img = ImageIO.read(data); + } + + /** + * @return the buffered image + */ + public BufferedImage getImage() { + return img; + } + + /** + * @return the dimension of the buffered image + */ + public Dimension getDimension() { + return (img == null) + ? new Dimension(0,0) + : new Dimension(img.getWidth(),img.getHeight()); + } + + /** + * @param alpha the alpha [0..1] to be added to the image (possibly already containing an alpha channel) + */ + public void setAlpha(double alpha) { + if (img == null) return; + + Dimension dim = getDimension(); + BufferedImage newImg = new BufferedImage((int)dim.getWidth(), (int)dim.getHeight(), BufferedImage.TYPE_INT_ARGB); + Graphics2D g = newImg.createGraphics(); + RescaleOp op = new RescaleOp(new float[]{1.0f, 1.0f, 1.0f, (float)alpha}, new float[]{0,0,0,0}, null); + g.drawImage(img, op, 0, 0); + g.dispose(); + + img = newImg; + } + + + /** + * Render picture data into the supplied graphics + * + * @return true if the picture data was successfully rendered + */ + public boolean drawImage( + Graphics2D graphics, + Rectangle2D anchor) { + return drawImage(graphics, anchor, null); + } + + /** + * Render picture data into the supplied graphics + * + * @return true if the picture data was successfully rendered + */ + public boolean drawImage( + Graphics2D graphics, + Rectangle2D anchor, + Insets clip) { + if (img == null) return false; + + boolean isClipped = true; + if (clip == null) { + isClipped = false; + clip = new Insets(0,0,0,0); + } + + int iw = img.getWidth(); + int ih = img.getHeight(); + + double cw = (100000-clip.left-clip.right) / 100000.0; + double ch = (100000-clip.top-clip.bottom) / 100000.0; + double sx = anchor.getWidth()/(iw*cw); + double sy = anchor.getHeight()/(ih*ch); + double tx = anchor.getX()-(iw*sx*clip.left/100000.0); + double ty = anchor.getY()-(ih*sy*clip.top/100000.0); + AffineTransform at = new AffineTransform(sx, 0, 0, sy, tx, ty) ; + + Shape clipOld = graphics.getClip(); + if (isClipped) graphics.clip(anchor.getBounds2D()); + graphics.drawRenderedImage(img, at); + graphics.setClip(clipOld); + + return true; + } +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAdjPoint2D.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAdjPoint2D.java new file mode 100644 index 000000000..ff07ce7cf --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAdjPoint2D.java @@ -0,0 +1,126 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_AdjPoint2D complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_AdjPoint2D">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="x" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
+ *       <attribute name="y" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_AdjPoint2D", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTAdjPoint2D + implements Locatable +{ + + @XmlAttribute(name = "x", required = true) + protected String x; + @XmlAttribute(name = "y", required = true) + protected String y; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the x property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getX() { + return x; + } + + /** + * Sets the value of the x property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setX(String value) { + this.x = value; + } + + public boolean isSetX() { + return (this.x!= null); + } + + /** + * Gets the value of the y property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getY() { + return y; + } + + /** + * Sets the value of the y property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setY(String value) { + this.y = value; + } + + public boolean isSetY() { + return (this.y!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAdjustHandleList.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAdjustHandleList.java new file mode 100644 index 000000000..ae1482e49 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAdjustHandleList.java @@ -0,0 +1,116 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_AdjustHandleList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_AdjustHandleList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice maxOccurs="unbounded" minOccurs="0">
+ *         <element name="ahXY" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_XYAdjustHandle"/>
+ *         <element name="ahPolar" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_PolarAdjustHandle"/>
+ *       </choice>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_AdjustHandleList", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "ahXYOrAhPolar" +}) +public class CTAdjustHandleList + implements Locatable +{ + + @XmlElements({ + @XmlElement(name = "ahXY", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = CTXYAdjustHandle.class), + @XmlElement(name = "ahPolar", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = CTPolarAdjustHandle.class) + }) + protected List ahXYOrAhPolar; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the ahXYOrAhPolar property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the ahXYOrAhPolar property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAhXYOrAhPolar().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CTXYAdjustHandle } + * {@link CTPolarAdjustHandle } + * + * + */ + public List getAhXYOrAhPolar() { + if (ahXYOrAhPolar == null) { + ahXYOrAhPolar = new ArrayList(); + } + return this.ahXYOrAhPolar; + } + + public boolean isSetAhXYOrAhPolar() { + return ((this.ahXYOrAhPolar!= null)&&(!this.ahXYOrAhPolar.isEmpty())); + } + + public void unsetAhXYOrAhPolar() { + this.ahXYOrAhPolar = null; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAngle.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAngle.java new file mode 100644 index 000000000..77f138790 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAngle.java @@ -0,0 +1,86 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Angle complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Angle">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="val" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Angle" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Angle", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTAngle implements Locatable +{ + + @XmlAttribute(name = "val", required = true) + protected int val; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the val property. + * + */ + public int getVal() { + return val; + } + + /** + * Sets the value of the val property. + * + */ + public void setVal(int value) { + this.val = value; + } + + public boolean isSetVal() { + return true; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTColor.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTColor.java new file mode 100644 index 000000000..c03c7319d --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTColor.java @@ -0,0 +1,254 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Color complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Color">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <group ref="{http://schemas.openxmlformats.org/drawingml/2006/main}EG_ColorChoice"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Color", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "scrgbClr", + "srgbClr", + "hslClr", + "sysClr", + "schemeClr", + "prstClr" +}) +public class CTColor + implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTScRgbColor scrgbClr; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTSRgbColor srgbClr; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTHslColor hslClr; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTSystemColor sysClr; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTSchemeColor schemeClr; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTPresetColor prstClr; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the scrgbClr property. + * + * @return + * possible object is + * {@link CTScRgbColor } + * + */ + public CTScRgbColor getScrgbClr() { + return scrgbClr; + } + + /** + * Sets the value of the scrgbClr property. + * + * @param value + * allowed object is + * {@link CTScRgbColor } + * + */ + public void setScrgbClr(CTScRgbColor value) { + this.scrgbClr = value; + } + + public boolean isSetScrgbClr() { + return (this.scrgbClr!= null); + } + + /** + * Gets the value of the srgbClr property. + * + * @return + * possible object is + * {@link CTSRgbColor } + * + */ + public CTSRgbColor getSrgbClr() { + return srgbClr; + } + + /** + * Sets the value of the srgbClr property. + * + * @param value + * allowed object is + * {@link CTSRgbColor } + * + */ + public void setSrgbClr(CTSRgbColor value) { + this.srgbClr = value; + } + + public boolean isSetSrgbClr() { + return (this.srgbClr!= null); + } + + /** + * Gets the value of the hslClr property. + * + * @return + * possible object is + * {@link CTHslColor } + * + */ + public CTHslColor getHslClr() { + return hslClr; + } + + /** + * Sets the value of the hslClr property. + * + * @param value + * allowed object is + * {@link CTHslColor } + * + */ + public void setHslClr(CTHslColor value) { + this.hslClr = value; + } + + public boolean isSetHslClr() { + return (this.hslClr!= null); + } + + /** + * Gets the value of the sysClr property. + * + * @return + * possible object is + * {@link CTSystemColor } + * + */ + public CTSystemColor getSysClr() { + return sysClr; + } + + /** + * Sets the value of the sysClr property. + * + * @param value + * allowed object is + * {@link CTSystemColor } + * + */ + public void setSysClr(CTSystemColor value) { + this.sysClr = value; + } + + public boolean isSetSysClr() { + return (this.sysClr!= null); + } + + /** + * Gets the value of the schemeClr property. + * + * @return + * possible object is + * {@link CTSchemeColor } + * + */ + public CTSchemeColor getSchemeClr() { + return schemeClr; + } + + /** + * Sets the value of the schemeClr property. + * + * @param value + * allowed object is + * {@link CTSchemeColor } + * + */ + public void setSchemeClr(CTSchemeColor value) { + this.schemeClr = value; + } + + public boolean isSetSchemeClr() { + return (this.schemeClr!= null); + } + + /** + * Gets the value of the prstClr property. + * + * @return + * possible object is + * {@link CTPresetColor } + * + */ + public CTPresetColor getPrstClr() { + return prstClr; + } + + /** + * Sets the value of the prstClr property. + * + * @param value + * allowed object is + * {@link CTPresetColor } + * + */ + public void setPrstClr(CTPresetColor value) { + this.prstClr = value; + } + + public boolean isSetPrstClr() { + return (this.prstClr!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTColorMRU.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTColorMRU.java new file mode 100644 index 000000000..2439cc1ba --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTColorMRU.java @@ -0,0 +1,123 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_ColorMRU complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_ColorMRU">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <group ref="{http://schemas.openxmlformats.org/drawingml/2006/main}EG_ColorChoice" maxOccurs="10" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_ColorMRU", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "egColorChoice" +}) +public class CTColorMRU + implements Locatable +{ + + @XmlElements({ + @XmlElement(name = "scrgbClr", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = CTScRgbColor.class), + @XmlElement(name = "srgbClr", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = CTSRgbColor.class), + @XmlElement(name = "hslClr", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = CTHslColor.class), + @XmlElement(name = "sysClr", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = CTSystemColor.class), + @XmlElement(name = "schemeClr", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = CTSchemeColor.class), + @XmlElement(name = "prstClr", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = CTPresetColor.class) + }) + protected List egColorChoice; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the egColorChoice property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the egColorChoice property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getEGColorChoice().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CTScRgbColor } + * {@link CTSRgbColor } + * {@link CTHslColor } + * {@link CTSystemColor } + * {@link CTSchemeColor } + * {@link CTPresetColor } + * + * + */ + public List getEGColorChoice() { + if (egColorChoice == null) { + egColorChoice = new ArrayList(); + } + return this.egColorChoice; + } + + public boolean isSetEGColorChoice() { + return ((this.egColorChoice!= null)&&(!this.egColorChoice.isEmpty())); + } + + public void unsetEGColorChoice() { + this.egColorChoice = null; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTComplementTransform.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTComplementTransform.java new file mode 100644 index 000000000..491971549 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTComplementTransform.java @@ -0,0 +1,62 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_ComplementTransform complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_ComplementTransform">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_ComplementTransform", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTComplementTransform implements Locatable +{ + + @XmlLocation + @XmlTransient + protected Locator locator; + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnection.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnection.java new file mode 100644 index 000000000..b2c88ae45 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnection.java @@ -0,0 +1,112 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Connection complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Connection">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="id" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_DrawingElementId" />
+ *       <attribute name="idx" use="required" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Connection", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTConnection + implements Locatable +{ + + @XmlAttribute(name = "id", required = true) + protected long id; + @XmlAttribute(name = "idx", required = true) + @XmlSchemaType(name = "unsignedInt") + protected long idx; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the id property. + * + */ + public long getId() { + return id; + } + + /** + * Sets the value of the id property. + * + */ + public void setId(long value) { + this.id = value; + } + + public boolean isSetId() { + return true; + } + + /** + * Gets the value of the idx property. + * + */ + public long getIdx() { + return idx; + } + + /** + * Sets the value of the idx property. + * + */ + public void setIdx(long value) { + this.idx = value; + } + + public boolean isSetIdx() { + return true; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnectionSite.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnectionSite.java new file mode 100644 index 000000000..c6189d112 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnectionSite.java @@ -0,0 +1,131 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_ConnectionSite complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_ConnectionSite">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="pos" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AdjPoint2D"/>
+ *       </sequence>
+ *       <attribute name="ang" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjAngle" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_ConnectionSite", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "pos" +}) +public class CTConnectionSite + implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", required = true) + protected CTAdjPoint2D pos; + @XmlAttribute(name = "ang", required = true) + protected String ang; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the pos property. + * + * @return + * possible object is + * {@link CTAdjPoint2D } + * + */ + public CTAdjPoint2D getPos() { + return pos; + } + + /** + * Sets the value of the pos property. + * + * @param value + * allowed object is + * {@link CTAdjPoint2D } + * + */ + public void setPos(CTAdjPoint2D value) { + this.pos = value; + } + + public boolean isSetPos() { + return (this.pos!= null); + } + + /** + * Gets the value of the ang property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getAng() { + return ang; + } + + /** + * Sets the value of the ang property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAng(String value) { + this.ang = value; + } + + public boolean isSetAng() { + return (this.ang!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnectionSiteList.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnectionSiteList.java new file mode 100644 index 000000000..49e812399 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnectionSiteList.java @@ -0,0 +1,110 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_ConnectionSiteList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_ConnectionSiteList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="cxn" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_ConnectionSite" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_ConnectionSiteList", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "cxn" +}) +public class CTConnectionSiteList + implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected List cxn; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the cxn property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the cxn property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getCxn().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CTConnectionSite } + * + * + */ + public List getCxn() { + if (cxn == null) { + cxn = new ArrayList(); + } + return this.cxn; + } + + public boolean isSetCxn() { + return ((this.cxn!= null)&&(!this.cxn.isEmpty())); + } + + public void unsetCxn() { + this.cxn = null; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTCustomGeometry2D.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTCustomGeometry2D.java new file mode 100644 index 000000000..4e43d915c --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTCustomGeometry2D.java @@ -0,0 +1,259 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_CustomGeometry2D complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_CustomGeometry2D">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="avLst" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_GeomGuideList" minOccurs="0"/>
+ *         <element name="gdLst" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_GeomGuideList" minOccurs="0"/>
+ *         <element name="ahLst" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AdjustHandleList" minOccurs="0"/>
+ *         <element name="cxnLst" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_ConnectionSiteList" minOccurs="0"/>
+ *         <element name="rect" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_GeomRect" minOccurs="0"/>
+ *         <element name="pathLst" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_Path2DList"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_CustomGeometry2D", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "avLst", + "gdLst", + "ahLst", + "cxnLst", + "rect", + "pathLst" +}) +public class CTCustomGeometry2D + implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTGeomGuideList avLst; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTGeomGuideList gdLst; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTAdjustHandleList ahLst; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTConnectionSiteList cxnLst; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTGeomRect rect; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", required = true) + protected CTPath2DList pathLst; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the avLst property. + * + * @return + * possible object is + * {@link CTGeomGuideList } + * + */ + public CTGeomGuideList getAvLst() { + return avLst; + } + + /** + * Sets the value of the avLst property. + * + * @param value + * allowed object is + * {@link CTGeomGuideList } + * + */ + public void setAvLst(CTGeomGuideList value) { + this.avLst = value; + } + + public boolean isSetAvLst() { + return (this.avLst!= null); + } + + /** + * Gets the value of the gdLst property. + * + * @return + * possible object is + * {@link CTGeomGuideList } + * + */ + public CTGeomGuideList getGdLst() { + return gdLst; + } + + /** + * Sets the value of the gdLst property. + * + * @param value + * allowed object is + * {@link CTGeomGuideList } + * + */ + public void setGdLst(CTGeomGuideList value) { + this.gdLst = value; + } + + public boolean isSetGdLst() { + return (this.gdLst!= null); + } + + /** + * Gets the value of the ahLst property. + * + * @return + * possible object is + * {@link CTAdjustHandleList } + * + */ + public CTAdjustHandleList getAhLst() { + return ahLst; + } + + /** + * Sets the value of the ahLst property. + * + * @param value + * allowed object is + * {@link CTAdjustHandleList } + * + */ + public void setAhLst(CTAdjustHandleList value) { + this.ahLst = value; + } + + public boolean isSetAhLst() { + return (this.ahLst!= null); + } + + /** + * Gets the value of the cxnLst property. + * + * @return + * possible object is + * {@link CTConnectionSiteList } + * + */ + public CTConnectionSiteList getCxnLst() { + return cxnLst; + } + + /** + * Sets the value of the cxnLst property. + * + * @param value + * allowed object is + * {@link CTConnectionSiteList } + * + */ + public void setCxnLst(CTConnectionSiteList value) { + this.cxnLst = value; + } + + public boolean isSetCxnLst() { + return (this.cxnLst!= null); + } + + /** + * Gets the value of the rect property. + * + * @return + * possible object is + * {@link CTGeomRect } + * + */ + public CTGeomRect getRect() { + return rect; + } + + /** + * Sets the value of the rect property. + * + * @param value + * allowed object is + * {@link CTGeomRect } + * + */ + public void setRect(CTGeomRect value) { + this.rect = value; + } + + public boolean isSetRect() { + return (this.rect!= null); + } + + /** + * Gets the value of the pathLst property. + * + * @return + * possible object is + * {@link CTPath2DList } + * + */ + public CTPath2DList getPathLst() { + return pathLst; + } + + /** + * Sets the value of the pathLst property. + * + * @param value + * allowed object is + * {@link CTPath2DList } + * + */ + public void setPathLst(CTPath2DList value) { + this.pathLst = value; + } + + public boolean isSetPathLst() { + return (this.pathLst!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTEmbeddedWAVAudioFile.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTEmbeddedWAVAudioFile.java new file mode 100644 index 000000000..aaef46da9 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTEmbeddedWAVAudioFile.java @@ -0,0 +1,169 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_EmbeddedWAVAudioFile complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_EmbeddedWAVAudioFile">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute ref="{http://schemas.openxmlformats.org/officeDocument/2006/relationships}embed use="required""/>
+ *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
+ *       <attribute name="builtIn" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_EmbeddedWAVAudioFile", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTEmbeddedWAVAudioFile + implements Locatable +{ + + @XmlAttribute(name = "embed", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/relationships", required = true) + protected String embed; + @XmlAttribute(name = "name") + protected String name; + @XmlAttribute(name = "builtIn") + protected Boolean builtIn; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Embedded Audio File Relationship ID + * + * @return + * possible object is + * {@link String } + * + */ + public String getEmbed() { + return embed; + } + + /** + * Sets the value of the embed property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setEmbed(String value) { + this.embed = value; + } + + public boolean isSetEmbed() { + return (this.embed!= null); + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + if (name == null) { + return ""; + } else { + return name; + } + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + public boolean isSetName() { + return (this.name!= null); + } + + /** + * Gets the value of the builtIn property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isBuiltIn() { + if (builtIn == null) { + return false; + } else { + return builtIn; + } + } + + /** + * Sets the value of the builtIn property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setBuiltIn(boolean value) { + this.builtIn = value; + } + + public boolean isSetBuiltIn() { + return (this.builtIn!= null); + } + + public void unsetBuiltIn() { + this.builtIn = null; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTFixedPercentage.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTFixedPercentage.java new file mode 100644 index 000000000..14bcd3776 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTFixedPercentage.java @@ -0,0 +1,86 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_FixedPercentage complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_FixedPercentage">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="val" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_FixedPercentage" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_FixedPercentage", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTFixedPercentage implements Locatable +{ + + @XmlAttribute(name = "val", required = true) + protected int val; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the val property. + * + */ + public int getVal() { + return val; + } + + /** + * Sets the value of the val property. + * + */ + public void setVal(int value) { + this.val = value; + } + + public boolean isSetVal() { + return true; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGammaTransform.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGammaTransform.java new file mode 100644 index 000000000..84e7f3b0e --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGammaTransform.java @@ -0,0 +1,62 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_GammaTransform complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_GammaTransform">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_GammaTransform", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTGammaTransform implements Locatable +{ + + @XmlLocation + @XmlTransient + protected Locator locator; + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomGuide.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomGuide.java new file mode 100644 index 000000000..e0723d97a --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomGuide.java @@ -0,0 +1,129 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_GeomGuide complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_GeomGuide">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="name" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_GeomGuideName" />
+ *       <attribute name="fmla" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_GeomGuideFormula" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_GeomGuide", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTGeomGuide + implements Locatable +{ + + @XmlAttribute(name = "name", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String name; + @XmlAttribute(name = "fmla", required = true) + protected String fmla; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + public boolean isSetName() { + return (this.name!= null); + } + + /** + * Gets the value of the fmla property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getFmla() { + return fmla; + } + + /** + * Sets the value of the fmla property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFmla(String value) { + this.fmla = value; + } + + public boolean isSetFmla() { + return (this.fmla!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomGuideList.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomGuideList.java new file mode 100644 index 000000000..d5203d849 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomGuideList.java @@ -0,0 +1,110 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_GeomGuideList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_GeomGuideList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="gd" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_GeomGuide" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_GeomGuideList", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "gd" +}) +public class CTGeomGuideList + implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected List gd; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the gd property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the gd property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getGd().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CTGeomGuide } + * + * + */ + public List getGd() { + if (gd == null) { + gd = new ArrayList(); + } + return this.gd; + } + + public boolean isSetGd() { + return ((this.gd!= null)&&(!this.gd.isEmpty())); + } + + public void unsetGd() { + this.gd = null; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomRect.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomRect.java new file mode 100644 index 000000000..f0383f81f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomRect.java @@ -0,0 +1,188 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_GeomRect complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_GeomRect">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="l" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
+ *       <attribute name="t" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
+ *       <attribute name="r" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
+ *       <attribute name="b" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_GeomRect", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTGeomRect + implements Locatable +{ + + @XmlAttribute(name = "l", required = true) + protected String l; + @XmlAttribute(name = "t", required = true) + protected String t; + @XmlAttribute(name = "r", required = true) + protected String r; + @XmlAttribute(name = "b", required = true) + protected String b; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the l property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getL() { + return l; + } + + /** + * Sets the value of the l property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setL(String value) { + this.l = value; + } + + public boolean isSetL() { + return (this.l!= null); + } + + /** + * Gets the value of the t property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getT() { + return t; + } + + /** + * Sets the value of the t property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setT(String value) { + this.t = value; + } + + public boolean isSetT() { + return (this.t!= null); + } + + /** + * Gets the value of the r property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getR() { + return r; + } + + /** + * Sets the value of the r property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setR(String value) { + this.r = value; + } + + public boolean isSetR() { + return (this.r!= null); + } + + /** + * Gets the value of the b property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getB() { + return b; + } + + /** + * Sets the value of the b property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setB(String value) { + this.b = value; + } + + public boolean isSetB() { + return (this.b!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGrayscaleTransform.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGrayscaleTransform.java new file mode 100644 index 000000000..ef5ad887f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGrayscaleTransform.java @@ -0,0 +1,62 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_GrayscaleTransform complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_GrayscaleTransform">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_GrayscaleTransform", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTGrayscaleTransform implements Locatable +{ + + @XmlLocation + @XmlTransient + protected Locator locator; + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGroupTransform2D.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGroupTransform2D.java new file mode 100644 index 000000000..15386a230 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGroupTransform2D.java @@ -0,0 +1,313 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_GroupTransform2D complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_GroupTransform2D">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="off" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_Point2D" minOccurs="0"/>
+ *         <element name="ext" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_PositiveSize2D" minOccurs="0"/>
+ *         <element name="chOff" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_Point2D" minOccurs="0"/>
+ *         <element name="chExt" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_PositiveSize2D" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="rot" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Angle" default="0" />
+ *       <attribute name="flipH" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *       <attribute name="flipV" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_GroupTransform2D", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "off", + "ext", + "chOff", + "chExt" +}) +public class CTGroupTransform2D + implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTPoint2D off; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTPositiveSize2D ext; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTPoint2D chOff; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTPositiveSize2D chExt; + @XmlAttribute(name = "rot") + protected Integer rot; + @XmlAttribute(name = "flipH") + protected Boolean flipH; + @XmlAttribute(name = "flipV") + protected Boolean flipV; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the off property. + * + * @return + * possible object is + * {@link CTPoint2D } + * + */ + public CTPoint2D getOff() { + return off; + } + + /** + * Sets the value of the off property. + * + * @param value + * allowed object is + * {@link CTPoint2D } + * + */ + public void setOff(CTPoint2D value) { + this.off = value; + } + + public boolean isSetOff() { + return (this.off!= null); + } + + /** + * Gets the value of the ext property. + * + * @return + * possible object is + * {@link CTPositiveSize2D } + * + */ + public CTPositiveSize2D getExt() { + return ext; + } + + /** + * Sets the value of the ext property. + * + * @param value + * allowed object is + * {@link CTPositiveSize2D } + * + */ + public void setExt(CTPositiveSize2D value) { + this.ext = value; + } + + public boolean isSetExt() { + return (this.ext!= null); + } + + /** + * Gets the value of the chOff property. + * + * @return + * possible object is + * {@link CTPoint2D } + * + */ + public CTPoint2D getChOff() { + return chOff; + } + + /** + * Sets the value of the chOff property. + * + * @param value + * allowed object is + * {@link CTPoint2D } + * + */ + public void setChOff(CTPoint2D value) { + this.chOff = value; + } + + public boolean isSetChOff() { + return (this.chOff!= null); + } + + /** + * Gets the value of the chExt property. + * + * @return + * possible object is + * {@link CTPositiveSize2D } + * + */ + public CTPositiveSize2D getChExt() { + return chExt; + } + + /** + * Sets the value of the chExt property. + * + * @param value + * allowed object is + * {@link CTPositiveSize2D } + * + */ + public void setChExt(CTPositiveSize2D value) { + this.chExt = value; + } + + public boolean isSetChExt() { + return (this.chExt!= null); + } + + /** + * Gets the value of the rot property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public int getRot() { + if (rot == null) { + return 0; + } else { + return rot; + } + } + + /** + * Sets the value of the rot property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setRot(int value) { + this.rot = value; + } + + public boolean isSetRot() { + return (this.rot!= null); + } + + public void unsetRot() { + this.rot = null; + } + + /** + * Gets the value of the flipH property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isFlipH() { + if (flipH == null) { + return false; + } else { + return flipH; + } + } + + /** + * Sets the value of the flipH property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setFlipH(boolean value) { + this.flipH = value; + } + + public boolean isSetFlipH() { + return (this.flipH!= null); + } + + public void unsetFlipH() { + this.flipH = null; + } + + /** + * Gets the value of the flipV property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isFlipV() { + if (flipV == null) { + return false; + } else { + return flipV; + } + } + + /** + * Sets the value of the flipV property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setFlipV(boolean value) { + this.flipV = value; + } + + public boolean isSetFlipV() { + return (this.flipV!= null); + } + + public void unsetFlipV() { + this.flipV = null; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTHslColor.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTHslColor.java new file mode 100644 index 000000000..534a9b370 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTHslColor.java @@ -0,0 +1,237 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_HslColor complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_HslColor">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <group ref="{http://schemas.openxmlformats.org/drawingml/2006/main}EG_ColorTransform" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="hue" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_PositiveFixedAngle" />
+ *       <attribute name="sat" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Percentage" />
+ *       <attribute name="lum" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Percentage" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_HslColor", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "egColorTransform" +}) +public class CTHslColor implements Locatable +{ + + @XmlElementRefs({ + @XmlElementRef(name = "hueOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blueOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "gamma", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "green", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lumOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "red", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "redMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "gray", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "shade", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alphaOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "satOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "greenMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "inv", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "satMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "redOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "sat", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lum", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "invGamma", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hueMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "greenOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alpha", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alphaMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "comp", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hue", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lumMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "tint", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blueMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blue", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false) + }) + protected List> egColorTransform; + @XmlAttribute(name = "hue", required = true) + protected int hue; + @XmlAttribute(name = "sat", required = true) + protected int sat; + @XmlAttribute(name = "lum", required = true) + protected int lum; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the egColorTransform property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the egColorTransform property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getEGColorTransform().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link CTAngle }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTGammaTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTGrayscaleTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTInverseTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTInverseGammaTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTComplementTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedAngle }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * + * + */ + public List> getEGColorTransform() { + if (egColorTransform == null) { + egColorTransform = new ArrayList>(); + } + return this.egColorTransform; + } + + public boolean isSetEGColorTransform() { + return ((this.egColorTransform!= null)&&(!this.egColorTransform.isEmpty())); + } + + public void unsetEGColorTransform() { + this.egColorTransform = null; + } + + /** + * Gets the value of the hue property. + * + */ + public int getHue() { + return hue; + } + + /** + * Sets the value of the hue property. + * + */ + public void setHue(int value) { + this.hue = value; + } + + public boolean isSetHue() { + return true; + } + + /** + * Gets the value of the sat property. + * + */ + public int getSat() { + return sat; + } + + /** + * Sets the value of the sat property. + * + */ + public void setSat(int value) { + this.sat = value; + } + + public boolean isSetSat() { + return true; + } + + /** + * Gets the value of the lum property. + * + */ + public int getLum() { + return lum; + } + + /** + * Sets the value of the lum property. + * + */ + public void setLum(int value) { + this.lum = value; + } + + public boolean isSetLum() { + return true; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTHyperlink.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTHyperlink.java new file mode 100644 index 000000000..571ff8b64 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTHyperlink.java @@ -0,0 +1,420 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Hyperlink complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Hyperlink">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="snd" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_EmbeddedWAVAudioFile" minOccurs="0"/>
+ *         <element name="extLst" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_OfficeArtExtensionList" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute ref="{http://schemas.openxmlformats.org/officeDocument/2006/relationships}id"/>
+ *       <attribute name="invalidUrl" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
+ *       <attribute name="action" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
+ *       <attribute name="tgtFrame" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
+ *       <attribute name="tooltip" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
+ *       <attribute name="history" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *       <attribute name="highlightClick" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *       <attribute name="endSnd" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Hyperlink", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "snd", + "extLst" +}) +public class CTHyperlink + implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTEmbeddedWAVAudioFile snd; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTOfficeArtExtensionList extLst; + @XmlAttribute(name = "id", namespace = "http://schemas.openxmlformats.org/officeDocument/2006/relationships") + protected String id; + @XmlAttribute(name = "invalidUrl") + protected String invalidUrl; + @XmlAttribute(name = "action") + protected String action; + @XmlAttribute(name = "tgtFrame") + protected String tgtFrame; + @XmlAttribute(name = "tooltip") + protected String tooltip; + @XmlAttribute(name = "history") + protected Boolean history; + @XmlAttribute(name = "highlightClick") + protected Boolean highlightClick; + @XmlAttribute(name = "endSnd") + protected Boolean endSnd; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the snd property. + * + * @return + * possible object is + * {@link CTEmbeddedWAVAudioFile } + * + */ + public CTEmbeddedWAVAudioFile getSnd() { + return snd; + } + + /** + * Sets the value of the snd property. + * + * @param value + * allowed object is + * {@link CTEmbeddedWAVAudioFile } + * + */ + public void setSnd(CTEmbeddedWAVAudioFile value) { + this.snd = value; + } + + public boolean isSetSnd() { + return (this.snd!= null); + } + + /** + * Gets the value of the extLst property. + * + * @return + * possible object is + * {@link CTOfficeArtExtensionList } + * + */ + public CTOfficeArtExtensionList getExtLst() { + return extLst; + } + + /** + * Sets the value of the extLst property. + * + * @param value + * allowed object is + * {@link CTOfficeArtExtensionList } + * + */ + public void setExtLst(CTOfficeArtExtensionList value) { + this.extLst = value; + } + + public boolean isSetExtLst() { + return (this.extLst!= null); + } + + /** + * Drawing Object Hyperlink Target + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + public boolean isSetId() { + return (this.id!= null); + } + + /** + * Gets the value of the invalidUrl property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getInvalidUrl() { + if (invalidUrl == null) { + return ""; + } else { + return invalidUrl; + } + } + + /** + * Sets the value of the invalidUrl property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setInvalidUrl(String value) { + this.invalidUrl = value; + } + + public boolean isSetInvalidUrl() { + return (this.invalidUrl!= null); + } + + /** + * Gets the value of the action property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getAction() { + if (action == null) { + return ""; + } else { + return action; + } + } + + /** + * Sets the value of the action property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAction(String value) { + this.action = value; + } + + public boolean isSetAction() { + return (this.action!= null); + } + + /** + * Gets the value of the tgtFrame property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTgtFrame() { + if (tgtFrame == null) { + return ""; + } else { + return tgtFrame; + } + } + + /** + * Sets the value of the tgtFrame property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTgtFrame(String value) { + this.tgtFrame = value; + } + + public boolean isSetTgtFrame() { + return (this.tgtFrame!= null); + } + + /** + * Gets the value of the tooltip property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTooltip() { + if (tooltip == null) { + return ""; + } else { + return tooltip; + } + } + + /** + * Sets the value of the tooltip property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTooltip(String value) { + this.tooltip = value; + } + + public boolean isSetTooltip() { + return (this.tooltip!= null); + } + + /** + * Gets the value of the history property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isHistory() { + if (history == null) { + return true; + } else { + return history; + } + } + + /** + * Sets the value of the history property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setHistory(boolean value) { + this.history = value; + } + + public boolean isSetHistory() { + return (this.history!= null); + } + + public void unsetHistory() { + this.history = null; + } + + /** + * Gets the value of the highlightClick property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isHighlightClick() { + if (highlightClick == null) { + return false; + } else { + return highlightClick; + } + } + + /** + * Sets the value of the highlightClick property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setHighlightClick(boolean value) { + this.highlightClick = value; + } + + public boolean isSetHighlightClick() { + return (this.highlightClick!= null); + } + + public void unsetHighlightClick() { + this.highlightClick = null; + } + + /** + * Gets the value of the endSnd property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isEndSnd() { + if (endSnd == null) { + return false; + } else { + return endSnd; + } + } + + /** + * Sets the value of the endSnd property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setEndSnd(boolean value) { + this.endSnd = value; + } + + public boolean isSetEndSnd() { + return (this.endSnd!= null); + } + + public void unsetEndSnd() { + this.endSnd = null; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTInverseGammaTransform.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTInverseGammaTransform.java new file mode 100644 index 000000000..091d6e231 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTInverseGammaTransform.java @@ -0,0 +1,62 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_InverseGammaTransform complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_InverseGammaTransform">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_InverseGammaTransform", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTInverseGammaTransform implements Locatable +{ + + @XmlLocation + @XmlTransient + protected Locator locator; + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTInverseTransform.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTInverseTransform.java new file mode 100644 index 000000000..e1de7b8b5 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTInverseTransform.java @@ -0,0 +1,62 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_InverseTransform complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_InverseTransform">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_InverseTransform", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTInverseTransform implements Locatable +{ + + @XmlLocation + @XmlTransient + protected Locator locator; + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTOfficeArtExtension.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTOfficeArtExtension.java new file mode 100644 index 000000000..db1831fdf --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTOfficeArtExtension.java @@ -0,0 +1,139 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.w3c.dom.Element; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_OfficeArtExtension complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_OfficeArtExtension">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <any processContents='lax'/>
+ *       </sequence>
+ *       <attribute name="uri" type="{http://www.w3.org/2001/XMLSchema}token" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_OfficeArtExtension", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "any" +}) +public class CTOfficeArtExtension + implements Locatable +{ + + @XmlAnyElement(lax = true) + protected Object any; + @XmlAttribute(name = "uri") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "token") + protected String uri; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the any property. + * + * @return + * possible object is + * {@link Object } + * {@link Element } + * + */ + public Object getAny() { + return any; + } + + /** + * Sets the value of the any property. + * + * @param value + * allowed object is + * {@link Object } + * {@link Element } + * + */ + public void setAny(Object value) { + this.any = value; + } + + public boolean isSetAny() { + return (this.any!= null); + } + + /** + * Gets the value of the uri property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getUri() { + return uri; + } + + /** + * Sets the value of the uri property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUri(String value) { + this.uri = value; + } + + public boolean isSetUri() { + return (this.uri!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTOfficeArtExtensionList.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTOfficeArtExtensionList.java new file mode 100644 index 000000000..fc806911f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTOfficeArtExtensionList.java @@ -0,0 +1,110 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_OfficeArtExtensionList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_OfficeArtExtensionList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <group ref="{http://schemas.openxmlformats.org/drawingml/2006/main}EG_OfficeArtExtensionList"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_OfficeArtExtensionList", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "ext" +}) +public class CTOfficeArtExtensionList + implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected List ext; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the ext property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the ext property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getExt().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CTOfficeArtExtension } + * + * + */ + public List getExt() { + if (ext == null) { + ext = new ArrayList(); + } + return this.ext; + } + + public boolean isSetExt() { + return ((this.ext!= null)&&(!this.ext.isEmpty())); + } + + public void unsetExt() { + this.ext = null; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2D.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2D.java new file mode 100644 index 000000000..bcba3c8c8 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2D.java @@ -0,0 +1,320 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Path2D complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Path2D">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice maxOccurs="unbounded" minOccurs="0">
+ *         <element name="close" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_Path2DClose"/>
+ *         <element name="moveTo" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_Path2DMoveTo"/>
+ *         <element name="lnTo" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_Path2DLineTo"/>
+ *         <element name="arcTo" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_Path2DArcTo"/>
+ *         <element name="quadBezTo" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_Path2DQuadBezierTo"/>
+ *         <element name="cubicBezTo" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_Path2DCubicBezierTo"/>
+ *       </choice>
+ *       <attribute name="w" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_PositiveCoordinate" default="0" />
+ *       <attribute name="h" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_PositiveCoordinate" default="0" />
+ *       <attribute name="fill" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_PathFillMode" default="norm" />
+ *       <attribute name="stroke" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *       <attribute name="extrusionOk" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Path2D", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "closeOrMoveToOrLnTo" +}) +public class CTPath2D + implements Locatable +{ + + @XmlElements({ + @XmlElement(name = "close", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = CTPath2DClose.class), + @XmlElement(name = "moveTo", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = CTPath2DMoveTo.class), + @XmlElement(name = "lnTo", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = CTPath2DLineTo.class), + @XmlElement(name = "arcTo", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = CTPath2DArcTo.class), + @XmlElement(name = "quadBezTo", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = CTPath2DQuadBezierTo.class), + @XmlElement(name = "cubicBezTo", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = CTPath2DCubicBezierTo.class) + }) + protected List closeOrMoveToOrLnTo; + @XmlAttribute(name = "w") + protected Long w; + @XmlAttribute(name = "h") + protected Long h; + @XmlAttribute(name = "fill") + protected STPathFillMode fill; + @XmlAttribute(name = "stroke") + protected Boolean stroke; + @XmlAttribute(name = "extrusionOk") + protected Boolean extrusionOk; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the closeOrMoveToOrLnTo property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the closeOrMoveToOrLnTo property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getCloseOrMoveToOrLnTo().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CTPath2DClose } + * {@link CTPath2DMoveTo } + * {@link CTPath2DLineTo } + * {@link CTPath2DArcTo } + * {@link CTPath2DQuadBezierTo } + * {@link CTPath2DCubicBezierTo } + * + * + */ + public List getCloseOrMoveToOrLnTo() { + if (closeOrMoveToOrLnTo == null) { + closeOrMoveToOrLnTo = new ArrayList(); + } + return this.closeOrMoveToOrLnTo; + } + + public boolean isSetCloseOrMoveToOrLnTo() { + return ((this.closeOrMoveToOrLnTo!= null)&&(!this.closeOrMoveToOrLnTo.isEmpty())); + } + + public void unsetCloseOrMoveToOrLnTo() { + this.closeOrMoveToOrLnTo = null; + } + + /** + * Gets the value of the w property. + * + * @return + * possible object is + * {@link Long } + * + */ + public long getW() { + if (w == null) { + return 0L; + } else { + return w; + } + } + + /** + * Sets the value of the w property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setW(long value) { + this.w = value; + } + + public boolean isSetW() { + return (this.w!= null); + } + + public void unsetW() { + this.w = null; + } + + /** + * Gets the value of the h property. + * + * @return + * possible object is + * {@link Long } + * + */ + public long getH() { + if (h == null) { + return 0L; + } else { + return h; + } + } + + /** + * Sets the value of the h property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setH(long value) { + this.h = value; + } + + public boolean isSetH() { + return (this.h!= null); + } + + public void unsetH() { + this.h = null; + } + + /** + * Gets the value of the fill property. + * + * @return + * possible object is + * {@link STPathFillMode } + * + */ + public STPathFillMode getFill() { + if (fill == null) { + return STPathFillMode.NORM; + } else { + return fill; + } + } + + /** + * Sets the value of the fill property. + * + * @param value + * allowed object is + * {@link STPathFillMode } + * + */ + public void setFill(STPathFillMode value) { + this.fill = value; + } + + public boolean isSetFill() { + return (this.fill!= null); + } + + /** + * Gets the value of the stroke property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isStroke() { + if (stroke == null) { + return true; + } else { + return stroke; + } + } + + /** + * Sets the value of the stroke property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setStroke(boolean value) { + this.stroke = value; + } + + public boolean isSetStroke() { + return (this.stroke!= null); + } + + public void unsetStroke() { + this.stroke = null; + } + + /** + * Gets the value of the extrusionOk property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isExtrusionOk() { + if (extrusionOk == null) { + return true; + } else { + return extrusionOk; + } + } + + /** + * Sets the value of the extrusionOk property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setExtrusionOk(boolean value) { + this.extrusionOk = value; + } + + public boolean isSetExtrusionOk() { + return (this.extrusionOk!= null); + } + + public void unsetExtrusionOk() { + this.extrusionOk = null; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DArcTo.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DArcTo.java new file mode 100644 index 000000000..225d87005 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DArcTo.java @@ -0,0 +1,187 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Path2DArcTo complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Path2DArcTo">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="wR" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
+ *       <attribute name="hR" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
+ *       <attribute name="stAng" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjAngle" />
+ *       <attribute name="swAng" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjAngle" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Path2DArcTo", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTPath2DArcTo implements Locatable +{ + + @XmlAttribute(name = "wR", required = true) + protected String wr; + @XmlAttribute(name = "hR", required = true) + protected String hr; + @XmlAttribute(name = "stAng", required = true) + protected String stAng; + @XmlAttribute(name = "swAng", required = true) + protected String swAng; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the wr property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getWR() { + return wr; + } + + /** + * Sets the value of the wr property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setWR(String value) { + this.wr = value; + } + + public boolean isSetWR() { + return (this.wr!= null); + } + + /** + * Gets the value of the hr property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getHR() { + return hr; + } + + /** + * Sets the value of the hr property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setHR(String value) { + this.hr = value; + } + + public boolean isSetHR() { + return (this.hr!= null); + } + + /** + * Gets the value of the stAng property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStAng() { + return stAng; + } + + /** + * Sets the value of the stAng property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStAng(String value) { + this.stAng = value; + } + + public boolean isSetStAng() { + return (this.stAng!= null); + } + + /** + * Gets the value of the swAng property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSwAng() { + return swAng; + } + + /** + * Sets the value of the swAng property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSwAng(String value) { + this.swAng = value; + } + + public boolean isSetSwAng() { + return (this.swAng!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DClose.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DClose.java new file mode 100644 index 000000000..f8f2514fa --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DClose.java @@ -0,0 +1,62 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Path2DClose complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Path2DClose">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Path2DClose", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTPath2DClose implements Locatable +{ + + @XmlLocation + @XmlTransient + protected Locator locator; + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DCubicBezierTo.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DCubicBezierTo.java new file mode 100644 index 000000000..0f27b0506 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DCubicBezierTo.java @@ -0,0 +1,109 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Path2DCubicBezierTo complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Path2DCubicBezierTo">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="pt" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AdjPoint2D" maxOccurs="3" minOccurs="3"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Path2DCubicBezierTo", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "pt" +}) +public class CTPath2DCubicBezierTo implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", required = true) + protected List pt; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the pt property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the pt property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getPt().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CTAdjPoint2D } + * + * + */ + public List getPt() { + if (pt == null) { + pt = new ArrayList(); + } + return this.pt; + } + + public boolean isSetPt() { + return ((this.pt!= null)&&(!this.pt.isEmpty())); + } + + public void unsetPt() { + this.pt = null; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DLineTo.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DLineTo.java new file mode 100644 index 000000000..0cfeb7cd6 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DLineTo.java @@ -0,0 +1,98 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Path2DLineTo complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Path2DLineTo">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="pt" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AdjPoint2D"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Path2DLineTo", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "pt" +}) +public class CTPath2DLineTo implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", required = true) + protected CTAdjPoint2D pt; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the pt property. + * + * @return + * possible object is + * {@link CTAdjPoint2D } + * + */ + public CTAdjPoint2D getPt() { + return pt; + } + + /** + * Sets the value of the pt property. + * + * @param value + * allowed object is + * {@link CTAdjPoint2D } + * + */ + public void setPt(CTAdjPoint2D value) { + this.pt = value; + } + + public boolean isSetPt() { + return (this.pt!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DList.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DList.java new file mode 100644 index 000000000..c190710cf --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DList.java @@ -0,0 +1,110 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Path2DList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Path2DList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="path" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_Path2D" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Path2DList", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "path" +}) +public class CTPath2DList + implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected List path; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the path property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the path property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getPath().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CTPath2D } + * + * + */ + public List getPath() { + if (path == null) { + path = new ArrayList(); + } + return this.path; + } + + public boolean isSetPath() { + return ((this.path!= null)&&(!this.path.isEmpty())); + } + + public void unsetPath() { + this.path = null; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DMoveTo.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DMoveTo.java new file mode 100644 index 000000000..6554a296d --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DMoveTo.java @@ -0,0 +1,98 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Path2DMoveTo complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Path2DMoveTo">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="pt" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AdjPoint2D"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Path2DMoveTo", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "pt" +}) +public class CTPath2DMoveTo implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", required = true) + protected CTAdjPoint2D pt; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the pt property. + * + * @return + * possible object is + * {@link CTAdjPoint2D } + * + */ + public CTAdjPoint2D getPt() { + return pt; + } + + /** + * Sets the value of the pt property. + * + * @param value + * allowed object is + * {@link CTAdjPoint2D } + * + */ + public void setPt(CTAdjPoint2D value) { + this.pt = value; + } + + public boolean isSetPt() { + return (this.pt!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DQuadBezierTo.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DQuadBezierTo.java new file mode 100644 index 000000000..4db373722 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DQuadBezierTo.java @@ -0,0 +1,109 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Path2DQuadBezierTo complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Path2DQuadBezierTo">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="pt" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AdjPoint2D" maxOccurs="2" minOccurs="2"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Path2DQuadBezierTo", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "pt" +}) +public class CTPath2DQuadBezierTo implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", required = true) + protected List pt; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the pt property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the pt property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getPt().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CTAdjPoint2D } + * + * + */ + public List getPt() { + if (pt == null) { + pt = new ArrayList(); + } + return this.pt; + } + + public boolean isSetPt() { + return ((this.pt!= null)&&(!this.pt.isEmpty())); + } + + public void unsetPt() { + this.pt = null; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPercentage.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPercentage.java new file mode 100644 index 000000000..1c07c22d9 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPercentage.java @@ -0,0 +1,86 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Percentage complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Percentage">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="val" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Percentage" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Percentage", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTPercentage implements Locatable +{ + + @XmlAttribute(name = "val", required = true) + protected int val; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the val property. + * + */ + public int getVal() { + return val; + } + + /** + * Sets the value of the val property. + * + */ + public void setVal(int value) { + this.val = value; + } + + public boolean isSetVal() { + return true; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPoint2D.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPoint2D.java new file mode 100644 index 000000000..a178b26b1 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPoint2D.java @@ -0,0 +1,110 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Point2D complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Point2D">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="x" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Coordinate" />
+ *       <attribute name="y" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Coordinate" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Point2D", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTPoint2D + implements Locatable +{ + + @XmlAttribute(name = "x", required = true) + protected long x; + @XmlAttribute(name = "y", required = true) + protected long y; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the x property. + * + */ + public long getX() { + return x; + } + + /** + * Sets the value of the x property. + * + */ + public void setX(long value) { + this.x = value; + } + + public boolean isSetX() { + return true; + } + + /** + * Gets the value of the y property. + * + */ + public long getY() { + return y; + } + + /** + * Sets the value of the y property. + * + */ + public void setY(long value) { + this.y = value; + } + + public boolean isSetY() { + return true; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPoint3D.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPoint3D.java new file mode 100644 index 000000000..641ad4611 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPoint3D.java @@ -0,0 +1,133 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Point3D complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Point3D">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="x" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Coordinate" />
+ *       <attribute name="y" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Coordinate" />
+ *       <attribute name="z" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Coordinate" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Point3D", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTPoint3D + implements Locatable +{ + + @XmlAttribute(name = "x", required = true) + protected long x; + @XmlAttribute(name = "y", required = true) + protected long y; + @XmlAttribute(name = "z", required = true) + protected long z; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the x property. + * + */ + public long getX() { + return x; + } + + /** + * Sets the value of the x property. + * + */ + public void setX(long value) { + this.x = value; + } + + public boolean isSetX() { + return true; + } + + /** + * Gets the value of the y property. + * + */ + public long getY() { + return y; + } + + /** + * Sets the value of the y property. + * + */ + public void setY(long value) { + this.y = value; + } + + public boolean isSetY() { + return true; + } + + /** + * Gets the value of the z property. + * + */ + public long getZ() { + return z; + } + + /** + * Sets the value of the z property. + * + */ + public void setZ(long value) { + this.z = value; + } + + public boolean isSetZ() { + return true; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPolarAdjustHandle.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPolarAdjustHandle.java new file mode 100644 index 000000000..2c3f9b992 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPolarAdjustHandle.java @@ -0,0 +1,289 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_PolarAdjustHandle complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_PolarAdjustHandle">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="pos" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AdjPoint2D"/>
+ *       </sequence>
+ *       <attribute name="gdRefR" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_GeomGuideName" />
+ *       <attribute name="minR" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
+ *       <attribute name="maxR" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
+ *       <attribute name="gdRefAng" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_GeomGuideName" />
+ *       <attribute name="minAng" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjAngle" />
+ *       <attribute name="maxAng" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjAngle" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_PolarAdjustHandle", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "pos" +}) +public class CTPolarAdjustHandle implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", required = true) + protected CTAdjPoint2D pos; + @XmlAttribute(name = "gdRefR") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String gdRefR; + @XmlAttribute(name = "minR") + protected String minR; + @XmlAttribute(name = "maxR") + protected String maxR; + @XmlAttribute(name = "gdRefAng") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String gdRefAng; + @XmlAttribute(name = "minAng") + protected String minAng; + @XmlAttribute(name = "maxAng") + protected String maxAng; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the pos property. + * + * @return + * possible object is + * {@link CTAdjPoint2D } + * + */ + public CTAdjPoint2D getPos() { + return pos; + } + + /** + * Sets the value of the pos property. + * + * @param value + * allowed object is + * {@link CTAdjPoint2D } + * + */ + public void setPos(CTAdjPoint2D value) { + this.pos = value; + } + + public boolean isSetPos() { + return (this.pos!= null); + } + + /** + * Gets the value of the gdRefR property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getGdRefR() { + return gdRefR; + } + + /** + * Sets the value of the gdRefR property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGdRefR(String value) { + this.gdRefR = value; + } + + public boolean isSetGdRefR() { + return (this.gdRefR!= null); + } + + /** + * Gets the value of the minR property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMinR() { + return minR; + } + + /** + * Sets the value of the minR property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMinR(String value) { + this.minR = value; + } + + public boolean isSetMinR() { + return (this.minR!= null); + } + + /** + * Gets the value of the maxR property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMaxR() { + return maxR; + } + + /** + * Sets the value of the maxR property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMaxR(String value) { + this.maxR = value; + } + + public boolean isSetMaxR() { + return (this.maxR!= null); + } + + /** + * Gets the value of the gdRefAng property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getGdRefAng() { + return gdRefAng; + } + + /** + * Sets the value of the gdRefAng property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGdRefAng(String value) { + this.gdRefAng = value; + } + + public boolean isSetGdRefAng() { + return (this.gdRefAng!= null); + } + + /** + * Gets the value of the minAng property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMinAng() { + return minAng; + } + + /** + * Sets the value of the minAng property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMinAng(String value) { + this.minAng = value; + } + + public boolean isSetMinAng() { + return (this.minAng!= null); + } + + /** + * Gets the value of the maxAng property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMaxAng() { + return maxAng; + } + + /** + * Sets the value of the maxAng property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMaxAng(String value) { + this.maxAng = value; + } + + public boolean isSetMaxAng() { + return (this.maxAng!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveFixedAngle.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveFixedAngle.java new file mode 100644 index 000000000..c544044ae --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveFixedAngle.java @@ -0,0 +1,86 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_PositiveFixedAngle complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_PositiveFixedAngle">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="val" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_PositiveFixedAngle" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_PositiveFixedAngle", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTPositiveFixedAngle implements Locatable +{ + + @XmlAttribute(name = "val", required = true) + protected int val; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the val property. + * + */ + public int getVal() { + return val; + } + + /** + * Sets the value of the val property. + * + */ + public void setVal(int value) { + this.val = value; + } + + public boolean isSetVal() { + return true; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveFixedPercentage.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveFixedPercentage.java new file mode 100644 index 000000000..475ae740c --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveFixedPercentage.java @@ -0,0 +1,86 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_PositiveFixedPercentage complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_PositiveFixedPercentage">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="val" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_PositiveFixedPercentage" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_PositiveFixedPercentage", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTPositiveFixedPercentage implements Locatable +{ + + @XmlAttribute(name = "val", required = true) + protected int val; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the val property. + * + */ + public int getVal() { + return val; + } + + /** + * Sets the value of the val property. + * + */ + public void setVal(int value) { + this.val = value; + } + + public boolean isSetVal() { + return true; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositivePercentage.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositivePercentage.java new file mode 100644 index 000000000..9d7b8b975 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositivePercentage.java @@ -0,0 +1,86 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_PositivePercentage complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_PositivePercentage">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="val" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_PositivePercentage" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_PositivePercentage", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTPositivePercentage implements Locatable +{ + + @XmlAttribute(name = "val", required = true) + protected int val; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the val property. + * + */ + public int getVal() { + return val; + } + + /** + * Sets the value of the val property. + * + */ + public void setVal(int value) { + this.val = value; + } + + public boolean isSetVal() { + return true; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveSize2D.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveSize2D.java new file mode 100644 index 000000000..f070ab75a --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveSize2D.java @@ -0,0 +1,110 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_PositiveSize2D complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_PositiveSize2D">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="cx" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_PositiveCoordinate" />
+ *       <attribute name="cy" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_PositiveCoordinate" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_PositiveSize2D", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTPositiveSize2D + implements Locatable +{ + + @XmlAttribute(name = "cx", required = true) + protected long cx; + @XmlAttribute(name = "cy", required = true) + protected long cy; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the cx property. + * + */ + public long getCx() { + return cx; + } + + /** + * Sets the value of the cx property. + * + */ + public void setCx(long value) { + this.cx = value; + } + + public boolean isSetCx() { + return true; + } + + /** + * Gets the value of the cy property. + * + */ + public long getCy() { + return cy; + } + + /** + * Sets the value of the cy property. + * + */ + public void setCy(long value) { + this.cy = value; + } + + public boolean isSetCy() { + return true; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetColor.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetColor.java new file mode 100644 index 000000000..5c8d53e10 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetColor.java @@ -0,0 +1,199 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_PresetColor complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_PresetColor">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <group ref="{http://schemas.openxmlformats.org/drawingml/2006/main}EG_ColorTransform" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="val" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_PresetColorVal" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_PresetColor", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "egColorTransform" +}) +public class CTPresetColor implements Locatable +{ + + @XmlElementRefs({ + @XmlElementRef(name = "hueMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lum", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hue", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "redOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "sat", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "tint", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alphaOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "green", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "gamma", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blue", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "gray", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "shade", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "satOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "red", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "invGamma", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "greenMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "redMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blueMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lumOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "comp", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "greenOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "satMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lumMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hueOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alpha", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blueOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alphaMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "inv", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false) + }) + protected List> egColorTransform; + @XmlAttribute(name = "val") + protected STPresetColorVal val; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the egColorTransform property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the egColorTransform property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getEGColorTransform().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedAngle }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTGammaTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTGrayscaleTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTInverseGammaTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTComplementTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTAngle }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTInverseTransform }{@code >} + * + * + */ + public List> getEGColorTransform() { + if (egColorTransform == null) { + egColorTransform = new ArrayList>(); + } + return this.egColorTransform; + } + + public boolean isSetEGColorTransform() { + return ((this.egColorTransform!= null)&&(!this.egColorTransform.isEmpty())); + } + + public void unsetEGColorTransform() { + this.egColorTransform = null; + } + + /** + * Gets the value of the val property. + * + * @return + * possible object is + * {@link STPresetColorVal } + * + */ + public STPresetColorVal getVal() { + return val; + } + + /** + * Sets the value of the val property. + * + * @param value + * allowed object is + * {@link STPresetColorVal } + * + */ + public void setVal(STPresetColorVal value) { + this.val = value; + } + + public boolean isSetVal() { + return (this.val!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetGeometry2D.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetGeometry2D.java new file mode 100644 index 000000000..0989d29f0 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetGeometry2D.java @@ -0,0 +1,131 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_PresetGeometry2D complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_PresetGeometry2D">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="avLst" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_GeomGuideList" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="prst" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_ShapeType" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_PresetGeometry2D", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "avLst" +}) +public class CTPresetGeometry2D + implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTGeomGuideList avLst; + @XmlAttribute(name = "prst", required = true) + protected STShapeType prst; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the avLst property. + * + * @return + * possible object is + * {@link CTGeomGuideList } + * + */ + public CTGeomGuideList getAvLst() { + return avLst; + } + + /** + * Sets the value of the avLst property. + * + * @param value + * allowed object is + * {@link CTGeomGuideList } + * + */ + public void setAvLst(CTGeomGuideList value) { + this.avLst = value; + } + + public boolean isSetAvLst() { + return (this.avLst!= null); + } + + /** + * Gets the value of the prst property. + * + * @return + * possible object is + * {@link STShapeType } + * + */ + public STShapeType getPrst() { + return prst; + } + + /** + * Sets the value of the prst property. + * + * @param value + * allowed object is + * {@link STShapeType } + * + */ + public void setPrst(STShapeType value) { + this.prst = value; + } + + public boolean isSetPrst() { + return (this.prst!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetTextShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetTextShape.java new file mode 100644 index 000000000..77d5e3f25 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetTextShape.java @@ -0,0 +1,131 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_PresetTextShape complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_PresetTextShape">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="avLst" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_GeomGuideList" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="prst" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_TextShapeType" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_PresetTextShape", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "avLst" +}) +public class CTPresetTextShape + implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTGeomGuideList avLst; + @XmlAttribute(name = "prst", required = true) + protected STTextShapeType prst; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the avLst property. + * + * @return + * possible object is + * {@link CTGeomGuideList } + * + */ + public CTGeomGuideList getAvLst() { + return avLst; + } + + /** + * Sets the value of the avLst property. + * + * @param value + * allowed object is + * {@link CTGeomGuideList } + * + */ + public void setAvLst(CTGeomGuideList value) { + this.avLst = value; + } + + public boolean isSetAvLst() { + return (this.avLst!= null); + } + + /** + * Gets the value of the prst property. + * + * @return + * possible object is + * {@link STTextShapeType } + * + */ + public STTextShapeType getPrst() { + return prst; + } + + /** + * Sets the value of the prst property. + * + * @param value + * allowed object is + * {@link STTextShapeType } + * + */ + public void setPrst(STTextShapeType value) { + this.prst = value; + } + + public boolean isSetPrst() { + return (this.prst!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTRatio.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTRatio.java new file mode 100644 index 000000000..3ea12ebe5 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTRatio.java @@ -0,0 +1,110 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Ratio complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Ratio">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="n" use="required" type="{http://www.w3.org/2001/XMLSchema}long" />
+ *       <attribute name="d" use="required" type="{http://www.w3.org/2001/XMLSchema}long" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Ratio", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTRatio + implements Locatable +{ + + @XmlAttribute(name = "n", required = true) + protected long n; + @XmlAttribute(name = "d", required = true) + protected long d; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the n property. + * + */ + public long getN() { + return n; + } + + /** + * Sets the value of the n property. + * + */ + public void setN(long value) { + this.n = value; + } + + public boolean isSetN() { + return true; + } + + /** + * Gets the value of the d property. + * + */ + public long getD() { + return d; + } + + /** + * Sets the value of the d property. + * + */ + public void setD(long value) { + this.d = value; + } + + public boolean isSetD() { + return true; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTRelativeRect.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTRelativeRect.java new file mode 100644 index 000000000..7d46b575a --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTRelativeRect.java @@ -0,0 +1,220 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_RelativeRect complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_RelativeRect">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="l" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Percentage" default="0" />
+ *       <attribute name="t" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Percentage" default="0" />
+ *       <attribute name="r" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Percentage" default="0" />
+ *       <attribute name="b" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Percentage" default="0" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_RelativeRect", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTRelativeRect + implements Locatable +{ + + @XmlAttribute(name = "l") + protected Integer l; + @XmlAttribute(name = "t") + protected Integer t; + @XmlAttribute(name = "r") + protected Integer r; + @XmlAttribute(name = "b") + protected Integer b; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the l property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public int getL() { + if (l == null) { + return 0; + } else { + return l; + } + } + + /** + * Sets the value of the l property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setL(int value) { + this.l = value; + } + + public boolean isSetL() { + return (this.l!= null); + } + + public void unsetL() { + this.l = null; + } + + /** + * Gets the value of the t property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public int getT() { + if (t == null) { + return 0; + } else { + return t; + } + } + + /** + * Sets the value of the t property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setT(int value) { + this.t = value; + } + + public boolean isSetT() { + return (this.t!= null); + } + + public void unsetT() { + this.t = null; + } + + /** + * Gets the value of the r property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public int getR() { + if (r == null) { + return 0; + } else { + return r; + } + } + + /** + * Sets the value of the r property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setR(int value) { + this.r = value; + } + + public boolean isSetR() { + return (this.r!= null); + } + + public void unsetR() { + this.r = null; + } + + /** + * Gets the value of the b property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public int getB() { + if (b == null) { + return 0; + } else { + return b; + } + } + + /** + * Sets the value of the b property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setB(int value) { + this.b = value; + } + + public boolean isSetB() { + return (this.b!= null); + } + + public void unsetB() { + this.b = null; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSRgbColor.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSRgbColor.java new file mode 100644 index 000000000..d74a3527c --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSRgbColor.java @@ -0,0 +1,202 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.HexBinaryAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_SRgbColor complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_SRgbColor">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <group ref="{http://schemas.openxmlformats.org/drawingml/2006/main}EG_ColorTransform" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="val" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_HexBinary3" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_SRgbColor", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "egColorTransform" +}) +public class CTSRgbColor implements Locatable +{ + + @XmlElementRefs({ + @XmlElementRef(name = "red", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blue", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blueMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "invGamma", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "shade", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "satOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "greenMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "satMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alphaOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lumOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alpha", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "redMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alphaMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blueOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "redOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "green", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "tint", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hueMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "comp", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lumMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lum", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hueOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "gray", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "greenOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hue", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "inv", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "sat", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "gamma", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false) + }) + protected List> egColorTransform; + @XmlAttribute(name = "val", required = true) + @XmlJavaTypeAdapter(HexBinaryAdapter.class) + protected byte[] val; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the egColorTransform property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the egColorTransform property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getEGColorTransform().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTInverseGammaTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTComplementTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTAngle }{@code >} + * {@link JAXBElement }{@code <}{@link CTGrayscaleTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedAngle }{@code >} + * {@link JAXBElement }{@code <}{@link CTInverseTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTGammaTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * + * + */ + public List> getEGColorTransform() { + if (egColorTransform == null) { + egColorTransform = new ArrayList>(); + } + return this.egColorTransform; + } + + public boolean isSetEGColorTransform() { + return ((this.egColorTransform!= null)&&(!this.egColorTransform.isEmpty())); + } + + public void unsetEGColorTransform() { + this.egColorTransform = null; + } + + /** + * Gets the value of the val property. + * + * @return + * possible object is + * {@link String } + * + */ + public byte[] getVal() { + return val; + } + + /** + * Sets the value of the val property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setVal(byte[] value) { + this.val = value; + } + + public boolean isSetVal() { + return (this.val!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTScRgbColor.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTScRgbColor.java new file mode 100644 index 000000000..80d88ccc6 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTScRgbColor.java @@ -0,0 +1,237 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_ScRgbColor complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_ScRgbColor">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <group ref="{http://schemas.openxmlformats.org/drawingml/2006/main}EG_ColorTransform" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="r" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Percentage" />
+ *       <attribute name="g" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Percentage" />
+ *       <attribute name="b" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Percentage" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_ScRgbColor", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "egColorTransform" +}) +public class CTScRgbColor implements Locatable +{ + + @XmlElementRefs({ + @XmlElementRef(name = "satOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hueOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blue", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hue", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "tint", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "inv", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alphaOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "invGamma", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "satMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hueMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lumMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "greenMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "shade", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lum", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "greenOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "green", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "sat", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "gamma", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "gray", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alpha", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blueMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "red", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blueOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "redOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "comp", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "redMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alphaMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lumOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false) + }) + protected List> egColorTransform; + @XmlAttribute(name = "r", required = true) + protected int r; + @XmlAttribute(name = "g", required = true) + protected int g; + @XmlAttribute(name = "b", required = true) + protected int b; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the egColorTransform property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the egColorTransform property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getEGColorTransform().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTAngle }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedAngle }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTInverseTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTInverseGammaTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTGammaTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTGrayscaleTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTComplementTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * + * + */ + public List> getEGColorTransform() { + if (egColorTransform == null) { + egColorTransform = new ArrayList>(); + } + return this.egColorTransform; + } + + public boolean isSetEGColorTransform() { + return ((this.egColorTransform!= null)&&(!this.egColorTransform.isEmpty())); + } + + public void unsetEGColorTransform() { + this.egColorTransform = null; + } + + /** + * Gets the value of the r property. + * + */ + public int getR() { + return r; + } + + /** + * Sets the value of the r property. + * + */ + public void setR(int value) { + this.r = value; + } + + public boolean isSetR() { + return true; + } + + /** + * Gets the value of the g property. + * + */ + public int getG() { + return g; + } + + /** + * Sets the value of the g property. + * + */ + public void setG(int value) { + this.g = value; + } + + public boolean isSetG() { + return true; + } + + /** + * Gets the value of the b property. + * + */ + public int getB() { + return b; + } + + /** + * Sets the value of the b property. + * + */ + public void setB(int value) { + this.b = value; + } + + public boolean isSetB() { + return true; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTScale2D.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTScale2D.java new file mode 100644 index 000000000..0f00fd840 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTScale2D.java @@ -0,0 +1,131 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Scale2D complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Scale2D">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="sx" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_Ratio"/>
+ *         <element name="sy" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_Ratio"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Scale2D", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "sx", + "sy" +}) +public class CTScale2D + implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", required = true) + protected CTRatio sx; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", required = true) + protected CTRatio sy; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the sx property. + * + * @return + * possible object is + * {@link CTRatio } + * + */ + public CTRatio getSx() { + return sx; + } + + /** + * Sets the value of the sx property. + * + * @param value + * allowed object is + * {@link CTRatio } + * + */ + public void setSx(CTRatio value) { + this.sx = value; + } + + public boolean isSetSx() { + return (this.sx!= null); + } + + /** + * Gets the value of the sy property. + * + * @return + * possible object is + * {@link CTRatio } + * + */ + public CTRatio getSy() { + return sy; + } + + /** + * Sets the value of the sy property. + * + * @param value + * allowed object is + * {@link CTRatio } + * + */ + public void setSy(CTRatio value) { + this.sy = value; + } + + public boolean isSetSy() { + return (this.sy!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSchemeColor.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSchemeColor.java new file mode 100644 index 000000000..078e5793d --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSchemeColor.java @@ -0,0 +1,199 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_SchemeColor complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_SchemeColor">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <group ref="{http://schemas.openxmlformats.org/drawingml/2006/main}EG_ColorTransform" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="val" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_SchemeColorVal" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_SchemeColor", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "egColorTransform" +}) +public class CTSchemeColor implements Locatable +{ + + @XmlElementRefs({ + @XmlElementRef(name = "gamma", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "inv", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hue", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "tint", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lumOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "shade", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "comp", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "satOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hueOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alpha", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "invGamma", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "red", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hueMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lumMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "satMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "greenOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alphaMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alphaOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lum", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blueMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "sat", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blue", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "gray", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "green", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "redMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "redOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blueOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "greenMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false) + }) + protected List> egColorTransform; + @XmlAttribute(name = "val", required = true) + protected STSchemeColorVal val; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the egColorTransform property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the egColorTransform property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getEGColorTransform().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link CTGammaTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTInverseTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedAngle }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTComplementTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTAngle }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTInverseGammaTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTGrayscaleTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * + * + */ + public List> getEGColorTransform() { + if (egColorTransform == null) { + egColorTransform = new ArrayList>(); + } + return this.egColorTransform; + } + + public boolean isSetEGColorTransform() { + return ((this.egColorTransform!= null)&&(!this.egColorTransform.isEmpty())); + } + + public void unsetEGColorTransform() { + this.egColorTransform = null; + } + + /** + * Gets the value of the val property. + * + * @return + * possible object is + * {@link STSchemeColorVal } + * + */ + public STSchemeColorVal getVal() { + return val; + } + + /** + * Sets the value of the val property. + * + * @param value + * allowed object is + * {@link STSchemeColorVal } + * + */ + public void setVal(STSchemeColorVal value) { + this.val = value; + } + + public boolean isSetVal() { + return (this.val!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSphereCoords.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSphereCoords.java new file mode 100644 index 000000000..4ea585716 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSphereCoords.java @@ -0,0 +1,133 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_SphereCoords complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_SphereCoords">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="lat" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_PositiveFixedAngle" />
+ *       <attribute name="lon" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_PositiveFixedAngle" />
+ *       <attribute name="rev" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_PositiveFixedAngle" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_SphereCoords", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTSphereCoords + implements Locatable +{ + + @XmlAttribute(name = "lat", required = true) + protected int lat; + @XmlAttribute(name = "lon", required = true) + protected int lon; + @XmlAttribute(name = "rev", required = true) + protected int rev; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the lat property. + * + */ + public int getLat() { + return lat; + } + + /** + * Sets the value of the lat property. + * + */ + public void setLat(int value) { + this.lat = value; + } + + public boolean isSetLat() { + return true; + } + + /** + * Gets the value of the lon property. + * + */ + public int getLon() { + return lon; + } + + /** + * Sets the value of the lon property. + * + */ + public void setLon(int value) { + this.lon = value; + } + + public boolean isSetLon() { + return true; + } + + /** + * Gets the value of the rev property. + * + */ + public int getRev() { + return rev; + } + + /** + * Sets the value of the rev property. + * + */ + public void setRev(int value) { + this.rev = value; + } + + public boolean isSetRev() { + return true; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSystemColor.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSystemColor.java new file mode 100644 index 000000000..f91a71950 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSystemColor.java @@ -0,0 +1,235 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.HexBinaryAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_SystemColor complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_SystemColor">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <group ref="{http://schemas.openxmlformats.org/drawingml/2006/main}EG_ColorTransform" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="val" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_SystemColorVal" />
+ *       <attribute name="lastClr" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_HexBinary3" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_SystemColor", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "egColorTransform" +}) +public class CTSystemColor implements Locatable +{ + + @XmlElementRefs({ + @XmlElementRef(name = "alpha", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alphaOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lumOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "tint", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blueMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "sat", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "shade", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blue", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lum", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "blueOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "gamma", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "redOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "inv", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "gray", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "satOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "comp", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "satMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "redMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hueOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "lumMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "greenMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hueMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "invGamma", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "red", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "hue", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "green", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "alphaMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false), + @XmlElementRef(name = "greenOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class, required = false) + }) + protected List> egColorTransform; + @XmlAttribute(name = "val", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String val; + @XmlAttribute(name = "lastClr") + @XmlJavaTypeAdapter(HexBinaryAdapter.class) + protected byte[] lastClr; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the egColorTransform property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the egColorTransform property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getEGColorTransform().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTGammaTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTInverseTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTGrayscaleTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTComplementTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTAngle }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTInverseGammaTransform }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositiveFixedAngle }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >} + * {@link JAXBElement }{@code <}{@link CTPercentage }{@code >} + * + * + */ + public List> getEGColorTransform() { + if (egColorTransform == null) { + egColorTransform = new ArrayList>(); + } + return this.egColorTransform; + } + + public boolean isSetEGColorTransform() { + return ((this.egColorTransform!= null)&&(!this.egColorTransform.isEmpty())); + } + + public void unsetEGColorTransform() { + this.egColorTransform = null; + } + + /** + * Gets the value of the val property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getVal() { + return val; + } + + /** + * Sets the value of the val property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setVal(String value) { + this.val = value; + } + + public boolean isSetVal() { + return (this.val!= null); + } + + /** + * Gets the value of the lastClr property. + * + * @return + * possible object is + * {@link String } + * + */ + public byte[] getLastClr() { + return lastClr; + } + + /** + * Sets the value of the lastClr property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLastClr(byte[] value) { + this.lastClr = value; + } + + public boolean isSetLastClr() { + return (this.lastClr!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTTransform2D.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTTransform2D.java new file mode 100644 index 000000000..2ba4704cf --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTTransform2D.java @@ -0,0 +1,249 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Transform2D complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Transform2D">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="off" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_Point2D" minOccurs="0"/>
+ *         <element name="ext" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_PositiveSize2D" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="rot" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Angle" default="0" />
+ *       <attribute name="flipH" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *       <attribute name="flipV" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Transform2D", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "off", + "ext" +}) +public class CTTransform2D + implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTPoint2D off; + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") + protected CTPositiveSize2D ext; + @XmlAttribute(name = "rot") + protected Integer rot; + @XmlAttribute(name = "flipH") + protected Boolean flipH; + @XmlAttribute(name = "flipV") + protected Boolean flipV; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the off property. + * + * @return + * possible object is + * {@link CTPoint2D } + * + */ + public CTPoint2D getOff() { + return off; + } + + /** + * Sets the value of the off property. + * + * @param value + * allowed object is + * {@link CTPoint2D } + * + */ + public void setOff(CTPoint2D value) { + this.off = value; + } + + public boolean isSetOff() { + return (this.off!= null); + } + + /** + * Gets the value of the ext property. + * + * @return + * possible object is + * {@link CTPositiveSize2D } + * + */ + public CTPositiveSize2D getExt() { + return ext; + } + + /** + * Sets the value of the ext property. + * + * @param value + * allowed object is + * {@link CTPositiveSize2D } + * + */ + public void setExt(CTPositiveSize2D value) { + this.ext = value; + } + + public boolean isSetExt() { + return (this.ext!= null); + } + + /** + * Gets the value of the rot property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public int getRot() { + if (rot == null) { + return 0; + } else { + return rot; + } + } + + /** + * Sets the value of the rot property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setRot(int value) { + this.rot = value; + } + + public boolean isSetRot() { + return (this.rot!= null); + } + + public void unsetRot() { + this.rot = null; + } + + /** + * Gets the value of the flipH property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isFlipH() { + if (flipH == null) { + return false; + } else { + return flipH; + } + } + + /** + * Sets the value of the flipH property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setFlipH(boolean value) { + this.flipH = value; + } + + public boolean isSetFlipH() { + return (this.flipH!= null); + } + + public void unsetFlipH() { + this.flipH = null; + } + + /** + * Gets the value of the flipV property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public boolean isFlipV() { + if (flipV == null) { + return false; + } else { + return flipV; + } + } + + /** + * Sets the value of the flipV property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setFlipV(boolean value) { + this.flipV = value; + } + + public boolean isSetFlipV() { + return (this.flipV!= null); + } + + public void unsetFlipV() { + this.flipV = null; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTVector3D.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTVector3D.java new file mode 100644 index 000000000..53f4b8e03 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTVector3D.java @@ -0,0 +1,133 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_Vector3D complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_Vector3D">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="dx" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Coordinate" />
+ *       <attribute name="dy" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Coordinate" />
+ *       <attribute name="dz" use="required" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_Coordinate" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_Vector3D", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +public class CTVector3D + implements Locatable +{ + + @XmlAttribute(name = "dx", required = true) + protected long dx; + @XmlAttribute(name = "dy", required = true) + protected long dy; + @XmlAttribute(name = "dz", required = true) + protected long dz; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the dx property. + * + */ + public long getDx() { + return dx; + } + + /** + * Sets the value of the dx property. + * + */ + public void setDx(long value) { + this.dx = value; + } + + public boolean isSetDx() { + return true; + } + + /** + * Gets the value of the dy property. + * + */ + public long getDy() { + return dy; + } + + /** + * Sets the value of the dy property. + * + */ + public void setDy(long value) { + this.dy = value; + } + + public boolean isSetDy() { + return true; + } + + /** + * Gets the value of the dz property. + * + */ + public long getDz() { + return dz; + } + + /** + * Sets the value of the dz property. + * + */ + public void setDz(long value) { + this.dz = value; + } + + public boolean isSetDz() { + return true; + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTXYAdjustHandle.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTXYAdjustHandle.java new file mode 100644 index 000000000..e316f7783 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTXYAdjustHandle.java @@ -0,0 +1,289 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.xml.internal.bind.Locatable; +import com.sun.xml.internal.bind.annotation.XmlLocation; +import org.xml.sax.Locator; + + +/** + *

Java class for CT_XYAdjustHandle complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="CT_XYAdjustHandle">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="pos" type="{http://schemas.openxmlformats.org/drawingml/2006/main}CT_AdjPoint2D"/>
+ *       </sequence>
+ *       <attribute name="gdRefX" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_GeomGuideName" />
+ *       <attribute name="minX" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
+ *       <attribute name="maxX" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
+ *       <attribute name="gdRefY" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_GeomGuideName" />
+ *       <attribute name="minY" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
+ *       <attribute name="maxY" type="{http://schemas.openxmlformats.org/drawingml/2006/main}ST_AdjCoordinate" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CT_XYAdjustHandle", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", propOrder = { + "pos" +}) +public class CTXYAdjustHandle implements Locatable +{ + + @XmlElement(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", required = true) + protected CTAdjPoint2D pos; + @XmlAttribute(name = "gdRefX") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String gdRefX; + @XmlAttribute(name = "minX") + protected String minX; + @XmlAttribute(name = "maxX") + protected String maxX; + @XmlAttribute(name = "gdRefY") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String gdRefY; + @XmlAttribute(name = "minY") + protected String minY; + @XmlAttribute(name = "maxY") + protected String maxY; + @XmlLocation + @XmlTransient + protected Locator locator; + + /** + * Gets the value of the pos property. + * + * @return + * possible object is + * {@link CTAdjPoint2D } + * + */ + public CTAdjPoint2D getPos() { + return pos; + } + + /** + * Sets the value of the pos property. + * + * @param value + * allowed object is + * {@link CTAdjPoint2D } + * + */ + public void setPos(CTAdjPoint2D value) { + this.pos = value; + } + + public boolean isSetPos() { + return (this.pos!= null); + } + + /** + * Gets the value of the gdRefX property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getGdRefX() { + return gdRefX; + } + + /** + * Sets the value of the gdRefX property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGdRefX(String value) { + this.gdRefX = value; + } + + public boolean isSetGdRefX() { + return (this.gdRefX!= null); + } + + /** + * Gets the value of the minX property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMinX() { + return minX; + } + + /** + * Sets the value of the minX property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMinX(String value) { + this.minX = value; + } + + public boolean isSetMinX() { + return (this.minX!= null); + } + + /** + * Gets the value of the maxX property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMaxX() { + return maxX; + } + + /** + * Sets the value of the maxX property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMaxX(String value) { + this.maxX = value; + } + + public boolean isSetMaxX() { + return (this.maxX!= null); + } + + /** + * Gets the value of the gdRefY property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getGdRefY() { + return gdRefY; + } + + /** + * Sets the value of the gdRefY property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGdRefY(String value) { + this.gdRefY = value; + } + + public boolean isSetGdRefY() { + return (this.gdRefY!= null); + } + + /** + * Gets the value of the minY property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMinY() { + return minY; + } + + /** + * Sets the value of the minY property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMinY(String value) { + this.minY = value; + } + + public boolean isSetMinY() { + return (this.minY!= null); + } + + /** + * Gets the value of the maxY property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMaxY() { + return maxY; + } + + /** + * Sets the value of the maxY property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMaxY(String value) { + this.maxY = value; + } + + public boolean isSetMaxY() { + return (this.maxY!= null); + } + + public Locator sourceLocation() { + return locator; + } + + public void setSourceLocation(Locator newLocator) { + locator = newLocator; + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/ObjectFactory.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/ObjectFactory.java new file mode 100644 index 000000000..d5c0d65f8 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/ObjectFactory.java @@ -0,0 +1,2023 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the org.apache.poi.sl.draw.binding package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _CTHslColorAlpha_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "alpha"); + private final static QName _CTHslColorLum_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "lum"); + private final static QName _CTHslColorGamma_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "gamma"); + private final static QName _CTHslColorInvGamma_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "invGamma"); + private final static QName _CTHslColorAlphaMod_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "alphaMod"); + private final static QName _CTHslColorRedOff_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "redOff"); + private final static QName _CTHslColorAlphaOff_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "alphaOff"); + private final static QName _CTHslColorGreenOff_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "greenOff"); + private final static QName _CTHslColorHue_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "hue"); + private final static QName _CTHslColorRedMod_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "redMod"); + private final static QName _CTHslColorSatOff_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "satOff"); + private final static QName _CTHslColorGreenMod_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "greenMod"); + private final static QName _CTHslColorSat_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "sat"); + private final static QName _CTHslColorBlue_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "blue"); + private final static QName _CTHslColorRed_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "red"); + private final static QName _CTHslColorSatMod_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "satMod"); + private final static QName _CTHslColorBlueMod_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "blueMod"); + private final static QName _CTHslColorHueOff_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "hueOff"); + private final static QName _CTHslColorShade_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "shade"); + private final static QName _CTHslColorLumMod_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "lumMod"); + private final static QName _CTHslColorInv_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "inv"); + private final static QName _CTHslColorLumOff_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "lumOff"); + private final static QName _CTHslColorTint_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "tint"); + private final static QName _CTHslColorGreen_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "green"); + private final static QName _CTHslColorComp_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "comp"); + private final static QName _CTHslColorBlueOff_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "blueOff"); + private final static QName _CTHslColorHueMod_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "hueMod"); + private final static QName _CTHslColorGray_QNAME = new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "gray"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.poi.sl.draw.binding + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link CTPath2DQuadBezierTo } + * + */ + public CTPath2DQuadBezierTo createCTPath2DQuadBezierTo() { + return new CTPath2DQuadBezierTo(); + } + + /** + * Create an instance of {@link CTCustomGeometry2D } + * + */ + public CTCustomGeometry2D createCTCustomGeometry2D() { + return new CTCustomGeometry2D(); + } + + /** + * Create an instance of {@link CTPolarAdjustHandle } + * + */ + public CTPolarAdjustHandle createCTPolarAdjustHandle() { + return new CTPolarAdjustHandle(); + } + + /** + * Create an instance of {@link CTPath2DClose } + * + */ + public CTPath2DClose createCTPath2DClose() { + return new CTPath2DClose(); + } + + /** + * Create an instance of {@link CTPoint2D } + * + */ + public CTPoint2D createCTPoint2D() { + return new CTPoint2D(); + } + + /** + * Create an instance of {@link CTInverseTransform } + * + */ + public CTInverseTransform createCTInverseTransform() { + return new CTInverseTransform(); + } + + /** + * Create an instance of {@link CTPercentage } + * + */ + public CTPercentage createCTPercentage() { + return new CTPercentage(); + } + + /** + * Create an instance of {@link CTSystemColor } + * + */ + public CTSystemColor createCTSystemColor() { + return new CTSystemColor(); + } + + /** + * Create an instance of {@link CTConnectionSite } + * + */ + public CTConnectionSite createCTConnectionSite() { + return new CTConnectionSite(); + } + + /** + * Create an instance of {@link CTColor } + * + */ + public CTColor createCTColor() { + return new CTColor(); + } + + /** + * Create an instance of {@link CTPositiveFixedAngle } + * + */ + public CTPositiveFixedAngle createCTPositiveFixedAngle() { + return new CTPositiveFixedAngle(); + } + + /** + * Create an instance of {@link CTFixedPercentage } + * + */ + public CTFixedPercentage createCTFixedPercentage() { + return new CTFixedPercentage(); + } + + /** + * Create an instance of {@link CTHslColor } + * + */ + public CTHslColor createCTHslColor() { + return new CTHslColor(); + } + + /** + * Create an instance of {@link CTConnection } + * + */ + public CTConnection createCTConnection() { + return new CTConnection(); + } + + /** + * Create an instance of {@link CTPath2DLineTo } + * + */ + public CTPath2DLineTo createCTPath2DLineTo() { + return new CTPath2DLineTo(); + } + + /** + * Create an instance of {@link CTTransform2D } + * + */ + public CTTransform2D createCTTransform2D() { + return new CTTransform2D(); + } + + /** + * Create an instance of {@link CTPositivePercentage } + * + */ + public CTPositivePercentage createCTPositivePercentage() { + return new CTPositivePercentage(); + } + + /** + * Create an instance of {@link CTVector3D } + * + */ + public CTVector3D createCTVector3D() { + return new CTVector3D(); + } + + /** + * Create an instance of {@link CTSphereCoords } + * + */ + public CTSphereCoords createCTSphereCoords() { + return new CTSphereCoords(); + } + + /** + * Create an instance of {@link CTPath2D } + * + */ + public CTPath2D createCTPath2D() { + return new CTPath2D(); + } + + /** + * Create an instance of {@link CTGroupTransform2D } + * + */ + public CTGroupTransform2D createCTGroupTransform2D() { + return new CTGroupTransform2D(); + } + + /** + * Create an instance of {@link CTGrayscaleTransform } + * + */ + public CTGrayscaleTransform createCTGrayscaleTransform() { + return new CTGrayscaleTransform(); + } + + /** + * Create an instance of {@link CTRatio } + * + */ + public CTRatio createCTRatio() { + return new CTRatio(); + } + + /** + * Create an instance of {@link CTSRgbColor } + * + */ + public CTSRgbColor createCTSRgbColor() { + return new CTSRgbColor(); + } + + /** + * Create an instance of {@link CTGeomGuideList } + * + */ + public CTGeomGuideList createCTGeomGuideList() { + return new CTGeomGuideList(); + } + + /** + * Create an instance of {@link CTComplementTransform } + * + */ + public CTComplementTransform createCTComplementTransform() { + return new CTComplementTransform(); + } + + /** + * Create an instance of {@link CTPath2DCubicBezierTo } + * + */ + public CTPath2DCubicBezierTo createCTPath2DCubicBezierTo() { + return new CTPath2DCubicBezierTo(); + } + + /** + * Create an instance of {@link CTXYAdjustHandle } + * + */ + public CTXYAdjustHandle createCTXYAdjustHandle() { + return new CTXYAdjustHandle(); + } + + /** + * Create an instance of {@link CTPresetColor } + * + */ + public CTPresetColor createCTPresetColor() { + return new CTPresetColor(); + } + + /** + * Create an instance of {@link CTOfficeArtExtension } + * + */ + public CTOfficeArtExtension createCTOfficeArtExtension() { + return new CTOfficeArtExtension(); + } + + /** + * Create an instance of {@link CTSchemeColor } + * + */ + public CTSchemeColor createCTSchemeColor() { + return new CTSchemeColor(); + } + + /** + * Create an instance of {@link CTConnectionSiteList } + * + */ + public CTConnectionSiteList createCTConnectionSiteList() { + return new CTConnectionSiteList(); + } + + /** + * Create an instance of {@link CTPath2DArcTo } + * + */ + public CTPath2DArcTo createCTPath2DArcTo() { + return new CTPath2DArcTo(); + } + + /** + * Create an instance of {@link CTPath2DList } + * + */ + public CTPath2DList createCTPath2DList() { + return new CTPath2DList(); + } + + /** + * Create an instance of {@link CTAngle } + * + */ + public CTAngle createCTAngle() { + return new CTAngle(); + } + + /** + * Create an instance of {@link CTScale2D } + * + */ + public CTScale2D createCTScale2D() { + return new CTScale2D(); + } + + /** + * Create an instance of {@link CTPositiveSize2D } + * + */ + public CTPositiveSize2D createCTPositiveSize2D() { + return new CTPositiveSize2D(); + } + + /** + * Create an instance of {@link CTOfficeArtExtensionList } + * + */ + public CTOfficeArtExtensionList createCTOfficeArtExtensionList() { + return new CTOfficeArtExtensionList(); + } + + /** + * Create an instance of {@link CTHyperlink } + * + */ + public CTHyperlink createCTHyperlink() { + return new CTHyperlink(); + } + + /** + * Create an instance of {@link CTPoint3D } + * + */ + public CTPoint3D createCTPoint3D() { + return new CTPoint3D(); + } + + /** + * Create an instance of {@link CTInverseGammaTransform } + * + */ + public CTInverseGammaTransform createCTInverseGammaTransform() { + return new CTInverseGammaTransform(); + } + + /** + * Create an instance of {@link CTPositiveFixedPercentage } + * + */ + public CTPositiveFixedPercentage createCTPositiveFixedPercentage() { + return new CTPositiveFixedPercentage(); + } + + /** + * Create an instance of {@link CTGeomRect } + * + */ + public CTGeomRect createCTGeomRect() { + return new CTGeomRect(); + } + + /** + * Create an instance of {@link CTPresetTextShape } + * + */ + public CTPresetTextShape createCTPresetTextShape() { + return new CTPresetTextShape(); + } + + /** + * Create an instance of {@link CTColorMRU } + * + */ + public CTColorMRU createCTColorMRU() { + return new CTColorMRU(); + } + + /** + * Create an instance of {@link CTPath2DMoveTo } + * + */ + public CTPath2DMoveTo createCTPath2DMoveTo() { + return new CTPath2DMoveTo(); + } + + /** + * Create an instance of {@link CTEmbeddedWAVAudioFile } + * + */ + public CTEmbeddedWAVAudioFile createCTEmbeddedWAVAudioFile() { + return new CTEmbeddedWAVAudioFile(); + } + + /** + * Create an instance of {@link CTScRgbColor } + * + */ + public CTScRgbColor createCTScRgbColor() { + return new CTScRgbColor(); + } + + /** + * Create an instance of {@link CTPresetGeometry2D } + * + */ + public CTPresetGeometry2D createCTPresetGeometry2D() { + return new CTPresetGeometry2D(); + } + + /** + * Create an instance of {@link CTGeomGuide } + * + */ + public CTGeomGuide createCTGeomGuide() { + return new CTGeomGuide(); + } + + /** + * Create an instance of {@link CTRelativeRect } + * + */ + public CTRelativeRect createCTRelativeRect() { + return new CTRelativeRect(); + } + + /** + * Create an instance of {@link CTAdjustHandleList } + * + */ + public CTAdjustHandleList createCTAdjustHandleList() { + return new CTAdjustHandleList(); + } + + /** + * Create an instance of {@link CTAdjPoint2D } + * + */ + public CTAdjPoint2D createCTAdjPoint2D() { + return new CTAdjPoint2D(); + } + + /** + * Create an instance of {@link CTGammaTransform } + * + */ + public CTGammaTransform createCTGammaTransform() { + return new CTGammaTransform(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTHslColor.class) + public JAXBElement createCTHslColorAlpha(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTHslColor.class) + public JAXBElement createCTHslColorLum(CTPercentage value) { + return new JAXBElement(_CTHslColorLum_QNAME, CTPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTGammaTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTHslColor.class) + public JAXBElement createCTHslColorGamma(CTGammaTransform value) { + return new JAXBElement(_CTHslColorGamma_QNAME, CTGammaTransform.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTInverseGammaTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTHslColor.class) + public JAXBElement createCTHslColorInvGamma(CTInverseGammaTransform value) { + return new JAXBElement(_CTHslColorInvGamma_QNAME, CTInverseGammaTransform.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTHslColor.class) + public JAXBElement createCTHslColorAlphaMod(CTPositivePercentage value) { + return new JAXBElement(_CTHslColorAlphaMod_QNAME, CTPositivePercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTHslColor.class) + public JAXBElement createCTHslColorRedOff(CTPercentage value) { + return new JAXBElement(_CTHslColorRedOff_QNAME, CTPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTHslColor.class) + public JAXBElement createCTHslColorAlphaOff(CTFixedPercentage value) { + return new JAXBElement(_CTHslColorAlphaOff_QNAME, CTFixedPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTHslColor.class) + public JAXBElement createCTHslColorGreenOff(CTPercentage value) { + return new JAXBElement(_CTHslColorGreenOff_QNAME, CTPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedAngle }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTHslColor.class) + public JAXBElement createCTHslColorHue(CTPositiveFixedAngle value) { + return new JAXBElement(_CTHslColorHue_QNAME, CTPositiveFixedAngle.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTHslColor.class) + public JAXBElement createCTHslColorRedMod(CTPercentage value) { + return new JAXBElement(_CTHslColorRedMod_QNAME, CTPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTHslColor.class) + public JAXBElement createCTHslColorSatOff(CTPercentage value) { + return new JAXBElement(_CTHslColorSatOff_QNAME, CTPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTHslColor.class) + public JAXBElement createCTHslColorGreenMod(CTPercentage value) { + return new JAXBElement(_CTHslColorGreenMod_QNAME, CTPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTHslColor.class) + public JAXBElement createCTHslColorSat(CTPercentage value) { + return new JAXBElement(_CTHslColorSat_QNAME, CTPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTHslColor.class) + public JAXBElement createCTHslColorBlue(CTPercentage value) { + return new JAXBElement(_CTHslColorBlue_QNAME, CTPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTHslColor.class) + public JAXBElement createCTHslColorRed(CTPercentage value) { + return new JAXBElement(_CTHslColorRed_QNAME, CTPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTHslColor.class) + public JAXBElement createCTHslColorSatMod(CTPercentage value) { + return new JAXBElement(_CTHslColorSatMod_QNAME, CTPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTHslColor.class) + public JAXBElement createCTHslColorBlueMod(CTPercentage value) { + return new JAXBElement(_CTHslColorBlueMod_QNAME, CTPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTAngle }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTHslColor.class) + public JAXBElement createCTHslColorHueOff(CTAngle value) { + return new JAXBElement(_CTHslColorHueOff_QNAME, CTAngle.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTHslColor.class) + public JAXBElement createCTHslColorShade(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorShade_QNAME, CTPositiveFixedPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTHslColor.class) + public JAXBElement createCTHslColorLumMod(CTPercentage value) { + return new JAXBElement(_CTHslColorLumMod_QNAME, CTPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTInverseTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTHslColor.class) + public JAXBElement createCTHslColorInv(CTInverseTransform value) { + return new JAXBElement(_CTHslColorInv_QNAME, CTInverseTransform.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTHslColor.class) + public JAXBElement createCTHslColorLumOff(CTPercentage value) { + return new JAXBElement(_CTHslColorLumOff_QNAME, CTPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTHslColor.class) + public JAXBElement createCTHslColorTint(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorTint_QNAME, CTPositiveFixedPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTHslColor.class) + public JAXBElement createCTHslColorGreen(CTPercentage value) { + return new JAXBElement(_CTHslColorGreen_QNAME, CTPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTComplementTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTHslColor.class) + public JAXBElement createCTHslColorComp(CTComplementTransform value) { + return new JAXBElement(_CTHslColorComp_QNAME, CTComplementTransform.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTHslColor.class) + public JAXBElement createCTHslColorBlueOff(CTPercentage value) { + return new JAXBElement(_CTHslColorBlueOff_QNAME, CTPercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTHslColor.class) + public JAXBElement createCTHslColorHueMod(CTPositivePercentage value) { + return new JAXBElement(_CTHslColorHueMod_QNAME, CTPositivePercentage.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTGrayscaleTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTHslColor.class) + public JAXBElement createCTHslColorGray(CTGrayscaleTransform value) { + return new JAXBElement(_CTHslColorGray_QNAME, CTGrayscaleTransform.class, CTHslColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorAlpha(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorLum(CTPercentage value) { + return new JAXBElement(_CTHslColorLum_QNAME, CTPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTGammaTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorGamma(CTGammaTransform value) { + return new JAXBElement(_CTHslColorGamma_QNAME, CTGammaTransform.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTInverseGammaTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorInvGamma(CTInverseGammaTransform value) { + return new JAXBElement(_CTHslColorInvGamma_QNAME, CTInverseGammaTransform.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorAlphaMod(CTPositivePercentage value) { + return new JAXBElement(_CTHslColorAlphaMod_QNAME, CTPositivePercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorRedOff(CTPercentage value) { + return new JAXBElement(_CTHslColorRedOff_QNAME, CTPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorAlphaOff(CTFixedPercentage value) { + return new JAXBElement(_CTHslColorAlphaOff_QNAME, CTFixedPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorGreenOff(CTPercentage value) { + return new JAXBElement(_CTHslColorGreenOff_QNAME, CTPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedAngle }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorHue(CTPositiveFixedAngle value) { + return new JAXBElement(_CTHslColorHue_QNAME, CTPositiveFixedAngle.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorRedMod(CTPercentage value) { + return new JAXBElement(_CTHslColorRedMod_QNAME, CTPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorSatOff(CTPercentage value) { + return new JAXBElement(_CTHslColorSatOff_QNAME, CTPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorGreenMod(CTPercentage value) { + return new JAXBElement(_CTHslColorGreenMod_QNAME, CTPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorSat(CTPercentage value) { + return new JAXBElement(_CTHslColorSat_QNAME, CTPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorBlue(CTPercentage value) { + return new JAXBElement(_CTHslColorBlue_QNAME, CTPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorRed(CTPercentage value) { + return new JAXBElement(_CTHslColorRed_QNAME, CTPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorSatMod(CTPercentage value) { + return new JAXBElement(_CTHslColorSatMod_QNAME, CTPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorBlueMod(CTPercentage value) { + return new JAXBElement(_CTHslColorBlueMod_QNAME, CTPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTAngle }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorHueOff(CTAngle value) { + return new JAXBElement(_CTHslColorHueOff_QNAME, CTAngle.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorShade(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorShade_QNAME, CTPositiveFixedPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorLumMod(CTPercentage value) { + return new JAXBElement(_CTHslColorLumMod_QNAME, CTPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTInverseTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorInv(CTInverseTransform value) { + return new JAXBElement(_CTHslColorInv_QNAME, CTInverseTransform.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorLumOff(CTPercentage value) { + return new JAXBElement(_CTHslColorLumOff_QNAME, CTPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorTint(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorTint_QNAME, CTPositiveFixedPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorGreen(CTPercentage value) { + return new JAXBElement(_CTHslColorGreen_QNAME, CTPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTComplementTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorComp(CTComplementTransform value) { + return new JAXBElement(_CTHslColorComp_QNAME, CTComplementTransform.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorBlueOff(CTPercentage value) { + return new JAXBElement(_CTHslColorBlueOff_QNAME, CTPercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorHueMod(CTPositivePercentage value) { + return new JAXBElement(_CTHslColorHueMod_QNAME, CTPositivePercentage.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTGrayscaleTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTSRgbColor.class) + public JAXBElement createCTSRgbColorGray(CTGrayscaleTransform value) { + return new JAXBElement(_CTHslColorGray_QNAME, CTGrayscaleTransform.class, CTSRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorAlpha(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorLum(CTPercentage value) { + return new JAXBElement(_CTHslColorLum_QNAME, CTPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTGammaTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorGamma(CTGammaTransform value) { + return new JAXBElement(_CTHslColorGamma_QNAME, CTGammaTransform.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTInverseGammaTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorInvGamma(CTInverseGammaTransform value) { + return new JAXBElement(_CTHslColorInvGamma_QNAME, CTInverseGammaTransform.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorAlphaMod(CTPositivePercentage value) { + return new JAXBElement(_CTHslColorAlphaMod_QNAME, CTPositivePercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorRedOff(CTPercentage value) { + return new JAXBElement(_CTHslColorRedOff_QNAME, CTPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorAlphaOff(CTFixedPercentage value) { + return new JAXBElement(_CTHslColorAlphaOff_QNAME, CTFixedPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorGreenOff(CTPercentage value) { + return new JAXBElement(_CTHslColorGreenOff_QNAME, CTPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedAngle }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorHue(CTPositiveFixedAngle value) { + return new JAXBElement(_CTHslColorHue_QNAME, CTPositiveFixedAngle.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorRedMod(CTPercentage value) { + return new JAXBElement(_CTHslColorRedMod_QNAME, CTPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorSatOff(CTPercentage value) { + return new JAXBElement(_CTHslColorSatOff_QNAME, CTPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorGreenMod(CTPercentage value) { + return new JAXBElement(_CTHslColorGreenMod_QNAME, CTPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorSat(CTPercentage value) { + return new JAXBElement(_CTHslColorSat_QNAME, CTPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorBlue(CTPercentage value) { + return new JAXBElement(_CTHslColorBlue_QNAME, CTPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorRed(CTPercentage value) { + return new JAXBElement(_CTHslColorRed_QNAME, CTPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorSatMod(CTPercentage value) { + return new JAXBElement(_CTHslColorSatMod_QNAME, CTPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorBlueMod(CTPercentage value) { + return new JAXBElement(_CTHslColorBlueMod_QNAME, CTPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTAngle }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorHueOff(CTAngle value) { + return new JAXBElement(_CTHslColorHueOff_QNAME, CTAngle.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorShade(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorShade_QNAME, CTPositiveFixedPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorLumMod(CTPercentage value) { + return new JAXBElement(_CTHslColorLumMod_QNAME, CTPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTInverseTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorInv(CTInverseTransform value) { + return new JAXBElement(_CTHslColorInv_QNAME, CTInverseTransform.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorLumOff(CTPercentage value) { + return new JAXBElement(_CTHslColorLumOff_QNAME, CTPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorTint(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorTint_QNAME, CTPositiveFixedPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorGreen(CTPercentage value) { + return new JAXBElement(_CTHslColorGreen_QNAME, CTPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTComplementTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorComp(CTComplementTransform value) { + return new JAXBElement(_CTHslColorComp_QNAME, CTComplementTransform.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorBlueOff(CTPercentage value) { + return new JAXBElement(_CTHslColorBlueOff_QNAME, CTPercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorHueMod(CTPositivePercentage value) { + return new JAXBElement(_CTHslColorHueMod_QNAME, CTPositivePercentage.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTGrayscaleTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTSystemColor.class) + public JAXBElement createCTSystemColorGray(CTGrayscaleTransform value) { + return new JAXBElement(_CTHslColorGray_QNAME, CTGrayscaleTransform.class, CTSystemColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorAlpha(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorLum(CTPercentage value) { + return new JAXBElement(_CTHslColorLum_QNAME, CTPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTGammaTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorGamma(CTGammaTransform value) { + return new JAXBElement(_CTHslColorGamma_QNAME, CTGammaTransform.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTInverseGammaTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorInvGamma(CTInverseGammaTransform value) { + return new JAXBElement(_CTHslColorInvGamma_QNAME, CTInverseGammaTransform.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorAlphaMod(CTPositivePercentage value) { + return new JAXBElement(_CTHslColorAlphaMod_QNAME, CTPositivePercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorRedOff(CTPercentage value) { + return new JAXBElement(_CTHslColorRedOff_QNAME, CTPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorAlphaOff(CTFixedPercentage value) { + return new JAXBElement(_CTHslColorAlphaOff_QNAME, CTFixedPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorGreenOff(CTPercentage value) { + return new JAXBElement(_CTHslColorGreenOff_QNAME, CTPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedAngle }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorHue(CTPositiveFixedAngle value) { + return new JAXBElement(_CTHslColorHue_QNAME, CTPositiveFixedAngle.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorRedMod(CTPercentage value) { + return new JAXBElement(_CTHslColorRedMod_QNAME, CTPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorSatOff(CTPercentage value) { + return new JAXBElement(_CTHslColorSatOff_QNAME, CTPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorGreenMod(CTPercentage value) { + return new JAXBElement(_CTHslColorGreenMod_QNAME, CTPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorSat(CTPercentage value) { + return new JAXBElement(_CTHslColorSat_QNAME, CTPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorBlue(CTPercentage value) { + return new JAXBElement(_CTHslColorBlue_QNAME, CTPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorRed(CTPercentage value) { + return new JAXBElement(_CTHslColorRed_QNAME, CTPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorSatMod(CTPercentage value) { + return new JAXBElement(_CTHslColorSatMod_QNAME, CTPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorBlueMod(CTPercentage value) { + return new JAXBElement(_CTHslColorBlueMod_QNAME, CTPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTAngle }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorHueOff(CTAngle value) { + return new JAXBElement(_CTHslColorHueOff_QNAME, CTAngle.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorShade(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorShade_QNAME, CTPositiveFixedPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorLumMod(CTPercentage value) { + return new JAXBElement(_CTHslColorLumMod_QNAME, CTPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTInverseTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorInv(CTInverseTransform value) { + return new JAXBElement(_CTHslColorInv_QNAME, CTInverseTransform.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorLumOff(CTPercentage value) { + return new JAXBElement(_CTHslColorLumOff_QNAME, CTPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorTint(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorTint_QNAME, CTPositiveFixedPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorGreen(CTPercentage value) { + return new JAXBElement(_CTHslColorGreen_QNAME, CTPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTComplementTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorComp(CTComplementTransform value) { + return new JAXBElement(_CTHslColorComp_QNAME, CTComplementTransform.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorBlueOff(CTPercentage value) { + return new JAXBElement(_CTHslColorBlueOff_QNAME, CTPercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorHueMod(CTPositivePercentage value) { + return new JAXBElement(_CTHslColorHueMod_QNAME, CTPositivePercentage.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTGrayscaleTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTSchemeColor.class) + public JAXBElement createCTSchemeColorGray(CTGrayscaleTransform value) { + return new JAXBElement(_CTHslColorGray_QNAME, CTGrayscaleTransform.class, CTSchemeColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorAlpha(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorLum(CTPercentage value) { + return new JAXBElement(_CTHslColorLum_QNAME, CTPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTGammaTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorGamma(CTGammaTransform value) { + return new JAXBElement(_CTHslColorGamma_QNAME, CTGammaTransform.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTInverseGammaTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorInvGamma(CTInverseGammaTransform value) { + return new JAXBElement(_CTHslColorInvGamma_QNAME, CTInverseGammaTransform.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorAlphaMod(CTPositivePercentage value) { + return new JAXBElement(_CTHslColorAlphaMod_QNAME, CTPositivePercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorRedOff(CTPercentage value) { + return new JAXBElement(_CTHslColorRedOff_QNAME, CTPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorAlphaOff(CTFixedPercentage value) { + return new JAXBElement(_CTHslColorAlphaOff_QNAME, CTFixedPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorGreenOff(CTPercentage value) { + return new JAXBElement(_CTHslColorGreenOff_QNAME, CTPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedAngle }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorHue(CTPositiveFixedAngle value) { + return new JAXBElement(_CTHslColorHue_QNAME, CTPositiveFixedAngle.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorRedMod(CTPercentage value) { + return new JAXBElement(_CTHslColorRedMod_QNAME, CTPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorSatOff(CTPercentage value) { + return new JAXBElement(_CTHslColorSatOff_QNAME, CTPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorGreenMod(CTPercentage value) { + return new JAXBElement(_CTHslColorGreenMod_QNAME, CTPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorSat(CTPercentage value) { + return new JAXBElement(_CTHslColorSat_QNAME, CTPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorBlue(CTPercentage value) { + return new JAXBElement(_CTHslColorBlue_QNAME, CTPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorRed(CTPercentage value) { + return new JAXBElement(_CTHslColorRed_QNAME, CTPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorSatMod(CTPercentage value) { + return new JAXBElement(_CTHslColorSatMod_QNAME, CTPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorBlueMod(CTPercentage value) { + return new JAXBElement(_CTHslColorBlueMod_QNAME, CTPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTAngle }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorHueOff(CTAngle value) { + return new JAXBElement(_CTHslColorHueOff_QNAME, CTAngle.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorShade(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorShade_QNAME, CTPositiveFixedPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorLumMod(CTPercentage value) { + return new JAXBElement(_CTHslColorLumMod_QNAME, CTPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTInverseTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorInv(CTInverseTransform value) { + return new JAXBElement(_CTHslColorInv_QNAME, CTInverseTransform.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorLumOff(CTPercentage value) { + return new JAXBElement(_CTHslColorLumOff_QNAME, CTPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorTint(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorTint_QNAME, CTPositiveFixedPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorGreen(CTPercentage value) { + return new JAXBElement(_CTHslColorGreen_QNAME, CTPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTComplementTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorComp(CTComplementTransform value) { + return new JAXBElement(_CTHslColorComp_QNAME, CTComplementTransform.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorBlueOff(CTPercentage value) { + return new JAXBElement(_CTHslColorBlueOff_QNAME, CTPercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorHueMod(CTPositivePercentage value) { + return new JAXBElement(_CTHslColorHueMod_QNAME, CTPositivePercentage.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTGrayscaleTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTScRgbColor.class) + public JAXBElement createCTScRgbColorGray(CTGrayscaleTransform value) { + return new JAXBElement(_CTHslColorGray_QNAME, CTGrayscaleTransform.class, CTScRgbColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alpha", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorAlpha(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorAlpha_QNAME, CTPositiveFixedPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lum", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorLum(CTPercentage value) { + return new JAXBElement(_CTHslColorLum_QNAME, CTPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTGammaTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gamma", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorGamma(CTGammaTransform value) { + return new JAXBElement(_CTHslColorGamma_QNAME, CTGammaTransform.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTInverseGammaTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "invGamma", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorInvGamma(CTInverseGammaTransform value) { + return new JAXBElement(_CTHslColorInvGamma_QNAME, CTInverseGammaTransform.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaMod", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorAlphaMod(CTPositivePercentage value) { + return new JAXBElement(_CTHslColorAlphaMod_QNAME, CTPositivePercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redOff", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorRedOff(CTPercentage value) { + return new JAXBElement(_CTHslColorRedOff_QNAME, CTPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "alphaOff", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorAlphaOff(CTFixedPercentage value) { + return new JAXBElement(_CTHslColorAlphaOff_QNAME, CTFixedPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenOff", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorGreenOff(CTPercentage value) { + return new JAXBElement(_CTHslColorGreenOff_QNAME, CTPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedAngle }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hue", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorHue(CTPositiveFixedAngle value) { + return new JAXBElement(_CTHslColorHue_QNAME, CTPositiveFixedAngle.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "redMod", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorRedMod(CTPercentage value) { + return new JAXBElement(_CTHslColorRedMod_QNAME, CTPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satOff", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorSatOff(CTPercentage value) { + return new JAXBElement(_CTHslColorSatOff_QNAME, CTPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "greenMod", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorGreenMod(CTPercentage value) { + return new JAXBElement(_CTHslColorGreenMod_QNAME, CTPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "sat", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorSat(CTPercentage value) { + return new JAXBElement(_CTHslColorSat_QNAME, CTPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blue", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorBlue(CTPercentage value) { + return new JAXBElement(_CTHslColorBlue_QNAME, CTPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "red", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorRed(CTPercentage value) { + return new JAXBElement(_CTHslColorRed_QNAME, CTPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "satMod", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorSatMod(CTPercentage value) { + return new JAXBElement(_CTHslColorSatMod_QNAME, CTPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueMod", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorBlueMod(CTPercentage value) { + return new JAXBElement(_CTHslColorBlueMod_QNAME, CTPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTAngle }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueOff", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorHueOff(CTAngle value) { + return new JAXBElement(_CTHslColorHueOff_QNAME, CTAngle.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "shade", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorShade(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorShade_QNAME, CTPositiveFixedPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumMod", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorLumMod(CTPercentage value) { + return new JAXBElement(_CTHslColorLumMod_QNAME, CTPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTInverseTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "inv", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorInv(CTInverseTransform value) { + return new JAXBElement(_CTHslColorInv_QNAME, CTInverseTransform.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "lumOff", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorLumOff(CTPercentage value) { + return new JAXBElement(_CTHslColorLumOff_QNAME, CTPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositiveFixedPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "tint", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorTint(CTPositiveFixedPercentage value) { + return new JAXBElement(_CTHslColorTint_QNAME, CTPositiveFixedPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "green", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorGreen(CTPercentage value) { + return new JAXBElement(_CTHslColorGreen_QNAME, CTPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTComplementTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "comp", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorComp(CTComplementTransform value) { + return new JAXBElement(_CTHslColorComp_QNAME, CTComplementTransform.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "blueOff", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorBlueOff(CTPercentage value) { + return new JAXBElement(_CTHslColorBlueOff_QNAME, CTPercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTPositivePercentage }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "hueMod", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorHueMod(CTPositivePercentage value) { + return new JAXBElement(_CTHslColorHueMod_QNAME, CTPositivePercentage.class, CTPresetColor.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CTGrayscaleTransform }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", name = "gray", scope = CTPresetColor.class) + public JAXBElement createCTPresetColorGray(CTGrayscaleTransform value) { + return new JAXBElement(_CTHslColorGray_QNAME, CTGrayscaleTransform.class, CTPresetColor.class, value); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/STBlackWhiteMode.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/STBlackWhiteMode.java new file mode 100644 index 000000000..27262d606 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/STBlackWhiteMode.java @@ -0,0 +1,149 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for ST_BlackWhiteMode. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="ST_BlackWhiteMode">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *     <enumeration value="clr"/>
+ *     <enumeration value="auto"/>
+ *     <enumeration value="gray"/>
+ *     <enumeration value="ltGray"/>
+ *     <enumeration value="invGray"/>
+ *     <enumeration value="grayWhite"/>
+ *     <enumeration value="blackGray"/>
+ *     <enumeration value="blackWhite"/>
+ *     <enumeration value="black"/>
+ *     <enumeration value="white"/>
+ *     <enumeration value="hidden"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "ST_BlackWhiteMode", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +@XmlEnum +public enum STBlackWhiteMode { + + + /** + * Color + * + */ + @XmlEnumValue("clr") + CLR("clr"), + + /** + * Automatic + * + */ + @XmlEnumValue("auto") + AUTO("auto"), + + /** + * Gray + * + */ + @XmlEnumValue("gray") + GRAY("gray"), + + /** + * Light Gray + * + */ + @XmlEnumValue("ltGray") + LT_GRAY("ltGray"), + + /** + * Inverse Gray + * + */ + @XmlEnumValue("invGray") + INV_GRAY("invGray"), + + /** + * Gray and White + * + */ + @XmlEnumValue("grayWhite") + GRAY_WHITE("grayWhite"), + + /** + * Black and Gray + * + */ + @XmlEnumValue("blackGray") + BLACK_GRAY("blackGray"), + + /** + * Black and White + * + */ + @XmlEnumValue("blackWhite") + BLACK_WHITE("blackWhite"), + + /** + * Black + * + */ + @XmlEnumValue("black") + BLACK("black"), + + /** + * White + * + */ + @XmlEnumValue("white") + WHITE("white"), + + /** + * Hidden + * + */ + @XmlEnumValue("hidden") + HIDDEN("hidden"); + private final String value; + + STBlackWhiteMode(String v) { + value = v; + } + + public String value() { + return value; + } + + public static STBlackWhiteMode fromValue(String v) { + for (STBlackWhiteMode c: STBlackWhiteMode.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/STPathFillMode.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/STPathFillMode.java new file mode 100644 index 000000000..8a26458f0 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/STPathFillMode.java @@ -0,0 +1,109 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for ST_PathFillMode. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="ST_PathFillMode">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *     <enumeration value="none"/>
+ *     <enumeration value="norm"/>
+ *     <enumeration value="lighten"/>
+ *     <enumeration value="lightenLess"/>
+ *     <enumeration value="darken"/>
+ *     <enumeration value="darkenLess"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "ST_PathFillMode", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +@XmlEnum +public enum STPathFillMode { + + + /** + * No Path Fill + * + */ + @XmlEnumValue("none") + NONE("none"), + + /** + * Normal Path Fill + * + */ + @XmlEnumValue("norm") + NORM("norm"), + + /** + * Lighten Path Fill + * + */ + @XmlEnumValue("lighten") + LIGHTEN("lighten"), + + /** + * Lighten Path Fill Less + * + */ + @XmlEnumValue("lightenLess") + LIGHTEN_LESS("lightenLess"), + + /** + * Darken Path Fill + * + */ + @XmlEnumValue("darken") + DARKEN("darken"), + + /** + * Darken Path Fill Less + * + */ + @XmlEnumValue("darkenLess") + DARKEN_LESS("darkenLess"); + private final String value; + + STPathFillMode(String v) { + value = v; + } + + public String value() { + return value; + } + + public static STPathFillMode fromValue(String v) { + for (STPathFillMode c: STPathFillMode.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/STPresetColorVal.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/STPresetColorVal.java new file mode 100644 index 000000000..7450ac656 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/STPresetColorVal.java @@ -0,0 +1,1181 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for ST_PresetColorVal. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="ST_PresetColorVal">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *     <enumeration value="aliceBlue"/>
+ *     <enumeration value="antiqueWhite"/>
+ *     <enumeration value="aqua"/>
+ *     <enumeration value="aquamarine"/>
+ *     <enumeration value="azure"/>
+ *     <enumeration value="beige"/>
+ *     <enumeration value="bisque"/>
+ *     <enumeration value="black"/>
+ *     <enumeration value="blanchedAlmond"/>
+ *     <enumeration value="blue"/>
+ *     <enumeration value="blueViolet"/>
+ *     <enumeration value="brown"/>
+ *     <enumeration value="burlyWood"/>
+ *     <enumeration value="cadetBlue"/>
+ *     <enumeration value="chartreuse"/>
+ *     <enumeration value="chocolate"/>
+ *     <enumeration value="coral"/>
+ *     <enumeration value="cornflowerBlue"/>
+ *     <enumeration value="cornsilk"/>
+ *     <enumeration value="crimson"/>
+ *     <enumeration value="cyan"/>
+ *     <enumeration value="dkBlue"/>
+ *     <enumeration value="dkCyan"/>
+ *     <enumeration value="dkGoldenrod"/>
+ *     <enumeration value="dkGray"/>
+ *     <enumeration value="dkGreen"/>
+ *     <enumeration value="dkKhaki"/>
+ *     <enumeration value="dkMagenta"/>
+ *     <enumeration value="dkOliveGreen"/>
+ *     <enumeration value="dkOrange"/>
+ *     <enumeration value="dkOrchid"/>
+ *     <enumeration value="dkRed"/>
+ *     <enumeration value="dkSalmon"/>
+ *     <enumeration value="dkSeaGreen"/>
+ *     <enumeration value="dkSlateBlue"/>
+ *     <enumeration value="dkSlateGray"/>
+ *     <enumeration value="dkTurquoise"/>
+ *     <enumeration value="dkViolet"/>
+ *     <enumeration value="deepPink"/>
+ *     <enumeration value="deepSkyBlue"/>
+ *     <enumeration value="dimGray"/>
+ *     <enumeration value="dodgerBlue"/>
+ *     <enumeration value="firebrick"/>
+ *     <enumeration value="floralWhite"/>
+ *     <enumeration value="forestGreen"/>
+ *     <enumeration value="fuchsia"/>
+ *     <enumeration value="gainsboro"/>
+ *     <enumeration value="ghostWhite"/>
+ *     <enumeration value="gold"/>
+ *     <enumeration value="goldenrod"/>
+ *     <enumeration value="gray"/>
+ *     <enumeration value="green"/>
+ *     <enumeration value="greenYellow"/>
+ *     <enumeration value="honeydew"/>
+ *     <enumeration value="hotPink"/>
+ *     <enumeration value="indianRed"/>
+ *     <enumeration value="indigo"/>
+ *     <enumeration value="ivory"/>
+ *     <enumeration value="khaki"/>
+ *     <enumeration value="lavender"/>
+ *     <enumeration value="lavenderBlush"/>
+ *     <enumeration value="lawnGreen"/>
+ *     <enumeration value="lemonChiffon"/>
+ *     <enumeration value="ltBlue"/>
+ *     <enumeration value="ltCoral"/>
+ *     <enumeration value="ltCyan"/>
+ *     <enumeration value="ltGoldenrodYellow"/>
+ *     <enumeration value="ltGray"/>
+ *     <enumeration value="ltGreen"/>
+ *     <enumeration value="ltPink"/>
+ *     <enumeration value="ltSalmon"/>
+ *     <enumeration value="ltSeaGreen"/>
+ *     <enumeration value="ltSkyBlue"/>
+ *     <enumeration value="ltSlateGray"/>
+ *     <enumeration value="ltSteelBlue"/>
+ *     <enumeration value="ltYellow"/>
+ *     <enumeration value="lime"/>
+ *     <enumeration value="limeGreen"/>
+ *     <enumeration value="linen"/>
+ *     <enumeration value="magenta"/>
+ *     <enumeration value="maroon"/>
+ *     <enumeration value="medAquamarine"/>
+ *     <enumeration value="medBlue"/>
+ *     <enumeration value="medOrchid"/>
+ *     <enumeration value="medPurple"/>
+ *     <enumeration value="medSeaGreen"/>
+ *     <enumeration value="medSlateBlue"/>
+ *     <enumeration value="medSpringGreen"/>
+ *     <enumeration value="medTurquoise"/>
+ *     <enumeration value="medVioletRed"/>
+ *     <enumeration value="midnightBlue"/>
+ *     <enumeration value="mintCream"/>
+ *     <enumeration value="mistyRose"/>
+ *     <enumeration value="moccasin"/>
+ *     <enumeration value="navajoWhite"/>
+ *     <enumeration value="navy"/>
+ *     <enumeration value="oldLace"/>
+ *     <enumeration value="olive"/>
+ *     <enumeration value="oliveDrab"/>
+ *     <enumeration value="orange"/>
+ *     <enumeration value="orangeRed"/>
+ *     <enumeration value="orchid"/>
+ *     <enumeration value="paleGoldenrod"/>
+ *     <enumeration value="paleGreen"/>
+ *     <enumeration value="paleTurquoise"/>
+ *     <enumeration value="paleVioletRed"/>
+ *     <enumeration value="papayaWhip"/>
+ *     <enumeration value="peachPuff"/>
+ *     <enumeration value="peru"/>
+ *     <enumeration value="pink"/>
+ *     <enumeration value="plum"/>
+ *     <enumeration value="powderBlue"/>
+ *     <enumeration value="purple"/>
+ *     <enumeration value="red"/>
+ *     <enumeration value="rosyBrown"/>
+ *     <enumeration value="royalBlue"/>
+ *     <enumeration value="saddleBrown"/>
+ *     <enumeration value="salmon"/>
+ *     <enumeration value="sandyBrown"/>
+ *     <enumeration value="seaGreen"/>
+ *     <enumeration value="seaShell"/>
+ *     <enumeration value="sienna"/>
+ *     <enumeration value="silver"/>
+ *     <enumeration value="skyBlue"/>
+ *     <enumeration value="slateBlue"/>
+ *     <enumeration value="slateGray"/>
+ *     <enumeration value="snow"/>
+ *     <enumeration value="springGreen"/>
+ *     <enumeration value="steelBlue"/>
+ *     <enumeration value="tan"/>
+ *     <enumeration value="teal"/>
+ *     <enumeration value="thistle"/>
+ *     <enumeration value="tomato"/>
+ *     <enumeration value="turquoise"/>
+ *     <enumeration value="violet"/>
+ *     <enumeration value="wheat"/>
+ *     <enumeration value="white"/>
+ *     <enumeration value="whiteSmoke"/>
+ *     <enumeration value="yellow"/>
+ *     <enumeration value="yellowGreen"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "ST_PresetColorVal", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +@XmlEnum +public enum STPresetColorVal { + + + /** + * Alice Blue Preset Color + * + */ + @XmlEnumValue("aliceBlue") + ALICE_BLUE("aliceBlue"), + + /** + * Antique White Preset Color + * + */ + @XmlEnumValue("antiqueWhite") + ANTIQUE_WHITE("antiqueWhite"), + + /** + * Aqua Preset Color + * + */ + @XmlEnumValue("aqua") + AQUA("aqua"), + + /** + * Aquamarine Preset Color + * + */ + @XmlEnumValue("aquamarine") + AQUAMARINE("aquamarine"), + + /** + * Azure Preset Color + * + */ + @XmlEnumValue("azure") + AZURE("azure"), + + /** + * Beige Preset Color + * + */ + @XmlEnumValue("beige") + BEIGE("beige"), + + /** + * Bisque Preset Color + * + */ + @XmlEnumValue("bisque") + BISQUE("bisque"), + + /** + * Black Preset Color + * + */ + @XmlEnumValue("black") + BLACK("black"), + + /** + * Blanched Almond Preset Color + * + */ + @XmlEnumValue("blanchedAlmond") + BLANCHED_ALMOND("blanchedAlmond"), + + /** + * Blue Preset Color + * + */ + @XmlEnumValue("blue") + BLUE("blue"), + + /** + * Blue Violet Preset Color + * + */ + @XmlEnumValue("blueViolet") + BLUE_VIOLET("blueViolet"), + + /** + * Brown Preset Color + * + */ + @XmlEnumValue("brown") + BROWN("brown"), + + /** + * Burly Wood Preset Color + * + */ + @XmlEnumValue("burlyWood") + BURLY_WOOD("burlyWood"), + + /** + * Cadet Blue Preset Color + * + */ + @XmlEnumValue("cadetBlue") + CADET_BLUE("cadetBlue"), + + /** + * Chartreuse Preset Color + * + */ + @XmlEnumValue("chartreuse") + CHARTREUSE("chartreuse"), + + /** + * Chocolate Preset Color + * + */ + @XmlEnumValue("chocolate") + CHOCOLATE("chocolate"), + + /** + * Coral Preset Color + * + */ + @XmlEnumValue("coral") + CORAL("coral"), + + /** + * Cornflower Blue Preset Color + * + */ + @XmlEnumValue("cornflowerBlue") + CORNFLOWER_BLUE("cornflowerBlue"), + + /** + * Cornsilk Preset Color + * + */ + @XmlEnumValue("cornsilk") + CORNSILK("cornsilk"), + + /** + * Crimson Preset Color + * + */ + @XmlEnumValue("crimson") + CRIMSON("crimson"), + + /** + * Cyan Preset Color + * + */ + @XmlEnumValue("cyan") + CYAN("cyan"), + + /** + * Dark Blue Preset Color + * + */ + @XmlEnumValue("dkBlue") + DK_BLUE("dkBlue"), + + /** + * Dark Cyan Preset Color + * + */ + @XmlEnumValue("dkCyan") + DK_CYAN("dkCyan"), + + /** + * Dark Goldenrod Preset Color + * + */ + @XmlEnumValue("dkGoldenrod") + DK_GOLDENROD("dkGoldenrod"), + + /** + * Dark Gray Preset Color + * + */ + @XmlEnumValue("dkGray") + DK_GRAY("dkGray"), + + /** + * Dark Green Preset Color + * + */ + @XmlEnumValue("dkGreen") + DK_GREEN("dkGreen"), + + /** + * Dark Khaki Preset Color + * + */ + @XmlEnumValue("dkKhaki") + DK_KHAKI("dkKhaki"), + + /** + * Dark Magenta Preset Color + * + */ + @XmlEnumValue("dkMagenta") + DK_MAGENTA("dkMagenta"), + + /** + * Dark Olive Green Preset Color + * + */ + @XmlEnumValue("dkOliveGreen") + DK_OLIVE_GREEN("dkOliveGreen"), + + /** + * Dark Orange Preset Color + * + */ + @XmlEnumValue("dkOrange") + DK_ORANGE("dkOrange"), + + /** + * Dark Orchid Preset Color + * + */ + @XmlEnumValue("dkOrchid") + DK_ORCHID("dkOrchid"), + + /** + * Dark Red Preset Color + * + */ + @XmlEnumValue("dkRed") + DK_RED("dkRed"), + + /** + * Dark Salmon Preset Color + * + */ + @XmlEnumValue("dkSalmon") + DK_SALMON("dkSalmon"), + + /** + * Dark Sea Green Preset Color + * + */ + @XmlEnumValue("dkSeaGreen") + DK_SEA_GREEN("dkSeaGreen"), + + /** + * Dark Slate Blue Preset Color + * + */ + @XmlEnumValue("dkSlateBlue") + DK_SLATE_BLUE("dkSlateBlue"), + + /** + * Dark Slate Gray Preset Color + * + */ + @XmlEnumValue("dkSlateGray") + DK_SLATE_GRAY("dkSlateGray"), + + /** + * Dark Turquoise Preset Color + * + */ + @XmlEnumValue("dkTurquoise") + DK_TURQUOISE("dkTurquoise"), + + /** + * Dark Violet Preset Color + * + */ + @XmlEnumValue("dkViolet") + DK_VIOLET("dkViolet"), + + /** + * Deep Pink Preset Color + * + */ + @XmlEnumValue("deepPink") + DEEP_PINK("deepPink"), + + /** + * Deep Sky Blue Preset Color + * + */ + @XmlEnumValue("deepSkyBlue") + DEEP_SKY_BLUE("deepSkyBlue"), + + /** + * Dim Gray Preset Color + * + */ + @XmlEnumValue("dimGray") + DIM_GRAY("dimGray"), + + /** + * Dodger Blue Preset Color + * + */ + @XmlEnumValue("dodgerBlue") + DODGER_BLUE("dodgerBlue"), + + /** + * Firebrick Preset Color + * + */ + @XmlEnumValue("firebrick") + FIREBRICK("firebrick"), + + /** + * Floral White Preset Color + * + */ + @XmlEnumValue("floralWhite") + FLORAL_WHITE("floralWhite"), + + /** + * Forest Green Preset Color + * + */ + @XmlEnumValue("forestGreen") + FOREST_GREEN("forestGreen"), + + /** + * Fuchsia Preset Color + * + */ + @XmlEnumValue("fuchsia") + FUCHSIA("fuchsia"), + + /** + * Gainsboro Preset Color + * + */ + @XmlEnumValue("gainsboro") + GAINSBORO("gainsboro"), + + /** + * Ghost White Preset Color + * + */ + @XmlEnumValue("ghostWhite") + GHOST_WHITE("ghostWhite"), + + /** + * Gold Preset Color + * + */ + @XmlEnumValue("gold") + GOLD("gold"), + + /** + * Goldenrod Preset Color + * + */ + @XmlEnumValue("goldenrod") + GOLDENROD("goldenrod"), + + /** + * Gray Preset Color + * + */ + @XmlEnumValue("gray") + GRAY("gray"), + + /** + * Green Preset Color + * + */ + @XmlEnumValue("green") + GREEN("green"), + + /** + * Green Yellow Preset Color + * + */ + @XmlEnumValue("greenYellow") + GREEN_YELLOW("greenYellow"), + + /** + * Honeydew Preset Color + * + */ + @XmlEnumValue("honeydew") + HONEYDEW("honeydew"), + + /** + * Hot Pink Preset Color + * + */ + @XmlEnumValue("hotPink") + HOT_PINK("hotPink"), + + /** + * Indian Red Preset Color + * + */ + @XmlEnumValue("indianRed") + INDIAN_RED("indianRed"), + + /** + * Indigo Preset Color + * + */ + @XmlEnumValue("indigo") + INDIGO("indigo"), + + /** + * Ivory Preset Color + * + */ + @XmlEnumValue("ivory") + IVORY("ivory"), + + /** + * Khaki Preset Color + * + */ + @XmlEnumValue("khaki") + KHAKI("khaki"), + + /** + * Lavender Preset Color + * + */ + @XmlEnumValue("lavender") + LAVENDER("lavender"), + + /** + * Lavender Blush Preset Color + * + */ + @XmlEnumValue("lavenderBlush") + LAVENDER_BLUSH("lavenderBlush"), + + /** + * Lawn Green Preset Color + * + */ + @XmlEnumValue("lawnGreen") + LAWN_GREEN("lawnGreen"), + + /** + * Lemon Chiffon Preset Color + * + */ + @XmlEnumValue("lemonChiffon") + LEMON_CHIFFON("lemonChiffon"), + + /** + * Light Blue Preset Color + * + */ + @XmlEnumValue("ltBlue") + LT_BLUE("ltBlue"), + + /** + * Light Coral Preset Color + * + */ + @XmlEnumValue("ltCoral") + LT_CORAL("ltCoral"), + + /** + * Light Cyan Preset Color + * + */ + @XmlEnumValue("ltCyan") + LT_CYAN("ltCyan"), + + /** + * Light Goldenrod Yellow Preset Color + * + */ + @XmlEnumValue("ltGoldenrodYellow") + LT_GOLDENROD_YELLOW("ltGoldenrodYellow"), + + /** + * Light Gray Preset Color + * + */ + @XmlEnumValue("ltGray") + LT_GRAY("ltGray"), + + /** + * Light Green Preset Color + * + */ + @XmlEnumValue("ltGreen") + LT_GREEN("ltGreen"), + + /** + * Light Pink Preset Color + * + */ + @XmlEnumValue("ltPink") + LT_PINK("ltPink"), + + /** + * Light Salmon Preset Color + * + */ + @XmlEnumValue("ltSalmon") + LT_SALMON("ltSalmon"), + + /** + * Light Sea Green Preset Color + * + */ + @XmlEnumValue("ltSeaGreen") + LT_SEA_GREEN("ltSeaGreen"), + + /** + * Light Sky Blue Preset Color + * + */ + @XmlEnumValue("ltSkyBlue") + LT_SKY_BLUE("ltSkyBlue"), + + /** + * Light Slate Gray Preset Color + * + */ + @XmlEnumValue("ltSlateGray") + LT_SLATE_GRAY("ltSlateGray"), + + /** + * Light Steel Blue Preset Color + * + */ + @XmlEnumValue("ltSteelBlue") + LT_STEEL_BLUE("ltSteelBlue"), + + /** + * Light Yellow Preset Color + * + */ + @XmlEnumValue("ltYellow") + LT_YELLOW("ltYellow"), + + /** + * Lime Preset Color + * + */ + @XmlEnumValue("lime") + LIME("lime"), + + /** + * Lime Green Preset Color + * + */ + @XmlEnumValue("limeGreen") + LIME_GREEN("limeGreen"), + + /** + * Linen Preset Color + * + */ + @XmlEnumValue("linen") + LINEN("linen"), + + /** + * Magenta Preset Color + * + */ + @XmlEnumValue("magenta") + MAGENTA("magenta"), + + /** + * Maroon Preset Color + * + */ + @XmlEnumValue("maroon") + MAROON("maroon"), + + /** + * Medium Aquamarine Preset Color + * + */ + @XmlEnumValue("medAquamarine") + MED_AQUAMARINE("medAquamarine"), + + /** + * Medium Blue Preset Color + * + */ + @XmlEnumValue("medBlue") + MED_BLUE("medBlue"), + + /** + * Medium Orchid Preset Color + * + */ + @XmlEnumValue("medOrchid") + MED_ORCHID("medOrchid"), + + /** + * Medium Purple Preset Color + * + */ + @XmlEnumValue("medPurple") + MED_PURPLE("medPurple"), + + /** + * Medium Sea Green Preset Color + * + */ + @XmlEnumValue("medSeaGreen") + MED_SEA_GREEN("medSeaGreen"), + + /** + * Medium Slate Blue Preset Color + * + */ + @XmlEnumValue("medSlateBlue") + MED_SLATE_BLUE("medSlateBlue"), + + /** + * Medium Spring Green Preset Color + * + */ + @XmlEnumValue("medSpringGreen") + MED_SPRING_GREEN("medSpringGreen"), + + /** + * Medium Turquoise Preset Color + * + */ + @XmlEnumValue("medTurquoise") + MED_TURQUOISE("medTurquoise"), + + /** + * Medium Violet Red Preset Color + * + */ + @XmlEnumValue("medVioletRed") + MED_VIOLET_RED("medVioletRed"), + + /** + * Midnight Blue Preset Color + * + */ + @XmlEnumValue("midnightBlue") + MIDNIGHT_BLUE("midnightBlue"), + + /** + * Mint Cream Preset Color + * + */ + @XmlEnumValue("mintCream") + MINT_CREAM("mintCream"), + + /** + * Misty Rose Preset Color + * + */ + @XmlEnumValue("mistyRose") + MISTY_ROSE("mistyRose"), + + /** + * Moccasin Preset Color + * + */ + @XmlEnumValue("moccasin") + MOCCASIN("moccasin"), + + /** + * Navajo White Preset Color + * + */ + @XmlEnumValue("navajoWhite") + NAVAJO_WHITE("navajoWhite"), + + /** + * Navy Preset Color + * + */ + @XmlEnumValue("navy") + NAVY("navy"), + + /** + * Old Lace Preset Color + * + */ + @XmlEnumValue("oldLace") + OLD_LACE("oldLace"), + + /** + * Olive Preset Color + * + */ + @XmlEnumValue("olive") + OLIVE("olive"), + + /** + * Olive Drab Preset Color + * + */ + @XmlEnumValue("oliveDrab") + OLIVE_DRAB("oliveDrab"), + + /** + * Orange Preset Color + * + */ + @XmlEnumValue("orange") + ORANGE("orange"), + + /** + * Orange Red Preset Color + * + */ + @XmlEnumValue("orangeRed") + ORANGE_RED("orangeRed"), + + /** + * Orchid Preset Color + * + */ + @XmlEnumValue("orchid") + ORCHID("orchid"), + + /** + * Pale Goldenrod Preset Color + * + */ + @XmlEnumValue("paleGoldenrod") + PALE_GOLDENROD("paleGoldenrod"), + + /** + * Pale Green Preset Color + * + */ + @XmlEnumValue("paleGreen") + PALE_GREEN("paleGreen"), + + /** + * Pale Turquoise Preset Color + * + */ + @XmlEnumValue("paleTurquoise") + PALE_TURQUOISE("paleTurquoise"), + + /** + * Pale Violet Red Preset Color + * + */ + @XmlEnumValue("paleVioletRed") + PALE_VIOLET_RED("paleVioletRed"), + + /** + * Papaya Whip Preset Color + * + */ + @XmlEnumValue("papayaWhip") + PAPAYA_WHIP("papayaWhip"), + + /** + * Peach Puff Preset Color + * + */ + @XmlEnumValue("peachPuff") + PEACH_PUFF("peachPuff"), + + /** + * Peru Preset Color + * + */ + @XmlEnumValue("peru") + PERU("peru"), + + /** + * Pink Preset Color + * + */ + @XmlEnumValue("pink") + PINK("pink"), + + /** + * Plum Preset Color + * + */ + @XmlEnumValue("plum") + PLUM("plum"), + + /** + * Powder Blue Preset Color + * + */ + @XmlEnumValue("powderBlue") + POWDER_BLUE("powderBlue"), + + /** + * Purple Preset Color + * + */ + @XmlEnumValue("purple") + PURPLE("purple"), + + /** + * Red Preset Color + * + */ + @XmlEnumValue("red") + RED("red"), + + /** + * Rosy Brown Preset Color + * + */ + @XmlEnumValue("rosyBrown") + ROSY_BROWN("rosyBrown"), + + /** + * Royal Blue Preset Color + * + */ + @XmlEnumValue("royalBlue") + ROYAL_BLUE("royalBlue"), + + /** + * Saddle Brown Preset Color + * + */ + @XmlEnumValue("saddleBrown") + SADDLE_BROWN("saddleBrown"), + + /** + * Salmon Preset Color + * + */ + @XmlEnumValue("salmon") + SALMON("salmon"), + + /** + * Sandy Brown Preset Color + * + */ + @XmlEnumValue("sandyBrown") + SANDY_BROWN("sandyBrown"), + + /** + * Sea Green Preset Color + * + */ + @XmlEnumValue("seaGreen") + SEA_GREEN("seaGreen"), + + /** + * Sea Shell Preset Color + * + */ + @XmlEnumValue("seaShell") + SEA_SHELL("seaShell"), + + /** + * Sienna Preset Color + * + */ + @XmlEnumValue("sienna") + SIENNA("sienna"), + + /** + * Silver Preset Color + * + */ + @XmlEnumValue("silver") + SILVER("silver"), + + /** + * Sky Blue Preset Color + * + */ + @XmlEnumValue("skyBlue") + SKY_BLUE("skyBlue"), + + /** + * Slate Blue Preset Color + * + */ + @XmlEnumValue("slateBlue") + SLATE_BLUE("slateBlue"), + + /** + * Slate Gray Preset Color + * + */ + @XmlEnumValue("slateGray") + SLATE_GRAY("slateGray"), + + /** + * Snow Preset Color + * + */ + @XmlEnumValue("snow") + SNOW("snow"), + + /** + * Spring Green Preset Color + * + */ + @XmlEnumValue("springGreen") + SPRING_GREEN("springGreen"), + + /** + * Steel Blue Preset Color + * + */ + @XmlEnumValue("steelBlue") + STEEL_BLUE("steelBlue"), + + /** + * Tan Preset Color + * + */ + @XmlEnumValue("tan") + TAN("tan"), + + /** + * Teal Preset Color + * + */ + @XmlEnumValue("teal") + TEAL("teal"), + + /** + * Thistle Preset Color + * + */ + @XmlEnumValue("thistle") + THISTLE("thistle"), + + /** + * Tomato Preset Color + * + */ + @XmlEnumValue("tomato") + TOMATO("tomato"), + + /** + * Turquoise Preset Color + * + */ + @XmlEnumValue("turquoise") + TURQUOISE("turquoise"), + + /** + * Violet Preset Color + * + */ + @XmlEnumValue("violet") + VIOLET("violet"), + + /** + * Wheat Preset Color + * + */ + @XmlEnumValue("wheat") + WHEAT("wheat"), + + /** + * White Preset Color + * + */ + @XmlEnumValue("white") + WHITE("white"), + + /** + * White Smoke Preset Color + * + */ + @XmlEnumValue("whiteSmoke") + WHITE_SMOKE("whiteSmoke"), + + /** + * Yellow Preset Color + * + */ + @XmlEnumValue("yellow") + YELLOW("yellow"), + + /** + * Yellow Green Preset Color + * + */ + @XmlEnumValue("yellowGreen") + YELLOW_GREEN("yellowGreen"); + private final String value; + + STPresetColorVal(String v) { + value = v; + } + + public String value() { + return value; + } + + public static STPresetColorVal fromValue(String v) { + for (STPresetColorVal c: STPresetColorVal.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/STRectAlignment.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/STRectAlignment.java new file mode 100644 index 000000000..688a166ba --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/STRectAlignment.java @@ -0,0 +1,133 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for ST_RectAlignment. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="ST_RectAlignment">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *     <enumeration value="tl"/>
+ *     <enumeration value="t"/>
+ *     <enumeration value="tr"/>
+ *     <enumeration value="l"/>
+ *     <enumeration value="ctr"/>
+ *     <enumeration value="r"/>
+ *     <enumeration value="bl"/>
+ *     <enumeration value="b"/>
+ *     <enumeration value="br"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "ST_RectAlignment", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +@XmlEnum +public enum STRectAlignment { + + + /** + * Rectangle Alignment Enum ( Top Left ) + * + */ + @XmlEnumValue("tl") + TL("tl"), + + /** + * Rectangle Alignment Enum ( Top ) + * + */ + @XmlEnumValue("t") + T("t"), + + /** + * Rectangle Alignment Enum ( Top Right ) + * + */ + @XmlEnumValue("tr") + TR("tr"), + + /** + * Rectangle Alignment Enum ( Left ) + * + */ + @XmlEnumValue("l") + L("l"), + + /** + * Rectangle Alignment Enum ( Center ) + * + */ + @XmlEnumValue("ctr") + CTR("ctr"), + + /** + * Rectangle Alignment Enum ( Right ) + * + */ + @XmlEnumValue("r") + R("r"), + + /** + * Rectangle Alignment Enum ( Bottom Left ) + * + */ + @XmlEnumValue("bl") + BL("bl"), + + /** + * Rectangle Alignment Enum ( Bottom ) + * + */ + @XmlEnumValue("b") + B("b"), + + /** + * Rectangle Alignment Enum ( Bottom Right ) + * + */ + @XmlEnumValue("br") + BR("br"); + private final String value; + + STRectAlignment(String v) { + value = v; + } + + public String value() { + return value; + } + + public static STRectAlignment fromValue(String v) { + for (STRectAlignment c: STRectAlignment.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/STSchemeColorVal.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/STSchemeColorVal.java new file mode 100644 index 000000000..84b88075f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/STSchemeColorVal.java @@ -0,0 +1,197 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for ST_SchemeColorVal. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="ST_SchemeColorVal">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *     <enumeration value="bg1"/>
+ *     <enumeration value="tx1"/>
+ *     <enumeration value="bg2"/>
+ *     <enumeration value="tx2"/>
+ *     <enumeration value="accent1"/>
+ *     <enumeration value="accent2"/>
+ *     <enumeration value="accent3"/>
+ *     <enumeration value="accent4"/>
+ *     <enumeration value="accent5"/>
+ *     <enumeration value="accent6"/>
+ *     <enumeration value="hlink"/>
+ *     <enumeration value="folHlink"/>
+ *     <enumeration value="phClr"/>
+ *     <enumeration value="dk1"/>
+ *     <enumeration value="lt1"/>
+ *     <enumeration value="dk2"/>
+ *     <enumeration value="lt2"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "ST_SchemeColorVal", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +@XmlEnum +public enum STSchemeColorVal { + + + /** + * Background Color 1 + * + */ + @XmlEnumValue("bg1") + BG_1("bg1"), + + /** + * Text Color 1 + * + */ + @XmlEnumValue("tx1") + TX_1("tx1"), + + /** + * Background Color 2 + * + */ + @XmlEnumValue("bg2") + BG_2("bg2"), + + /** + * Text Color 2 + * + */ + @XmlEnumValue("tx2") + TX_2("tx2"), + + /** + * Accent Color 1 + * + */ + @XmlEnumValue("accent1") + ACCENT_1("accent1"), + + /** + * Accent Color 2 + * + */ + @XmlEnumValue("accent2") + ACCENT_2("accent2"), + + /** + * Accent Color 3 + * + */ + @XmlEnumValue("accent3") + ACCENT_3("accent3"), + + /** + * Accent Color 4 + * + */ + @XmlEnumValue("accent4") + ACCENT_4("accent4"), + + /** + * Accent Color 5 + * + */ + @XmlEnumValue("accent5") + ACCENT_5("accent5"), + + /** + * Accent Color 6 + * + */ + @XmlEnumValue("accent6") + ACCENT_6("accent6"), + + /** + * Hyperlink Color + * + */ + @XmlEnumValue("hlink") + HLINK("hlink"), + + /** + * Followed Hyperlink Color + * + */ + @XmlEnumValue("folHlink") + FOL_HLINK("folHlink"), + + /** + * Style Color + * + */ + @XmlEnumValue("phClr") + PH_CLR("phClr"), + + /** + * Dark Color 1 + * + */ + @XmlEnumValue("dk1") + DK_1("dk1"), + + /** + * Light Color 1 + * + */ + @XmlEnumValue("lt1") + LT_1("lt1"), + + /** + * Dark Color 2 + * + */ + @XmlEnumValue("dk2") + DK_2("dk2"), + + /** + * Light Color 2 + * + */ + @XmlEnumValue("lt2") + LT_2("lt2"); + private final String value; + + STSchemeColorVal(String v) { + value = v; + } + + public String value() { + return value; + } + + public static STSchemeColorVal fromValue(String v) { + for (STSchemeColorVal c: STSchemeColorVal.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/STShapeType.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/STShapeType.java new file mode 100644 index 000000000..559b0a159 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/STShapeType.java @@ -0,0 +1,1557 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for ST_ShapeType. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="ST_ShapeType">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *     <enumeration value="line"/>
+ *     <enumeration value="lineInv"/>
+ *     <enumeration value="triangle"/>
+ *     <enumeration value="rtTriangle"/>
+ *     <enumeration value="rect"/>
+ *     <enumeration value="diamond"/>
+ *     <enumeration value="parallelogram"/>
+ *     <enumeration value="trapezoid"/>
+ *     <enumeration value="nonIsoscelesTrapezoid"/>
+ *     <enumeration value="pentagon"/>
+ *     <enumeration value="hexagon"/>
+ *     <enumeration value="heptagon"/>
+ *     <enumeration value="octagon"/>
+ *     <enumeration value="decagon"/>
+ *     <enumeration value="dodecagon"/>
+ *     <enumeration value="star4"/>
+ *     <enumeration value="star5"/>
+ *     <enumeration value="star6"/>
+ *     <enumeration value="star7"/>
+ *     <enumeration value="star8"/>
+ *     <enumeration value="star10"/>
+ *     <enumeration value="star12"/>
+ *     <enumeration value="star16"/>
+ *     <enumeration value="star24"/>
+ *     <enumeration value="star32"/>
+ *     <enumeration value="roundRect"/>
+ *     <enumeration value="round1Rect"/>
+ *     <enumeration value="round2SameRect"/>
+ *     <enumeration value="round2DiagRect"/>
+ *     <enumeration value="snipRoundRect"/>
+ *     <enumeration value="snip1Rect"/>
+ *     <enumeration value="snip2SameRect"/>
+ *     <enumeration value="snip2DiagRect"/>
+ *     <enumeration value="plaque"/>
+ *     <enumeration value="ellipse"/>
+ *     <enumeration value="teardrop"/>
+ *     <enumeration value="homePlate"/>
+ *     <enumeration value="chevron"/>
+ *     <enumeration value="pieWedge"/>
+ *     <enumeration value="pie"/>
+ *     <enumeration value="blockArc"/>
+ *     <enumeration value="donut"/>
+ *     <enumeration value="noSmoking"/>
+ *     <enumeration value="rightArrow"/>
+ *     <enumeration value="leftArrow"/>
+ *     <enumeration value="upArrow"/>
+ *     <enumeration value="downArrow"/>
+ *     <enumeration value="stripedRightArrow"/>
+ *     <enumeration value="notchedRightArrow"/>
+ *     <enumeration value="bentUpArrow"/>
+ *     <enumeration value="leftRightArrow"/>
+ *     <enumeration value="upDownArrow"/>
+ *     <enumeration value="leftUpArrow"/>
+ *     <enumeration value="leftRightUpArrow"/>
+ *     <enumeration value="quadArrow"/>
+ *     <enumeration value="leftArrowCallout"/>
+ *     <enumeration value="rightArrowCallout"/>
+ *     <enumeration value="upArrowCallout"/>
+ *     <enumeration value="downArrowCallout"/>
+ *     <enumeration value="leftRightArrowCallout"/>
+ *     <enumeration value="upDownArrowCallout"/>
+ *     <enumeration value="quadArrowCallout"/>
+ *     <enumeration value="bentArrow"/>
+ *     <enumeration value="uturnArrow"/>
+ *     <enumeration value="circularArrow"/>
+ *     <enumeration value="leftCircularArrow"/>
+ *     <enumeration value="leftRightCircularArrow"/>
+ *     <enumeration value="curvedRightArrow"/>
+ *     <enumeration value="curvedLeftArrow"/>
+ *     <enumeration value="curvedUpArrow"/>
+ *     <enumeration value="curvedDownArrow"/>
+ *     <enumeration value="swooshArrow"/>
+ *     <enumeration value="cube"/>
+ *     <enumeration value="can"/>
+ *     <enumeration value="lightningBolt"/>
+ *     <enumeration value="heart"/>
+ *     <enumeration value="sun"/>
+ *     <enumeration value="moon"/>
+ *     <enumeration value="smileyFace"/>
+ *     <enumeration value="irregularSeal1"/>
+ *     <enumeration value="irregularSeal2"/>
+ *     <enumeration value="foldedCorner"/>
+ *     <enumeration value="bevel"/>
+ *     <enumeration value="frame"/>
+ *     <enumeration value="halfFrame"/>
+ *     <enumeration value="corner"/>
+ *     <enumeration value="diagStripe"/>
+ *     <enumeration value="chord"/>
+ *     <enumeration value="arc"/>
+ *     <enumeration value="leftBracket"/>
+ *     <enumeration value="rightBracket"/>
+ *     <enumeration value="leftBrace"/>
+ *     <enumeration value="rightBrace"/>
+ *     <enumeration value="bracketPair"/>
+ *     <enumeration value="bracePair"/>
+ *     <enumeration value="straightConnector1"/>
+ *     <enumeration value="bentConnector2"/>
+ *     <enumeration value="bentConnector3"/>
+ *     <enumeration value="bentConnector4"/>
+ *     <enumeration value="bentConnector5"/>
+ *     <enumeration value="curvedConnector2"/>
+ *     <enumeration value="curvedConnector3"/>
+ *     <enumeration value="curvedConnector4"/>
+ *     <enumeration value="curvedConnector5"/>
+ *     <enumeration value="callout1"/>
+ *     <enumeration value="callout2"/>
+ *     <enumeration value="callout3"/>
+ *     <enumeration value="accentCallout1"/>
+ *     <enumeration value="accentCallout2"/>
+ *     <enumeration value="accentCallout3"/>
+ *     <enumeration value="borderCallout1"/>
+ *     <enumeration value="borderCallout2"/>
+ *     <enumeration value="borderCallout3"/>
+ *     <enumeration value="accentBorderCallout1"/>
+ *     <enumeration value="accentBorderCallout2"/>
+ *     <enumeration value="accentBorderCallout3"/>
+ *     <enumeration value="wedgeRectCallout"/>
+ *     <enumeration value="wedgeRoundRectCallout"/>
+ *     <enumeration value="wedgeEllipseCallout"/>
+ *     <enumeration value="cloudCallout"/>
+ *     <enumeration value="cloud"/>
+ *     <enumeration value="ribbon"/>
+ *     <enumeration value="ribbon2"/>
+ *     <enumeration value="ellipseRibbon"/>
+ *     <enumeration value="ellipseRibbon2"/>
+ *     <enumeration value="leftRightRibbon"/>
+ *     <enumeration value="verticalScroll"/>
+ *     <enumeration value="horizontalScroll"/>
+ *     <enumeration value="wave"/>
+ *     <enumeration value="doubleWave"/>
+ *     <enumeration value="plus"/>
+ *     <enumeration value="flowChartProcess"/>
+ *     <enumeration value="flowChartDecision"/>
+ *     <enumeration value="flowChartInputOutput"/>
+ *     <enumeration value="flowChartPredefinedProcess"/>
+ *     <enumeration value="flowChartInternalStorage"/>
+ *     <enumeration value="flowChartDocument"/>
+ *     <enumeration value="flowChartMultidocument"/>
+ *     <enumeration value="flowChartTerminator"/>
+ *     <enumeration value="flowChartPreparation"/>
+ *     <enumeration value="flowChartManualInput"/>
+ *     <enumeration value="flowChartManualOperation"/>
+ *     <enumeration value="flowChartConnector"/>
+ *     <enumeration value="flowChartPunchedCard"/>
+ *     <enumeration value="flowChartPunchedTape"/>
+ *     <enumeration value="flowChartSummingJunction"/>
+ *     <enumeration value="flowChartOr"/>
+ *     <enumeration value="flowChartCollate"/>
+ *     <enumeration value="flowChartSort"/>
+ *     <enumeration value="flowChartExtract"/>
+ *     <enumeration value="flowChartMerge"/>
+ *     <enumeration value="flowChartOfflineStorage"/>
+ *     <enumeration value="flowChartOnlineStorage"/>
+ *     <enumeration value="flowChartMagneticTape"/>
+ *     <enumeration value="flowChartMagneticDisk"/>
+ *     <enumeration value="flowChartMagneticDrum"/>
+ *     <enumeration value="flowChartDisplay"/>
+ *     <enumeration value="flowChartDelay"/>
+ *     <enumeration value="flowChartAlternateProcess"/>
+ *     <enumeration value="flowChartOffpageConnector"/>
+ *     <enumeration value="actionButtonBlank"/>
+ *     <enumeration value="actionButtonHome"/>
+ *     <enumeration value="actionButtonHelp"/>
+ *     <enumeration value="actionButtonInformation"/>
+ *     <enumeration value="actionButtonForwardNext"/>
+ *     <enumeration value="actionButtonBackPrevious"/>
+ *     <enumeration value="actionButtonEnd"/>
+ *     <enumeration value="actionButtonBeginning"/>
+ *     <enumeration value="actionButtonReturn"/>
+ *     <enumeration value="actionButtonDocument"/>
+ *     <enumeration value="actionButtonSound"/>
+ *     <enumeration value="actionButtonMovie"/>
+ *     <enumeration value="gear6"/>
+ *     <enumeration value="gear9"/>
+ *     <enumeration value="funnel"/>
+ *     <enumeration value="mathPlus"/>
+ *     <enumeration value="mathMinus"/>
+ *     <enumeration value="mathMultiply"/>
+ *     <enumeration value="mathDivide"/>
+ *     <enumeration value="mathEqual"/>
+ *     <enumeration value="mathNotEqual"/>
+ *     <enumeration value="cornerTabs"/>
+ *     <enumeration value="squareTabs"/>
+ *     <enumeration value="plaqueTabs"/>
+ *     <enumeration value="chartX"/>
+ *     <enumeration value="chartStar"/>
+ *     <enumeration value="chartPlus"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "ST_ShapeType", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +@XmlEnum +public enum STShapeType { + + + /** + * Line Shape + * + */ + @XmlEnumValue("line") + LINE("line"), + + /** + * Line Inverse Shape + * + */ + @XmlEnumValue("lineInv") + LINE_INV("lineInv"), + + /** + * Triangle Shape + * + */ + @XmlEnumValue("triangle") + TRIANGLE("triangle"), + + /** + * Right Triangle Shape + * + */ + @XmlEnumValue("rtTriangle") + RT_TRIANGLE("rtTriangle"), + + /** + * Rectangle Shape + * + */ + @XmlEnumValue("rect") + RECT("rect"), + + /** + * Diamond Shape + * + */ + @XmlEnumValue("diamond") + DIAMOND("diamond"), + + /** + * Parallelogram Shape + * + */ + @XmlEnumValue("parallelogram") + PARALLELOGRAM("parallelogram"), + + /** + * Trapezoid Shape + * + */ + @XmlEnumValue("trapezoid") + TRAPEZOID("trapezoid"), + + /** + * Non-Isosceles Trapezoid Shape + * + */ + @XmlEnumValue("nonIsoscelesTrapezoid") + NON_ISOSCELES_TRAPEZOID("nonIsoscelesTrapezoid"), + + /** + * Pentagon Shape + * + */ + @XmlEnumValue("pentagon") + PENTAGON("pentagon"), + + /** + * Hexagon Shape + * + */ + @XmlEnumValue("hexagon") + HEXAGON("hexagon"), + + /** + * Heptagon Shape + * + */ + @XmlEnumValue("heptagon") + HEPTAGON("heptagon"), + + /** + * Octagon Shape + * + */ + @XmlEnumValue("octagon") + OCTAGON("octagon"), + + /** + * Decagon Shape + * + */ + @XmlEnumValue("decagon") + DECAGON("decagon"), + + /** + * Dodecagon Shape + * + */ + @XmlEnumValue("dodecagon") + DODECAGON("dodecagon"), + + /** + * Four Pointed Star Shape + * + */ + @XmlEnumValue("star4") + STAR_4("star4"), + + /** + * Five Pointed Star Shape + * + */ + @XmlEnumValue("star5") + STAR_5("star5"), + + /** + * Six Pointed Star Shape + * + */ + @XmlEnumValue("star6") + STAR_6("star6"), + + /** + * Seven Pointed Star Shape + * + */ + @XmlEnumValue("star7") + STAR_7("star7"), + + /** + * Eight Pointed Star Shape + * + */ + @XmlEnumValue("star8") + STAR_8("star8"), + + /** + * Ten Pointed Star Shape + * + */ + @XmlEnumValue("star10") + STAR_10("star10"), + + /** + * Twelve Pointed Star Shape + * + */ + @XmlEnumValue("star12") + STAR_12("star12"), + + /** + * Sixteen Pointed Star Shape + * + */ + @XmlEnumValue("star16") + STAR_16("star16"), + + /** + * Twenty Four Pointed Star Shape + * + */ + @XmlEnumValue("star24") + STAR_24("star24"), + + /** + * Thirty Two Pointed Star Shape + * + */ + @XmlEnumValue("star32") + STAR_32("star32"), + + /** + * Round Corner Rectangle Shape + * + */ + @XmlEnumValue("roundRect") + ROUND_RECT("roundRect"), + + /** + * One Round Corner Rectangle Shape + * + */ + @XmlEnumValue("round1Rect") + ROUND_1_RECT("round1Rect"), + + /** + * Two Same-side Round Corner Rectangle Shape + * + */ + @XmlEnumValue("round2SameRect") + ROUND_2_SAME_RECT("round2SameRect"), + + /** + * Two Diagonal Round Corner Rectangle Shape + * + */ + @XmlEnumValue("round2DiagRect") + ROUND_2_DIAG_RECT("round2DiagRect"), + + /** + * One Snip One Round Corner Rectangle Shape + * + */ + @XmlEnumValue("snipRoundRect") + SNIP_ROUND_RECT("snipRoundRect"), + + /** + * One Snip Corner Rectangle Shape + * + */ + @XmlEnumValue("snip1Rect") + SNIP_1_RECT("snip1Rect"), + + /** + * Two Same-side Snip Corner Rectangle Shape + * + */ + @XmlEnumValue("snip2SameRect") + SNIP_2_SAME_RECT("snip2SameRect"), + + /** + * Two Diagonal Snip Corner Rectangle Shape + * + */ + @XmlEnumValue("snip2DiagRect") + SNIP_2_DIAG_RECT("snip2DiagRect"), + + /** + * Plaque Shape + * + */ + @XmlEnumValue("plaque") + PLAQUE("plaque"), + + /** + * Ellipse Shape + * + */ + @XmlEnumValue("ellipse") + ELLIPSE("ellipse"), + + /** + * Teardrop Shape + * + */ + @XmlEnumValue("teardrop") + TEARDROP("teardrop"), + + /** + * Home Plate Shape + * + */ + @XmlEnumValue("homePlate") + HOME_PLATE("homePlate"), + + /** + * Chevron Shape + * + */ + @XmlEnumValue("chevron") + CHEVRON("chevron"), + + /** + * Pie Wedge Shape + * + */ + @XmlEnumValue("pieWedge") + PIE_WEDGE("pieWedge"), + + /** + * Pie Shape + * + */ + @XmlEnumValue("pie") + PIE("pie"), + + /** + * Block Arc Shape + * + */ + @XmlEnumValue("blockArc") + BLOCK_ARC("blockArc"), + + /** + * Donut Shape + * + */ + @XmlEnumValue("donut") + DONUT("donut"), + + /** + * No Smoking Shape + * + */ + @XmlEnumValue("noSmoking") + NO_SMOKING("noSmoking"), + + /** + * Right Arrow Shape + * + */ + @XmlEnumValue("rightArrow") + RIGHT_ARROW("rightArrow"), + + /** + * Left Arrow Shape + * + */ + @XmlEnumValue("leftArrow") + LEFT_ARROW("leftArrow"), + + /** + * Up Arrow Shape + * + */ + @XmlEnumValue("upArrow") + UP_ARROW("upArrow"), + + /** + * Down Arrow Shape + * + */ + @XmlEnumValue("downArrow") + DOWN_ARROW("downArrow"), + + /** + * Striped Right Arrow Shape + * + */ + @XmlEnumValue("stripedRightArrow") + STRIPED_RIGHT_ARROW("stripedRightArrow"), + + /** + * Notched Right Arrow Shape + * + */ + @XmlEnumValue("notchedRightArrow") + NOTCHED_RIGHT_ARROW("notchedRightArrow"), + + /** + * Bent Up Arrow Shape + * + */ + @XmlEnumValue("bentUpArrow") + BENT_UP_ARROW("bentUpArrow"), + + /** + * Left Right Arrow Shape + * + */ + @XmlEnumValue("leftRightArrow") + LEFT_RIGHT_ARROW("leftRightArrow"), + + /** + * Up Down Arrow Shape + * + */ + @XmlEnumValue("upDownArrow") + UP_DOWN_ARROW("upDownArrow"), + + /** + * Left Up Arrow Shape + * + */ + @XmlEnumValue("leftUpArrow") + LEFT_UP_ARROW("leftUpArrow"), + + /** + * Left Right Up Arrow Shape + * + */ + @XmlEnumValue("leftRightUpArrow") + LEFT_RIGHT_UP_ARROW("leftRightUpArrow"), + + /** + * Quad-Arrow Shape + * + */ + @XmlEnumValue("quadArrow") + QUAD_ARROW("quadArrow"), + + /** + * Callout Left Arrow Shape + * + */ + @XmlEnumValue("leftArrowCallout") + LEFT_ARROW_CALLOUT("leftArrowCallout"), + + /** + * Callout Right Arrow Shape + * + */ + @XmlEnumValue("rightArrowCallout") + RIGHT_ARROW_CALLOUT("rightArrowCallout"), + + /** + * Callout Up Arrow Shape + * + */ + @XmlEnumValue("upArrowCallout") + UP_ARROW_CALLOUT("upArrowCallout"), + + /** + * Callout Down Arrow Shape + * + */ + @XmlEnumValue("downArrowCallout") + DOWN_ARROW_CALLOUT("downArrowCallout"), + + /** + * Callout Left Right Arrow Shape + * + */ + @XmlEnumValue("leftRightArrowCallout") + LEFT_RIGHT_ARROW_CALLOUT("leftRightArrowCallout"), + + /** + * Callout Up Down Arrow Shape + * + */ + @XmlEnumValue("upDownArrowCallout") + UP_DOWN_ARROW_CALLOUT("upDownArrowCallout"), + + /** + * Callout Quad-Arrow Shape + * + */ + @XmlEnumValue("quadArrowCallout") + QUAD_ARROW_CALLOUT("quadArrowCallout"), + + /** + * Bent Arrow Shape + * + */ + @XmlEnumValue("bentArrow") + BENT_ARROW("bentArrow"), + + /** + * U-Turn Arrow Shape + * + */ + @XmlEnumValue("uturnArrow") + UTURN_ARROW("uturnArrow"), + + /** + * Circular Arrow Shape + * + */ + @XmlEnumValue("circularArrow") + CIRCULAR_ARROW("circularArrow"), + + /** + * Left Circular Arrow Shape + * + */ + @XmlEnumValue("leftCircularArrow") + LEFT_CIRCULAR_ARROW("leftCircularArrow"), + + /** + * Left Right Circular Arrow Shape + * + */ + @XmlEnumValue("leftRightCircularArrow") + LEFT_RIGHT_CIRCULAR_ARROW("leftRightCircularArrow"), + + /** + * Curved Right Arrow Shape + * + */ + @XmlEnumValue("curvedRightArrow") + CURVED_RIGHT_ARROW("curvedRightArrow"), + + /** + * Curved Left Arrow Shape + * + */ + @XmlEnumValue("curvedLeftArrow") + CURVED_LEFT_ARROW("curvedLeftArrow"), + + /** + * Curved Up Arrow Shape + * + */ + @XmlEnumValue("curvedUpArrow") + CURVED_UP_ARROW("curvedUpArrow"), + + /** + * Curved Down Arrow Shape + * + */ + @XmlEnumValue("curvedDownArrow") + CURVED_DOWN_ARROW("curvedDownArrow"), + + /** + * Swoosh Arrow Shape + * + */ + @XmlEnumValue("swooshArrow") + SWOOSH_ARROW("swooshArrow"), + + /** + * Cube Shape + * + */ + @XmlEnumValue("cube") + CUBE("cube"), + + /** + * Can Shape + * + */ + @XmlEnumValue("can") + CAN("can"), + + /** + * Lightning Bolt Shape + * + */ + @XmlEnumValue("lightningBolt") + LIGHTNING_BOLT("lightningBolt"), + + /** + * Heart Shape + * + */ + @XmlEnumValue("heart") + HEART("heart"), + + /** + * Sun Shape + * + */ + @XmlEnumValue("sun") + SUN("sun"), + + /** + * Moon Shape + * + */ + @XmlEnumValue("moon") + MOON("moon"), + + /** + * Smiley Face Shape + * + */ + @XmlEnumValue("smileyFace") + SMILEY_FACE("smileyFace"), + + /** + * Irregular Seal 1 Shape + * + */ + @XmlEnumValue("irregularSeal1") + IRREGULAR_SEAL_1("irregularSeal1"), + + /** + * Irregular Seal 2 Shape + * + */ + @XmlEnumValue("irregularSeal2") + IRREGULAR_SEAL_2("irregularSeal2"), + + /** + * Folded Corner Shape + * + */ + @XmlEnumValue("foldedCorner") + FOLDED_CORNER("foldedCorner"), + + /** + * Bevel Shape + * + */ + @XmlEnumValue("bevel") + BEVEL("bevel"), + + /** + * Frame Shape + * + */ + @XmlEnumValue("frame") + FRAME("frame"), + + /** + * Half Frame Shape + * + */ + @XmlEnumValue("halfFrame") + HALF_FRAME("halfFrame"), + + /** + * Corner Shape + * + */ + @XmlEnumValue("corner") + CORNER("corner"), + + /** + * Diagonal Stripe Shape + * + */ + @XmlEnumValue("diagStripe") + DIAG_STRIPE("diagStripe"), + + /** + * Chord Shape + * + */ + @XmlEnumValue("chord") + CHORD("chord"), + + /** + * Curved Arc Shape + * + */ + @XmlEnumValue("arc") + ARC("arc"), + + /** + * Left Bracket Shape + * + */ + @XmlEnumValue("leftBracket") + LEFT_BRACKET("leftBracket"), + + /** + * Right Bracket Shape + * + */ + @XmlEnumValue("rightBracket") + RIGHT_BRACKET("rightBracket"), + + /** + * Left Brace Shape + * + */ + @XmlEnumValue("leftBrace") + LEFT_BRACE("leftBrace"), + + /** + * Right Brace Shape + * + */ + @XmlEnumValue("rightBrace") + RIGHT_BRACE("rightBrace"), + + /** + * Bracket Pair Shape + * + */ + @XmlEnumValue("bracketPair") + BRACKET_PAIR("bracketPair"), + + /** + * Brace Pair Shape + * + */ + @XmlEnumValue("bracePair") + BRACE_PAIR("bracePair"), + + /** + * Straight Connector 1 Shape + * + */ + @XmlEnumValue("straightConnector1") + STRAIGHT_CONNECTOR_1("straightConnector1"), + + /** + * Bent Connector 2 Shape + * + */ + @XmlEnumValue("bentConnector2") + BENT_CONNECTOR_2("bentConnector2"), + + /** + * Bent Connector 3 Shape + * + */ + @XmlEnumValue("bentConnector3") + BENT_CONNECTOR_3("bentConnector3"), + + /** + * Bent Connector 4 Shape + * + */ + @XmlEnumValue("bentConnector4") + BENT_CONNECTOR_4("bentConnector4"), + + /** + * Bent Connector 5 Shape + * + */ + @XmlEnumValue("bentConnector5") + BENT_CONNECTOR_5("bentConnector5"), + + /** + * Curved Connector 2 Shape + * + */ + @XmlEnumValue("curvedConnector2") + CURVED_CONNECTOR_2("curvedConnector2"), + + /** + * Curved Connector 3 Shape + * + */ + @XmlEnumValue("curvedConnector3") + CURVED_CONNECTOR_3("curvedConnector3"), + + /** + * Curved Connector 4 Shape + * + */ + @XmlEnumValue("curvedConnector4") + CURVED_CONNECTOR_4("curvedConnector4"), + + /** + * Curved Connector 5 Shape + * + */ + @XmlEnumValue("curvedConnector5") + CURVED_CONNECTOR_5("curvedConnector5"), + + /** + * Callout 1 Shape + * + */ + @XmlEnumValue("callout1") + CALLOUT_1("callout1"), + + /** + * Callout 2 Shape + * + */ + @XmlEnumValue("callout2") + CALLOUT_2("callout2"), + + /** + * Callout 3 Shape + * + */ + @XmlEnumValue("callout3") + CALLOUT_3("callout3"), + + /** + * Callout 1 Shape + * + */ + @XmlEnumValue("accentCallout1") + ACCENT_CALLOUT_1("accentCallout1"), + + /** + * Callout 2 Shape + * + */ + @XmlEnumValue("accentCallout2") + ACCENT_CALLOUT_2("accentCallout2"), + + /** + * Callout 3 Shape + * + */ + @XmlEnumValue("accentCallout3") + ACCENT_CALLOUT_3("accentCallout3"), + + /** + * Callout 1 with Border Shape + * + */ + @XmlEnumValue("borderCallout1") + BORDER_CALLOUT_1("borderCallout1"), + + /** + * Callout 2 with Border Shape + * + */ + @XmlEnumValue("borderCallout2") + BORDER_CALLOUT_2("borderCallout2"), + + /** + * Callout 3 with Border Shape + * + */ + @XmlEnumValue("borderCallout3") + BORDER_CALLOUT_3("borderCallout3"), + + /** + * Callout 1 with Border and Accent Shape + * + */ + @XmlEnumValue("accentBorderCallout1") + ACCENT_BORDER_CALLOUT_1("accentBorderCallout1"), + + /** + * Callout 2 with Border and Accent Shape + * + */ + @XmlEnumValue("accentBorderCallout2") + ACCENT_BORDER_CALLOUT_2("accentBorderCallout2"), + + /** + * Callout 3 with Border and Accent Shape + * + */ + @XmlEnumValue("accentBorderCallout3") + ACCENT_BORDER_CALLOUT_3("accentBorderCallout3"), + + /** + * Callout Wedge Rectangle Shape + * + */ + @XmlEnumValue("wedgeRectCallout") + WEDGE_RECT_CALLOUT("wedgeRectCallout"), + + /** + * Callout Wedge Round Rectangle Shape + * + */ + @XmlEnumValue("wedgeRoundRectCallout") + WEDGE_ROUND_RECT_CALLOUT("wedgeRoundRectCallout"), + + /** + * Callout Wedge Ellipse Shape + * + */ + @XmlEnumValue("wedgeEllipseCallout") + WEDGE_ELLIPSE_CALLOUT("wedgeEllipseCallout"), + + /** + * Callout Cloud Shape + * + */ + @XmlEnumValue("cloudCallout") + CLOUD_CALLOUT("cloudCallout"), + + /** + * Cloud Shape + * + */ + @XmlEnumValue("cloud") + CLOUD("cloud"), + + /** + * Ribbon Shape + * + */ + @XmlEnumValue("ribbon") + RIBBON("ribbon"), + + /** + * Ribbon 2 Shape + * + */ + @XmlEnumValue("ribbon2") + RIBBON_2("ribbon2"), + + /** + * Ellipse Ribbon Shape + * + */ + @XmlEnumValue("ellipseRibbon") + ELLIPSE_RIBBON("ellipseRibbon"), + + /** + * Ellipse Ribbon 2 Shape + * + */ + @XmlEnumValue("ellipseRibbon2") + ELLIPSE_RIBBON_2("ellipseRibbon2"), + + /** + * Left Right Ribbon Shape + * + */ + @XmlEnumValue("leftRightRibbon") + LEFT_RIGHT_RIBBON("leftRightRibbon"), + + /** + * Vertical Scroll Shape + * + */ + @XmlEnumValue("verticalScroll") + VERTICAL_SCROLL("verticalScroll"), + + /** + * Horizontal Scroll Shape + * + */ + @XmlEnumValue("horizontalScroll") + HORIZONTAL_SCROLL("horizontalScroll"), + + /** + * Wave Shape + * + */ + @XmlEnumValue("wave") + WAVE("wave"), + + /** + * Double Wave Shape + * + */ + @XmlEnumValue("doubleWave") + DOUBLE_WAVE("doubleWave"), + + /** + * Plus Shape + * + */ + @XmlEnumValue("plus") + PLUS("plus"), + + /** + * Process Flow Shape + * + */ + @XmlEnumValue("flowChartProcess") + FLOW_CHART_PROCESS("flowChartProcess"), + + /** + * Decision Flow Shape + * + */ + @XmlEnumValue("flowChartDecision") + FLOW_CHART_DECISION("flowChartDecision"), + + /** + * Input Output Flow Shape + * + */ + @XmlEnumValue("flowChartInputOutput") + FLOW_CHART_INPUT_OUTPUT("flowChartInputOutput"), + + /** + * Predefined Process Flow Shape + * + */ + @XmlEnumValue("flowChartPredefinedProcess") + FLOW_CHART_PREDEFINED_PROCESS("flowChartPredefinedProcess"), + + /** + * Internal Storage Flow Shape + * + */ + @XmlEnumValue("flowChartInternalStorage") + FLOW_CHART_INTERNAL_STORAGE("flowChartInternalStorage"), + + /** + * Document Flow Shape + * + */ + @XmlEnumValue("flowChartDocument") + FLOW_CHART_DOCUMENT("flowChartDocument"), + + /** + * Multi-Document Flow Shape + * + */ + @XmlEnumValue("flowChartMultidocument") + FLOW_CHART_MULTIDOCUMENT("flowChartMultidocument"), + + /** + * Terminator Flow Shape + * + */ + @XmlEnumValue("flowChartTerminator") + FLOW_CHART_TERMINATOR("flowChartTerminator"), + + /** + * Preparation Flow Shape + * + */ + @XmlEnumValue("flowChartPreparation") + FLOW_CHART_PREPARATION("flowChartPreparation"), + + /** + * Manual Input Flow Shape + * + */ + @XmlEnumValue("flowChartManualInput") + FLOW_CHART_MANUAL_INPUT("flowChartManualInput"), + + /** + * Manual Operation Flow Shape + * + */ + @XmlEnumValue("flowChartManualOperation") + FLOW_CHART_MANUAL_OPERATION("flowChartManualOperation"), + + /** + * Connector Flow Shape + * + */ + @XmlEnumValue("flowChartConnector") + FLOW_CHART_CONNECTOR("flowChartConnector"), + + /** + * Punched Card Flow Shape + * + */ + @XmlEnumValue("flowChartPunchedCard") + FLOW_CHART_PUNCHED_CARD("flowChartPunchedCard"), + + /** + * Punched Tape Flow Shape + * + */ + @XmlEnumValue("flowChartPunchedTape") + FLOW_CHART_PUNCHED_TAPE("flowChartPunchedTape"), + + /** + * Summing Junction Flow Shape + * + */ + @XmlEnumValue("flowChartSummingJunction") + FLOW_CHART_SUMMING_JUNCTION("flowChartSummingJunction"), + + /** + * Or Flow Shape + * + */ + @XmlEnumValue("flowChartOr") + FLOW_CHART_OR("flowChartOr"), + + /** + * Collate Flow Shape + * + */ + @XmlEnumValue("flowChartCollate") + FLOW_CHART_COLLATE("flowChartCollate"), + + /** + * Sort Flow Shape + * + */ + @XmlEnumValue("flowChartSort") + FLOW_CHART_SORT("flowChartSort"), + + /** + * Extract Flow Shape + * + */ + @XmlEnumValue("flowChartExtract") + FLOW_CHART_EXTRACT("flowChartExtract"), + + /** + * Merge Flow Shape + * + */ + @XmlEnumValue("flowChartMerge") + FLOW_CHART_MERGE("flowChartMerge"), + + /** + * Offline Storage Flow Shape + * + */ + @XmlEnumValue("flowChartOfflineStorage") + FLOW_CHART_OFFLINE_STORAGE("flowChartOfflineStorage"), + + /** + * Online Storage Flow Shape + * + */ + @XmlEnumValue("flowChartOnlineStorage") + FLOW_CHART_ONLINE_STORAGE("flowChartOnlineStorage"), + + /** + * Magnetic Tape Flow Shape + * + */ + @XmlEnumValue("flowChartMagneticTape") + FLOW_CHART_MAGNETIC_TAPE("flowChartMagneticTape"), + + /** + * Magnetic Disk Flow Shape + * + */ + @XmlEnumValue("flowChartMagneticDisk") + FLOW_CHART_MAGNETIC_DISK("flowChartMagneticDisk"), + + /** + * Magnetic Drum Flow Shape + * + */ + @XmlEnumValue("flowChartMagneticDrum") + FLOW_CHART_MAGNETIC_DRUM("flowChartMagneticDrum"), + + /** + * Display Flow Shape + * + */ + @XmlEnumValue("flowChartDisplay") + FLOW_CHART_DISPLAY("flowChartDisplay"), + + /** + * Delay Flow Shape + * + */ + @XmlEnumValue("flowChartDelay") + FLOW_CHART_DELAY("flowChartDelay"), + + /** + * Alternate Process Flow Shape + * + */ + @XmlEnumValue("flowChartAlternateProcess") + FLOW_CHART_ALTERNATE_PROCESS("flowChartAlternateProcess"), + + /** + * Off-Page Connector Flow Shape + * + */ + @XmlEnumValue("flowChartOffpageConnector") + FLOW_CHART_OFFPAGE_CONNECTOR("flowChartOffpageConnector"), + + /** + * Blank Button Shape + * + */ + @XmlEnumValue("actionButtonBlank") + ACTION_BUTTON_BLANK("actionButtonBlank"), + + /** + * Home Button Shape + * + */ + @XmlEnumValue("actionButtonHome") + ACTION_BUTTON_HOME("actionButtonHome"), + + /** + * Help Button Shape + * + */ + @XmlEnumValue("actionButtonHelp") + ACTION_BUTTON_HELP("actionButtonHelp"), + + /** + * Information Button Shape + * + */ + @XmlEnumValue("actionButtonInformation") + ACTION_BUTTON_INFORMATION("actionButtonInformation"), + + /** + * Forward or Next Button Shape + * + */ + @XmlEnumValue("actionButtonForwardNext") + ACTION_BUTTON_FORWARD_NEXT("actionButtonForwardNext"), + + /** + * Back or Previous Button Shape + * + */ + @XmlEnumValue("actionButtonBackPrevious") + ACTION_BUTTON_BACK_PREVIOUS("actionButtonBackPrevious"), + + /** + * End Button Shape + * + */ + @XmlEnumValue("actionButtonEnd") + ACTION_BUTTON_END("actionButtonEnd"), + + /** + * Beginning Button Shape + * + */ + @XmlEnumValue("actionButtonBeginning") + ACTION_BUTTON_BEGINNING("actionButtonBeginning"), + + /** + * Return Button Shape + * + */ + @XmlEnumValue("actionButtonReturn") + ACTION_BUTTON_RETURN("actionButtonReturn"), + + /** + * Document Button Shape + * + */ + @XmlEnumValue("actionButtonDocument") + ACTION_BUTTON_DOCUMENT("actionButtonDocument"), + + /** + * Sound Button Shape + * + */ + @XmlEnumValue("actionButtonSound") + ACTION_BUTTON_SOUND("actionButtonSound"), + + /** + * Movie Button Shape + * + */ + @XmlEnumValue("actionButtonMovie") + ACTION_BUTTON_MOVIE("actionButtonMovie"), + + /** + * Gear 6 Shape + * + */ + @XmlEnumValue("gear6") + GEAR_6("gear6"), + + /** + * Gear 9 Shape + * + */ + @XmlEnumValue("gear9") + GEAR_9("gear9"), + + /** + * Funnel Shape + * + */ + @XmlEnumValue("funnel") + FUNNEL("funnel"), + + /** + * Plus Math Shape + * + */ + @XmlEnumValue("mathPlus") + MATH_PLUS("mathPlus"), + + /** + * Minus Math Shape + * + */ + @XmlEnumValue("mathMinus") + MATH_MINUS("mathMinus"), + + /** + * Multiply Math Shape + * + */ + @XmlEnumValue("mathMultiply") + MATH_MULTIPLY("mathMultiply"), + + /** + * Divide Math Shape + * + */ + @XmlEnumValue("mathDivide") + MATH_DIVIDE("mathDivide"), + + /** + * Equal Math Shape + * + */ + @XmlEnumValue("mathEqual") + MATH_EQUAL("mathEqual"), + + /** + * Not Equal Math Shape + * + */ + @XmlEnumValue("mathNotEqual") + MATH_NOT_EQUAL("mathNotEqual"), + + /** + * Corner Tabs Shape + * + */ + @XmlEnumValue("cornerTabs") + CORNER_TABS("cornerTabs"), + + /** + * Square Tabs Shape + * + */ + @XmlEnumValue("squareTabs") + SQUARE_TABS("squareTabs"), + + /** + * Plaque Tabs Shape + * + */ + @XmlEnumValue("plaqueTabs") + PLAQUE_TABS("plaqueTabs"), + + /** + * Chart X Shape + * + */ + @XmlEnumValue("chartX") + CHART_X("chartX"), + + /** + * Chart Star Shape + * + */ + @XmlEnumValue("chartStar") + CHART_STAR("chartStar"), + + /** + * Chart Plus Shape + * + */ + @XmlEnumValue("chartPlus") + CHART_PLUS("chartPlus"); + private final String value; + + STShapeType(String v) { + value = v; + } + + public String value() { + return value; + } + + public static STShapeType fromValue(String v) { + for (STShapeType c: STShapeType.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/binding/STTextShapeType.java b/src/scratchpad/src/org/apache/poi/sl/draw/binding/STTextShapeType.java new file mode 100644 index 000000000..f3ed4b0cf --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/binding/STTextShapeType.java @@ -0,0 +1,389 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.draw.binding; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for ST_TextShapeType. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="ST_TextShapeType">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *     <enumeration value="textNoShape"/>
+ *     <enumeration value="textPlain"/>
+ *     <enumeration value="textStop"/>
+ *     <enumeration value="textTriangle"/>
+ *     <enumeration value="textTriangleInverted"/>
+ *     <enumeration value="textChevron"/>
+ *     <enumeration value="textChevronInverted"/>
+ *     <enumeration value="textRingInside"/>
+ *     <enumeration value="textRingOutside"/>
+ *     <enumeration value="textArchUp"/>
+ *     <enumeration value="textArchDown"/>
+ *     <enumeration value="textCircle"/>
+ *     <enumeration value="textButton"/>
+ *     <enumeration value="textArchUpPour"/>
+ *     <enumeration value="textArchDownPour"/>
+ *     <enumeration value="textCirclePour"/>
+ *     <enumeration value="textButtonPour"/>
+ *     <enumeration value="textCurveUp"/>
+ *     <enumeration value="textCurveDown"/>
+ *     <enumeration value="textCanUp"/>
+ *     <enumeration value="textCanDown"/>
+ *     <enumeration value="textWave1"/>
+ *     <enumeration value="textWave2"/>
+ *     <enumeration value="textDoubleWave1"/>
+ *     <enumeration value="textWave4"/>
+ *     <enumeration value="textInflate"/>
+ *     <enumeration value="textDeflate"/>
+ *     <enumeration value="textInflateBottom"/>
+ *     <enumeration value="textDeflateBottom"/>
+ *     <enumeration value="textInflateTop"/>
+ *     <enumeration value="textDeflateTop"/>
+ *     <enumeration value="textDeflateInflate"/>
+ *     <enumeration value="textDeflateInflateDeflate"/>
+ *     <enumeration value="textFadeRight"/>
+ *     <enumeration value="textFadeLeft"/>
+ *     <enumeration value="textFadeUp"/>
+ *     <enumeration value="textFadeDown"/>
+ *     <enumeration value="textSlantUp"/>
+ *     <enumeration value="textSlantDown"/>
+ *     <enumeration value="textCascadeUp"/>
+ *     <enumeration value="textCascadeDown"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "ST_TextShapeType", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main") +@XmlEnum +public enum STTextShapeType { + + + /** + * No Text Shape + * + */ + @XmlEnumValue("textNoShape") + TEXT_NO_SHAPE("textNoShape"), + + /** + * Plain Text Shape + * + */ + @XmlEnumValue("textPlain") + TEXT_PLAIN("textPlain"), + + /** + * Stop Sign Text Shape + * + */ + @XmlEnumValue("textStop") + TEXT_STOP("textStop"), + + /** + * Triangle Text Shape + * + */ + @XmlEnumValue("textTriangle") + TEXT_TRIANGLE("textTriangle"), + + /** + * Inverted Triangle Text Shape + * + */ + @XmlEnumValue("textTriangleInverted") + TEXT_TRIANGLE_INVERTED("textTriangleInverted"), + + /** + * Chevron Text Shape + * + */ + @XmlEnumValue("textChevron") + TEXT_CHEVRON("textChevron"), + + /** + * Inverted Chevron Text Shape + * + */ + @XmlEnumValue("textChevronInverted") + TEXT_CHEVRON_INVERTED("textChevronInverted"), + + /** + * Inside Ring Text Shape + * + */ + @XmlEnumValue("textRingInside") + TEXT_RING_INSIDE("textRingInside"), + + /** + * Outside Ring Text Shape + * + */ + @XmlEnumValue("textRingOutside") + TEXT_RING_OUTSIDE("textRingOutside"), + + /** + * Upward Arch Text Shape + * + */ + @XmlEnumValue("textArchUp") + TEXT_ARCH_UP("textArchUp"), + + /** + * Downward Arch Text Shape + * + */ + @XmlEnumValue("textArchDown") + TEXT_ARCH_DOWN("textArchDown"), + + /** + * Circle Text Shape + * + */ + @XmlEnumValue("textCircle") + TEXT_CIRCLE("textCircle"), + + /** + * Button Text Shape + * + */ + @XmlEnumValue("textButton") + TEXT_BUTTON("textButton"), + + /** + * Upward Pour Arch Text Shape + * + */ + @XmlEnumValue("textArchUpPour") + TEXT_ARCH_UP_POUR("textArchUpPour"), + + /** + * Downward Pour Arch Text Shape + * + */ + @XmlEnumValue("textArchDownPour") + TEXT_ARCH_DOWN_POUR("textArchDownPour"), + + /** + * Circle Pour Text Shape + * + */ + @XmlEnumValue("textCirclePour") + TEXT_CIRCLE_POUR("textCirclePour"), + + /** + * Button Pour Text Shape + * + */ + @XmlEnumValue("textButtonPour") + TEXT_BUTTON_POUR("textButtonPour"), + + /** + * Upward Curve Text Shape + * + */ + @XmlEnumValue("textCurveUp") + TEXT_CURVE_UP("textCurveUp"), + + /** + * Downward Curve Text Shape + * + */ + @XmlEnumValue("textCurveDown") + TEXT_CURVE_DOWN("textCurveDown"), + + /** + * Upward Can Text Shape + * + */ + @XmlEnumValue("textCanUp") + TEXT_CAN_UP("textCanUp"), + + /** + * Downward Can Text Shape + * + */ + @XmlEnumValue("textCanDown") + TEXT_CAN_DOWN("textCanDown"), + + /** + * Wave 1 Text Shape + * + */ + @XmlEnumValue("textWave1") + TEXT_WAVE_1("textWave1"), + + /** + * Wave 2 Text Shape + * + */ + @XmlEnumValue("textWave2") + TEXT_WAVE_2("textWave2"), + + /** + * Double Wave 1 Text Shape + * + */ + @XmlEnumValue("textDoubleWave1") + TEXT_DOUBLE_WAVE_1("textDoubleWave1"), + + /** + * Wave 4 Text Shape + * + */ + @XmlEnumValue("textWave4") + TEXT_WAVE_4("textWave4"), + + /** + * Inflate Text Shape + * + */ + @XmlEnumValue("textInflate") + TEXT_INFLATE("textInflate"), + + /** + * Deflate Text Shape + * + */ + @XmlEnumValue("textDeflate") + TEXT_DEFLATE("textDeflate"), + + /** + * Bottom Inflate Text Shape + * + */ + @XmlEnumValue("textInflateBottom") + TEXT_INFLATE_BOTTOM("textInflateBottom"), + + /** + * Bottom Deflate Text Shape + * + */ + @XmlEnumValue("textDeflateBottom") + TEXT_DEFLATE_BOTTOM("textDeflateBottom"), + + /** + * Top Inflate Text Shape + * + */ + @XmlEnumValue("textInflateTop") + TEXT_INFLATE_TOP("textInflateTop"), + + /** + * Top Deflate Text Shape + * + */ + @XmlEnumValue("textDeflateTop") + TEXT_DEFLATE_TOP("textDeflateTop"), + + /** + * Deflate-Inflate Text Shape + * + */ + @XmlEnumValue("textDeflateInflate") + TEXT_DEFLATE_INFLATE("textDeflateInflate"), + + /** + * Deflate-Inflate-Deflate Text Shape + * + */ + @XmlEnumValue("textDeflateInflateDeflate") + TEXT_DEFLATE_INFLATE_DEFLATE("textDeflateInflateDeflate"), + + /** + * Right Fade Text Shape + * + */ + @XmlEnumValue("textFadeRight") + TEXT_FADE_RIGHT("textFadeRight"), + + /** + * Left Fade Text Shape + * + */ + @XmlEnumValue("textFadeLeft") + TEXT_FADE_LEFT("textFadeLeft"), + + /** + * Upward Fade Text Shape + * + */ + @XmlEnumValue("textFadeUp") + TEXT_FADE_UP("textFadeUp"), + + /** + * Downward Fade Text Shape + * + */ + @XmlEnumValue("textFadeDown") + TEXT_FADE_DOWN("textFadeDown"), + + /** + * Upward Slant Text Shape + * + */ + @XmlEnumValue("textSlantUp") + TEXT_SLANT_UP("textSlantUp"), + + /** + * Downward Slant Text Shape + * + */ + @XmlEnumValue("textSlantDown") + TEXT_SLANT_DOWN("textSlantDown"), + + /** + * Upward Cascade Text Shape + * + */ + @XmlEnumValue("textCascadeUp") + TEXT_CASCADE_UP("textCascadeUp"), + + /** + * Downward Cascade Text Shape + * + */ + @XmlEnumValue("textCascadeDown") + TEXT_CASCADE_DOWN("textCascadeDown"); + private final String value; + + STTextShapeType(String v) { + value = v; + } + + public String value() { + return value; + } + + public static STTextShapeType fromValue(String v) { + for (STTextShapeType c: STTextShapeType.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/AbsExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/AbsExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/AbsExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/AbsExpression.java index 5790e5383..0f94e14b6 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/AbsExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/AbsExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/AddDivideExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/AddDivideExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/AddDivideExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/AddDivideExpression.java index 7fe14e8b1..2a01de449 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/AddDivideExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/AddDivideExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/AddSubtractExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/AddSubtractExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/AddSubtractExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/AddSubtractExpression.java index bd7e47e16..5d5f1e635 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/AddSubtractExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/AddSubtractExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/AdjustValue.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/AdjustValue.java similarity index 93% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/AdjustValue.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/AdjustValue.java index 8df1d6f87..8a2f0a456 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/AdjustValue.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/AdjustValue.java @@ -17,9 +17,9 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; -import org.openxmlformats.schemas.drawingml.x2006.main.CTGeomGuide; +import org.apache.poi.sl.draw.binding.CTGeomGuide; /** * Represents a shape adjust values (see section 20.1.9.5 in the spec) diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/ArcTanExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/ArcTanExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/ArcTanExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/ArcTanExpression.java index 252c0fc62..9044e8ad3 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/ArcTanExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/ArcTanExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/ArcToCommand.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/ArcToCommand.java similarity index 95% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/ArcToCommand.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/ArcToCommand.java index b1ea0defc..0382d7f99 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/ArcToCommand.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/ArcToCommand.java @@ -17,9 +17,9 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; -import org.openxmlformats.schemas.drawingml.x2006.main.CTPath2DArcTo; +import org.apache.poi.sl.draw.binding.CTPath2DArcTo; import java.awt.geom.Arc2D; import java.awt.geom.GeneralPath; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/ClosePathCommand.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/ClosePathCommand.java similarity index 96% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/ClosePathCommand.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/ClosePathCommand.java index b9a95404e..9d2906280 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/ClosePathCommand.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/ClosePathCommand.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.awt.geom.GeneralPath; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/Context.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/Context.java similarity index 98% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/Context.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/Context.java index ea86c5100..8fd5147ed 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/Context.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/Context.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.awt.geom.Rectangle2D; import java.util.HashMap; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/CosExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/CosExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/CosExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/CosExpression.java index 47e38f162..56373d919 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/CosExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/CosExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/CosineArcTanExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/CosineArcTanExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/CosineArcTanExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/CosineArcTanExpression.java index cb9928b22..4bed9b72d 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/CosineArcTanExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/CosineArcTanExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/CurveToCommand.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/CurveToCommand.java similarity index 94% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/CurveToCommand.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/CurveToCommand.java index 6f342d2ee..02eeb2953 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/CurveToCommand.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/CurveToCommand.java @@ -17,9 +17,9 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; -import org.openxmlformats.schemas.drawingml.x2006.main.CTAdjPoint2D; +import org.apache.poi.sl.draw.binding.CTAdjPoint2D; import java.awt.geom.GeneralPath; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/CustomGeometry.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/CustomGeometry.java similarity index 69% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/CustomGeometry.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/CustomGeometry.java index 4e30ac90d..ce1b26c49 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/CustomGeometry.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/CustomGeometry.java @@ -17,18 +17,11 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; +import java.util.*; -import org.openxmlformats.schemas.drawingml.x2006.main.CTCustomGeometry2D; -import org.openxmlformats.schemas.drawingml.x2006.main.CTGeomGuide; -import org.openxmlformats.schemas.drawingml.x2006.main.CTGeomGuideList; -import org.openxmlformats.schemas.drawingml.x2006.main.CTGeomRect; -import org.openxmlformats.schemas.drawingml.x2006.main.CTPath2D; -import org.openxmlformats.schemas.drawingml.x2006.main.CTPath2DList; +import org.apache.poi.sl.draw.binding.*; /** * Definition of a custom geometric shape @@ -41,25 +34,30 @@ public class CustomGeometry implements Iterable{ List paths = new ArrayList(); Path textBounds; - @SuppressWarnings("deprecation") public CustomGeometry(CTCustomGeometry2D geom) { CTGeomGuideList avLst = geom.getAvLst(); - if(avLst != null) for(CTGeomGuide gd : avLst.getGdArray()){ - adjusts.add(new AdjustValue(gd)); + if(avLst != null) { + for(CTGeomGuide gd : avLst.getGd()){ + adjusts.add(new AdjustValue(gd)); + } } CTGeomGuideList gdLst = geom.getGdLst(); - if(gdLst != null) for(CTGeomGuide gd : gdLst.getGdArray()){ - guides.add(new Guide(gd)); + if(gdLst != null) { + for(CTGeomGuide gd : gdLst.getGd()){ + guides.add(new Guide(gd)); + } } CTPath2DList pathLst = geom.getPathLst(); - if(pathLst != null) for(CTPath2D spPath : pathLst.getPathArray()){ - paths.add(new Path(spPath)); + if(pathLst != null) { + for(CTPath2D spPath : pathLst.getPath()){ + paths.add(new Path(spPath)); + } } - if(geom.isSetRect()) { - CTGeomRect rect = geom.getRect(); + CTGeomRect rect = geom.getRect(); + if(rect != null) { textBounds = new Path(); textBounds.addCommand( new MoveToCommand(rect.getL().toString(), rect.getT().toString())); @@ -73,9 +71,7 @@ public class CustomGeometry implements Iterable{ new ClosePathCommand()); } } - - - + public Iterator iterator() { return paths.iterator(); } diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/Expression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/Expression.java similarity index 96% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/Expression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/Expression.java index 2b0f751f3..2403c85a0 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/Expression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/Expression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; /** * Date: 10/24/11 diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/ExpressionParser.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/ExpressionParser.java similarity index 98% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/ExpressionParser.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/ExpressionParser.java index 699f995ea..f1f0193a8 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/ExpressionParser.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/ExpressionParser.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.HashMap; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/Formula.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/Formula.java similarity index 99% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/Formula.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/Formula.java index 0d3b2bbba..47453475a 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/Formula.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/Formula.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.awt.geom.Rectangle2D; import java.util.HashMap; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/Guide.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/Guide.java similarity index 93% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/Guide.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/Guide.java index 584e22483..f14213244 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/Guide.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/Guide.java @@ -17,9 +17,9 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; -import org.openxmlformats.schemas.drawingml.x2006.main.CTGeomGuide; +import org.apache.poi.sl.draw.binding.CTGeomGuide; /** * Date: 10/24/11 diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/IAdjustableShape.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/IAdjustableShape.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/IAdjustableShape.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/IAdjustableShape.java index 44f5a562f..920acb82d 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/IAdjustableShape.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/IAdjustableShape.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; /** diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/IfElseExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/IfElseExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/IfElseExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/IfElseExpression.java index 3e16645f5..443115a78 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/IfElseExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/IfElseExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/LineToCommand.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/LineToCommand.java similarity index 93% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/LineToCommand.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/LineToCommand.java index 5142dd234..99c5a6b20 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/LineToCommand.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/LineToCommand.java @@ -17,9 +17,9 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; -import org.openxmlformats.schemas.drawingml.x2006.main.CTAdjPoint2D; +import org.apache.poi.sl.draw.binding.CTAdjPoint2D; import java.awt.geom.GeneralPath; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/LiteralValueExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/LiteralValueExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/LiteralValueExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/LiteralValueExpression.java index f84483cd5..ab3abc7fd 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/LiteralValueExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/LiteralValueExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/MaxExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/MaxExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/MaxExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/MaxExpression.java index 0c7ac3ecb..88a9c6047 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/MaxExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/MaxExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/MinExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/MinExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/MinExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/MinExpression.java index 3e28cdd82..8c1864c5a 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/MinExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/MinExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/ModExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/ModExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/ModExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/ModExpression.java index cf17f0564..ff20fc20f 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/ModExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/ModExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/MoveToCommand.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/MoveToCommand.java similarity index 93% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/MoveToCommand.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/MoveToCommand.java index 9d9575ace..22ccd5409 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/MoveToCommand.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/MoveToCommand.java @@ -17,9 +17,9 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; -import org.openxmlformats.schemas.drawingml.x2006.main.CTAdjPoint2D; +import org.apache.poi.sl.draw.binding.CTAdjPoint2D; import java.awt.geom.GeneralPath; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/MultiplyDivideExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/MultiplyDivideExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/MultiplyDivideExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/MultiplyDivideExpression.java index 17aca48d1..5af0ff12c 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/MultiplyDivideExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/MultiplyDivideExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/Outline.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/Outline.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/Outline.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/Outline.java index dbf9f1f9c..b4ffc4257 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/Outline.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/Outline.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.awt.Shape; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/Path.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/Path.java similarity index 87% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/Path.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/Path.java index 3f552a4cf..b496e9fc9 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/Path.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/Path.java @@ -17,15 +17,14 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; - -import org.apache.xmlbeans.XmlObject; -import org.openxmlformats.schemas.drawingml.x2006.main.*; +package org.apache.poi.sl.draw.geom; import java.awt.geom.GeneralPath; import java.util.ArrayList; import java.util.List; +import org.apache.poi.sl.draw.binding.*; + /** * Specifies a creation path consisting of a series of moves, lines and curves * that when combined forms a geometric shape @@ -51,12 +50,13 @@ public class Path { public Path(CTPath2D spPath){ _fill = spPath.getFill() != STPathFillMode.NONE; - _stroke = spPath.getStroke(); + _stroke = spPath.isStroke(); _w = spPath.isSetW() ? spPath.getW() : -1; _h = spPath.isSetH() ? spPath.getH() : -1; commands = new ArrayList(); - for(XmlObject ch : spPath.selectPath("*")){ + + for(Object ch : spPath.getCloseOrMoveToOrLnTo()){ if(ch instanceof CTPath2DMoveTo){ CTAdjPoint2D pt = ((CTPath2DMoveTo)ch).getPt(); commands.add(new MoveToCommand(pt)); @@ -68,14 +68,14 @@ public class Path { commands.add(new ArcToCommand(arc)); } else if (ch instanceof CTPath2DQuadBezierTo){ CTPath2DQuadBezierTo bez = ((CTPath2DQuadBezierTo)ch); - CTAdjPoint2D pt1 = bez.getPtArray(0); - CTAdjPoint2D pt2 = bez.getPtArray(1); + CTAdjPoint2D pt1 = bez.getPt().get(0); + CTAdjPoint2D pt2 = bez.getPt().get(1); commands.add(new QuadToCommand(pt1, pt2)); } else if (ch instanceof CTPath2DCubicBezierTo){ CTPath2DCubicBezierTo bez = ((CTPath2DCubicBezierTo)ch); - CTAdjPoint2D pt1 = bez.getPtArray(0); - CTAdjPoint2D pt2 = bez.getPtArray(1); - CTAdjPoint2D pt3 = bez.getPtArray(2); + CTAdjPoint2D pt1 = bez.getPt().get(0); + CTAdjPoint2D pt2 = bez.getPt().get(1); + CTAdjPoint2D pt3 = bez.getPt().get(2); commands.add(new CurveToCommand(pt1, pt2, pt3)); } else if (ch instanceof CTPath2DClose){ commands.add(new ClosePathCommand()); diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/PathCommand.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/PathCommand.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/PathCommand.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/PathCommand.java index 7b3ec4937..3063ab81b 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/PathCommand.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/PathCommand.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.awt.geom.GeneralPath; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/PinExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/PinExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/PinExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/PinExpression.java index c1b7fe446..ee0d4e510 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/PinExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/PinExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/scratchpad/src/org/apache/poi/sl/draw/geom/PresetGeometries.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/PresetGeometries.java new file mode 100644 index 000000000..d876d1512 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/PresetGeometries.java @@ -0,0 +1,114 @@ +/* + * ==================================================================== + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ==================================================================== + */ + +package org.apache.poi.sl.draw.geom; + +import java.io.*; +import java.nio.charset.Charset; +import java.util.LinkedHashMap; + +import javax.xml.bind.*; +import javax.xml.stream.*; +import javax.xml.stream.events.StartElement; +import javax.xml.stream.events.XMLEvent; + +import org.apache.poi.sl.draw.binding.CTCustomGeometry2D; +import org.apache.poi.util.POILogFactory; +import org.apache.poi.util.POILogger; + +/** + * + */ +public class PresetGeometries extends LinkedHashMap { + private final static POILogger LOG = POILogFactory.getLogger(PresetGeometries.class); + protected final static String BINDING_PACKAGE = "org.apache.poi.sl.draw.binding"; + + protected static PresetGeometries _inst; + + protected PresetGeometries(){} + + @SuppressWarnings("unused") + public void init(InputStream is) throws XMLStreamException, JAXBException { + Reader xml = new InputStreamReader( is, Charset.forName("UTF-8") ); + + + // StAX: + EventFilter startElementFilter = new EventFilter() { + @Override + public boolean accept(XMLEvent event) { + return event.isStartElement(); + } + }; + + long cntElem = 0; + XMLInputFactory staxFactory = XMLInputFactory.newInstance(); + XMLEventReader staxReader = staxFactory.createXMLEventReader(xml); + XMLEventReader staxFiltRd = staxFactory.createFilteredReader(staxReader, startElementFilter); + // ignore StartElement: + XMLEvent evDoc = staxFiltRd.nextEvent(); + // JAXB: + JAXBContext jaxbContext = JAXBContext.newInstance(BINDING_PACKAGE); + Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); + + while (staxFiltRd.peek() != null) { + StartElement evRoot = (StartElement)staxFiltRd.peek(); + String name = evRoot.getName().getLocalPart(); + JAXBElement el = unmarshaller.unmarshal(staxReader, CTCustomGeometry2D.class); + CTCustomGeometry2D cus = el.getValue(); + cntElem++; + + if(containsKey(name)) { + LOG.log(POILogger.WARN, "Duplicate definoition of " + name); + } + put(name, new CustomGeometry(cus)); + } + } + + /** + * Convert a single CustomGeometry object, i.e. from xmlbeans + */ + public static CustomGeometry convertCustomGeometry(XMLStreamReader staxReader) { + try { + JAXBContext jaxbContext = JAXBContext.newInstance(BINDING_PACKAGE); + Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); + JAXBElement el = unmarshaller.unmarshal(staxReader, CTCustomGeometry2D.class); + return new CustomGeometry(el.getValue()); + } catch (JAXBException e) { + LOG.log(POILogger.ERROR, "Unable to parse single custom geometry", e); + return null; + } + } + + public static synchronized PresetGeometries getInstance(){ + if(_inst == null) { + _inst = new PresetGeometries(); + try { + InputStream is = PresetGeometries.class. + getResourceAsStream("presetShapeDefinitions.xml"); + _inst.init(is); + is.close(); + } catch (Exception e){ + throw new RuntimeException(e); + } + } + + return _inst; + } + +} diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/QuadToCommand.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/QuadToCommand.java similarity index 93% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/QuadToCommand.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/QuadToCommand.java index 65fd7d45e..e9a9364b2 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/QuadToCommand.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/QuadToCommand.java @@ -17,9 +17,9 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; -import org.openxmlformats.schemas.drawingml.x2006.main.CTAdjPoint2D; +import org.apache.poi.sl.draw.binding.CTAdjPoint2D; import java.awt.geom.GeneralPath; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/SinArcTanExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/SinArcTanExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/SinArcTanExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/SinArcTanExpression.java index 8ac68e0c6..e14acb9e6 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/SinArcTanExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/SinArcTanExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/SinExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/SinExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/SinExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/SinExpression.java index 9e82f5abd..ca0c110ce 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/SinExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/SinExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/SqrtExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/SqrtExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/SqrtExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/SqrtExpression.java index d798e93a1..5cdd67cc5 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/SqrtExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/SqrtExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/ooxml/java/org/apache/poi/xslf/model/geom/TanExpression.java b/src/scratchpad/src/org/apache/poi/sl/draw/geom/TanExpression.java similarity index 97% rename from src/ooxml/java/org/apache/poi/xslf/model/geom/TanExpression.java rename to src/scratchpad/src/org/apache/poi/sl/draw/geom/TanExpression.java index 3435f3560..7eebdcedf 100644 --- a/src/ooxml/java/org/apache/poi/xslf/model/geom/TanExpression.java +++ b/src/scratchpad/src/org/apache/poi/sl/draw/geom/TanExpression.java @@ -17,7 +17,7 @@ * ==================================================================== */ -package org.apache.poi.xslf.model.geom; +package org.apache.poi.sl.draw.geom; import java.util.regex.Matcher; diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/AutoShape.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/AutoShape.java index ae2fb7c7d..0e0b1dbbe 100644 --- a/src/scratchpad/src/org/apache/poi/sl/usermodel/AutoShape.java +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/AutoShape.java @@ -17,6 +17,6 @@ package org.apache.poi.sl.usermodel; -public interface AutoShape extends SimpleShape { +public interface AutoShape extends TextShape { public TextRun getTextRun(); } diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/ColorStyle.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/ColorStyle.java new file mode 100644 index 000000000..9be847b36 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/ColorStyle.java @@ -0,0 +1,69 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.usermodel; + +import java.awt.Color; + + +public interface ColorStyle { + Color getColor(); + + /** + * the opacity as expressed by a percentage value + * + * @return opacity in percents in the range [0..100000] + * or -1 if the value is not set + */ + int getAlpha(); + + /** + * the luminance shift as expressed by a percentage relative to the input color + * + * @return luminance shift in percents in the range [0..100000] + * or -1 if the value is not set + */ + int getLumOff(); + + /** + * the luminance as expressed by a percentage relative to the input color + * + * @return luminance in percents in the range [0..100000] + * or -1 if the value is not set + */ + int getLumMod(); + + /** + * specifies a darker version of its input color. + * A 10% shade is 10% of the input color combined with 90% black. + * + * @return the value of the shade specified as percents in the range [0..100000] + * with 0% indicating minimal shade and 100% indicating maximum + * or -1 if the value is not set + */ + int getShade(); + + /** + * specifies a lighter version of its input color. + * A 10% tint is 10% of the input color combined with 90% white. + * + * @return the value of the tint specified as percents in the range [0..100000] + * with 0% indicating minimal tint and 100% indicating maximum + * or -1 if the value is not set + */ + int getTint(); +} diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/LineStyle.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/FillStyle.java similarity index 92% rename from src/scratchpad/src/org/apache/poi/sl/usermodel/LineStyle.java rename to src/scratchpad/src/org/apache/poi/sl/usermodel/FillStyle.java index 43ef4a7b7..8414000b8 100644 --- a/src/scratchpad/src/org/apache/poi/sl/usermodel/LineStyle.java +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/FillStyle.java @@ -1,21 +1,22 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ - -package org.apache.poi.sl.usermodel; - -public interface LineStyle extends org.apache.poi.common.usermodel.LineStyle { -} +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.usermodel; + +public interface FillStyle { + PaintStyle getPaint(); +} diff --git a/src/java/org/apache/poi/common/usermodel/LineStyle.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/FreeformShape.java similarity index 89% rename from src/java/org/apache/poi/common/usermodel/LineStyle.java rename to src/scratchpad/src/org/apache/poi/sl/usermodel/FreeformShape.java index db676f529..4d2ffb67a 100644 --- a/src/java/org/apache/poi/common/usermodel/LineStyle.java +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/FreeformShape.java @@ -1,21 +1,22 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ -package org.apache.poi.common.usermodel; - -public interface LineStyle { - -} +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.usermodel; + +public interface FreeformShape extends AutoShape { + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/GradientPaint.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/GradientPaint.java new file mode 100644 index 000000000..e16b430be --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/GradientPaint.java @@ -0,0 +1,32 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.usermodel; + + +public interface GradientPaint extends PaintStyle { + enum GradientType { linear, circular, shape } + + /** + * @return the angle of the gradient + */ + double getGradientAngle(); + ColorStyle[] getGradientColors(); + float[] getGradientFractions(); + boolean isRotatedWithShape(); + GradientType getGradientType(); +} diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/Insets2D.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/Insets2D.java new file mode 100644 index 000000000..04b4d77cf --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/Insets2D.java @@ -0,0 +1,146 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.usermodel; + +import java.awt.Insets; + +/** + * This is a replacement for {@link java.awt.Insets} which works on doubles + * instead of ints + */ +public class Insets2D { + + /** + * The inset from the top. + * This value is added to the Top of the rectangle + * to yield a new location for the Top. + */ + public double top; + + /** + * The inset from the left. + * This value is added to the Left of the rectangle + * to yield a new location for the Left edge. + */ + public double left; + + /** + * The inset from the bottom. + * This value is subtracted from the Bottom of the rectangle + * to yield a new location for the Bottom. + */ + public double bottom; + + /** + * The inset from the right. + * This value is subtracted from the Right of the rectangle + * to yield a new location for the Right edge. + */ + public double right; + + /** + * Creates and initializes a new Insets object with the + * specified top, left, bottom, and right insets. + * @param top the inset from the top. + * @param left the inset from the left. + * @param bottom the inset from the bottom. + * @param right the inset from the right. + */ + public Insets2D(double top, double left, double bottom, double right) { + this.top = top; + this.left = left; + this.bottom = bottom; + this.right = right; + } + + /** + * Set top, left, bottom, and right to the specified values + * + * @param top the inset from the top. + * @param left the inset from the left. + * @param bottom the inset from the bottom. + * @param right the inset from the right. + * @since 1.5 + */ + public void set(double top, double left, double bottom, double right) { + this.top = top; + this.left = left; + this.bottom = bottom; + this.right = right; + } + + /** + * Checks whether two insets objects are equal. Two instances + * of Insets are equal if the four integer values + * of the fields top, left, + * bottom, and right are all equal. + * @return true if the two insets are equal; + * otherwise false. + * @since JDK1.1 + */ + public boolean equals(Object obj) { + if (obj instanceof Insets) { + Insets insets = (Insets)obj; + return ((top == insets.top) && (left == insets.left) && + (bottom == insets.bottom) && (right == insets.right)); + } + return false; + } + + /** + * Returns the hash code for this Insets. + * + * @return a hash code for this Insets. + */ + public int hashCode() { + double sum1 = left + bottom; + double sum2 = right + top; + double val1 = sum1 * (sum1 + 1)/2 + left; + double val2 = sum2 * (sum2 + 1)/2 + top; + double sum3 = val1 + val2; + return (int)(sum3 * (sum3 + 1)/2 + val2); + } + + /** + * Returns a string representation of this Insets object. + * This method is intended to be used only for debugging purposes, and + * the content and format of the returned string may vary between + * implementations. The returned string may be empty but may not be + * null. + * + * @return a string representation of this Insets object. + */ + public String toString() { + return getClass().getName() + "[top=" + top + ",left=" + left + ",bottom=" + bottom + ",right=" + right + "]"; + } + + /** + * Create a copy of this object. + * @return a copy of this Insets2D object. + */ + public Object clone() { + try { + return super.clone(); + } catch (CloneNotSupportedException e) { + // this shouldn't happen, since we are Cloneable + throw new InternalError(); + } + } + + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/LineDecoration.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/LineDecoration.java new file mode 100644 index 000000000..e8cab5527 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/LineDecoration.java @@ -0,0 +1,69 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.usermodel; + +public interface LineDecoration { + /** + * Represents the shape decoration that appears at the ends of lines. + */ + enum DecorationShape { + NONE, + TRIANGLE, + STEALTH, + DIAMOND, + OVAL, + ARROW + } + + enum DecorationSize { + SMALL, + MEDIUM, + LARGE + } + + /** + * @return the line start shape + */ + DecorationShape getHeadShape(); + + /** + * @return the width of the start shape + */ + DecorationSize getHeadWidth(); + + /** + * @return the length of the start shape + */ + DecorationSize getHeadLength(); + + /** + * @return the line end shape + */ + DecorationShape getTailShape(); + + /** + * @return the width of the end shape + */ + DecorationSize getTailWidth(); + + /** + * @return the length of the end shape + */ + DecorationSize getTailLength(); + +} diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/Fill.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/PaintStyle.java similarity index 93% rename from src/scratchpad/src/org/apache/poi/sl/usermodel/Fill.java rename to src/scratchpad/src/org/apache/poi/sl/usermodel/PaintStyle.java index e62b0480d..e92e650bb 100644 --- a/src/scratchpad/src/org/apache/poi/sl/usermodel/Fill.java +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/PaintStyle.java @@ -17,5 +17,9 @@ package org.apache.poi.sl.usermodel; -public interface Fill extends org.apache.poi.common.usermodel.Fill { + + +public interface PaintStyle { + + } diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/PlaceableShape.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/PlaceableShape.java new file mode 100644 index 000000000..0535536d7 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/PlaceableShape.java @@ -0,0 +1,39 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.usermodel; + +import java.awt.geom.Rectangle2D; + +public interface PlaceableShape { + Rectangle2D getAnchor(); + + FillStyle getFillStyle(); + + StrokeStyle getStrokeStyle(); + + /** + * Rotation angle in degrees + *

+ * Positive angles are clockwise (i.e., towards the positive y axis); + * negative angles are counter-clockwise (i.e., towards the negative y axis). + *

+ * + * @return rotation angle in degrees + */ + double getRotation(); +} diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/Shadow.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/Shadow.java new file mode 100644 index 000000000..589f09554 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/Shadow.java @@ -0,0 +1,47 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.usermodel; + +import java.awt.Color; + + +public interface Shadow { + /** + * @return the offset of this shadow in points + */ + double getDistance(); + + /** + * + * @return the direction to offset the shadow in angles + */ + double getAngle(); + + /** + * + * @return the blur radius of the shadow + * TODO: figure out how to make sense of this property when rendering shadows + */ + double getBlur(); + + /** + * @return the color of this shadow. + * Depending whether the parent shape is filled or stroked, this color is used to fill or stroke this shadow + */ + Color getColor(); +} diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/Shape.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/Shape.java index 11c0bf625..02cab6dbb 100644 --- a/src/scratchpad/src/org/apache/poi/sl/usermodel/Shape.java +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/Shape.java @@ -19,13 +19,61 @@ package org.apache.poi.sl.usermodel; import java.awt.geom.Rectangle2D; -public interface Shape { - public int getShapeType(); +import org.apache.poi.sl.draw.geom.CustomGeometry; - public Rectangle2D getAnchor(); - public void setAnchor(Rectangle2D anchor); +public interface Shape extends PlaceableShape { + CustomGeometry getGeometry(); + + ShapeType getShapeType(); - public void moveTo(float x, float y); + void setAnchor(Rectangle2D anchor); - public Shape getParent(); + ShapeContainer getParent(); + + boolean isPlaceholder(); + + /** + * + * @return the sheet this shape belongs to + */ + Sheet getSheet(); + + /** + * Rotate this shape. + *

+ * Positive angles are clockwise (i.e., towards the positive y axis); + * negative angles are counter-clockwise (i.e., towards the negative y axis). + *

+ * + * @param theta the rotation angle in degrees. + */ + void setRotation(double theta); + + /** + * @param flip whether the shape is horizontally flipped + */ + void setFlipHorizontal(boolean flip); + + /** + * Whether the shape is vertically flipped + * + * @param flip whether the shape is vertically flipped + */ + void setFlipVertical(boolean flip); + + /** + * Whether the shape is horizontally flipped + * + * @return whether the shape is horizontally flipped + */ + boolean getFlipHorizontal(); + + /** + * Whether the shape is vertically flipped + * + * @return whether the shape is vertically flipped + */ + boolean getFlipVertical(); + + } diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeContainer.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeContainer.java index cabcf4bc8..faee9a1b8 100644 --- a/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeContainer.java +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeContainer.java @@ -17,8 +17,28 @@ package org.apache.poi.sl.usermodel; -public interface ShapeContainer { + +public interface ShapeContainer extends Iterable, PlaceableShape { + /** + * Returns an array containing all of the elements in this container in proper + * sequence (from first to last element). + * + * @return an array containing all of the elements in this container in proper + * sequence + */ public Shape[] getShapes(); + public void addShape(Shape shape); + + /** + * Removes the specified shape from this sheet, if it is present + * (optional operation). If this sheet does not contain the element, + * it is unchanged. + * + * @param xShape shape to be removed from this sheet, if present + * @return true if this sheet contained the specified element + * @throws IllegalArgumentException if the type of the specified shape + * is incompatible with this sheet (optional) + */ public boolean removeShape(Shape shape); } diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeType.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeType.java new file mode 100644 index 000000000..0c25f5be4 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeType.java @@ -0,0 +1,295 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.usermodel; + +/** + * known preset shape geometries in PresentationML + */ +public enum ShapeType { + NOT_PRIMITIVE(-1, 0, "NotPrimitive"), + LINE(1, 20, "Line"), + LINE_INV(2, -1, null), + TRIANGLE(3, 5, "IsocelesTriangle"), + RT_TRIANGLE(4, 6, "RightTriangle"), + RECT(5, 1, "Rectangle"), + DIAMOND(6, 4, "Diamond"), + PARALLELOGRAM(7, 7, "Parallelogram"), + TRAPEZOID(8, 8, "Trapezoid"), + NON_ISOSCELES_TRAPEZOID(9, -1, null), + PENTAGON(10, 56, "Pentagon"), + HEXAGON(11, 9, "Hexagon"), + HEPTAGON(12, -1, null), + OCTAGON(13, 10, "Octagon"), + DECAGON(14, -1, null), + DODECAGON(15, -1, null), + STAR_4(16, 187, "Star4"), + STAR_5(17, 12, "Star"), // aka star in native + STAR_6(18, -1, null), + STAR_7(19, -1, null), + STAR_8(20, 58, "Star8"), + STAR_10(21, -1, null), + STAR_12(22, -1, null), + STAR_16(23, 59, "Star16"), + SEAL(23, 18, "Seal"), // same as star_16, but twice in native + STAR_24(24, 92, "Star24"), + STAR_32(25, 60, "Star32"), + ROUND_RECT(26, 2, "RoundRectangle"), + ROUND_1_RECT(27, -1, null), + ROUND_2_SAME_RECT(28, -1, null), + ROUND_2_DIAG_RECT(29, -1, null), + SNIP_ROUND_RECT(30, -1, null), + SNIP_1_RECT(31, -1, null), + SNIP_2_SAME_RECT(32, -1, null), + SNIP_2_DIAG_RECT(33, -1, null), + PLAQUE(34, 21, "Plaque"), + ELLIPSE(35, 3, "Ellipse"), + TEARDROP(36, -1, null), + HOME_PLATE(37, 15, "HomePlate"), + CHEVRON(38, 55, "Chevron"), + PIE_WEDGE(39, -1, null), + PIE(40, -1, null), + BLOCK_ARC(41, 95, "BlockArc"), + DONUT(42, 23, "Donut"), + NO_SMOKING(43, 57, "NoSmoking"), + RIGHT_ARROW(44, 13, "Arrow"), // aka arrow in native + LEFT_ARROW(45, 66, "LeftArrow"), + UP_ARROW(46, 68, "UpArrow"), + DOWN_ARROW(47, 67, "DownArrow"), + STRIPED_RIGHT_ARROW(48, 93, "StripedRightArrow"), + NOTCHED_RIGHT_ARROW(49, 94, "NotchedRightArrow"), + BENT_UP_ARROW(50, 90, "BentUpArrow"), + LEFT_RIGHT_ARROW(51, 69, "LeftRightArrow"), + UP_DOWN_ARROW(52, 70, "UpDownArrow"), + LEFT_UP_ARROW(53, 89, "LeftUpArrow"), + LEFT_RIGHT_UP_ARROW(54, 182, "LeftRightUpArrow"), + QUAD_ARROW(55, 76, "QuadArrow"), + LEFT_ARROW_CALLOUT(56, 77, "LeftArrowCallout"), + RIGHT_ARROW_CALLOUT(57, 78, "RightArrowCallout"), + UP_ARROW_CALLOUT(58, 79, "UpArrowCallout"), + DOWN_ARROW_CALLOUT(59, 80, "DownArrowCallout"), + LEFT_RIGHT_ARROW_CALLOUT(60, 81, "LeftRightArrowCallout"), + UP_DOWN_ARROW_CALLOUT(61, 82, "UpDownArrowCallout"), + QUAD_ARROW_CALLOUT(62, 83, "QuadArrowCallout"), + BENT_ARROW(63, 91, "BentArrow"), + UTURN_ARROW(64, 101, "UturnArrow"), + CIRCULAR_ARROW(65, 99, "CircularArrow"), + LEFT_CIRCULAR_ARROW(66, -1, null), + LEFT_RIGHT_CIRCULAR_ARROW(67, -1, null), + CURVED_RIGHT_ARROW(68, 102, "CurvedRightArrow"), + CURVED_LEFT_ARROW(69, 103, "CurvedLeftArrow"), + CURVED_UP_ARROW(70, 104, "CurvedUpArrow"), + CURVED_DOWN_ARROW(71, 105, "CurvedDownArrow"), + SWOOSH_ARROW(72, -1, null), + CUBE(73, 16, "Cube"), + CAN(74, 22, "Can"), + LIGHTNING_BOLT(75, 73, "LightningBolt"), + HEART(76, 74, "Heart"), + SUN(77, 183, "Sun"), + MOON(78, 184, "Moon"), + SMILEY_FACE(79, 96, "SmileyFace"), + IRREGULAR_SEAL_1(80, 71, "IrregularSeal1"), + IRREGULAR_SEAL_2(81, 72, "IrregularSeal2"), + FOLDED_CORNER(82, 65, "FoldedCorner"), + BEVEL(83, 84, "Bevel"), + FRAME(84, 75, "PictureFrame"), + HALF_FRAME(85, -1, null), + CORNER(86, -1, null), + DIAG_STRIPE(87, -1, null), + CHORD(88, -1, null), + ARC(89, 19, "Arc"), + LEFT_BRACKET(90, 85, "LeftBracket"), + RIGHT_BRACKET(91, 86, "RightBracket"), + LEFT_BRACE(92, 87, "LeftBrace"), + RIGHT_BRACE(93, 88, "RightBrace"), + BRACKET_PAIR(94, 185, "BracketPair"), + BRACE_PAIR(95, 186, "BracePair"), + STRAIGHT_CONNECTOR_1(96, 32, "StraightConnector1"), + BENT_CONNECTOR_2(97, 33, "BentConnector2"), + BENT_CONNECTOR_3(98, 34, "BentConnector3"), + BENT_CONNECTOR_4(99, 35, "BentConnector4"), + BENT_CONNECTOR_5(100, 36, "BentConnector5"), + CURVED_CONNECTOR_2(101, 37, "CurvedConnector2"), + CURVED_CONNECTOR_3(102, 38, "CurvedConnector3"), + CURVED_CONNECTOR_4(103, 39, "CurvedConnector4"), + CURVED_CONNECTOR_5(104, 40, "CurvedConnector5"), + CALLOUT_1(105, 41, "Callout1"), + CALLOUT_2(106, 42, "Callout2"), + CALLOUT_3(107, 43, "Callout3"), + ACCENT_CALLOUT_1(108, 44, "AccentCallout1"), + ACCENT_CALLOUT_2(109, 45, "AccentCallout2"), + ACCENT_CALLOUT_3(110, 46, "AccentCallout3"), + BORDER_CALLOUT_1(111, 47, "BorderCallout1"), + BORDER_CALLOUT_2(112, 48, "BorderCallout2"), + BORDER_CALLOUT_3(113, 49, "BorderCallout3"), + ACCENT_BORDER_CALLOUT_1(114, 50, "AccentBorderCallout1"), + ACCENT_BORDER_CALLOUT_2(115, 51, "AccentBorderCallout2"), + ACCENT_BORDER_CALLOUT_3(116, 52, "AccentBorderCallout3"), + WEDGE_RECT_CALLOUT(117, 61, "WedgeRectCallout"), + WEDGE_ROUND_RECT_CALLOUT(118, 62, "WedgeRRectCallout"), + WEDGE_ELLIPSE_CALLOUT(119, 63, "WedgeEllipseCallout"), + CLOUD_CALLOUT(120, 106, "CloudCallout"), + CLOUD(121, -1, null), + RIBBON(122, 53, "Ribbon"), + RIBBON_2(123, 54, "Ribbon2"), + ELLIPSE_RIBBON(124, 107, "EllipseRibbon"), + ELLIPSE_RIBBON_2(125, 108, "EllipseRibbon2"), + LEFT_RIGHT_RIBBON(126, -1, null), + VERTICAL_SCROLL(127, 97, "VerticalScroll"), + HORIZONTAL_SCROLL(128, 98, "HorizontalScroll"), + WAVE(129, 64, "Wave"), + DOUBLE_WAVE(130, 188, "DoubleWave"), + PLUS(131, 11, "Plus"), + FLOW_CHART_PROCESS(132, 109, "FlowChartProcess"), + FLOW_CHART_DECISION(133, 110, "FlowChartDecision"), + FLOW_CHART_INPUT_OUTPUT(134, 111, "FlowChartInputOutput"), + FLOW_CHART_PREDEFINED_PROCESS(135, 112, "FlowChartPredefinedProcess"), + FLOW_CHART_INTERNAL_STORAGE(136, 113, "FlowChartInternalStorage"), + FLOW_CHART_DOCUMENT(137, 114, "FlowChartDocument"), + FLOW_CHART_MULTIDOCUMENT(138, 115, "FlowChartMultidocument"), + FLOW_CHART_TERMINATOR(139, 116, "FlowChartTerminator"), + FLOW_CHART_PREPARATION(140, 117, "FlowChartPreparation"), + FLOW_CHART_MANUAL_INPUT(141, 118, "FlowChartManualInput"), + FLOW_CHART_MANUAL_OPERATION(142, 119, "FlowChartManualOperation"), + FLOW_CHART_CONNECTOR(143, 120, "FlowChartConnector"), + FLOW_CHART_PUNCHED_CARD(144, 121, "FlowChartPunchedCard"), + FLOW_CHART_PUNCHED_TAPE(145, 122, "FlowChartPunchedTape"), + FLOW_CHART_SUMMING_JUNCTION(146, 123, "FlowChartSummingJunction"), + FLOW_CHART_OR(147, 124, "FlowChartOr"), + FLOW_CHART_COLLATE(148, 125, "FlowChartCollate"), + FLOW_CHART_SORT(149, 126, "FlowChartSort"), + FLOW_CHART_EXTRACT(150, 127, "FlowChartExtract"), + FLOW_CHART_MERGE(151, 128, "FlowChartMerge"), + FLOW_CHART_OFFLINE_STORAGE(152, 129, "FlowChartOfflineStorage"), + FLOW_CHART_ONLINE_STORAGE(153, 130, "FlowChartOnlineStorage"), + FLOW_CHART_MAGNETIC_TAPE(154, 131, "FlowChartMagneticTape"), + FLOW_CHART_MAGNETIC_DISK(155, 132, "FlowChartMagneticDisk"), + FLOW_CHART_MAGNETIC_DRUM(156, 133, "FlowChartMagneticDrum"), + FLOW_CHART_DISPLAY(157, 134, "FlowChartDisplay"), + FLOW_CHART_DELAY(158, 135, "FlowChartDelay"), + FLOW_CHART_ALTERNATE_PROCESS(159, 176, "FlowChartAlternateProcess"), + FLOW_CHART_OFFPAGE_CONNECTOR(160, 177, "FlowChartOffpageConnector"), + ACTION_BUTTON_BLANK(161, 189, "ActionButtonBlank"), + ACTION_BUTTON_HOME(162, 190, "ActionButtonHome"), + ACTION_BUTTON_HELP(163, 191, "ActionButtonHelp"), + ACTION_BUTTON_INFORMATION(164, 192, "ActionButtonInformation"), + ACTION_BUTTON_FORWARD_NEXT(165, 193, "ActionButtonForwardNext"), + ACTION_BUTTON_BACK_PREVIOUS(166, 194, "ActionButtonBackPrevious"), + ACTION_BUTTON_END(167, 195, "ActionButtonEnd"), + ACTION_BUTTON_BEGINNING(168, 196, "ActionButtonBeginning"), + ACTION_BUTTON_RETURN(169, 197, "ActionButtonReturn"), + ACTION_BUTTON_DOCUMENT(170, 198, "ActionButtonDocument"), + ACTION_BUTTON_SOUND(171, 199, "ActionButtonSound"), + ACTION_BUTTON_MOVIE(172, 200, "ActionButtonMovie"), + GEAR_6(173, -1, null), + GEAR_9(174, -1, null), + FUNNEL(175, -1, null), + MATH_PLUS(176, -1, null), + MATH_MINUS(177, -1, null), + MATH_MULTIPLY(178, -1, null), + MATH_DIVIDE(179, -1, null), + MATH_EQUAL(180, -1, null), + MATH_NOT_EQUAL(181, -1, null), + CORNER_TABS(182, -1, null), + SQUARE_TABS(183, -1, null), + PLAQUE_TABS(184, -1, null), + CHART_X(185, -1, null), + CHART_STAR(186, -1, null), + CHART_PLUS(187, -1, null), + // below are shape types only found in native + NOTCHED_CIRCULAR_ARROW(-1, 100, "NotchedCircularArrow"), + THICK_ARROW(-1, 14, "ThickArrow"), + BALLOON(-1, 17, "Balloon"), + TEXT_SIMPLE(-1, 24, "TextSimple"), + TEXT_OCTAGON(-1, 25, "TextOctagon"), + TEXT_HEXAGON(-1, 26, "TextHexagon"), + TEXT_CURVE(-1, 27, "TextCurve"), + TEXT_WAVE(-1, 28, "TextWave"), + TEXT_RING(-1, 29, "TextRing"), + TEXT_ON_CURVE(-1, 30, "TextOnCurve"), + TEXT_ON_RING(-1, 31, "TextOnRing"), + TEXT_PLAIN_TEXT(-1, 136, "TextPlainText"), + TEXT_STOP(-1, 137, "TextStop"), + TEXT_TRIANGLE(-1, 138, "TextTriangle"), + TEXT_TRIANGLE_INVERTED(-1, 139, "TextTriangleInverted"), + TEXT_CHEVRON(-1, 140, "TextChevron"), + TEXT_CHEVRON_INVERTED(-1, 141, "TextChevronInverted"), + TEXT_RING_INSIDE(-1, 142, "TextRingInside"), + TEXT_RING_OUTSIDE(-1, 143, "TextRingOutside"), + TEXT_ARCH_UP_CURVE(-1, 144, "TextArchUpCurve"), + TEXT_ARCH_DOWN_CURVE(-1, 145, "TextArchDownCurve"), + TEXT_CIRCLE_CURVE(-1, 146, "TextCircleCurve"), + TEXT_BUTTON_CURVE(-1, 147, "TextButtonCurve"), + TEXT_ARCH_UP_POUR(-1, 148, "TextArchUpPour"), + TEXT_ARCH_DOWN_POUR(-1, 149, "TextArchDownPour"), + TEXT_CIRCLE_POUR(-1, 150, "TextCirclePour"), + TEXT_BUTTON_POUR(-1, 151, "TextButtonPour"), + TEXT_CURVE_UP(-1, 152, "TextCurveUp"), + TEXT_CURVE_DOWN(-1, 153, "TextCurveDown"), + TEXT_CASCADE_UP(-1, 154, "TextCascadeUp"), + TEXT_CASCADE_DOWN(-1, 155, "TextCascadeDown"), + TEXT_WAVE_1(-1, 156, "TextWave1"), + TEXT_WAVE_2(-1, 157, "TextWave2"), + TEXT_WAVE_3(-1, 158, "TextWave3"), + TEXT_WAVE_4(-1, 159, "TextWave4"), + TEXT_INFLATE(-1, 160, "TextInflate"), + TEXT_DEFLATE(-1, 161, "TextDeflate"), + TEXT_INFLATE_BOTTOM(-1, 162, "TextInflateBottom"), + TEXT_DEFLATE_BOTTOM(-1, 163, "TextDeflateBottom"), + TEXT_INFLATE_TOP(-1, 164, "TextInflateTop"), + TEXT_DEFLATE_TOP(-1, 165, "TextDeflateTop"), + TEXT_DEFLATE_INFLATE(-1, 166, "TextDeflateInflate"), + TEXT_DEFLATE_INFLATE_DEFLATE(-1, 167, "TextDeflateInflateDeflate"), + TEXT_FADE_RIGHT(-1, 168, "TextFadeRight"), + TEXT_FADE_LEFT(-1, 169, "TextFadeLeft"), + TEXT_FADE_UP(-1, 170, "TextFadeUp"), + TEXT_FADE_DOWN(-1, 171, "TextFadeDown"), + TEXT_SLANT_UP(-1, 172, "TextSlantUp"), + TEXT_SLANT_DOWN(-1, 173, "TextSlantDown"), + TEXT_CAN_UP(-1, 174, "TextCanUp"), + TEXT_CAN_DOWN(-1, 175, "TextCanDown"), + CALLOUT_90(-1, 178, "Callout90"), + ACCENT_CALLOUT_90(-1, 179, "AccentCallout90"), + BORDER_CALLOUT_90(-1, 180, "BorderCallout90"), + ACCENT_BORDER_CALLOUT_90(-1, 181, "AccentBorderCallout90"), + HOST_CONTROL(-1, 201, "HostControl"), + TEXT_BOX(-1, 202, "TextBox") + ; + + /** Preset-ID for XML-based shapes */ + public final int ooxmlId; + + /** Preset-ID for binary-based shapes */ + public final int nativeId; + + /** POI-specific name for the binary-based type */ + public final String nativeName; + + ShapeType(int ooxmlId, int nativeId, String nativeName){ + this.ooxmlId = ooxmlId; + this.nativeId = nativeId; + this.nativeName = nativeName; + } + + public static ShapeType forId(int id, boolean isOoxmlId){ + for(ShapeType t : values()){ + if((isOoxmlId && t.ooxmlId == id) || + (!isOoxmlId && t.nativeId == id)) return t; + } + throw new IllegalArgumentException("Unknown shape type: " + id); + } +} diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeTypes.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeTypes.java deleted file mode 100644 index 69325fe13..000000000 --- a/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeTypes.java +++ /dev/null @@ -1,224 +0,0 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ - -package org.apache.poi.sl.usermodel; - -public interface ShapeTypes { - public static final int NotPrimitive = 0; - public static final int Rectangle = 1; - public static final int RoundRectangle = 2; - public static final int Ellipse = 3; - public static final int Diamond = 4; - public static final int IsocelesTriangle = 5; - public static final int RightTriangle = 6; - public static final int Parallelogram = 7; - public static final int Trapezoid = 8; - public static final int Hexagon = 9; - public static final int Octagon = 10; - public static final int Plus = 11; - public static final int Star = 12; - public static final int Arrow = 13; - public static final int ThickArrow = 14; - public static final int HomePlate = 15; - public static final int Cube = 16; - public static final int Balloon = 17; - public static final int Seal = 18; - public static final int Arc = 19; - public static final int Line = 20; - public static final int Plaque = 21; - public static final int Can = 22; - public static final int Donut = 23; - public static final int TextSimple = 24; - public static final int TextOctagon = 25; - public static final int TextHexagon = 26; - public static final int TextCurve = 27; - public static final int TextWave = 28; - public static final int TextRing = 29; - public static final int TextOnCurve = 30; - public static final int TextOnRing = 31; - public static final int StraightConnector1 = 32; - public static final int BentConnector2 = 33; - public static final int BentConnector3 = 34; - public static final int BentConnector4 = 35; - public static final int BentConnector5 = 36; - public static final int CurvedConnector2 = 37; - public static final int CurvedConnector3 = 38; - public static final int CurvedConnector4 = 39; - public static final int CurvedConnector5 = 40; - public static final int Callout1 = 41; - public static final int Callout2 = 42; - public static final int Callout3 = 43; - public static final int AccentCallout1 = 44; - public static final int AccentCallout2 = 45; - public static final int AccentCallout3 = 46; - public static final int BorderCallout1 = 47; - public static final int BorderCallout2 = 48; - public static final int BorderCallout3 = 49; - public static final int AccentBorderCallout1 = 50; - public static final int AccentBorderCallout2 = 51; - public static final int AccentBorderCallout3 = 52; - public static final int Ribbon = 53; - public static final int Ribbon2 = 54; - public static final int Chevron = 55; - public static final int Pentagon = 56; - public static final int NoSmoking = 57; - public static final int Star8 = 58; - public static final int Star16 = 59; - public static final int Star32 = 60; - public static final int WedgeRectCallout = 61; - public static final int WedgeRRectCallout = 62; - public static final int WedgeEllipseCallout = 63; - public static final int Wave = 64; - public static final int FoldedCorner = 65; - public static final int LeftArrow = 66; - public static final int DownArrow = 67; - public static final int UpArrow = 68; - public static final int LeftRightArrow = 69; - public static final int UpDownArrow = 70; - public static final int IrregularSeal1 = 71; - public static final int IrregularSeal2 = 72; - public static final int LightningBolt = 73; - public static final int Heart = 74; - public static final int PictureFrame = 75; - public static final int QuadArrow = 76; - public static final int LeftArrowCallout = 77; - public static final int RightArrowCallout = 78; - public static final int UpArrowCallout = 79; - public static final int DownArrowCallout = 80; - public static final int LeftRightArrowCallout = 81; - public static final int UpDownArrowCallout = 82; - public static final int QuadArrowCallout = 83; - public static final int Bevel = 84; - public static final int LeftBracket = 85; - public static final int RightBracket = 86; - public static final int LeftBrace = 87; - public static final int RightBrace = 88; - public static final int LeftUpArrow = 89; - public static final int BentUpArrow = 90; - public static final int BentArrow = 91; - public static final int Star24 = 92; - public static final int StripedRightArrow = 93; - public static final int NotchedRightArrow = 94; - public static final int BlockArc = 95; - public static final int SmileyFace = 96; - public static final int VerticalScroll = 97; - public static final int HorizontalScroll = 98; - public static final int CircularArrow = 99; - public static final int NotchedCircularArrow = 100; - public static final int UturnArrow = 101; - public static final int CurvedRightArrow = 102; - public static final int CurvedLeftArrow = 103; - public static final int CurvedUpArrow = 104; - public static final int CurvedDownArrow = 105; - public static final int CloudCallout = 106; - public static final int EllipseRibbon = 107; - public static final int EllipseRibbon2 = 108; - public static final int FlowChartProcess = 109; - public static final int FlowChartDecision = 110; - public static final int FlowChartInputOutput = 111; - public static final int FlowChartPredefinedProcess = 112; - public static final int FlowChartInternalStorage = 113; - public static final int FlowChartDocument = 114; - public static final int FlowChartMultidocument = 115; - public static final int FlowChartTerminator = 116; - public static final int FlowChartPreparation = 117; - public static final int FlowChartManualInput = 118; - public static final int FlowChartManualOperation = 119; - public static final int FlowChartConnector = 120; - public static final int FlowChartPunchedCard = 121; - public static final int FlowChartPunchedTape = 122; - public static final int FlowChartSummingJunction = 123; - public static final int FlowChartOr = 124; - public static final int FlowChartCollate = 125; - public static final int FlowChartSort = 126; - public static final int FlowChartExtract = 127; - public static final int FlowChartMerge = 128; - public static final int FlowChartOfflineStorage = 129; - public static final int FlowChartOnlineStorage = 130; - public static final int FlowChartMagneticTape = 131; - public static final int FlowChartMagneticDisk = 132; - public static final int FlowChartMagneticDrum = 133; - public static final int FlowChartDisplay = 134; - public static final int FlowChartDelay = 135; - public static final int TextPlainText = 136; - public static final int TextStop = 137; - public static final int TextTriangle = 138; - public static final int TextTriangleInverted = 139; - public static final int TextChevron = 140; - public static final int TextChevronInverted = 141; - public static final int TextRingInside = 142; - public static final int TextRingOutside = 143; - public static final int TextArchUpCurve = 144; - public static final int TextArchDownCurve = 145; - public static final int TextCircleCurve = 146; - public static final int TextButtonCurve = 147; - public static final int TextArchUpPour = 148; - public static final int TextArchDownPour = 149; - public static final int TextCirclePour = 150; - public static final int TextButtonPour = 151; - public static final int TextCurveUp = 152; - public static final int TextCurveDown = 153; - public static final int TextCascadeUp = 154; - public static final int TextCascadeDown = 155; - public static final int TextWave1 = 156; - public static final int TextWave2 = 157; - public static final int TextWave3 = 158; - public static final int TextWave4 = 159; - public static final int TextInflate = 160; - public static final int TextDeflate = 161; - public static final int TextInflateBottom = 162; - public static final int TextDeflateBottom = 163; - public static final int TextInflateTop = 164; - public static final int TextDeflateTop = 165; - public static final int TextDeflateInflate = 166; - public static final int TextDeflateInflateDeflate = 167; - public static final int TextFadeRight = 168; - public static final int TextFadeLeft = 169; - public static final int TextFadeUp = 170; - public static final int TextFadeDown = 171; - public static final int TextSlantUp = 172; - public static final int TextSlantDown = 173; - public static final int TextCanUp = 174; - public static final int TextCanDown = 175; - public static final int FlowChartAlternateProcess = 176; - public static final int FlowChartOffpageConnector = 177; - public static final int Callout90 = 178; - public static final int AccentCallout90 = 179; - public static final int BorderCallout90 = 180; - public static final int AccentBorderCallout90 = 181; - public static final int LeftRightUpArrow = 182; - public static final int Sun = 183; - public static final int Moon = 184; - public static final int BracketPair = 185; - public static final int BracePair = 186; - public static final int Star4 = 187; - public static final int DoubleWave = 188; - public static final int ActionButtonBlank = 189; - public static final int ActionButtonHome = 190; - public static final int ActionButtonHelp = 191; - public static final int ActionButtonInformation = 192; - public static final int ActionButtonForwardNext = 193; - public static final int ActionButtonBackPrevious = 194; - public static final int ActionButtonEnd = 195; - public static final int ActionButtonBeginning = 196; - public static final int ActionButtonReturn = 197; - public static final int ActionButtonDocument = 198; - public static final int ActionButtonSound = 199; - public static final int ActionButtonMovie = 200; - public static final int HostControl = 201; - public static final int TextBox = 202; -} diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/Sheet.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/Sheet.java index 7959838cc..4da90a6a3 100644 --- a/src/scratchpad/src/org/apache/poi/sl/usermodel/Sheet.java +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/Sheet.java @@ -17,13 +17,21 @@ package org.apache.poi.sl.usermodel; + /** * Common parent of Slides, Notes and Masters */ public interface Sheet extends ShapeContainer { - public SlideShow getSlideShow(); + SlideShow getSlideShow(); - public MasterSheet getMasterSheet(); + /** + * @return whether shapes on the master sheet should be shown. By default master graphics is turned off. + * Sheets that support the notion of master (slide, slideLayout) should override it and + * check this setting in the sheet XML + */ + boolean getFollowMasterGraphics(); + + MasterSheet getMasterSheet(); - public Background getBackground(); + Background getBackground(); } diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/SimpleShape.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/SimpleShape.java index 449433a7e..7de02dbf6 100644 --- a/src/scratchpad/src/org/apache/poi/sl/usermodel/SimpleShape.java +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/SimpleShape.java @@ -17,10 +17,14 @@ package org.apache.poi.sl.usermodel; -public interface SimpleShape extends Shape { - public Fill getFill(); - public LineStyle getLineStyle(); +import org.apache.poi.sl.draw.geom.IAdjustableShape; - public Hyperlink getHyperlink(); - public void setHyperlink(Hyperlink hyperlink); + +public interface SimpleShape extends Shape, IAdjustableShape { + StrokeStyle getStrokeStyle(); + Shadow getShadow(); + LineDecoration getLineDecoration(); + + Hyperlink getHyperlink(); + void setHyperlink(Hyperlink hyperlink); } diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/SlideShow.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/SlideShow.java index 8239bb91f..4505ca584 100644 --- a/src/scratchpad/src/org/apache/poi/sl/usermodel/SlideShow.java +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/SlideShow.java @@ -17,14 +17,22 @@ package org.apache.poi.sl.usermodel; +import java.awt.Dimension; import java.io.IOException; public interface SlideShow { - public Slide createSlide() throws IOException; - public MasterSheet createMasterSheet() throws IOException; + Slide createSlide() throws IOException; + MasterSheet createMasterSheet() throws IOException; - public Slide[] getSlides(); - public MasterSheet[] getMasterSheet(); + Slide[] getSlides(); + MasterSheet[] getMasterSheet(); - public Resources getResources(); + Resources getResources(); + + /** + * Returns the current page size + * + * @return the page size + */ + Dimension getPageSize(); } diff --git a/src/java/org/apache/poi/common/usermodel/Fill.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/SolidPaint.java similarity index 86% rename from src/java/org/apache/poi/common/usermodel/Fill.java rename to src/scratchpad/src/org/apache/poi/sl/usermodel/SolidPaint.java index 9e1ab4521..dd0225d2d 100644 --- a/src/java/org/apache/poi/common/usermodel/Fill.java +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/SolidPaint.java @@ -1,24 +1,23 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ -package org.apache.poi.common.usermodel; - -import java.awt.Color; - -public interface Fill { - public Color getColor(); - public void setColor(Color color); -} +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.usermodel; + + +public interface SolidPaint extends PaintStyle { + ColorStyle getSolidColor(); +} diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/StrokeStyle.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/StrokeStyle.java new file mode 100644 index 000000000..c02e1a33f --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/StrokeStyle.java @@ -0,0 +1,59 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.usermodel; + +public interface StrokeStyle { + enum LineCap { + /** Rounded ends */ + ROUND, + /** Square protrudes by half line width */ + SQUARE, + /** Line ends at end point*/ + FLAT; + } + + /** + * The line dash with pattern. + * The pattern is derived empirically on PowerPoint 2010 and needs to be multiplied + * with actual line width + */ + enum LineDash { + SOLID(1), + DOT(1,1), + DASH(3,4), + LG_DASH(8,3), + DASH_DOT(4,3,1,3), + LG_DASH_DOT(8,3,1,3), + LG_DASH_DOT_DOT(8,3,1,3,1,3), + SYS_DASH(2,2), + SYS_DOT(1,1), + SYS_DASH_DOT, + SYS_DASH_DOT_DOT; + + public int pattern[]; + + LineDash(int... pattern) { + this.pattern = (pattern == null || pattern.length == 0) ? new int[]{1} : pattern; + } + } + + PaintStyle getPaint(); + LineCap getLineCap(); + LineDash getLineDash(); + double getLineWidth(); +} diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/TextParagraph.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/TextParagraph.java new file mode 100644 index 000000000..e0c0317ed --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/TextParagraph.java @@ -0,0 +1,132 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.usermodel; + +import java.awt.Color; + + +public interface TextParagraph extends Iterable { + /** + * Specified a list of text alignment types + */ + public enum TextAlign { + /** + * Align text to the left margin. + */ + LEFT, + /** + * Align text in the center. + */ + CENTER, + + /** + * Align text to the right margin. + */ + RIGHT, + + /** + * Align text so that it is justified across the whole line. It + * is smart in the sense that it will not justify sentences + * which are short + */ + JUSTIFY, + JUSTIFY_LOW, + DIST, + THAI_DIST + } + + public interface BulletStyle { + String getBulletCharacter(); + String getBulletFont(); + double getBulletFontSize(); + Color getBulletFontColor(); + } + + /** + * The amount of vertical white space before the paragraph + * This may be specified in two different ways, percentage spacing and font point spacing: + *

+ * If spaceBefore >= 0, then space is a percentage of normal line height. + * If spaceBefore < 0, the absolute value of linespacing is the spacing in points + *

+ * + * @return the vertical white space before the paragraph + */ + double getSpaceBefore(); + + /** + * The amount of vertical white space after the paragraph + * This may be specified in two different ways, percentage spacing and font point spacing: + *

+ * If spaceBefore >= 0, then space is a percentage of normal line height. + * If spaceBefore < 0, the absolute value of linespacing is the spacing in points + *

+ * + * @return the vertical white space after the paragraph + */ + double getSpaceAfter(); + + /** + * @return the left margin (in points) of the paragraph + */ + double getLeftMargin(); + + /** + * @return the right margin (in points) of the paragraph + */ + double getRightMargin(); + + /** + * @return the indent applied (in points) to the first line of text in the paragraph. + */ + double getIndent(); + + /** + * Returns the vertical line spacing that is to be used within a paragraph. + * This may be specified in two different ways, percentage spacing and font point spacing: + *

+ * If linespacing >= 0, then linespacing is a percentage of normal line height. + * If linespacing < 0, the absolute value of linespacing is the spacing in points + *

+ * + * @return the vertical line spacing. + */ + double getLineSpacing(); + + String getDefaultFontFamily(); + + /** + * @return the default font size, in case its not set in the textrun + */ + double getDefaultFontSize(); + + /** + * Returns the alignment that is applied to the paragraph. + * + * If this attribute is omitted, then a value of left is implied. + * @return ??? alignment that is applied to the paragraph + */ + TextAlign getTextAlign(); + + /** + * @return the bullet style of the paragraph, if {@code null} then no bullets are used + */ + BulletStyle getBulletStyle(); + + TextShape getParentShape(); +} diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/TextRun.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/TextRun.java index ae1a13477..87758c105 100644 --- a/src/scratchpad/src/org/apache/poi/sl/usermodel/TextRun.java +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/TextRun.java @@ -17,14 +17,38 @@ package org.apache.poi.sl.usermodel; +import java.awt.Color; + /** * Some text. * * TODO - decide on how we do rich text stuff */ public interface TextRun { - public String getText(); + enum TextCap { + NONE, + SMALL, + ALL + } + + public String getText(); public void setText(String text); - // TODO - rich text formatting stuff + TextCap getTextCap(); + + Color getFontColor(); + double getFontSize(); + String getFontFamily(); + + boolean isBold(); + boolean isItalic(); + boolean isUnderline(); + boolean isStrikethrough(); + boolean isSubscript(); + boolean isSuperscript(); + + /** + * @return the pitch and family id or -1 if not applicable + */ + byte getPitchAndFamily(); } diff --git a/src/scratchpad/src/org/apache/poi/sl/usermodel/TextShape.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/TextShape.java new file mode 100644 index 000000000..68fff4793 --- /dev/null +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/TextShape.java @@ -0,0 +1,116 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.sl.usermodel; + + + +public interface TextShape extends SimpleShape, Iterable { + /** + * Vertical Text Types + */ + public enum TextDirection { + /** + * Horizontal text. This should be default. + */ + HORIZONTAL, + /** + * Vertical orientation. + * (each line is 90 degrees rotated clockwise, so it goes + * from top to bottom; each next line is to the left from + * the previous one). + */ + VERTICAL, + /** + * Vertical orientation. + * (each line is 270 degrees rotated clockwise, so it goes + * from bottom to top; each next line is to the right from + * the previous one). + */ + VERTICAL_270, + /** + * Determines if all of the text is vertical + * ("one letter on top of another"). + */ + STACKED; + } + + /** + * Specifies alist of auto-fit types. + *

+ * Autofit specofies that a shape should be auto-fit to fully contain the text described within it. + * Auto-fitting is when text within a shape is scaled in order to contain all the text inside + *

+ */ + public enum TextAutofit { + /** + * Specifies that text within the text body should not be auto-fit to the bounding box. + * Auto-fitting is when text within a text box is scaled in order to remain inside + * the text box. + */ + NONE, + /** + * Specifies that text within the text body should be normally auto-fit to the bounding box. + * Autofitting is when text within a text box is scaled in order to remain inside the text box. + * + *

+ * Example: Consider the situation where a user is building a diagram and needs + * to have the text for each shape that they are using stay within the bounds of the shape. + * An easy way this might be done is by using NORMAL autofit + *

+ */ + NORMAL, + /** + * Specifies that a shape should be auto-fit to fully contain the text described within it. + * Auto-fitting is when text within a shape is scaled in order to contain all the text inside. + * + *

+ * Example: Consider the situation where a user is building a diagram and needs to have + * the text for each shape that they are using stay within the bounds of the shape. + * An easy way this might be done is by using SHAPE autofit + *

+ */ + SHAPE + } + + /** + * @return text shape margin + */ + Insets2D getInsets(); + + /** + * Compute the cumulative height occupied by the text + */ + double getTextHeight(); + + /** + * Returns the type of vertical alignment for the text. + * + * @return the type of vertical alignment + */ + VerticalAlignment getVerticalAlignment(); + + /** + * @return whether to wrap words within the bounding rectangle + */ + boolean getWordWrap(); + + /** + * @return vertical orientation of the text + */ + TextDirection getTextDirection(); +} diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/LineCap.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/TexturePaint.java similarity index 72% rename from src/ooxml/java/org/apache/poi/xslf/usermodel/LineCap.java rename to src/scratchpad/src/org/apache/poi/sl/usermodel/TexturePaint.java index 55b4c8492..135b69b26 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/LineCap.java +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/TexturePaint.java @@ -14,25 +14,24 @@ See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ -package org.apache.poi.xslf.usermodel; -/** - * - * - * @author Yegor Kozlov - */ -public enum LineCap { +package org.apache.poi.sl.usermodel; + +import java.io.InputStream; + +public interface TexturePaint extends PaintStyle { /** - * Rounded ends + * @return the raw image stream */ - ROUND, - /** - * Square protrudes by half line width - */ - SQUARE, + InputStream getImageData(); /** - * Line ends at end point + * @return the content type of the image data */ - FLAT; -} \ No newline at end of file + String getContentType(); + + /** + * @return the alpha mask in percents [0..100000] + */ + int getAlpha(); +} diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/VerticalAlignment.java b/src/scratchpad/src/org/apache/poi/sl/usermodel/VerticalAlignment.java similarity index 95% rename from src/ooxml/java/org/apache/poi/xslf/usermodel/VerticalAlignment.java rename to src/scratchpad/src/org/apache/poi/sl/usermodel/VerticalAlignment.java index fd00a64e2..540bf2ed5 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/VerticalAlignment.java +++ b/src/scratchpad/src/org/apache/poi/sl/usermodel/VerticalAlignment.java @@ -16,7 +16,7 @@ * limitations under the License. * ==================================================================== */ -package org.apache.poi.xslf.usermodel; +package org.apache.poi.sl.usermodel; /** * Specifies a list of available anchoring types for text diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestBackground.java b/src/scratchpad/testcases/org/apache/poi/hslf/model/TestBackground.java index 41c5c58a3..29bd16f8b 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestBackground.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/model/TestBackground.java @@ -35,6 +35,7 @@ import org.apache.poi.ddf.EscherSimpleProperty; import org.apache.poi.hslf.HSLFSlideShow; import org.apache.poi.hslf.record.Document; import org.apache.poi.hslf.usermodel.SlideShow; +import org.apache.poi.sl.usermodel.ShapeType; import org.junit.Test; @@ -59,7 +60,7 @@ public final class TestBackground { assertTrue(slide.getFollowMasterBackground()); assertEquals(Fill.FILL_SOLID, slide.getBackground().getFill().getFillType()); - Shape shape = new AutoShape(ShapeTypes.Rectangle); + Shape shape = new AutoShape(ShapeType.RECT); assertEquals(Fill.FILL_SOLID, shape.getFill().getFillType()); } @@ -114,7 +115,7 @@ public final class TestBackground { fill.setFillType(Fill.FILL_PICTURE); fill.setPictureData(idx); - shape = new AutoShape(ShapeTypes.Rectangle); + shape = new AutoShape(ShapeType.RECT); shape.setAnchor(new java.awt.Rectangle(100, 100, 200, 200)); fill = shape.getFill(); fill.setFillType(Fill.FILL_SOLID); @@ -130,7 +131,7 @@ public final class TestBackground { fill.setBackgroundColor(Color.green); fill.setForegroundColor(Color.red); - shape = new AutoShape(ShapeTypes.Rectangle); + shape = new AutoShape(ShapeType.RECT); shape.setAnchor(new java.awt.Rectangle(100, 100, 200, 200)); fill = shape.getFill(); fill.setFillType(Fill.FILL_BACKGROUND); @@ -144,7 +145,7 @@ public final class TestBackground { fill.setFillType(Fill.FILL_TEXTURE); fill.setPictureData(idx); - shape = new AutoShape(ShapeTypes.Rectangle); + shape = new AutoShape(ShapeType.RECT); shape.setAnchor(new java.awt.Rectangle(100, 100, 200, 200)); fill = shape.getFill(); fill.setFillType(Fill.FILL_PICTURE); @@ -160,7 +161,7 @@ public final class TestBackground { fill.setBackgroundColor(Color.white); fill.setForegroundColor(Color.darkGray); - shape = new AutoShape(ShapeTypes.Rectangle); + shape = new AutoShape(ShapeType.RECT); shape.setAnchor(new java.awt.Rectangle(100, 100, 200, 200)); fill = shape.getFill(); fill.setFillType(Fill.FILL_SHADE); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java b/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java index b3e4f6ac9..10ff88da6 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java @@ -41,6 +41,7 @@ import org.apache.poi.ddf.EscherSimpleProperty; import org.apache.poi.hslf.HSLFSlideShow; import org.apache.poi.hslf.usermodel.RichTextRun; import org.apache.poi.hslf.usermodel.SlideShow; +import org.apache.poi.sl.usermodel.ShapeType; import org.junit.Before; import org.junit.Test; @@ -81,7 +82,7 @@ public final class TestShapes { line.setLineColor(Color.red); slide.addShape(line); - AutoShape ellipse = new AutoShape(ShapeTypes.Ellipse); + AutoShape ellipse = new AutoShape(ShapeType.ELLIPSE); java.awt.Rectangle ellipseAnchor = new Rectangle(320, 154, 55, 111); ellipse.setAnchor(ellipseAnchor); ellipse.setLineWidth(2); @@ -334,7 +335,7 @@ public final class TestShapes { @Test public void lineWidth() { - SimpleShape sh = new AutoShape(ShapeTypes.RightTriangle); + SimpleShape sh = new AutoShape(ShapeType.RT_TRIANGLE); EscherOptRecord opt = sh.getEscherOptRecord(); EscherSimpleProperty prop = SimpleShape.getEscherProperty(opt, EscherProperties.LINESTYLE__LINEWIDTH); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextShape.java b/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextShape.java index 48b6df54a..928f1e450 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextShape.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextShape.java @@ -17,26 +17,38 @@ package org.apache.poi.hslf.model; -import junit.framework.TestCase; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; +import java.util.Map; -import org.apache.poi.hslf.usermodel.SlideShow; -import org.apache.poi.hslf.record.TextHeaderAtom; import org.apache.poi.POIDataSamples; +import org.apache.poi.hslf.record.TextHeaderAtom; +import org.apache.poi.hslf.usermodel.SlideShow; +import org.apache.poi.sl.usermodel.ShapeType; +import org.junit.Test; /** * Verify behavior of TextShape and its sub-classes * * @author Yegor Kozlov */ -public final class TestTextShape extends TestCase { +public final class TestTextShape { private static POIDataSamples _slTests = POIDataSamples.getSlideShowInstance(); - public void testCreateAutoShape(){ - TextShape shape = new AutoShape(ShapeTypes.Trapezoid); + @Test + public void createAutoShape(){ + TextShape shape = new AutoShape(ShapeType.TRAPEZOID); assertNull(shape.getTextRun()); assertNull(shape.getText()); assertNull(shape.getEscherTextboxWrapper()); @@ -50,7 +62,8 @@ public final class TestTextShape extends TestCase { assertEquals(-1, run.getIndex()); } - public void testCreateTextBox(){ + @Test + public void createTextBox(){ TextShape shape = new TextBox(); TextRun run = shape.getTextRun(); assertNotNull(run); @@ -70,10 +83,11 @@ public final class TestTextShape extends TestCase { * - normal TextBox object * - text in auto-shapes */ - public void testRead() throws IOException { + @Test + public void read() throws IOException { SlideShow ppt = new SlideShow(_slTests.openResourceAsStream("text_shapes.ppt")); - ArrayList lst1 = new ArrayList(); + List lst1 = new ArrayList(); Slide slide = ppt.getSlides()[0]; Shape[] shape = slide.getShapes(); for (int i = 0; i < shape.length; i++) { @@ -83,24 +97,24 @@ public final class TestTextShape extends TestCase { assertNotNull(run); int runType = run.getRunType(); - int type = shape[i].getShapeType(); + ShapeType type = shape[i].getShapeType(); switch (type){ - case ShapeTypes.TextBox: + case TEXT_BOX: assertEquals("Text in a TextBox", run.getText()); break; - case ShapeTypes.Rectangle: + case RECT: if(runType == TextHeaderAtom.OTHER_TYPE) assertEquals("Rectangle", run.getText()); else if(runType == TextHeaderAtom.TITLE_TYPE) assertEquals("Title Placeholder", run.getText()); break; - case ShapeTypes.Octagon: + case OCTAGON: assertEquals("Octagon", run.getText()); break; - case ShapeTypes.Ellipse: + case ELLIPSE: assertEquals("Ellipse", run.getText()); break; - case ShapeTypes.RoundRectangle: + case ROUND_RECT: assertEquals("RoundRectangle", run.getText()); break; default: @@ -110,7 +124,7 @@ public final class TestTextShape extends TestCase { lst1.add(run.getText()); } - ArrayList lst2 = new ArrayList(); + List lst2 = new ArrayList(); TextRun[] run = slide.getTextRuns(); for (int i = 0; i < run.length; i++) { lst2.add(run[i].getText()); @@ -119,7 +133,8 @@ public final class TestTextShape extends TestCase { assertTrue(lst1.containsAll(lst2)); } - public void testReadWrite() throws IOException { + @Test + public void readWrite() throws IOException { SlideShow ppt = new SlideShow(); Slide slide = ppt.createSlide(); @@ -130,7 +145,7 @@ public final class TestTextShape extends TestCase { shape1.moveTo(100, 100); - TextShape shape2 = new AutoShape(ShapeTypes.Arrow); + TextShape shape2 = new AutoShape(ShapeType.RIGHT_ARROW); TextRun run2 = shape2.createTextRun(); run2.setText("Testing TextShape"); slide.addShape(shape2); @@ -146,21 +161,22 @@ public final class TestTextShape extends TestCase { assertTrue(shape[0] instanceof TextShape); shape1 = (TextShape)shape[0]; - assertEquals(ShapeTypes.TextBox, shape1.getShapeType()); + assertEquals(ShapeType.TEXT_BOX, shape1.getShapeType()); assertEquals("Hello, World!", shape1.getTextRun().getText()); assertTrue(shape[1] instanceof TextShape); shape1 = (TextShape)shape[1]; - assertEquals(ShapeTypes.Arrow, shape1.getShapeType()); + assertEquals(ShapeType.RIGHT_ARROW, shape1.getShapeType()); assertEquals("Testing TextShape", shape1.getTextRun().getText()); } - public void testMargins() throws IOException { + @Test + public void margins() throws IOException { SlideShow ppt = new SlideShow(_slTests.openResourceAsStream("text-margins.ppt")); Slide slide = ppt.getSlides()[0]; - HashMap map = new HashMap(); + Map map = new HashMap(); Shape[] shape = slide.getShapes(); for (int i = 0; i < shape.length; i++) { if(shape[i] instanceof TextShape){ @@ -171,32 +187,33 @@ public final class TestTextShape extends TestCase { TextShape tx; - tx = (TextShape)map.get("TEST1"); + tx = map.get("TEST1"); assertEquals(0.1, tx.getMarginLeft()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); assertEquals(0.1, tx.getMarginRight()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); assertEquals(0.39, tx.getMarginTop()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); assertEquals(0.05, tx.getMarginBottom()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); - tx = (TextShape)map.get("TEST2"); + tx = map.get("TEST2"); assertEquals(0.1, tx.getMarginLeft()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); assertEquals(0.1, tx.getMarginRight()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); assertEquals(0.05, tx.getMarginTop()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); assertEquals(0.39, tx.getMarginBottom()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); - tx = (TextShape)map.get("TEST3"); + tx = map.get("TEST3"); assertEquals(0.39, tx.getMarginLeft()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); assertEquals(0.1, tx.getMarginRight()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); assertEquals(0.05, tx.getMarginTop()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); assertEquals(0.05, tx.getMarginBottom()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); - tx = (TextShape)map.get("TEST4"); + tx = map.get("TEST4"); assertEquals(0.1, tx.getMarginLeft()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); assertEquals(0.39, tx.getMarginRight()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); assertEquals(0.05, tx.getMarginTop()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); assertEquals(0.05, tx.getMarginBottom()*Shape.EMU_PER_POINT/Shape.EMU_PER_INCH, 0.01); } - public void test52599() throws IOException { + @Test + public void bug52599() throws IOException { SlideShow ppt = new SlideShow(_slTests.openResourceAsStream("52599.ppt")); Slide slide = ppt.getSlides()[0]; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java index 67d250a4b..6a2f3229c 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java @@ -653,7 +653,7 @@ public final class TestBugs { for (byte data[] : ep) { EscherColorRef ecr = new EscherColorRef(data, 0, 4); int rgb[] = ecr.getRGB(); - double pos = Units.fixedPointToDecimal(LittleEndian.getInt(data, 4)); + double pos = Units.fixedPointToDouble(LittleEndian.getInt(data, 4)); assertEquals((int)exp[i][0], rgb[0]); assertEquals((int)exp[i][1], rgb[1]); assertEquals((int)exp[i][2], rgb[2]); diff --git a/src/types/definitions/dml-shapeGeometry.xjb b/src/types/definitions/dml-shapeGeometry.xjb new file mode 100644 index 000000000..43a0c2a68 --- /dev/null +++ b/src/types/definitions/dml-shapeGeometry.xjb @@ -0,0 +1,7 @@ + + +