/** Draws the background annoations. */
        private void draw(
            final ExecutionUnit process,
            final Graphics2D g2,
            final ProcessRendererModel rendererModel,
            final boolean printing) {
          if (!visualizer.isActive()) {
            return;
          }

          // background annotations
          WorkflowAnnotations annotations = rendererModel.getProcessAnnotations(process);
          if (annotations != null) {
            for (WorkflowAnnotation anno : annotations.getAnnotationsDrawOrder()) {
              // selected is drawn by highlight decorator
              if (anno.equals(model.getSelected())) {
                continue;
              }

              // paint the annotation itself
              Graphics2D g2P = (Graphics2D) g2.create();
              drawer.drawAnnotation(anno, g2P, printing);
              g2P.dispose();
            }
          }
        }
 /** Draws the annotation icon on operators. */
 private void draw(
     final Operator operator,
     final Graphics2D g2,
     final ProcessRendererModel rendererModel,
     final boolean printing) {
   // Draw annotation icons regardless of active state
   WorkflowAnnotations annotations = rendererModel.getOperatorAnnotations(operator);
   if (annotations == null || annotations.isEmpty()) {
     return;
   }
   Rectangle2D frame = rendererModel.getOperatorRect(operator);
   int xOffset = (IMAGE_ANNOTATION.getIconWidth() + 2) * 2;
   ProcessDrawUtils.getIcon(operator, IMAGE_ANNOTATION)
       .paintIcon(
           null,
           g2,
           (int) (frame.getX() + frame.getWidth() - xOffset),
           (int) (frame.getY() + frame.getHeight() - IMAGE_ANNOTATION.getIconHeight() - 1));
 }
        /** Draws the selected annotation. */
        private void draw(
            final ExecutionUnit process,
            final Graphics2D g2,
            final ProcessRendererModel rendererModel,
            final boolean printing) {
          if (!visualizer.isActive()) {
            return;
          }

          // paint the selected annotation
          WorkflowAnnotation selected = model.getSelected();
          if (selected != null) {
            // only draw in correct execution unit
            if (selected.getProcess().equals(process)) {
              // only paint annotation if not editing
              if (editPane == null) {
                // paint the annotation itself
                Graphics2D g2P = (Graphics2D) g2.create();
                drawer.drawAnnotation(selected, g2P, printing);
                g2P.dispose();
              } else {
                // only paint shadow
                Rectangle2D loc = selected.getLocation();
                g2.draw(
                    new Rectangle2D.Double(
                        loc.getX() - 1,
                        loc.getY() - 1,
                        editPane.getBounds().getWidth() + 1,
                        editPane.getBounds().getHeight() + 1));
                Rectangle2D shadowFrameEditor =
                    new Rectangle2D.Double(
                        loc.getX(),
                        loc.getY(),
                        editPane.getBounds().getWidth() + 1,
                        editPane.getBounds().getHeight() + 1);
                ProcessDrawUtils.drawShadow(shadowFrameEditor, g2);
                if (editPanel != null) {
                  Point absolute = new Point(editPanel.getX(), editPanel.getY());
                  Point relative =
                      ProcessDrawUtils.convertToRelativePoint(
                          absolute, rendererModel.getProcessIndex(process), rendererModel);
                  Rectangle2D shadowFramePanel =
                      new Rectangle2D.Double(
                          relative.getX(), relative.getY(), EDIT_PANEL_WIDTH, EDIT_PANEL_HEIGHT);
                  ProcessDrawUtils.drawShadow(shadowFramePanel, g2);
                }
              }
            }
          }
        }
        /** Draws the annotation for the given operator (if he has one). */
        private void drawOpAnno(
            final Operator operator,
            final Graphics2D g2,
            final ProcessRendererModel rendererModel,
            final boolean printing) {
          WorkflowAnnotations annotations = rendererModel.getOperatorAnnotations(operator);
          if (annotations == null) {
            return;
          }
          for (WorkflowAnnotation anno : annotations.getAnnotationsDrawOrder()) {
            // selected is drawn by highlight decorator
            if (anno.equals(model.getSelected())) {
              continue;
            }

            // paint the annotation itself
            Graphics2D g2P = (Graphics2D) g2.create();
            drawer.drawAnnotation(anno, g2P, printing);
            g2P.dispose();
          }
        }
        /** Draws the operator annoations. */
        private void draw(
            final ExecutionUnit process,
            final Graphics2D g2,
            final ProcessRendererModel rendererModel,
            final boolean printing) {
          if (!visualizer.isActive()) {
            return;
          }

          // operator attached annotations
          List<Operator> selectedOperators = rendererModel.getSelectedOperators();
          for (Operator operator : process.getOperators()) {
            if (selectedOperators.contains(operator)) {
              continue;
            }
            drawOpAnno(operator, g2, rendererModel, printing);
          }
          // selected operators annotations need to be drawn over non selected ones
          for (Operator selOp : selectedOperators) {
            if (process.equals(selOp.getExecutionUnit())) {
              drawOpAnno(selOp, g2, rendererModel, printing);
            }
          }
        }