/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.cnr.iasi.giant.util;

import java.awt.Color;
import java.awt.Paint;
import java.util.HashMap;

/**
 *
 * @author Fabio Cumbo
 * @info GIANT
 * @version v1.0
 * @organization IASI-CNR : Istituto di Analisi dei Sistemi ed Informatica 
 *                  "Antonio Ruberti" - Consiglio Nazionale delle Ricerche
 * 
 */
public class ColorNodeUtil {
    
    private HashMap<String, String> region2hexColor;
    private HashMap<String, String> region2color;
    private HashMap<String, Paint> region2paint;
    
    public ColorNodeUtil() {
        initHexMap();
        initColorMap();
        initPaintMap();
    }
    
    public String getHexRegionColor(String region) {
        return region2hexColor.get(region);
    }
    
    public String getRegionColor(String region) {
        return region2color.get(region);
    }
    
    public Paint getPaint(String region) {
        return region2paint.get(region);
    }
    
    private void initHexMap() {
        region2hexColor = new HashMap<String, String>();
        region2hexColor.put("R1" , "#FF0000");
        region2hexColor.put("R2" , "#DDA0DD");
        region2hexColor.put("R3" , "#0000CC");
        region2hexColor.put("R4" , "#00FF00");
        region2hexColor.put("R5" , "#FFFF00");
        region2hexColor.put("R6" , "#FF00FF");
        region2hexColor.put("R7" , "#87CEEB");
    }
    
    private void initColorMap() {
        region2color = new HashMap<String, String>();
        region2color.put("R1" , "RED");
        region2color.put("R2" , "PINK");
        region2color.put("R3" , "BLUE");
        region2color.put("R4" , "GREEN");
        region2color.put("R5" , "YELLOW");
        region2color.put("R6" , "MAGENTA");
        region2color.put("R7" , "SKY-BLUE");
    }
    
    private void initPaintMap() {
        region2paint = new HashMap<String, Paint>();
        region2paint.put("R1" , Color.RED);
        region2paint.put("R2" , Color.PINK);
        region2paint.put("R3" , Color.BLUE);
        region2paint.put("R4" , Color.GREEN);
        region2paint.put("R5" , Color.YELLOW);
        region2paint.put("R6" , Color.MAGENTA);
        region2paint.put("R7" , Color.BLUE.brighter());
    }
    
}
