|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ohf.stem.ui.ge.Aspect
public class Aspect
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 |
---|
public static final java.lang.String PROPERTIES_NAME
public static final double[] DEFAULT_RANGE
public static final int[] DEFAULT_OPACITY
Constructor Detail |
---|
public Aspect(java.lang.String code, java.lang.String name)
code
- name
- id
- Method Detail |
---|
public static void setup()
public boolean isSane()
public static Aspect getAspect(java.lang.String code)
code
-
public static boolean exists(java.lang.String aspectCode)
aspectCode
-
public static java.util.Map<java.lang.String,Aspect> getMap()
public static void setMap(java.util.Map<java.lang.String,Aspect> map)
map
- the map to setpublic java.lang.String getCode()
public void setCode(java.lang.String newcode)
newcode
- the code to setpublic java.lang.String getName()
public void setName(java.lang.String name)
name
- the name to setpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- the description to setpublic double[] getRange()
public double getRange(int n)
n
- entry within the array
public void setRange(java.lang.String range)
range
- the range to setpublic int[] getOpacity()
public int getOpacity(int n)
n
- entry the list to get
public void setOpacity(java.lang.String opacity)
opacity
- comma separated listpublic void setRed(java.lang.String color)
color
- range of colorspublic void setGreen(java.lang.String color)
color
- range of colorspublic void setBlue(java.lang.String color)
color
- range of colorspublic int getRed(int n)
n
- list entry
public int getGreen(int n)
n
- list entry
public int getBlue(int n)
n
- list entry
public void setRange(double[] range)
range
- the range to setpublic java.lang.String getType()
public void setType(java.lang.String type)
type
- the type to setpublic static Aspect getDefault()
public static java.lang.String getDefaultCode()
public static void setDefaultCode(java.lang.String defaultAspectCode)
defaultAspectCode
- the aspect to setpublic java.lang.String getUnit()
public void setUnit(java.lang.String unit)
unit
- the unit to setpublic static java.lang.String getKmlDisplayClass()
public static java.util.Properties getProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |