halo.userinterface.gui
Class GuiHalfLife

java.lang.Object
  extended by halo.userinterface.gui.GuiHalfLife

public class GuiHalfLife
extends java.lang.Object

'Interface' which connects GUI and methods for half-life calculations

Author:
Stefanie Kaufmann

Field Summary
static java.lang.String EU
           
static java.lang.String NEW
           
static java.lang.String PRE
           
 
Constructor Summary
GuiHalfLife()
           
 
Method Summary
 void addHL(java.lang.String hlName, double time, int replicate)
          Add a half-life object to the current list, also add corresponding time
 void calcHL()
          Use set variables and create HalfLife objects for every method, calculate half-lives
 void calcHLonMedian(java.util.List<CorrectionFactors> corr)
          Calculates the half-life values based on a list of correction factors which correspond to the list of half-lives
 double calculateMedian()
          Calculate the median for a set of half-lives
 void clearHL()
          Resets everything that has been used for half-life calculation of previous half-life list
 void generateHL()
          Generate empty HalfLife objects according to the given methods, without calculating the half-lives
 Alpha getAlpha()
          Returns the alpha function of the first half-life object, based on the assumption that all objects use the same alpha
 java.util.List<CorrectionFactors> getCFonMedian(double mD)
          Calculates the median for each HalfLife object and the correction factors based on this median
 java.util.List<HalfLife> getHL()
          Returns the list of half-life objects calculated
 double getMD()
          Returns the last calculated median
 java.util.List<java.lang.String> getMethods()
          Returns the list of method descriptions used for half-life calculation
 java.util.List<java.lang.Integer> getReplicates()
          Returns the number of the used replicate for each half-life object
 java.util.List<java.lang.Double> getTimes()
          Returns the list of time points used for calculation
 boolean hasHL()
          Checks whether there are any half-lives
 void saveHL()
          Based on calculated half-lives, writes results into output file
 void saveHLWithAttributes(int index, java.lang.String file, java.util.ArrayList<java.lang.String> labels)
           
 void setAlpha(Alpha alpha)
          Sets the alpha object
 void setCorr(CorrectionFactors corr)
          Sets the correction factors needed for half-life calculation
 void setData(Data data)
          Sets the data on which the half-life calculation is based
 void setMax(double max)
          Sets the maximal value for half-life values
 void setMethods(java.util.List<java.lang.String> methods)
          Sets the list of method descriptions for calculation
 void setMin(double min)
          Sets the minimum value for half-life values
 void setOutput(java.lang.String filename, int which)
          Sets all necessary variables for defining the output
 void setRatioMethod(int method)
          Changes the method used for ratio calculation
 void setReplicates(java.util.List<java.lang.Integer> replicates)
          Sets the numbers of the replicates for the half-life calculations
 void setTimes(java.util.List<java.lang.Double> times)
          Sets the list of time points for calculation, order corresponding to the list of methods
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEW

public static final java.lang.String NEW
See Also:
Constant Field Values

PRE

public static final java.lang.String PRE
See Also:
Constant Field Values

EU

public static final java.lang.String EU
See Also:
Constant Field Values
Constructor Detail

GuiHalfLife

public GuiHalfLife()
Method Detail

calcHL

public void calcHL()
Use set variables and create HalfLife objects for every method, calculate half-lives


generateHL

public void generateHL()
Generate empty HalfLife objects according to the given methods, without calculating the half-lives


calculateMedian

public double calculateMedian()
Calculate the median for a set of half-lives


getCFonMedian

public java.util.List<CorrectionFactors> getCFonMedian(double mD)
Calculates the median for each HalfLife object and the correction factors based on this median

Parameters:
mD - The median value
Returns:
A list of correction factors based on median, corresponding to the list of half-lives

calcHLonMedian

public void calcHLonMedian(java.util.List<CorrectionFactors> corr)
Calculates the half-life values based on a list of correction factors which correspond to the list of half-lives

Parameters:
corr - List containing a set of correction factors for every half-life object

saveHL

public void saveHL()
Based on calculated half-lives, writes results into output file


saveHLWithAttributes

public void saveHLWithAttributes(int index,
                                 java.lang.String file,
                                 java.util.ArrayList<java.lang.String> labels)

clearHL

public void clearHL()
Resets everything that has been used for half-life calculation of previous half-life list


hasHL

public boolean hasHL()
Checks whether there are any half-lives

Returns:
True if already any half-lives have been set

addHL

public void addHL(java.lang.String hlName,
                  double time,
                  int replicate)
Add a half-life object to the current list, also add corresponding time

Parameters:
hlName - Name of the half-life object (new/pre/eu)
time - Time point for which calculation is wanted
replicate - Replicate for which the calculation is wanted

setRatioMethod

public void setRatioMethod(int method)
Changes the method used for ratio calculation

Parameters:
method - The method to be used for ratio calculation

setAlpha

public void setAlpha(Alpha alpha)
Sets the alpha object

Parameters:
alpha - Alpha object with specific alpha calculation function

setMax

public void setMax(double max)
Sets the maximal value for half-life values

Parameters:
max - Maximum value for half-lives

setMin

public void setMin(double min)
Sets the minimum value for half-life values

Parameters:
min - Minimum value for half-lives

setOutput

public void setOutput(java.lang.String filename,
                      int which)
Sets all necessary variables for defining the output

Parameters:
filename - Name of the file in which output will be saved
which - Which results will be saved (ratio/halflife/both?)

setData

public void setData(Data data)
Sets the data on which the half-life calculation is based

Parameters:
data - The data object for the calculation

setReplicates

public void setReplicates(java.util.List<java.lang.Integer> replicates)
Sets the numbers of the replicates for the half-life calculations

Parameters:
replicates - The list of replicate numbers

setCorr

public void setCorr(CorrectionFactors corr)
Sets the correction factors needed for half-life calculation

Parameters:
corr - The correction factors for the calculation

setMethods

public void setMethods(java.util.List<java.lang.String> methods)
Sets the list of method descriptions for calculation

Parameters:
methods - The list of methods for half-life calculation

setTimes

public void setTimes(java.util.List<java.lang.Double> times)
Sets the list of time points for calculation, order corresponding to the list of methods

Parameters:
times - A list of time points for half- life calculation

getAlpha

public Alpha getAlpha()
Returns the alpha function of the first half-life object, based on the assumption that all objects use the same alpha

Returns:
The alpha function used for half-life calculation

getMethods

public java.util.List<java.lang.String> getMethods()
Returns the list of method descriptions used for half-life calculation

Returns:
The list of methods for half-life calculation

getReplicates

public java.util.List<java.lang.Integer> getReplicates()
Returns the number of the used replicate for each half-life object

Returns:
The numbers of the used replicates

getMD

public double getMD()
Returns the last calculated median

Returns:
The last calculated median

getTimes

public java.util.List<java.lang.Double> getTimes()
Returns the list of time points used for calculation

Returns:
The list of time points for half-life calculation

getHL

public java.util.List<HalfLife> getHL()
Returns the list of half-life objects calculated

Returns:
The list of half-life objects