org.stellarium.ui.fader
Class ParabolicFader

java.lang.Object
  extended by org.stellarium.ui.fader.Fader
      extended by org.stellarium.ui.fader.ParabolicFader

public class ParabolicFader
extends Fader

Please note that state is updated instantaneously, so if you need to draw something fading in and out, you need to check the interstate value (!=0) to know to draw when on AND during transitions


Field Summary
protected  int counter
           
protected  int duration
           
protected  float interstate
           
protected  boolean isTransiting
           
protected  float startValue
           
protected  float targetValue
           
 
Fields inherited from class org.stellarium.ui.fader.Fader
max_value, min_value, state
 
Constructor Summary
ParabolicFader()
           
ParabolicFader(int _duration, float _min_value, float _max_value, boolean _state)
          Create and initialise to default
 
Method Summary
 int getDuration()
           
 float getInterstate()
          Get current switch state
 float getInterstatePercentage()
           
 boolean hasInterstate()
           
 Fader set(boolean s)
          Faders can be used just as bools
 void setDuration(int _duration)
           
 void setMaxValue(float _max)
           
 void setMinValue(float _min)
           
 void update(int delta_ticks)
          Increments the internal counter of delta_time ticks
 
Methods inherited from class org.stellarium.ui.fader.Fader
booleanValue, equals, getState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isTransiting

protected boolean isTransiting

duration

protected int duration

startValue

protected float startValue

targetValue

protected float targetValue

counter

protected int counter

interstate

protected float interstate
Constructor Detail

ParabolicFader

public ParabolicFader(int _duration,
                      float _min_value,
                      float _max_value,
                      boolean _state)
Create and initialise to default

Parameters:
_duration -
_min_value -
_max_value -
_state -

ParabolicFader

public ParabolicFader()
Method Detail

update

public void update(int delta_ticks)
Increments the internal counter of delta_time ticks

Specified by:
update in class Fader

getInterstate

public float getInterstate()
Get current switch state

Specified by:
getInterstate in class Fader

getInterstatePercentage

public float getInterstatePercentage()
Specified by:
getInterstatePercentage in class Fader

set

public Fader set(boolean s)
Faders can be used just as bools

Specified by:
set in class Fader

setDuration

public void setDuration(int _duration)
Overrides:
setDuration in class Fader

getDuration

public int getDuration()

setMinValue

public void setMinValue(float _min)
Overrides:
setMinValue in class Fader

setMaxValue

public void setMaxValue(float _max)
Overrides:
setMaxValue in class Fader

hasInterstate

public boolean hasInterstate()