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 |
addTarget(ParallaxTarget target)Add a ParallaxTarget to run parallax effect. |
final List<Parallax.PropertyMarkerValue> |
Returns the list of |
final List<ParallaxTarget> |
Returns the list of |
final void |
performMapping(Parallax source)Perform mapping from |
final void |
removeTarget(ParallaxTarget target)Remove a |
final void |
setPropertyRanges(Parallax.PropertyMarkerValue[] markerValues)Sets the list of |
final ParallaxEffect |
target(ParallaxTarget target)Add a ParallaxTarget to run parallax effect. |
final ParallaxEffect |
target(Object targetObject, PropertyValuesHolder values)Creates a |
final ParallaxEffect |
Creates a |
Public methods
addTarget
public final void addTarget(ParallaxTarget target)
Add a ParallaxTarget to run parallax effect.
| Parameters | |
|---|---|
ParallaxTarget target |
ParallaxTarget to add. |
getPropertyRanges
public final List<Parallax.PropertyMarkerValue> getPropertyRanges()
Returns the list of PropertyMarkerValues, which represents the range of values that source variables can take.
| Returns | |
|---|---|
List<Parallax.PropertyMarkerValue> |
A list of |
| See also | |
|---|---|
performMapping |
getTargets
public final List<ParallaxTarget> getTargets()
Returns the list of ParallaxTarget objects.
| Returns | |
|---|---|
List<ParallaxTarget> |
The list of |
performMapping
public final void performMapping(Parallax source)
Perform mapping from Parallax to list of ParallaxTarget.
removeTarget
public final void removeTarget(ParallaxTarget target)
Remove a ParallaxTarget object from the list.
| Parameters | |
|---|---|
ParallaxTarget target |
The |
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 |
| See also | |
|---|---|
performMapping |
target
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
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
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 |