VariableParamAnimateable
vmm3d.core

Class VariableParamAnimateable

  • All Implemented Interfaces:
    Animateable


    public class VariableParamAnimateableextends VariableParamimplements Animateable
    An animateable parameter that has a real value and a start and end value to be used for animation. Parameters of this type are mostly for use in user-defined objects. The name of a VariableParam is shared with the associated variable and therefor should probably be of human-readable form, such as "a" or "b".
    • Constructor Detail

      • VariableParamAnimateable

        public VariableParamAnimateable()
        Creates a VariableParamAnimateable that initially has no name and has value and default value equal to 0, with animation limits also equal to zero.
      • VariableParamAnimateable

        public VariableParamAnimateable(String name,                        double value)
        Create a VariableParamAnimateable with a specified name and initial value and with animation start and end values equal to the same value. A variable is created with the same name and initial value to share the value of this parameter.
        Parameters:
        name - The name of the Parameter, which can be null but ordinarily should not be. The name shoud identify the Parameter uniquely among parameters associated with a given Parameterizeable object.
        value - The initial value of the parameter. This also becomes its default value.
      • VariableParamAnimateable

        public VariableParamAnimateable(Variable v)
        Create a VariableParamAnimateable that will share the value of the specified variable. The parameter's name and initial value are copied from the variable. The animation start and end values are set to the same value
        Parameters:
        v - the non-null variable that will be associated with the parameter
      • VariableParamAnimateable

        public VariableParamAnimateable(String name,                        String valueAsString)
        Create a VariableParamAnimateable with a specified name and initial value and with animation start and end values equal to the same value. A variable with the same name and initial value is created to share the value of the parameter.
        Parameters:
        name - The name of the Parameter, which can be null but ordinarily should not be. The name shoud identify the Parameter uniquely among parameters associated with a given Parameterizeable object.
        valueAsString - The initial value of the parameter, given as a string. An error of type NumberFormatException occurs if this string does not represent a legal value.
      • VariableParamAnimateable

        public VariableParamAnimateable(String name,                        String valueAsString,                        String startString,                        String endString)
        Create a VariableParamAnimateable with a specified name, initial value and animation start and end values. A variable with the same name and initial value is created to share the value of the parameter. An error of type NumberFormatExcpetion will occur if any of the strings does not represent a legal value.
        Parameters:
        name - The name of the Parameter, which can be null but ordinarily should not be. The name shoud identify the Parameter uniquely among parameters associated with a given Parameterizeable object.
      • VariableParamAnimateable

        public VariableParamAnimateable(String name,                        double value,                        double start,                        double end)
        Create a VariableParamAnimateable with a specified name, initial value and animation start and end values. A variable is created with the same name and initial value to share the value of this parameter.
        Parameters:
        name - The name of the Parameter, which can be null but ordinarily should not be. The name shoud identify the Parameter uniquely among parameters associated with a given Parameterizeable object.
      • VariableParamAnimateable

        public VariableParamAnimateable(Variable v,                        double start,                        double end)
        Create a VariableParamAnimateable that will share the value of the specified variable. The parameter's name and initial value are copied from the variable. The animation start and end values are as specified.
        Parameters:
        v - the non-null variable that will be associated with the parameter
        start - the animation start value
        end - the animation end value
    • Method Detail

      • reset

        public void reset(double value)
        Sets both the default value and the value of this parameter to the specified number. In addition the values and default values for the animation start and end properities are also set to the same value. This is primarily meant to be called in the constructor of an Exhibit when it wants to change the value of a parameter that is inherited from a superclass.
        Overrides:
        reset in class RealParam
        See Also:
        Parameter.reset(String)
      • reset

        public void reset(double value,         double animationStart,         double animationEnd)
        Sets both the value and default value of the parameter, as well as the value and default value of the animation start and end properties.
      • reset

        public void reset(String valueAsString)
        Set both the value and the default value of the parameter to the value encoded in the given string, as if that string had been passed to the constructor. In addition the values and default values for the animation start and end properities are also set to the same value. This is primarily meant to be called in the constructor of an Exhibit when it wants to change the value of a parameter that is inherited from a superclass.
        Overrides:
        reset in class Parameter
        See Also:
        RealParam.stringToValueObject(String)
      • reset

        public void reset(String valueAsString,         String animationStartAsString,         String animationEndAsString)
        Sets both the value and default value of the parameter, as well as the value and default value of the animation start and end properties.
      • getDefaultAnimationStart

        public double getDefaultAnimationStart()
      • getDefaultAnimationEnd

        public double getDefaultAnimationEnd()
      • setDefaultAnimationLimits

        public void setDefaultAnimationLimits(double defaultStart,                             double defaultEnd)
      • setDefaultAnimationStartFromString

        public void setDefaultAnimationStartFromString(String startString)
        Description copied from interface: Animateable
        Sets the default start animation value for this Animateable object from a string representation of the value. The default values are used, for example, when the user clicks the "Defaults" button in AnimationLimitsDialog.
        Specified by:
        setDefaultAnimationStartFromString in interface Animateable
        Parameters:
        startString - The default start value, as a string. This string will be parsed as a constant expression, and a NumberFormatException will be thrown if the string is not a legal expression.
      • setDefaultAnimationEndFromString

        public void setDefaultAnimationEndFromString(String endString)
        Description copied from interface: Animateable
        Sets the default ending animation value for this Animateable object from a string representation of the value. The default values are used, for example, when the user clicks the "Defaults" button in AnimationLimitsDialog.
        Specified by:
        setDefaultAnimationEndFromString in interface Animateable
        Parameters:
        endString - The default end value, as a string. This string will be parsed as a constant expression, and a NumberFormatException will be thrown if the string is not a legal expression.
      • setAnimationLimits

        public void setAnimationLimits(double start,                      double end)
      • setAnimationLimitsAndDefaults

        public void setAnimationLimitsAndDefaults(double start,                                 double end)
      • setAnimationStart

        public void setAnimationStart(double x)
      • setAnimationEnd

        public void setAnimationEnd(double x)
      • getAnimationStart

        public double getAnimationStart()
      • getAnimationEnd

        public double getAnimationEnd()
      • setAnimationStartFromString

        public void setAnimationStartFromString(String startVal)
        Description copied from interface: Animateable
        Set the starting Animation value for this Animateable object from a string. This method will probably only be used by Dialog boxes such as AnimationLimitsDialog.
        Specified by:
        setAnimationStartFromString in interface Animateable
        Parameters:
        startVal - The start value, as a string. This string will be parsed as a constant expression, and a NumberFormatException will be thrown if the string is not a legal expression.
      • setAnimationEndFromString

        public void setAnimationEndFromString(String endVal)
        Description copied from interface: Animateable
        Set the ending Animation value for this Animateable object from a string.
        Specified by:
        setAnimationEndFromString in interface Animateable
        Parameters:
        endVal - The end value, as a string. This string will be parsed as a constant expression, and a NumberFormatException will be thrown if the string is not a legal expression.
      • setFractionComplete

        public void setFractionComplete(double fractionComplete)
        Description copied from interface: Animateable
        Called during the course of a morphing animation so that the Animateable object can adjust itself to the current stage of the animation. In fact, an Animateable Parameter could set its value to "startValue + fractionComplete * (endValue - startValue)" when this metod is called.
        Specified by:
        setFractionComplete in interface Animateable
        Parameters:
        fractionComplete - A number in the range 0 to 1 that tells what stage the animation is at. The Animateable object adjusts itself accordingly.
        See Also:
        BasicAnimator
      • reallyAnimated

        public boolean reallyAnimated()
        Description copied from interface: Animateable
        Check whether this Animateable will really change during an animation. (If the start and end values are the same, then the return value will presumably be false.)
        Specified by:
        reallyAnimated in interface Animateable

SCaVis 2.2 © jWork.ORG