Package org.broad.igv.renderer

Examples of org.broad.igv.renderer.AbstractColorScale


                            log.error("Error parsing range string: " + rangeString, e);
                        }
                    }
                }

                AbstractColorScale scale = null;
                if (tokens.length == 3) {
                    Color baseColor = ColorUtilities.stringToColor(tokens[2]);
                    scale = new MonocolorScale(min, max, baseColor);
                    colorScales.put(attKey, scale);
                } else {
View Full Code Here


        final ColumnMetaData metaData = columnMetaData.get(attKey.toUpperCase());
        if (metaData == null) {
            return Color.gray;
        }
        if (metaData.isNumeric()) {
            AbstractColorScale cs = colorScales.get(attKey);
            {
                if (cs == null) {
                    // Create color scale based loosely on Brewer diverging / sequential palletes
                    // TODO -- use actual brewer palletes if # of values < 8
                    if (metaData.isDiverging()) {
                        // reg-blue diverging
                        Color minColor = new Color(198, 219, 239);
                        Color midColor = Color.white;
                        Color maxColor = new Color(33, 102, 172);
                        cs = new ContinuousColorScale(metaData.getMin(), 0, metaData.getMax(), minColor, midColor, maxColor);
                        colorScales.put(attKey, cs);

                    } else {
                        // Blues scale
                        Color minColor = new Color(198, 219, 239);
                        Color maxColor = new Color(8, 69, 148);
                        cs = new ContinuousColorScale(metaData.getMin(), metaData.getMax(), minColor, maxColor);
                        colorScales.put(attKey, cs);
                    }
                }
                try {
                    float x = Float.parseFloat(attValue);
                    return cs.getColor(x);
                } catch (NumberFormatException e) {
                    return Color.lightGray;
                }

View Full Code Here

TOP

Related Classes of org.broad.igv.renderer.AbstractColorScale

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.