forked from geodmms/xdgnjobs

?? ?
2008-06-09 bd210ee7438fd203c19d3e8080ea12b79fe56159
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/DefaultColorTable.java
@@ -6,7 +6,7 @@
public class DefaultColorTable implements ColorTableMapping
{
    private static DefaultColorTable _instance  = null;
    private static DefaultColorTable _instance = null;
    public static ColorTableMapping getInstance()
    {
@@ -19,6 +19,7 @@
    }
    private ArrayList<Color> colortable = null;
    private DefaultColorTable()
    {
        initializeColorTable();
@@ -328,36 +329,40 @@
        return false;
    }
    private static String colorToString(Color c) {
      char[] buf = new char[7];
      buf[0] = '#';
      String s = Integer.toHexString(c.getRed());
      if (s.length() == 1) {
         buf[1] = '0';
         buf[2] = s.charAt(0);
      }
      else {
         buf[1] = s.charAt(0);
         buf[2] = s.charAt(1);
      }
      s = Integer.toHexString(c.getGreen());
      if (s.length() == 1) {
         buf[3] = '0';
         buf[4] = s.charAt(0);
      }
      else {
         buf[3] = s.charAt(0);
         buf[4] = s.charAt(1);
      }
      s = Integer.toHexString(c.getBlue());
      if (s.length() == 1) {
         buf[5] = '0';
         buf[6] = s.charAt(0);
      }
      else {
         buf[5] = s.charAt(0);
         buf[6] = s.charAt(1);
      }
      return String.valueOf(buf);
   }
    private static String colorToString(Color c)
    {
        char[] buf = new char[7];
        buf[0] = '#';
        String s = Integer.toHexString(c.getRed());
        if (s.length() == 1)
        {
            buf[1] = '0';
            buf[2] = s.charAt(0);
        } else
        {
            buf[1] = s.charAt(0);
            buf[2] = s.charAt(1);
        }
        s = Integer.toHexString(c.getGreen());
        if (s.length() == 1)
        {
            buf[3] = '0';
            buf[4] = s.charAt(0);
        } else
        {
            buf[3] = s.charAt(0);
            buf[4] = s.charAt(1);
        }
        s = Integer.toHexString(c.getBlue());
        if (s.length() == 1)
        {
            buf[5] = '0';
            buf[6] = s.charAt(0);
        } else
        {
            buf[5] = s.charAt(0);
            buf[6] = s.charAt(1);
        }
        return String.valueOf(buf);
    }
}