org.apache.pdfbox.pdmodel.interactive.pagenavigation

## Class PDTransition

- java.lang.Object
- - org.apache.pdfbox.pdmodel.common.PDDictionaryWrapper
  - - org.apache.pdfbox.pdmodel.interactive.pagenavigation.PDTransition

All Implemented Interfaces:
  COSObjectable

    public final class PDTransition
    extends PDDictionaryWrapper

Represents a page transition as defined in paragraph 12.4.4.1 of PDF 32000-1:2008

Author:
  Andrea Vacondio

### Constructor Summary

Constructors
Constructor and Description
`PDTransition()` creates a new transition with default "replace" style `PDTransitionStyle.R`
`PDTransition(COSDictionary dictionary)` creates a new transition for an existing dictionary
`PDTransition(PDTransitionStyle style)` creates a new transition with the given style.

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `getDimension()`
`COSBase` `getDirection()`
`float` `getDuration()`
`float` `getFlyScale()`
`String` `getMotion()`
`String` `getStyle()`
`boolean` `isFlyAreaOpaque()`
`void` `setDimension(PDTransitionDimension dimension)` Sets the dimension in which the specified transition effect shall occur.
`void` `setDirection(PDTransitionDirection direction)` Sets the direction in which the specified transition effect shall move.
`void` `setDuration(float duration)`
`void` `setFlyAreaOpaque(boolean opaque)`
`void` `setFlyScale(float scale)`
`void` `setMotion(PDTransitionMotion motion)` Sets the direction of motion for the specified transition effect.

### Methods inherited from class org.apache.pdfbox.pdmodel.common.PDDictionaryWrapper

`equals, getCOSObject, hashCode`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### PDTransition

    public PDTransition()

creates a new transition with default "replace" style `PDTransitionStyle.R`

#### PDTransition

    public PDTransition(PDTransitionStyle style)

creates a new transition with the given style.

Parameters:
  `style` - the style to be used to create the new transition

#### PDTransition

    public PDTransition(COSDictionary dictionary)

creates a new transition for an existing dictionary

Parameters:
  `dictionary` - the dictionary to be used for the new transition

### Method Detail

#### getStyle

    public String getStyle()

Returns:
  the style for this transition
See Also:
  `PDTransitionStyle.valueOf(String)`

#### getDimension

    public String getDimension()

Returns:
  The dimension in which the specified transition effect shall occur or the default `PDTransitionDimension.H` if no dimension is found.
See Also:
  `PDTransitionDimension`

#### setDimension

    public void setDimension(PDTransitionDimension dimension)

Sets the dimension in which the specified transition effect shall occur. Only for `PDTransitionStyle.Split` and `PDTransitionStyle.Blinds`.

Parameters:
  `dimension` - the dimension in which the specified transition effect shall occur

#### getMotion

    public String getMotion()

Returns:
  The direction of motion for the specified transition effect or the default `PDTransitionMotion.I` if no motion is found.
See Also:
  `PDTransitionMotion`

#### setMotion

    public void setMotion(PDTransitionMotion motion)

Sets the direction of motion for the specified transition effect. Only for `PDTransitionStyle.Split`, `PDTransitionStyle.Blinds` and `PDTransitionStyle.Fly`.

Parameters:
  `motion` - the direction of motion for the specified transition effect

#### getDirection

    public COSBase getDirection()

Returns:
  the direction in which the specified transition effect shall move. It can be either a `COSInteger` or `COSName.NONE`. Default to `COSInteger.ZERO`
See Also:
  `PDTransitionDirection`

#### setDirection

    public void setDirection(PDTransitionDirection direction)

Sets the direction in which the specified transition effect shall move. Only for `PDTransitionStyle.Wipe`, `PDTransitionStyle.Glitter`, `PDTransitionStyle.Fly`, `PDTransitionStyle.Cover`, `PDTransitionStyle.Uncover` and `PDTransitionStyle.Push`.

Parameters:
  `direction` - the direction in which the specified transition effect shall move

#### getDuration

    public float getDuration()

Returns:
  The duration in seconds of the transition effect or the default 1 if no duration is found.

#### setDuration

    public void setDuration(float duration)

Parameters:
  `duration` - The duration of the transition effect, in seconds.

#### getFlyScale

    public float getFlyScale()

Returns:
  The starting or ending scale at which the changes shall be drawn or the default 1 if no scale is found. Only for `PDTransitionStyle.Fly`.

#### setFlyScale

    public void setFlyScale(float scale)

Parameters:
  `scale` - The starting or ending scale at which the changes shall be drawn. Only for `PDTransitionStyle.Fly`.

#### isFlyAreaOpaque

    public boolean isFlyAreaOpaque()

Returns:
  true if the area that shall be flown in is rectangular and opaque. Default is false. Only for `PDTransitionStyle.Fly`.

#### setFlyAreaOpaque

    public void setFlyAreaOpaque(boolean opaque)

Parameters:
  `opaque` - If true, the area that shall be flown in is rectangular and opaque. Only for `PDTransitionStyle.Fly`.