- c = getControlPanel().getAnnotationColors().get( ann.asSimpleText().toString() );
- if ( c == null ) {
- c = getTreeColorSet().getAnnotationColor();
+ final StringBuilder sb = new StringBuilder();
+ for( final Annotation a : ann ) {
+ sb.append( !ForesterUtil.isEmpty( a.getRef() ) ? a.getRef() : a.getDesc() );
+ }
+ final String ann_str = sb.toString();
+ if ( !ForesterUtil.isEmpty( ann_str ) ) {
+ c = getControlPanel().getAnnotationColors().get( ann_str );
+ if ( c == null ) {
+ c = AptxUtil.calculateColorFromString( ann_str );
+ getControlPanel().getAnnotationColors().put( ann_str, c );
+ }
+ if ( c == null ) {
+ c = getTreeColorSet().getAnnotationColor();
+ }