Slide Transition

From Apache OpenOffice Wiki
< Documentation‎ | DevGuide
Revision as of 14:57, 20 December 2020 by DiGro (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



In Impress, each page has its own slide transition that can be composed by the properties of the service com.sun.star.presentation.DrawPage.

Setting the following properties enables slide transition:

Properties of com.sun.star.presentation.DrawPage
Change long - Specifies how the page change is triggered. If this is 0, the user must click to start each object animation and to change the page. If set to 1, the page is automatically switched. If it is set to 2, all object effects run automatically, but the user has to click on the page to change it.
Duration long - If the property Change is set to 1, this property is the time in seconds the page is shown, before switching to the next page.
Effect com.sun.star.presentation.FadeEffect. This is the effect that is used to fade in the page.
Speed com.sun.star.presentation.AnimationSpeed. Defines the speed of the fade-in effect of the page. Possible values are:
  • SLOW sets the speed from the animation or fade to slow.
  • MEDIUM sets the speed from the animation or fade to medium.
  • FAST sets the speed from the animation or fade to fast.
Layout short - This number specifies a presentation layout for this page, if this property is not ZERO.


The next table contains all available com.sun.star.presentation.FadeEffect enum values:

NONE RANDOM DISSOLVE
FADE_FROM_LEFT

FADE_FROM_RIGHT
FADE_FROM_TOP
FADE_FROM_BOTTOM
FADE_FROM_UPPERLEFT
FADE_FROM_UPPERRIGHT
FADE_FROM_LOWERLEFT
FADE_FROM_LOWERRIGHT

MOVE_FROM_LEFT

MOVE_FROM_RIGHT
MOVE_FROM_TOP
MOVE_FROM_BOTTOM
MOVE_FROM_UPPERLEFT
MOVE_FROM_UPPERRIGHT
MOVE_FROM_LOWERRIGHT
MOVE_FROM_LOWERLEFT

UNCOVER_TO_LEFT

UNCOVER_TO_RIGHT
UNCOVER_TO_TOP
UNCOVER_TO_BOTTOM
UNCOVER_TO_UPPERLEFT
UNCOVER_TO_UPPERRIGHT
UNCOVER_TO_LOWERRIGHT
UNCOVER_TO_LOWERLEFT

FADE_TO_CENTER

FADE_FROM_CENTER

VERTICAL_STRIPES

HORIZONTAL_STRIPES

CLOCKWISE

COUNTERCLOCKWISE

ROLL_FROM_LEFT

ROLL_FROM_RIGHT
ROLL_FROM_TOP
ROLL_FROM_BOTTOM

CLOSE_VERTICAL

CLOSE_HORIZONTAL
OPEN_VERTICAL
OPEN_HORIZONTAL

SPIRALIN_LEFT

SPIRALIN_RIGHT
SPIRALOUT_LEFT
SPIRALOUT_RIGHT

WAVYLINE_FROM_LEFT

WAVYLINE_FROM_RIGHT
WAVYLINE_FROM_TOP
WAVYLINE_FROM_BOTTOM

STRETCH_FROM_LEFT

STRETCH_FROM_RIGHT
STRETCH_FROM_TOP
STRETCH_FROM_BOTTOM

VERTICAL_LINES

HORIZONTAL_LINES

VERTICAL_CHECKERBOARD

HORIZONTAL_CHECKERBOARD

The following Java example shows how to set slide transition effects that are applied to the first page.

  // set the slide transition effect of the first page
  XDrawPagesSupplier xDrawPagesSupplier =(XDrawPagesSupplier)UnoRuntime.queryInterface(
      XDrawPagesSupplier.class, xComponent);
  XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages();
  XDrawPage xDrawPage = (XdrawPage)UnoRuntime.queryInterface(XDrawPage.class, 
      xDrawPages.getByIndex(0));
  xShapes = (XShapes)UnoRuntime.queryInterface(XShapes.class, xDrawPage);
  XPropertySet xPropSet = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xDrawPage);
  // set the slide transition effect properties
  xPropSet.setPropertyValue("Effect", com.sun.star.presentation.FadeEffect.RANDOM);
  xPropSet.setPropertyValue("Speed", com.sun.star.presentation.AnimationSpeed.MEDIUM);
  /* Change specifies how the page change is triggered. If this
     is 0, the user must click to start each object animation
     and to change the page. If set to 1, the page is
     automatically switched. If it is set to 2, all object
     effects run automatically, but the user has to click on the 
     page to change it.
   */
  xPropSet.setPropertyValue("Change", new Integer(1));
  /* If the property DrawPage::Change is set to 1, Duration specifies the
     time in seconds the page is shown before switching to the next page.
   */
  xPropSet.setPropertyValue("Duration", new Integer(5));
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages