Package org.codemap.util

Examples of org.codemap.util.MColor


public class ColorsTest {
 
  @Test
  public void compareColorValues() {
    assertEquals(Color.BLUE.getRGB(), new MColor(0,0,255).asRGB());
    assertEquals(new Color(123, 123, 123).getRGB(), new MColor(123, 123, 123).asRGB());
  }
View Full Code Here


  private void updateColors() {
    if (!enabled) return;
    Value<MapScheme<MColor>> colorValue = theController.getActiveMap().getValues().colorScheme;

    HeatMapColors heatMap = new HeatMapColors(HISTORY_LENGTH);
    MColor cold = heatMap.getColdest();
   
    CodemapColors colorScheme = new CodemapColors(cold);
    for(String each: history) { // from hottest to cold
      colorScheme.setColor(each, heatMap.colder());      
    }
View Full Code Here

        current += step;
        return makeColor(getColorArray()[index]);
    }

    private MColor makeColor(int[] color) {
        return new MColor(color[0], color[1], color[2]);
    }
View Full Code Here

        GC gc = new GC(background);
       
        String makeRed = "MapPerProject";
       
        CodemapColors colors = new CodemapColors();
        colors.setColor(makeRed, new MColor(255, 0, 0));
        Iterable<Location> locations = mapInstance.locations();
        ColorBrewer colorBrewer = new ColorBrewer();
        for (Location location : locations) {
            MColor color = colorBrewer.forPackage(location.getDocument());
            colors.setColor(location.getDocument(), color);
        }
       
        Color black = new Color(gc.getDevice(), 0, 0, 0);
        gc.setBackground(black);
View Full Code Here

                    continue;
                }
                // get color from location a.k.a. hill colors
                nnStopWatch.start();
                Location nearestNeighbor = map.nearestNeighbor(x, y);
                MColor mcolor;
                if (nearestNeighbor == null) {
                    mcolor = colorScheme().getHillColor();
                } else {
                    mcolor = colors.forLocation(nearestNeighbor.getPoint());                   
                }
                nnStopWatch.stop();
                // make rgb
                int baseIndex = i*3;
                imageBytes[baseIndex++] = (byte) mcolor.getRed(); // R
                imageBytes[baseIndex++] = (byte) mcolor.getGreen(); // G
                imageBytes[baseIndex++] = (byte) mcolor.getBlue(); // B
               
                // make alpha
                // 0 for fully transparent
                // 255 for fully opaque
                double f = shade[x][y];
View Full Code Here

        for (Pair<String, Double> pair : lastCoverageInfo) {
            String identifier = pair.fst;
            Double ratio = pair.snd;
            int redVal = (int) ((1 - ratio) * 255);
            int greenVal = (int) (ratio * 255);
            MColor col = new MColor(redVal, greenVal, 0);
            colorScheme.setColor(identifier, col);
        }
        colorValue.setValue(colorScheme);
    }
View Full Code Here

        HashMap<String, List<String>> forPackage = findPackageDeclarations();
       
        GoodColorGenerator colors = new GoodColorGenerator(forPackage.keySet().size());
       
        for(String pack: forPackage.keySet()) {
            MColor col = colors.next();
            List<String> classes = forPackage.get(pack);
            for(String clazz: classes) {
                colorScheme.setColor(clazz, col);
            }
        }
View Full Code Here

TOP

Related Classes of org.codemap.util.MColor

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.