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