public void registerPainter ( Painter painter ) { if ( painters . containsKey ( painter . getPaintableClassName ( ) ) ) { List < Painter > list = painters . remove ( painter . getPaintableClassName ( ) ) ; list . add ( painter ) ; this . painters . put ( painter . getPaintableClassName ( ) , list ) ; } else { List < Painter > list = new ArrayList < Painter > ( ) ; list . add ( painter ) ; this . painters . put ( painter . getPaintableClassName ( ) , list ) ; } }
Register a new painter to this visitor .