public class MarsRegion extends AbstractJsonConvertibleRecord implements JsonConvertibleRecord
Molecule
s and
MarsMetadata
s can contain a list of these regions, which are used
when running several commands including KCPCommand
,
SigmaCalculatorCommand
, KCPCommand
,
RegionDifferenceCalculatorCommand
, VarianceCalculatorCommand
.
Region definitions include name, start value, end value, column (Time (s) or slice or otherwise), color (in hex), and opacity (range 0 to 1). These values are used by mars-fx to draw regions on plots based on the start, end color and opacity.
Opacity specified in the hex code is ignored. The opacity setting overrides the value in the hex string.
Constructor and Description |
---|
MarsRegion(com.fasterxml.jackson.core.JsonParser jParser)
Constructor for creating a plot region given a json stream.
|
MarsRegion(java.lang.String name)
Constructor for creating a plot region of a given name with default
settings.
|
MarsRegion(java.lang.String name,
java.lang.String column,
double start,
double end,
java.lang.String color,
double opacity)
Constructor for creating a plot region using known parameters.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createIOMaps()
Must be implemented in subclasses to define how fields, objects, arrays
should be saved based on the Jackson streaming API.
|
java.lang.String |
getColor()
Get the string color of the region in hex.
|
java.lang.String |
getColumn()
Get the name of the column the start and end values refer to.
|
double |
getEnd()
Get the upper bound of the region.
|
java.lang.String |
getName()
Get the name of the region.
|
double |
getOpacity()
Get the opacity of the region.
|
double |
getStart()
Get lower bound of the region.
|
void |
setColor(java.lang.String color)
Set the hex color string.
|
void |
setColumn(java.lang.String column)
Set the name of the column the start and end values refer to.
|
void |
setEnd(double end)
Set the upper bound of the region.
|
void |
setName(java.lang.String name)
Set the region name.
|
void |
setOpacity(double opacity)
Set the opacity of the region.
|
void |
setStart(double start)
Set the lower bound of the region.
|
dumpJSON, fromJSON, getJsonGenerator, getJsonParser, setJsonField, setShowWarnings, toJSON
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dumpJSON, fromJSON, getJsonGenerator, getJsonParser, setJsonField, setShowWarnings, toJSON
public MarsRegion(java.lang.String name)
name
- Name of the region.public MarsRegion(com.fasterxml.jackson.core.JsonParser jParser) throws java.io.IOException
jParser
- Json stream used to build the object.java.io.IOException
- Thrown if unable to parse Json from the JsonParser
stream.public MarsRegion(java.lang.String name, java.lang.String column, double start, double end, java.lang.String color, double opacity)
name
- Name of the region.column
- Name of column the region refers to.start
- Starting value of the region.end
- Ending value of the region.color
- Color string in hex format.opacity
- Opacity of the region between 0 and 1.protected void createIOMaps()
AbstractJsonConvertibleRecord
createIOMaps
in class AbstractJsonConvertibleRecord
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The region name.public java.lang.String getColumn()
public void setColumn(java.lang.String column)
column
- The column name.public java.lang.String getColor()
public void setColor(java.lang.String color)
color
- The hex color string.public double getStart()
public void setStart(double start)
start
- The lower bound of the region.public double getEnd()
public void setEnd(double end)
end
- The upper bound of the region.public void setOpacity(double opacity)
opacity
- The opacity of the region.public double getOpacity()