public class ImageMap extends TrianaPixelMap
pixelMap
NOT_CONNECTED, NOT_READY, OUT_OF_RANGE
Constructor and Description |
---|
ImageMap()
Default constructor.
|
ImageMap(double[][] matrix,
double toRed,
double toGreen,
double toBlue,
boolean loWhite,
boolean hiWhite,
boolean logarithmic)
Constuctor using a matrix and parameters that govern the map.
|
ImageMap(MatrixType parent,
double toRed,
double toGreen,
double toBlue,
boolean loWhite,
boolean hiWhite,
boolean logarithmic)
Constuctor using a MatrixType and parameters that govern the map.
|
Modifier and Type | Method and Description |
---|---|
int |
colorOf(double data)
Returns the Triana Color Map color value associated with a given data value.
|
protected void |
copyData(TrianaType source)
Implement the abstract copyData method of TrianaType.
|
TrianaType |
copyMe()
This is one of the most important methods of Triana data.
|
protected void |
copyParameters(TrianaType source)
Over-ride the copyParameters method to copy the parameter valid.
|
double |
dataFrom(int color)
Returns the data value associated with a particular color value.
|
double[] |
getColorKeyTable()
Returns the key table that lists the values of the input data associated with each color
|
MatrixType |
getParent()
Return a reference to the MatrixType parent so that its graphing information can be used.
|
boolean |
hasParent()
Return information as to whether a parent MatrixType exists.
|
boolean |
isHighWhite()
Returns true if the data values above that mapped to Blue are mapped to white, false if black
|
boolean |
isLogScale()
Returns true if the data values are mapped to colors logarithmically, false if linear
|
boolean |
isLowWhite()
Returns true if the data values below that mapped to Red are mapped to white, false if black
|
void |
setColorKeyTable(double[] newKeyTable)
Sets the key table that lists the values of the input data associated with each color
|
getPixelMap, getTrianaImage, isValid, setPixelMap, updateObsoletePointers
containerSize, dataExists, deleteFromContainer, getDataContainer, getFromContainer, getSequenceNumber, insertIntoContainer, inspectDataContainer, setDataContainer, setSequenceNumber
public ImageMap()
public ImageMap(double[][] matrix, double toRed, double toGreen, double toBlue, boolean loWhite, boolean hiWhite, boolean logarithmic)
matrix
- The input data matrixtoRed
- The data value mapped to the lowest color (0)toGreen
- The data value mapped to the middle color (127)toBlue
- The data value mapped to the highest color (255)loWhite
- true if values below toRed are white, false if blackhiWhite
- true if values above toBlue are white, false if blacklogarithmic
- true if the scaling to color values is logarithmic, false if linearpublic ImageMap(MatrixType parent, double toRed, double toGreen, double toBlue, boolean loWhite, boolean hiWhite, boolean logarithmic)
parent
- The input MatrixType whose data is usedtoRed
- The data value mapped to the lowest color (0)toGreen
- The data value mapped to the middle color (127)toBlue
- The data value mapped to the highest color (255)loWhite
- true if values below toRed are white, false if blackhiWhite
- true if values above toBlue are white, false if blacklogarithmic
- true if the scaling to color values is logarithmic, false if linearpublic double[] getColorKeyTable()
public boolean isHighWhite()
public boolean isLowWhite()
public boolean isLogScale()
public void setColorKeyTable(double[] newKeyTable)
newKeyTable
- The values of the input data for each colorpublic MatrixType getParent()
public boolean hasParent()
public int colorOf(double data)
data
- The data valuepublic double dataFrom(int color)
color
- The Triana Color Map color valuepublic TrianaType copyMe()
To override, the programmer should not invoke the super.copyMe method. Instead, create an object of the current type and call methods copyData and copyParameters. If these have been written correctly, then they will do the copying. The code should createTool, for type YourType:
YourType y = null; try { y = (YourType)getClass().newInstance(); y.copyData( this ); y.copyParameters( this ); y.setLegend( this.getLegend() ); } catch (IllegalAccessException ee) { System.out.println("Illegal Access: " + ee.getMessage()); } catch (InstantiationException ee) { System.out.println("Couldn't be instantiated: " + ee.getMessage()); } return y;
The copied object's data should be identical to the original. The method here modifies only one item: a String indicating that the object was created as a copy is added to the description StringVector.
copyMe
in class TrianaPixelMap
protected void copyData(TrianaType source)
copyData
in class TrianaPixelMap
source
- The TrianaImage whose image is being copiedprotected void copyParameters(TrianaType source)
copyParameters
in class TrianaPixelMap
source
- The object from which the copy will be made