org.stellarium.ui.fader
Class LinearFader

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

public class LinearFader
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 is_transiting
           
protected  float start_value
           
protected  float target_value
           
 
Fields inherited from class org.stellarium.ui.fader.Fader
max_value, min_value, state
 
Constructor Summary
LinearFader()
          Create and initialise to default
LinearFader(int _duration, float _min_value, float _max_value, boolean _state)
          Create and initialise to default
 
Method Summary
 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

is_transiting

protected boolean is_transiting

duration

protected int duration

start_value

protected float start_value

target_value

protected float target_value

counter

protected int counter

interstate

protected float interstate
Constructor Detail

LinearFader

public LinearFader()
Create and initialise to default


LinearFader

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

Parameters:
_duration -
_min_value -
_max_value -
_state -
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

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()