Effect

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.slides.IEffect, com.aspose.slides.IDOMObject

public class Effect implements IEffect, IDOMObject

Represents animation effect.

Methods

Method Description
getSequence() Returns a sequence for an effect.
getTextAnimation() TextAnimation Read-only ITextAnimation.
getPresetClassType() Defines class of effect.
setPresetClassType(int value) Defines class of effect.
getType() Defines type of effect.
setType(int value) Defines type of effect.
getSubtype() Defines subtype of effect.
setSubtype(int value) Defines subtype of effect.
getBehaviors() Returns collection of behavior for effect.
setBehaviors(IBehaviorCollection value) Returns collection of behavior for effect.
getTiming() Defines timing value for effect.
setTiming(ITiming value) Defines timing value for effect.
getTargetShape() Returns target shape for effect.
getSound() Defined embedded sound for effect.
setSound(IAudio value) Defined embedded sound for effect.
getStopPreviousSound() This attribute specifies if the animation effect stops the previous sound.
setStopPreviousSound(boolean value) This attribute specifies if the animation effect stops the previous sound.
getParent_Immediate()

getSequence()

public final ISequence getSequence()

Returns a sequence for an effect. Read-only ISequence.

Returns: ISequence

getTextAnimation()

public final ITextAnimation getTextAnimation()

TextAnimation Read-only ITextAnimation.

Returns: ITextAnimation

getPresetClassType()

public final int getPresetClassType()

Defines class of effect. Read/write EffectPresetClassType.

Returns: int

setPresetClassType(int value)

public final void setPresetClassType(int value)

Defines class of effect. Read/write EffectPresetClassType.

Parameters:

Parameter Type Description
value int

getType()

public final int getType()

Defines type of effect. Read/write EffectType.

Returns: int

setType(int value)

public final void setType(int value)

Defines type of effect. Read/write EffectType.

Parameters:

Parameter Type Description
value int

getSubtype()

public final int getSubtype()

Defines subtype of effect. Read/write EffectSubtype.

Returns: int

setSubtype(int value)

public final void setSubtype(int value)

Defines subtype of effect. Read/write EffectSubtype.

Parameters:

Parameter Type Description
value int

getBehaviors()

public final IBehaviorCollection getBehaviors()

Returns collection of behavior for effect. Read/write IBehaviorCollection.

Returns: IBehaviorCollection

setBehaviors(IBehaviorCollection value)

public final void setBehaviors(IBehaviorCollection value)

Returns collection of behavior for effect. Read/write IBehaviorCollection.

Parameters:

Parameter Type Description
value IBehaviorCollection

getTiming()

public final ITiming getTiming()

Defines timing value for effect. Read/write ITiming.

Returns: ITiming

setTiming(ITiming value)

public final void setTiming(ITiming value)

Defines timing value for effect. Read/write ITiming.

Parameters:

Parameter Type Description
value ITiming

getTargetShape()

public final IShape getTargetShape()

Returns target shape for effect. Read-only IShape.

Returns: IShape

getSound()

public final IAudio getSound()

Defined embedded sound for effect. Read/write IAudio.


Presentation presentation = new Presentation("demo.pptx");
 try {
     ISlide slide = presentation.getSlides().get_Item(0);

     // Gets the effects sequence for the slide
     ISequence effectsSequence = slide.getTimeline().getMainSequence();

     for (IEffect effect : effectsSequence)
     {
         if (effect.getSound() == null)
             continue;

         // Extracts the effect sound in byte array
         byte[] audio = effect.getSound().getBinaryData();
     }
 } finally {
     if (presentation != null) presentation.dispose();
 }

Returns: IAudio

setSound(IAudio value)

public final void setSound(IAudio value)

Defined embedded sound for effect. Read/write IAudio.


Presentation presentation = new Presentation("demo.pptx");
 try {
     ISlide slide = presentation.getSlides().get_Item(0);

     // Gets the effects sequence for the slide
     ISequence effectsSequence = slide.getTimeline().getMainSequence();

     for (IEffect effect : effectsSequence)
     {
         if (effect.getSound() == null)
             continue;

         // Extracts the effect sound in byte array
         byte[] audio = effect.getSound().getBinaryData();
     }
 } finally {
     if (presentation != null) presentation.dispose();
 }

Parameters:

Parameter Type Description
value IAudio

getStopPreviousSound()

public final boolean getStopPreviousSound()

This attribute specifies if the animation effect stops the previous sound. Read/write boolean .


Presentation presentation = new Presentation("demo.pptx");
 try {
     // Get the first effect of the first slide.
     IEffect firstSlideEffect = presentation.getSlides().get_Item(0).getTimeline().getMainSequence().get_Item(0);

     // Get the first effect of the second slide.
     IEffect secondSlideEffect = presentation.getSlides().get_Item(1).getTimeline().getMainSequence().get_Item(0);

     if (firstSlideEffect.getSound() != null)
     {
         // Change the second effect Enhancements/Sound to "Stop Previous Sound"
         secondSlideEffect.setStopPreviousSound(true);
     }
 } finally {
     if (presentation != null) presentation.dispose();
 }

Returns: boolean

setStopPreviousSound(boolean value)

public final void setStopPreviousSound(boolean value)

This attribute specifies if the animation effect stops the previous sound. Read/write boolean .


Presentation presentation = new Presentation("demo.pptx");
 try {
     // Get the first effect of the first slide.
     IEffect firstSlideEffect = presentation.getSlides().get_Item(0).getTimeline().getMainSequence().get_Item(0);

     // Get the first effect of the second slide.
     IEffect secondSlideEffect = presentation.getSlides().get_Item(1).getTimeline().getMainSequence().get_Item(0);

     if (firstSlideEffect.getSound() != null)
     {
         // Change the second effect Enhancements/Sound to "Stop Previous Sound"
         secondSlideEffect.setStopPreviousSound(true);
     }
 } finally {
     if (presentation != null) presentation.dispose();
 }

Parameters:

Parameter Type Description
value boolean

getParent_Immediate()

public final IDOMObject getParent_Immediate()

Returns Parent_Immediate object. Read-only IDOMObject.

Returns: com.aspose.slides.IDOMObject