protected String shortenName(String name, int desiredLength)
public String shortenName(String name, int desiredLength)
    protected String shortenName(String name, int desiredLength)    {        // TODO: Find an algorithm that generates unique names        int originalLength = name.length();        if ((desiredLength <= 0) || (originalLength <= desiredLength))        {            return name;        }        int delta    = originalLength - desiredLength;        int startCut = desiredLength / 2;        StringBuffer result = new StringBuffer();        result.append(name.substring(0, startCut));        if (((startCut == 0) || (name.charAt(startCut - 1) != '_')) &&            ((startCut + delta + 1 == originalLength) || (name.charAt(startCut + delta + 1) != '_')))        {            // just to make sure that there isn't already a '_' right before or right            // after the cutting place (which would look odd with an aditional one)            result.append("_");        }        result.append(name.substring(startCut + delta + 1, originalLength));        return result.toString();    }