poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1661322 [1/14] - in /poi/branches/common_sl: ./ src/examples/src/org/apache/poi/hslf/examples/ src/examples/src/org/apache/poi/xslf/usermodel/ src/java/org/apache/poi/common/usermodel/ src/java/org/apache/poi/hssf/usermodel/ src/java/org/a...
Date Sat, 21 Feb 2015 10:56:06 GMT
Author: kiwiwings
Date: Sat Feb 21 10:56:03 2015
New Revision: 1661322

URL: http://svn.apache.org/r1661322
Log:
initial commit - still lots of errors, but I need to switch to a clean trunk for releasing and testing

Added:
    poi/branches/common_sl/src/resources/scratchpad/org/apache/poi/sl/
    poi/branches/common_sl/src/resources/scratchpad/org/apache/poi/sl/draw/
    poi/branches/common_sl/src/resources/scratchpad/org/apache/poi/sl/draw/presetShapeDefinitions.xml
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawAutoShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawFactory.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawFontManager.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawFreeformShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawMasterSheet.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawPaint.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSheet.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawSimpleShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextBox.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextFragment.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextParagraph.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/DrawTextShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/Drawable.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/ImageRenderer.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAdjPoint2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAdjustHandleList.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTAngle.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTColor.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTColorMRU.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTComplementTransform.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnection.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnectionSite.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTConnectionSiteList.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTCustomGeometry2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTEmbeddedWAVAudioFile.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTFixedPercentage.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGammaTransform.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomGuide.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomGuideList.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGeomRect.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGrayscaleTransform.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTGroupTransform2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTHslColor.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTHyperlink.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTInverseGammaTransform.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTInverseTransform.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTOfficeArtExtension.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTOfficeArtExtensionList.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DArcTo.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DClose.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DCubicBezierTo.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DLineTo.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DList.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DMoveTo.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPath2DQuadBezierTo.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPercentage.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPoint2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPoint3D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPolarAdjustHandle.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveFixedAngle.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveFixedPercentage.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositivePercentage.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPositiveSize2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetColor.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetGeometry2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTPresetTextShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTRatio.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTRelativeRect.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSRgbColor.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTScRgbColor.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTScale2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSchemeColor.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSphereCoords.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTSystemColor.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTTransform2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTVector3D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/CTXYAdjustHandle.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/ObjectFactory.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/STBlackWhiteMode.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/STPathFillMode.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/STPresetColorVal.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/STRectAlignment.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/STSchemeColorVal.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/STShapeType.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/binding/STTextShapeType.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/AbsExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/AddDivideExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/AddSubtractExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/AdjustValue.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/ArcTanExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/ArcToCommand.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/ClosePathCommand.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/Context.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/CosExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/CosineArcTanExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/CurveToCommand.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/CustomGeometry.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/Expression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/ExpressionParser.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/Formula.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/Guide.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/IAdjustableShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/IfElseExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/LineToCommand.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/LiteralValueExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/MaxExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/MinExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/ModExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/MoveToCommand.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/MultiplyDivideExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/Outline.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/Path.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/PathCommand.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/PinExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/PresetGeometries.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/QuadToCommand.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/SinArcTanExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/SinExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/SqrtExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/draw/geom/TanExpression.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/ColorStyle.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/FillStyle.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/FreeformShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/GradientPaint.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/Insets2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/LineDecoration.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/PaintStyle.java
      - copied, changed from r1661318, poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/Fill.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/PlaceableShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/Shadow.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeType.java
      - copied, changed from r1647885, poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeTypes.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/SolidPaint.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/StrokeStyle.java
      - copied, changed from r1647885, poi/trunk/src/scratchpad/src/org/apache/poi/sl/usermodel/LineStyle.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/TextParagraph.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/TextShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/TexturePaint.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/VerticalAlignment.java
      - copied, changed from r1661320, poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/VerticalAlignment.java
    poi/branches/common_sl/src/types/definitions/dml-shapeGeometry.xjb
Removed:
    poi/branches/common_sl/src/java/org/apache/poi/common/usermodel/Fill.java
    poi/branches/common_sl/src/java/org/apache/poi/common/usermodel/LineStyle.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/model/geom/
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/LineCap.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/LineDash.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/TextAlign.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/TextAutofit.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/TextCap.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/TextDirection.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/TextFragment.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/VerticalAlignment.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShapeType.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/ShapeTypes.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/Fill.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/LineStyle.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeTypes.java
Modified:
    poi/branches/common_sl/build.xml
    poi/branches/common_sl/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java
    poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial4.java
    poi/branches/common_sl/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java
    poi/branches/common_sl/src/java/org/apache/poi/util/Units.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/model/PropertyFetcher.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/RenderableShape.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFAutoShape.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFBackground.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFColor.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGraphicFrame.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotesMaster.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShapeContainer.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSimpleShape.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlide.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideLayout.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSlideMaster.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableCell.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextRun.java
    poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextShape.java
    poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFAutoShape.java
    poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFConnectorShape.java
    poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java
    poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTable.java
    poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextParagraph.java
    poi/branches/common_sl/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/ActiveXShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/AutoShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/AutoShapes.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Background.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Freeform.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Hyperlink.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Line.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/MovieShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/OLEShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/PPGraphics2D.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Picture.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Placeholder.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Polygon.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Shape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/ShapeFactory.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/ShapeGroup.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/SimpleShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Slide.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/Table.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/TableCell.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/TextBox.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/model/TextShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/hslf/record/PPDrawing.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/AutoShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/Shape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/ShapeContainer.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/Sheet.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/SimpleShape.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/SlideShow.java
    poi/branches/common_sl/src/scratchpad/src/org/apache/poi/sl/usermodel/TextRun.java
    poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestBackground.java
    poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java
    poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextShape.java
    poi/branches/common_sl/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java

Modified: poi/branches/common_sl/build.xml
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/build.xml?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/build.xml (original)
+++ poi/branches/common_sl/build.xml Sat Feb 21 10:56:03 2015
@@ -103,6 +103,12 @@ under the License.
     <property name="scratchpad.output.test.dir" location="build/scratchpad-test-classes"/>
     <property name="scratchpad.testokfile" location="build/scratchpad-testokfile.txt"/>
 
+    <!-- Scratchpad/Geometry -->
+	<property name="geometry.schema" value="src/resources/ooxml/org/apache/poi/xslf/usermodel/presetShapeDefinitions.xml"/>
+	<property name="geometry.pkg" value="org.apache.poi.sl.draw.binding"/>
+	<property name="geometry.output.tmpdir" value="build/geometry-java"/>
+	
+	
     <!-- Examples: -->
     <property name="examples.src" location="src/examples/src"/>
     <property name="examples.output.dir" location="build/examples-classes"/>
@@ -371,6 +377,7 @@ under the License.
         <mkdir dir="${scratchpad.output.dir}"/>
         <mkdir dir="${scratchpad.output.test.dir}"/>
         <mkdir dir="${scratchpad.reports.test}"/>
+    	<mkdir dir="${geometry.output.tmpdir}"/>
         <mkdir dir="${ooxml.output.dir}"/>
         <mkdir dir="${ooxml.output.test.dir}"/>
         <mkdir dir="${ooxml.reports.test}"/>
@@ -690,7 +697,38 @@ under the License.
         </copy>
     </target>
 
-    <target name="compile-scratchpad" depends="compile-main">
+	<target name="generate-geometry" depends="fetch-ooxml-xsds">
+		<delete dir="${geometry.output.tmpdir}"/>
+		<!-- taskdef xjc -->
+		<!-- "D:\Program Files\Java\jdk1.6.0_45\bin\xjc" -p org.apache.poi.sl.model.geom.binding -readOnly -Xlocator -mark-generated ooxml-schemas\dml-shapeGeometry.xsd -->
+		<unzip src="${ooxml.lib}/${ooxml.xsds.izip.1}" dest="${geometry.output.tmpdir}"/>
+		<exec executable="${env.JAVA_HOME}/bin/xjc">
+			<arg value="-p"/>
+			<arg value="${geometry.pkg}"/>
+			<arg value="-b"/>
+			<arg file="src/types/definitions/dml-shapeGeometry.xjb"/>
+			<arg value="-readOnly"/>
+			<arg value="-npa"/>
+			<arg value="-no-header"/>
+			<arg value="-Xlocator"/>
+			<arg file="${geometry.output.tmpdir}/dml-shapeGeometry.xsd"/>
+			<arg value="-d"/>
+			<arg file="${geometry.output.tmpdir}"/>
+		</exec>
+		<copy file="src/java/org/apache/poi/POIDocument.java" tofile="${geometry.output.tmpdir}/apache-license.txt">
+			<filterchain>
+			<headfilter lines="16"/>
+			</filterchain>
+		</copy>
+		<copy todir="${scratchpad.src}">
+			<fileset dir="${geometry.output.tmpdir}" includes="**/*.java"/>
+		     <filterchain>
+		         <concatfilter prepend="${geometry.output.tmpdir}/apache-license.txt"/>
+		     </filterchain>
+		</copy>
+	</target>
+	
+	<target name="compile-scratchpad" depends="compile-main,generate-geometry">
         <javac target="${jdk.version.class}"
                source="${jdk.version.source}"
                destdir="${scratchpad.output.dir}"

Modified: poi/branches/common_sl/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java (original)
+++ poi/branches/common_sl/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java Sat Feb 21 10:56:03 2015
@@ -20,6 +20,7 @@ package org.apache.poi.hslf.examples;
 import org.apache.poi.hslf.usermodel.*;
 import org.apache.poi.hslf.model.*;
 import org.apache.poi.hslf.record.TextHeaderAtom;
+import org.apache.poi.sl.usermodel.ShapeType;
 
 import java.io.IOException;
 import java.io.FileOutputStream;
@@ -312,7 +313,7 @@ public final class ApacheconEU08 {
         box3.setAnchor(new Rectangle(473, 243, 170, 170));
         slide.addShape(box3);
 
-        AutoShape box4 = new AutoShape(ShapeTypes.Arrow);
+        AutoShape box4 = new AutoShape(ShapeType.RIGHT_ARROW);
         box4.getFill().setForegroundColor(new Color(187, 224, 227));
         box4.setLineWidth(0.75);
         box4.setLineColor(Color.black);

Modified: poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial4.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial4.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial4.java (original)
+++ poi/branches/common_sl/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial4.java Sat Feb 21 10:56:03 2015
@@ -24,6 +24,8 @@ import java.awt.geom.Rectangle2D;
 import java.io.FileOutputStream;
 import java.io.IOException;
 
+import org.apache.poi.sl.usermodel.TextAlign;
+
 /**
  * PPTX Tables
  *

Modified: poi/branches/common_sl/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java (original)
+++ poi/branches/common_sl/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java Sat Feb 21 10:56:03 2015
@@ -519,7 +519,7 @@ public final class HSSFPatriarch impleme
     }
 
     public Chart createChart(ClientAnchor anchor) {
-        throw new RuntimeException("NotImplemented");
+        throw new UnsupportedOperationException("NotImplemented");
     }
 
 

Modified: poi/branches/common_sl/src/java/org/apache/poi/util/Units.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/java/org/apache/poi/util/Units.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/java/org/apache/poi/util/Units.java (original)
+++ poi/branches/common_sl/src/java/org/apache/poi/util/Units.java Sat Feb 21 10:56:03 2015
@@ -42,17 +42,32 @@ public class Units {
     }
     
     /**
-     * Converts a value of type FixedPoint to a decimal number
+     * Converts a value of type FixedPoint to a floating point
      *
      * @param fixedPoint
-     * @return decimal number
+     * @return floating point (double)
      * 
      * @see <a href="http://msdn.microsoft.com/en-us/library/dd910765(v=office.12).aspx">[MS-OSHARED] - 2.2.1.6 FixedPoint</a>
      */
-    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 <a href="http://msdn.microsoft.com/en-us/library/dd910765(v=office.12).aspx">[MS-OSHARED] - 2.2.1.6 FixedPoint</a>
+     */
+    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;
     }
 }

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/model/PropertyFetcher.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/model/PropertyFetcher.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/model/PropertyFetcher.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/model/PropertyFetcher.java Sat Feb 21 10:56:03 2015
@@ -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<T>
      * @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;

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/RenderableShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/RenderableShape.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/RenderableShape.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/RenderableShape.java Sat Feb 21 10:56:03 2015
@@ -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;

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java Sat Feb 21 10:56:03 2015
@@ -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.OPCP
 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.presen
 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.presen
  *  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 POIXM
      */
     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 POIXM
         return null;
     }
 
+    public MasterSheet<XSLFShape>[] getMasterSheet() {
+        return getSlideMasters();
+    }
+
+    public MasterSheet<XSLFShape> createMasterSheet() throws IOException {
+        // TODO: implement!
+        throw new UnsupportedOperationException();
+    }
+
+    public Resources getResources() {
+        // TODO: implement!
+        throw new UnsupportedOperationException();
+    }
 }

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFAutoShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFAutoShape.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFAutoShape.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFAutoShape.java Sat Feb 21 10:56:03 2015
@@ -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.presen
  * @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);

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFBackground.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFBackground.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFBackground.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFBackground.java Sat Feb 21 10:56:03 2015
@@ -17,25 +17,20 @@
 
 package org.apache.poi.xslf.usermodel;
 
+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.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.drawingml.x2006.main.*;
 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.geom.Rectangle2D;
-
 /**
  * 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);

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFColor.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFColor.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFColor.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFColor.java Sat Feb 21 10:56:03 2015
@@ -18,22 +18,18 @@
  */
 package org.apache.poi.xslf.usermodel;
 
+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.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.openxmlformats.schemas.drawingml.x2006.main.*;
 import org.w3c.dom.Node;
 
-import java.awt.Color;
-import java.util.HashMap;
-import java.util.Map;
-
 /**
  * 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,66 +144,50 @@ public class XSLFColor {
         return color;
     }
 
-    /**
-     * Read a perecentage value from the supplied xml bean.
-     * Example:
-     *   <a:tint val="45000"/>
-     *
-     * the returned value is 45
-     *
-     * @return  the percentage value in the range [0 .. 100]
-     */
-    private int getPercentageValue(String elem){
+    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){
+        if (_phClr != null){
             obj = _phClr.selectPath(query);
-            if(obj.length == 1){
+            if (obj.length == 1){
                 Node attr = obj[0].getDomNode().getAttributes().getNamedItem("val");
                 if(attr != null) {
-                    return Integer.parseInt(attr.getNodeValue()) / 1000;
+                    return Integer.parseInt(attr.getNodeValue());
                 }
             }
         }
 
         obj = _xmlObject.selectPath(query);
-        if(obj.length == 1){
+        if (obj.length == 1){
             Node attr = obj[0].getDomNode().getAttributes().getNamedItem("val");
             if(attr != null) {
-                return Integer.parseInt(attr.getNodeValue()) / 1000;
+                return Integer.parseInt(attr.getNodeValue());
             }
         }
 
-
-        return -1;
+        return -1;        
+    }
+    
+    /**
+     * Read a perecentage value from the supplied xml bean.
+     * Example:
+     *   <a:tint val="45000"/>
+     *
+     * the returned value is 45
+     *
+     * @return  the percentage value in the range [0 .. 100]
+     */
+    private int getPercentageValue(String elem){
+        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,70 +377,12 @@ 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
      */
     static final Map<String, Color> presetColors;

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGraphicFrame.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGraphicFrame.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGraphicFrame.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGraphicFrame.java Sat Feb 21 10:56:03 2015
@@ -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.drawin
 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 XS
         return _sheet;
     }
 
-    public int getShapeType(){
-        throw new RuntimeException("NotImplemented");
+    public ShapeType getShapeType(){
+        throw new UnsupportedOperationException();
     }
 
     public int getShapeId(){

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFGroupShape.java Sat Feb 21 10:56:03 2015
@@ -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.presen
 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 XSLF
     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 XSLF
         XSLFPictureShape sh = getDrawing().createPicture(rel.getId());
         sh.resize();
         _shapes.add(sh);
+        sh.setParent(this);
         return sh;
     }
 
@@ -343,4 +350,13 @@ public class XSLFGroupShape extends XSLF
         }
     }
 
+    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

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotes.java Sat Feb 21 10:56:03 2015
@@ -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.presen
 import org.openxmlformats.schemas.presentationml.x2006.main.NotesDocument;
 
 @Beta
-public final class XSLFNotes extends XSLFSheet {
+public final class XSLFNotes extends XSLFSheet implements Notes<XSLFShape> {
    private CTNotesSlide _notes;
 
     /**
@@ -80,7 +82,6 @@ public final class XSLFNotes extends XSL
     	return getMasterSheet().getTheme();
     }
 
-    @Override
     public XSLFNotesMaster getMasterSheet() {
         for (POIXMLDocumentPart p : getRelations()) {
            if (p instanceof XSLFNotesMaster){
@@ -89,4 +90,20 @@ public final class XSLFNotes extends XSL
         }
         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;
+    }
+    
+    
 }

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotesMaster.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotesMaster.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotesMaster.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFNotesMaster.java Sat Feb 21 10:56:03 2015
@@ -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.presen
  * @author Yegor Kozlov
 */
 @Beta
- public class XSLFNotesMaster extends XSLFSheet {
+ public class XSLFNotesMaster extends XSLFSheet implements MasterSheet<XSLFShape> {
 	 private CTNotesMaster _slide;
      private XSLFTheme _theme;
 
@@ -93,7 +94,7 @@ import org.openxmlformats.schemas.presen
     }
 
     @Override
-    public XSLFSheet getMasterSheet() {
+    public MasterSheet getMasterSheet() {
         return null;
     }
     

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShadow.java Sat Feb 21 10:56:03 2015
@@ -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;
 

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java Sat Feb 21 10:56:03 2015
@@ -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 org.apache.poi.util.Beta;
-import org.apache.poi.util.Internal;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.Comparator;
+
+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 {
-
-    /**
-     * @return the position of this shape within the drawing canvas.
-     *         The coordinates are expressed in points
-     */
-    public abstract Rectangle2D getAnchor();
-
-    /**
-     * @param anchor the position of this shape within the drawing canvas.
-     *               The coordinates are expressed in points
-     */
-    public abstract void setAnchor(Rectangle2D anchor);
+public abstract class XSLFShape implements Shape {
+    protected final XmlObject _shape;
+    protected final XSLFSheet _sheet;
+    protected XSLFShapeContainer _parent;
+
+    private CTShapeProperties _spPr;
+    private CTShapeStyle _spStyle;
+    private CTNonVisualDrawingProps _nvPr;
+    private CTPlaceholder _ph;
+
+    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"
      */
@@ -119,84 +149,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<PaintStyle> fetcher = new PropertyFetcher<PaintStyle>() {
+                    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:
+     * <p>
+     * slide <-- slideLayout <-- slideMaster
+     * </p>
+     *
+     * @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<CTTransform2D> fetcher = new PropertyFetcher<CTTransform2D>() {
+            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:
+     * <code>
+     *     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
+     *  </code>
+     *
+     * @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<CTGradientStop>() {
+                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

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShapeContainer.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShapeContainer.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShapeContainer.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShapeContainer.java Sat Feb 21 10:56:03 2015
@@ -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<XSLFShape> {
+public interface XSLFShapeContainer extends ShapeContainer {
 
     /**
      * create a new shape with a predefined geometry and add it to this shape container
@@ -56,27 +58,6 @@ public interface XSLFShapeContainer exte
     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 <tt>true</tt> 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.
      */

Modified: poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java
URL: http://svn.apache.org/viewvc/poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java?rev=1661322&r1=1661321&r2=1661322&view=diff
==============================================================================
--- poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java (original)
+++ poi/branches/common_sl/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java Sat Feb 21 10:56:03 2015
@@ -23,6 +23,8 @@ import org.apache.poi.openxml4j.opc.Pack
 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.presen
 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<XSLFShape> _shapes;
@@ -142,6 +147,7 @@ public abstract class XSLFSheet extends
         List<XSLFShape> shapes = getShapeList();
         XSLFAutoShape sh = getDrawing().createAutoShape();
         shapes.add(sh);
+        sh.setParent(this);
         return sh;
     }
 
@@ -149,6 +155,7 @@ public abstract class XSLFSheet extends
         List<XSLFShape> shapes = getShapeList();
         XSLFFreeformShape sh = getDrawing().createFreeform();
         shapes.add(sh);
+        sh.setParent(this);
         return sh;
     }
 
@@ -156,6 +163,7 @@ public abstract class XSLFSheet extends
         List<XSLFShape> shapes = getShapeList();
         XSLFTextBox sh = getDrawing().createTextBox();
         shapes.add(sh);
+        sh.setParent(this);
         return sh;
     }
 
@@ -163,6 +171,7 @@ public abstract class XSLFSheet extends
         List<XSLFShape> shapes = getShapeList();
         XSLFConnectorShape sh = getDrawing().createConnector();
         shapes.add(sh);
+        sh.setParent(this);
         return sh;
     }
 
@@ -170,6 +179,7 @@ public abstract class XSLFSheet extends
         List<XSLFShape> shapes = getShapeList();
         XSLFGroupShape sh = getDrawing().createGroup();
         shapes.add(sh);
+        sh.setParent(this);
         return sh;
     }
 
@@ -191,6 +201,7 @@ public abstract class XSLFSheet extends
         sh.resize();
 
         getShapeList().add(sh);
+        sh.setParent(this);
         return sh;
     }
 
@@ -198,6 +209,7 @@ public abstract class XSLFSheet extends
         List<XSLFShape> shapes = getShapeList();
         XSLFTable sh = getDrawing().createTable();
         shapes.add(sh);
+        sh.setParent(this);
         return sh;
     }
 
@@ -219,6 +231,12 @@ public abstract class XSLFSheet extends
         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
     	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
      * @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());



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message