public boolean isOptimizedDrawingEnabled() {
   return !myGlassPane.hasPainters() && myGlassPane.getComponentCount() == 0;
 }