|
|||||||||
Home >> All >> edu >> stanford >> genetics >> treeview >> [ dendroview overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |
edu.stanford.genetics.treeview.dendroview
Class ColorSet

java.lang.Objectedu.stanford.genetics.treeview.dendroview.ColorSet
- All Implemented Interfaces:
- edu.stanford.genetics.treeview.ConfigNodePersistent
- public class ColorSet
- extends java.lang.Object
- implements edu.stanford.genetics.treeview.ConfigNodePersistent
- extends java.lang.Object
This class represents a set of colors which can be used by a color extractor to translate data values into colors. NOTE: This class has been superceded by the ConfigColorSet in the edu.stanford.genetics.treeview package, although I am not likely to actually rewrite any of this code spontaneously.
- Version:
- @version $Revision: 1.2 $ $Date: 2003/06/23 08:03:07 $
Field Summary | |
private java.lang.String |
default_downColor
|
private java.lang.String |
default_emptyColor
|
private java.lang.String |
default_missingColor
|
private java.lang.String |
default_name
|
private java.lang.String |
default_upColor
|
private java.lang.String |
default_zeroColor
|
private java.awt.Color |
down
|
private java.awt.Color |
empty
|
private java.awt.Color |
missing
|
private java.lang.String |
name
|
private edu.stanford.genetics.treeview.ConfigNode |
root
|
private java.awt.Color |
up
|
private java.awt.Color |
zero
|
Constructor Summary | |
ColorSet()
Constructor for the ColorSet object, uses default values |
|
ColorSet(java.lang.String name,
java.lang.String up,
java.lang.String zero,
java.lang.String down,
java.lang.String missing,
java.lang.String empty)
Constructor for the ColorSet object |
Method Summary | |
void |
bindConfig(edu.stanford.genetics.treeview.ConfigNode root)
sets colors and name to reflect ConfigNode |
void |
copyStateFrom(ColorSet other)
copies colors and name from other color set. |
static java.awt.Color |
decodeColor(java.lang.String colorString)
Convert a color from a hex string to a Java Color object. |
static java.lang.String |
encodeColor(java.awt.Color color)
Convert a java Color object to a hex string. |
java.awt.Color |
getDown()
Color for negative values. |
java.awt.Color |
getEmpty()
Color for empty values. |
java.awt.Color |
getMissing()
Color for missing values. |
java.lang.String |
getName()
The name of this color set |
java.awt.Color |
getUp()
Color for positive values. |
java.awt.Color |
getZero()
color for zero values |
private static java.lang.String |
hex(int buf)
|
private static java.lang.String |
hexChar(int i)
|
void |
loadEisen(java.io.File file)
extract values from Eisen-formatted file |
void |
loadEisen(java.lang.String file)
extract values from Eisen-formatted file specified by the string argument The Eisen format is a 16 byte file. |
static void |
main(java.lang.String[] argv)
Simple test program, prints out default color set using toString. |
private void |
packEisen(java.awt.Color out,
java.io.OutputStream stream)
|
void |
saveEisen(java.io.File file)
save values to Eisen-formatted file sp |
void |
saveEisen(java.lang.String file)
save values to Eisen-formatted file specified by the String |
private void |
setDefaults()
|
void |
setDown(java.awt.Color newColor)
Color for negative values. |
void |
setDown(java.lang.String newString)
Color for negative values. |
void |
setEmpty(java.awt.Color newColor)
Color for empty values. |
void |
setEmpty(java.lang.String newString)
Color for empty values. |
void |
setMissing(java.awt.Color newColor)
Color for missing values. |
void |
setMissing(java.lang.String newString)
Color for missing values. |
void |
setName(java.lang.String name)
The name of this color set |
void |
setUp(java.awt.Color newColor)
Color for positive values. |
void |
setUp(java.lang.String newString)
Color for positive values. |
void |
setZero(java.awt.Color newColor)
color for zero values |
void |
setZero(java.lang.String newString)
color for zero values |
java.lang.String |
toString()
Convert this Object to a human-readable String. |
private java.awt.Color |
unpackEisen(java.io.InputStream stream)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
default_upColor
private java.lang.String default_upColor
default_zeroColor
private java.lang.String default_zeroColor
default_downColor
private java.lang.String default_downColor
default_missingColor
private java.lang.String default_missingColor
default_emptyColor
private java.lang.String default_emptyColor
default_name
private java.lang.String default_name
name
private java.lang.String name
up
private java.awt.Color up
zero
private java.awt.Color zero
down
private java.awt.Color down
missing
private java.awt.Color missing
empty
private java.awt.Color empty
root
private edu.stanford.genetics.treeview.ConfigNode root
Constructor Detail |
ColorSet
public ColorSet()
- Constructor for the ColorSet object,
uses default values
ColorSet
public ColorSet(java.lang.String name, java.lang.String up, java.lang.String zero, java.lang.String down, java.lang.String missing, java.lang.String empty)
- Constructor for the ColorSet object
Method Detail |
setDefaults
private void setDefaults()
copyStateFrom
public void copyStateFrom(ColorSet other)
- copies colors and name from other color set.
bindConfig
public void bindConfig(edu.stanford.genetics.treeview.ConfigNode root)
- sets colors and name to reflect
ConfigNode
- Specified by:
bindConfig
in interfaceedu.stanford.genetics.treeview.ConfigNodePersistent
main
public static final void main(java.lang.String[] argv)
- Simple test program, prints out default color set using toString.
if argument present, saves EisenFormat to specified file.
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string concatenation with this object. If the result is
null
, string concatenation will instead use"null"
.The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode())
.
loadEisen
public void loadEisen(java.lang.String file) throws java.io.IOException
- extract values from Eisen-formatted file specified by the string argument The
Eisen format is a 16 byte file. The first four bytes are interpreted as RBGA
values specifying red, green, blue and alpha values from 0-255 (00 - FF in base
16) for up-regulated genes, the next four are the values for unchanged, then
down regulated, then the color for missing values.
loadEisen
public void loadEisen(java.io.File file) throws java.io.IOException
- extract values from Eisen-formatted file
saveEisen
public void saveEisen(java.lang.String file) throws java.io.IOException
- save values to Eisen-formatted file specified by the String
saveEisen
public void saveEisen(java.io.File file) throws java.io.IOException
- save values to Eisen-formatted file sp
unpackEisen
private java.awt.Color unpackEisen(java.io.InputStream stream) throws java.io.IOException
packEisen
private void packEisen(java.awt.Color out, java.io.OutputStream stream) throws java.io.IOException
getUp
public java.awt.Color getUp()
- Color for positive values.
getZero
public java.awt.Color getZero()
- color for zero values
getDown
public java.awt.Color getDown()
- Color for negative values.
getMissing
public java.awt.Color getMissing()
- Color for missing values.
getEmpty
public java.awt.Color getEmpty()
- Color for empty values.
getName
public java.lang.String getName()
- The name of this color set
setUp
public void setUp(java.lang.String newString)
- Color for positive values.
setZero
public void setZero(java.lang.String newString)
- color for zero values
setDown
public void setDown(java.lang.String newString)
- Color for negative values.
setMissing
public void setMissing(java.lang.String newString)
- Color for missing values.
setEmpty
public void setEmpty(java.lang.String newString)
- Color for empty values.
setUp
public void setUp(java.awt.Color newColor)
- Color for positive values.
setZero
public void setZero(java.awt.Color newColor)
- color for zero values
setDown
public void setDown(java.awt.Color newColor)
- Color for negative values.
setMissing
public void setMissing(java.awt.Color newColor)
- Color for missing values.
setEmpty
public void setEmpty(java.awt.Color newColor)
- Color for empty values.
setName
public void setName(java.lang.String name)
- The name of this color set
decodeColor
public static final java.awt.Color decodeColor(java.lang.String colorString)
- Convert a color from a hex string to a Java
Color
object.
encodeColor
public static final java.lang.String encodeColor(java.awt.Color color)
- Convert a java
Color
object to a hex string.
hex
private static final java.lang.String hex(int buf)
hexChar
private static final java.lang.String hexChar(int i)
|
|||||||||
Home >> All >> edu >> stanford >> genetics >> treeview >> [ dendroview overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |