ParallaxEffect


public abstract class ParallaxEffect


ParallaxEffect class drives changes in ParallaxTarget in response to changes in variables defined in Parallax.

ParallaxEffect has a list of Parallax.PropertyMarkerValues which represents the range of values that source variables can take. The main function is performMapping which computes a fraction between 0 and 1 based on the current values of variables in Parallax. As the parallax effect goes on, the fraction increases from 0 at beginning to 1 at the end. Then the fraction is passed on to update.

App use addEffect to create a ParallaxEffect.

Summary

Public methods

final void

Add a ParallaxTarget to run parallax effect.

final List<Parallax.PropertyMarkerValue>

Returns the list of PropertyMarkerValues, which represents the range of values that source variables can take.

final List<ParallaxTarget>

Returns the list of ParallaxTarget objects.

final void

Perform mapping from Parallax to list of ParallaxTarget.

final void

Remove a ParallaxTarget object from the list.

final void
setPropertyRanges(Parallax.PropertyMarkerValue[] markerValues)

Sets the list of PropertyMarkerValues, which represents the range of values that source variables can take.

final ParallaxEffect

Add a ParallaxTarget to run parallax effect.

final ParallaxEffect
target(Object targetObject, PropertyValuesHolder values)

Creates a ParallaxTarget from PropertyValuesHolder and adds it to the list of targets.

final ParallaxEffect
<T, V extends Number> target(T targetObject, Property<T, V> targetProperty)

Creates a ParallaxTarget using direct mapping from source property into target property, the new ParallaxTarget will be added to its list of targets.

Public methods

addTarget

Added in 1.1.0
public final void addTarget(ParallaxTarget target)

Add a ParallaxTarget to run parallax effect.

Parameters
ParallaxTarget target

ParallaxTarget to add.

getPropertyRanges

Added in 1.1.0
public final List<Parallax.PropertyMarkerValuegetPropertyRanges()

Returns the list of PropertyMarkerValues, which represents the range of values that source variables can take.

See also
performMapping

getTargets

Added in 1.1.0
public final List<ParallaxTargetgetTargets()

Returns the list of ParallaxTarget objects.

Returns
List<ParallaxTarget>

The list of ParallaxTarget objects.

performMapping

Added in 1.1.0
public final void performMapping(Parallax source)

Perform mapping from Parallax to list of ParallaxTarget.

removeTarget

Added in 1.1.0
public final void removeTarget(ParallaxTarget target)

Remove a ParallaxTarget object from the list.

Parameters
ParallaxTarget target

The ParallaxTarget object to be removed.

setPropertyRanges

public final void setPropertyRanges(Parallax.PropertyMarkerValue[] markerValues)

Sets the list of PropertyMarkerValues, which represents the range of values that source variables can take.

Parameters
Parallax.PropertyMarkerValue[] markerValues

A list of PropertyMarkerValues.

See also
performMapping

target

Added in 1.1.0
public final ParallaxEffect target(ParallaxTarget target)

Add a ParallaxTarget to run parallax effect.

Parameters
ParallaxTarget target

ParallaxTarget to add.

Returns
ParallaxEffect

This ParallaxEffect object, allowing calls to methods in this class to be chained.

target

Added in 1.1.0
public final ParallaxEffect target(Object targetObject, PropertyValuesHolder values)

Creates a ParallaxTarget from PropertyValuesHolder and adds it to the list of targets.

Parameters
Object targetObject

Target object for PropertyValuesHolderTarget.

PropertyValuesHolder values

PropertyValuesHolder for PropertyValuesHolderTarget.

Returns
ParallaxEffect

This ParallaxEffect object, allowing calls to methods in this class to be chained.

target

Added in 1.1.0
public final ParallaxEffect <T, V extends Number> target(T targetObject, Property<T, V> targetProperty)

Creates a ParallaxTarget using direct mapping from source property into target property, the new ParallaxTarget will be added to its list of targets.

Parameters
<T>

Type of target object.

<V extends Number>

Type of target property value, either Integer or Float.

T targetObject

Target object for property.

Property<T, V> targetProperty

The target property that will receive values.

Returns
ParallaxEffect

This ParallaxEffect object, allowing calls to methods in this class to be chained.

See also
isDirectMapping