/**
  * @see
  *     org.locationtech.udig.project.internal.render.impl.RendererImpl#setContext(org.locationtech.udig.project.render.RenderContext)
  */
 @SuppressWarnings("unchecked")
 public void setContext(IRenderContext newContext) {
   if (context != null) {
     ((CompositeRenderContext) context).removeListener(contextListener);
   }
   if (newContext != null) {
     CompositeRenderContext compositeRenderContext = (CompositeRenderContext) newContext;
     compositeRenderContext.addListener(contextListener);
     for (IRenderContext context : compositeRenderContext.getContexts()) {
       if (findExecutor(context) == null) {
         Renderer renderer = getRendererCreator(context).getRenderer((RenderContext) context);
         getRenderExecutors().add(createRenderExecutor(renderer));
       }
     }
     super.setContext(newContext);
   }
 }
  private boolean isFullAlphaUsed(RenderExecutor executor) {

    Object object = getContext().getMap().getBlackboard().get("MYLAR"); // $NON-NLS-1$

    if (object == null || !((Boolean) object).booleanValue()) return true;

    if (executor.getContext() instanceof CompositeRenderContext) {
      CompositeRenderContext context = (CompositeRenderContext) executor.getContext();
      if (context.getLayers().contains(getContext().getSelectedLayer())) return true;

      return false;
    }

    if (executor.getContext().getLayer() == getContext().getSelectedLayer()) return true;

    return false;
  }