xDrawDoc = Helper.createDocument( xOfficeContext,
"private:factory/simpress", "_blank", 0, pPropValues );
XDrawPage xPage;
XShapes xShapes;
XPropertySet xShapePropSet;
// create pages, so that three are available
while ( PageHelper.getDrawPageCount( xDrawDoc ) < 3 )
PageHelper.insertNewDrawPageByIndex( xDrawDoc, 0 );
// set the slide transition for the first page
xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 0 );
xShapes = (XShapes)
UnoRuntime.queryInterface( XShapes.class, xPage );
// set slide transition effect
setSlideTransition( xPage,
com.sun.star.presentation.FadeEffect.FADE_FROM_RIGHT,
com.sun.star.presentation.AnimationSpeed.FAST,
1, 0 ); // automatic object and slide transition
// create a rectangle that is placed on the top left of the page
xShapePropSet = ShapeHelper.createAndInsertShape( xDrawDoc,
xShapes,new Point( 1000, 1000 ), new Size( 5000, 5000 ),
"com.sun.star.drawing.RectangleShape" );
xShapePropSet.setPropertyValue("Effect",
com.sun.star.presentation.AnimationEffect.WAVYLINE_FROM_BOTTOM );
/* the following three properties provokes that the shape is dimmed
to red
after the animation has been finished */
xShapePropSet.setPropertyValue( "DimHide", new Boolean( false ) );
xShapePropSet.setPropertyValue( "DimPrevious", new Boolean( true ) );
xShapePropSet.setPropertyValue( "DimColor", new Integer( 0xff0000 ) );
// set the slide transition for the second page
xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 1 );
xShapes = (XShapes)
UnoRuntime.queryInterface( XShapes.class, xPage );
setSlideTransition( xPage,
com.sun.star.presentation.FadeEffect.FADE_FROM_RIGHT,
com.sun.star.presentation.AnimationSpeed.SLOW,
1, 0 ); // automatic object and slide transition
// create an ellipse that is placed on the bottom right of second page
xShapePropSet = ShapeHelper.createAndInsertShape( xDrawDoc,
xShapes, new Point( 21000, 15000 ), new Size( 5000, 5000 ),
"com.sun.star.drawing.EllipseShape" );
xShapePropSet.setPropertyValue(
"Effect", com.sun.star.presentation.AnimationEffect.HIDE );
// create two objects for the third page
// clicking the first object lets the presentation jump
// to page one by using ClickAction.FIRSTPAGE,
// the second object lets the presentation jump to page two
// by using a ClickAction.BOOKMARK;
xPage = PageHelper.getDrawPageByIndex( xDrawDoc, 2 );
xShapes = (XShapes)
UnoRuntime.queryInterface( XShapes.class, xPage );
setSlideTransition( xPage,
com.sun.star.presentation.FadeEffect.ROLL_FROM_LEFT,
com.sun.star.presentation.AnimationSpeed.MEDIUM,
2, 0 );
XShape xShape = ShapeHelper.createShape( xDrawDoc,
new Point( 1000, 8000 ), new Size( 5000, 5000 ),
"com.sun.star.drawing.EllipseShape" );
xShapes.add( xShape );
ShapeHelper.addPortion( xShape, "click to go", false );
ShapeHelper.addPortion( xShape, "to first page", true );
xShapePropSet = (XPropertySet)
UnoRuntime.queryInterface( XPropertySet.class, xShape );
xShapePropSet.setPropertyValue("Effect",
com.sun.star.presentation.AnimationEffect.FADE_FROM_BOTTOM );
xShapePropSet.setPropertyValue(
"OnClick", com.sun.star.presentation.ClickAction.FIRSTPAGE );
xShape = ShapeHelper.createShape( xDrawDoc,
new Point( 22000, 8000 ), new Size( 5000, 5000 ),
"com.sun.star.drawing.RectangleShape" );
xShapes.add( xShape );
ShapeHelper.addPortion( xShape, "click to go", false );
ShapeHelper.addPortion( xShape, "to the second page", true );
xShapePropSet = (XPropertySet)
UnoRuntime.queryInterface( XPropertySet.class, xShape );
xShapePropSet.setPropertyValue("Effect",