|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<CPTVal>
org.opensha.commons.util.cpt.CPT
public class CPT
This class represents a GMT CPT file.
| Field Summary | |
|---|---|
Blender |
blender
|
static String |
XML_METADATA_NAME
|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
CPT()
Constructor which has no colors except for the default nanColor as Color.ORANGE,gapColor as Color.MAGENTA , belowMin as Color.BLACK, and aboveMax as Color.WHITE. |
|
CPT(String name)
|
|
| Method Summary | |
|---|---|
CPT |
asLog10()
|
CPT |
asPow10()
|
Object |
clone()
|
static CPT |
fromXMLMetadata(Element cptElem)
|
Color |
getAboveMaxColor()
|
Color |
getBelowMinColor()
|
Blender |
getBlender()
|
Color |
getColor(float value)
This returns a color given a value for this specific CPT file or null if the color is undefined |
CPTVal |
getCPTVal(float value)
Does a lookup for the color range (CPTVal) associated with this value |
Color |
getGapColor()
|
Color |
getMaxColor()
|
float |
getMaxValue()
|
Color |
getMinColor()
|
float |
getMinValue()
|
String |
getName()
Returns the name of this object |
Color |
getNaNColor()
|
static CPT |
loadFromFile(File dataFile)
This loads a CPT file into a CPT object The CPT format can be found here: http://hraun.vedur.is/~gg/hugb/gmt/doc/html/tutorial/node68.html The default overflow and underflow colors are the colors associated with the min and max values of the CPT file |
static CPT |
loadFromStream(InputStream is)
|
static void |
main(String[] args)
|
void |
paintGrid(BufferedImage bi)
|
CPT |
rescale(double min,
double max)
|
CPT |
reverse()
|
void |
setAboveMaxColor(Color color)
Set The value of the color returned by getColor if the value is above the range of the CPT class using r,g,b values as used in Color3f. |
void |
setAboveMaxColor(int r,
int g,
int b)
|
void |
setBelowMinColor(Color color)
Set The value of the color returned by getColor if the value is below the range of the CPT class using r,g,b values as used in Color3f. |
void |
setBelowMinColor(int r,
int g,
int b)
|
void |
setBlender(Blender blender)
|
void |
setCPTVal(CPTVal newcpt)
Adds the cpt_val into this list. |
void |
setGapColor(Color color)
Sets the color to be take on for values in the range of the minValue and maxValue, but without a specified color |
void |
setGapColor(int r,
int g,
int b)
|
void |
setName(String name)
|
void |
setNanColor(Color color)
Sets color to be used when given value is not a number (NaN) |
void |
setNanColor(int r,
int g,
int b)
Sets color to be used when given value is not a number (NaN) |
static String |
tabDelimColor(Color color)
|
String |
toString()
|
Element |
toXMLMetadata(Element root)
|
void |
writeCPTFile(File file)
|
void |
writeCPTFile(String fileName)
|
| Methods inherited from class java.util.ArrayList |
|---|
add, add, addAll, addAll, clear, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
equals, hashCode, iterator, listIterator, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, removeAll, retainAll |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
| Field Detail |
|---|
public static final String XML_METADATA_NAME
public Blender blender
| Constructor Detail |
|---|
public CPT()
ArrayListpublic CPT(String name)
| Method Detail |
|---|
public void setNanColor(int r,
int g,
int b)
r - g - b - for more information on rgb values.public void setNanColor(Color color)
Colorpublic void setBelowMinColor(Color color)
Colorpublic void setAboveMaxColor(Color color)
Colorpublic void setGapColor(Color color)
color -
public void setGapColor(int r,
int g,
int b)
setGapColor(Color3f color),
Color
public void setBelowMinColor(int r,
int g,
int b)
setBelowMinColor(Color3f color),
Color
public void setAboveMaxColor(int r,
int g,
int b)
setAboveMaxColor(Color3f color),
Colorpublic Color getAboveMaxColor()
public Color getBelowMinColor()
public Color getMinColor()
public Color getMaxColor()
public Color getNaNColor()
public Color getGapColor()
public Color getColor(float value)
value -
public static CPT loadFromFile(File dataFile)
throws FileNotFoundException,
IOException
dataFile -
FileNotFoundException
IOException
public static CPT loadFromStream(InputStream is)
throws IOException
IOExceptionpublic Element toXMLMetadata(Element root)
toXMLMetadata in interface XMLSaveablepublic static CPT fromXMLMetadata(Element cptElem)
public void writeCPTFile(String fileName)
throws IOException
IOException
public void writeCPTFile(File file)
throws IOException
IOExceptionpublic Blender getBlender()
public void setBlender(Blender blender)
blender, - the blender to be usedBlenderpublic CPTVal getCPTVal(float value)
containingValue -
public void setCPTVal(CPTVal newcpt)
cpt_val - public void paintGrid(BufferedImage bi)
public static String tabDelimColor(Color color)
public String toString()
toString in class AbstractCollection<CPTVal>public float getMinValue()
public float getMaxValue()
public static void main(String[] args)
throws FileNotFoundException,
IOException
FileNotFoundException
IOExceptionpublic String getName()
Named
getName in interface Namedpublic void setName(String name)
public Object clone()
clone in class ArrayList<CPTVal>public CPT asLog10()
public CPT asPow10()
public CPT rescale(double min,
double max)
public CPT reverse()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||