org.eclipse.ohf.stem.ui.ge
Class Aspect

java.lang.Object
  extended by org.eclipse.ohf.stem.ui.ge.Aspect

public class Aspect
extends java.lang.Object

Aspect This class is used to describe the Aspects of a disease that we are interested in. The common ones are: S, E I,and R for Susceptible, Exposed, Infectious, and Recoverable. However there could be others or some diseases may have less. The valid Aspects are described by a property file. The default is aspects.properties which would be found in the org.eclipse.ohf.stem.ui.ge package. The default if no properties file is found is S,E,I,R with default values for each aspect. Each valid Aspect is described by an instance of this class and the set of Aspects are stored in a HashMap that can be accessed as a static value for Aspect.

 Each Aspect has the following attributes:

    code     - the String code by which it is accessed (e.g "S")
    name     - The String that the user would understand
               (e.g "Susceptiple"
    description - The text description of the aspect.
    range    - A list of double values that describe the range 
               of values that the aspect might have. 
               For a relative aspect, these would range from 0.0 to 1.0
               (e.g  0.1, 0.33, 0.66, 0.9)
    red        The value (0 to 255) for the color "Red" if the value 
               is in the specified range. 
               (e.g  0,255,255,255 would cause an aspect with a value of 0
               to have red=0; with a value greater than 0 then red=255
               Assuming the green and blue values were 0,0,0,0 then the
               aspect would be shown as red. Equal values for red and green
               would result in yellow etc. 
    green      Same as above but for the color green.
    blue       Same as above but for the color blue.
    opacity    The value (0 to 255) that descripes the tranparency 
                         used by GoogleEarth when drawing a polygon to 
               represent the value of the aspect.  
               (e.g 0,128,160,192 with the range above would cause an area
                with a aspect value of 0 to 0.1 to not be filled in at all, 
                with a value less or equal to 0.33 to have an opacity
                of 128 and values greater thatn 0.9 an opacity of 192) 
 
 


Field Summary
static int[] DEFAULT_OPACITY
          default opacity
static double[] DEFAULT_RANGE
          default range
static java.lang.String PROPERTIES_NAME
          filename for properties file
 
Constructor Summary
Aspect(java.lang.String code, java.lang.String name)
          Create an instance of Aspect and place it into the Hashmap.
 
Method Summary
static boolean exists(java.lang.String aspectCode)
          Test if specified aspect code is in the map of aspects.
static Aspect getAspect(java.lang.String code)
          Return the Aspect that is associated with the specified code.
 int getBlue(int n)
           
 java.lang.String getCode()
           
static Aspect getDefault()
           
static java.lang.String getDefaultCode()
           
 java.lang.String getDescription()
           
 int getGreen(int n)
           
static java.lang.String getKmlDisplayClass()
           
static java.util.Map<java.lang.String,Aspect> getMap()
           
 java.lang.String getName()
           
 int[] getOpacity()
           
 int getOpacity(int n)
           
static java.util.Properties getProperties()
           
 double[] getRange()
           
 double getRange(int n)
          Get a specific entry in the array of range values
 int getRed(int n)
           
 java.lang.String getType()
           
 java.lang.String getUnit()
           
 boolean isSane()
          Verify that this instance of Aspect makes good sense and follows all of the rules.
 void setBlue(java.lang.String color)
          Set the Color of the displayed polygons based on the range of values.
 void setCode(java.lang.String newcode)
           
static void setDefaultCode(java.lang.String defaultAspectCode)
           
 void setDescription(java.lang.String description)
           
 void setGreen(java.lang.String color)
          Set the Color of the displayed polygons based on the range of values.
static void setMap(java.util.Map<java.lang.String,Aspect> map)
           
 void setName(java.lang.String name)
           
 void setOpacity(java.lang.String opacity)
          Set the Opacity of the displayed polygons based on the range of values.
 void setRange(double[] range)
           
 void setRange(java.lang.String range)
          Set the range of values used to display value.
 void setRed(java.lang.String color)
          Set the Color of the displayed polygons based on the range of values.
 void setType(java.lang.String type)
           
 void setUnit(java.lang.String unit)
           
static void setup()
          Initialization code.
 java.lang.String toString()
          Return the code that this Aspect represents.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTIES_NAME

public static final java.lang.String PROPERTIES_NAME
filename for properties file

See Also:
Constant Field Values

DEFAULT_RANGE

public static final double[] DEFAULT_RANGE
default range


DEFAULT_OPACITY

public static final int[] DEFAULT_OPACITY
default opacity

Constructor Detail

Aspect

public Aspect(java.lang.String code,
              java.lang.String name)
Create an instance of Aspect and place it into the Hashmap.

Parameters:
code -
name -
id -
Method Detail

setup

public static void setup()
Initialization code. It reads the property file and creates the Aspects and then stores each one in a hashmap.


isSane

public boolean isSane()
Verify that this instance of Aspect makes good sense and follows all of the rules.

Returns:
true if no problems found false if not

getAspect

public static Aspect getAspect(java.lang.String code)
Return the Aspect that is associated with the specified code. Reurn defaultAspect if unknown.

Parameters:
code -
Returns:
specified aspect

exists

public static boolean exists(java.lang.String aspectCode)
Test if specified aspect code is in the map of aspects.

Parameters:
aspectCode -
Returns:
true if the specified aspect code is in the map

getMap

public static java.util.Map<java.lang.String,Aspect> getMap()
Returns:
the map

setMap

public static void setMap(java.util.Map<java.lang.String,Aspect> map)
Parameters:
map - the map to set

getCode

public java.lang.String getCode()
Returns:
the code

setCode

public void setCode(java.lang.String newcode)
Parameters:
newcode - the code to set

getName

public java.lang.String getName()
Returns:
the name

setName

public void setName(java.lang.String name)
Parameters:
name - the name to set

toString

public java.lang.String toString()
Return the code that this Aspect represents. For Example "E" for Exposed.

Overrides:
toString in class java.lang.Object

getDescription

public java.lang.String getDescription()
Returns:
the description

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - the description to set

getRange

public double[] getRange()
Returns:
the range

getRange

public double getRange(int n)
Get a specific entry in the array of range values

Parameters:
n - entry within the array
Returns:
the range entry in list

setRange

public void setRange(java.lang.String range)
Set the range of values used to display value. It is given as a String of , separated values and converted to an array of doubles

Parameters:
range - the range to set

getOpacity

public int[] getOpacity()
Returns:
the opacity array

getOpacity

public int getOpacity(int n)
Parameters:
n - entry the list to get
Returns:
the opacity

setOpacity

public void setOpacity(java.lang.String opacity)
Set the Opacity of the displayed polygons based on the range of values. It is given as a String and converted to an array of ints that is the same size as range. If Less values specified, then last value will be repeated.

Parameters:
opacity - comma separated list

setRed

public void setRed(java.lang.String color)
Set the Color of the displayed polygons based on the range of values. It is given as a String and converted to an array of ints that is the same size as range. If Less values specified, then last value will be repeated.

Parameters:
color - range of colors

setGreen

public void setGreen(java.lang.String color)
Set the Color of the displayed polygons based on the range of values. It is given as a String and converted to an array of ints that is the same size as range. If Less values specified, then last value will be repeated.

Parameters:
color - range of colors

setBlue

public void setBlue(java.lang.String color)
Set the Color of the displayed polygons based on the range of values. It is given as a String and converted to an array of ints that is the same size as range. If Less values specified, then last value will be repeated.

Parameters:
color - range of colors

getRed

public int getRed(int n)
Parameters:
n - list entry
Returns:
the color entry

getGreen

public int getGreen(int n)
Parameters:
n - list entry
Returns:
the color entry

getBlue

public int getBlue(int n)
Parameters:
n - list entry
Returns:
the color entry

setRange

public void setRange(double[] range)
Parameters:
range - the range to set

getType

public java.lang.String getType()
Returns:
the type

setType

public void setType(java.lang.String type)
Parameters:
type - the type to set

getDefault

public static Aspect getDefault()
Returns:
the default Aspect

getDefaultCode

public static java.lang.String getDefaultCode()
Returns:
the default Aspect code

setDefaultCode

public static void setDefaultCode(java.lang.String defaultAspectCode)
Parameters:
defaultAspectCode - the aspect to set

getUnit

public java.lang.String getUnit()
Returns:
the unit

setUnit

public void setUnit(java.lang.String unit)
Parameters:
unit - the unit to set

getKmlDisplayClass

public static java.lang.String getKmlDisplayClass()
Returns:
the kmlDisplayClass

getProperties

public static java.util.Properties getProperties()
Returns:
the properties