コード例 #1
0
        /** 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();
            }
          }
        }
コード例 #2
0
 /** 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));
 }
コード例 #3
0
        /** 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();
          }
        }