org.activiti.engine.impl.bpmn.diagram
类 ProcessDiagramCanvas

java.lang.Object
  继承者 org.activiti.engine.impl.bpmn.diagram.ProcessDiagramCanvas

public class ProcessDiagramCanvas
extends Object

Represents a canvas on which BPMN 2.0 constructs can be drawn. Some of the icons used are licenced under a Creative Commons Attribution 2.5 License, see http://www.famfamfam.com/lab/icons/silk/

作者:
Joram Barrez
另请参见:
ProcessDiagramGenerator

字段摘要
protected  String activityFontName
           
protected static Font ANNOTATION_FONT
           
protected static Stroke ANNOTATION_STROKE
           
protected static int ANNOTATION_TEXT_PADDING
           
protected static int ARROW_WIDTH
           
protected static Stroke ASSOCIATION_STROKE
           
protected static Color BOUNDARY_EVENT_COLOR
           
protected static Image BUSINESS_RULE_TASK_IMAGE
           
protected  int canvasHeight
           
protected  int canvasWidth
           
protected  boolean closed
           
protected static Color CONDITIONAL_INDICATOR_COLOR
           
protected static int CONDITIONAL_INDICATOR_WIDTH
           
protected static int DEFAULT_INDICATOR_WIDTH
           
protected static Stroke END_EVENT_STROKE
           
protected static Image ERROR_CATCH_IMAGE
           
protected static Image ERROR_THROW_IMAGE
           
protected static Stroke EVENT_SUBPROCESS_STROKE
           
protected static int FONT_SIZE
           
protected static int FONT_SPACING
           
protected  FontMetrics fontMetrics
           
protected  Graphics2D g
           
protected static Stroke GATEWAY_TYPE_STROKE
           
protected static Color HIGHLIGHT_COLOR
           
protected static Stroke HIGHLIGHT_FLOW_STROKE
           
protected static int ICON_PADDING
           
protected static int ICON_SIZE
           
protected static Stroke INTERRUPTING_EVENT_STROKE
           
protected static Color LABEL_COLOR
           
protected static Font LABEL_FONT
           
protected  String labelFontName
           
protected static int LINE_HEIGHT
           
protected static org.slf4j.Logger LOGGER
           
protected static Image MANUALTASK_IMAGE
           
protected static int MARKER_WIDTH
           
protected  int minX
           
protected  int minY
           
protected static Stroke MULTI_INSTANCE_STROKE
           
protected  BufferedImage processDiagram
           
protected static Image RECEIVETASK_IMAGE
           
protected static Image SCRIPTTASK_IMAGE
           
protected static Image SENDTASK_IMAGE
           
protected static Image SERVICETASK_IMAGE
           
protected static Image SIGNAL_CATCH_IMAGE
           
protected static Image SIGNAL_THROW_IMAGE
           
protected static Color SUBPROCESS_BOX_COLOR
           
protected static Color TASK_BOX_COLOR
           
protected static Font TASK_FONT
           
protected static int TEXT_PADDING
           
protected static Stroke THICK_TASK_BORDER_STROKE
           
protected static Image TIMER_IMAGE
           
protected static Image USERTASK_IMAGE
           
 
构造方法摘要
ProcessDiagramCanvas(int width, int height)
          Creates an empty canvas with given width and height.
ProcessDiagramCanvas(int width, int height, int minX, int minY)
          Creates an empty canvas with given width and height.
 
方法摘要
 void close()
          Closes the canvas which dissallows further drawing and releases graphical resources.
 void drawActivityMarkers(int x, int y, int width, int height, boolean multiInstanceSequential, boolean multiInstanceParallel, boolean collapsed)
           
 void drawArrowHead(Line2D.Double line)
           
 void drawAssociation(int[] xPoints, int[] yPoints, org.activiti.bpmn.model.AssociationDirection associationDirection, boolean highLighted)
           
 void drawBusinessRuleTask(String name, int x, int y, int width, int height)
           
 void drawCatchingErrorEvent(int x, int y, int width, int height, boolean isInterrupting)
           
 void drawCatchingErrorEvent(String name, int x, int y, int width, int height, boolean isInterrupting)
           
 void drawCatchingEvent(int x, int y, int width, int height, boolean isInterrupting, Image image)
           
 void drawCatchingSignalEvent(int x, int y, int width, int height, boolean isInterrupting)
           
 void drawCatchingSignalEvent(String name, int x, int y, int width, int height, boolean isInterrupting)
           
 void drawCatchingTimerEvent(int x, int y, int width, int height, boolean isInterrupting)
           
 void drawCatchingTimerEvent(String name, int x, int y, int width, int height, boolean isInterrupting)
           
 void drawCollapsedCallActivity(String name, int x, int y, int width, int height)
           
 void drawCollapsedMarker(int x, int y, int width, int height)
           
 void drawCollapsedSubProcess(String name, int x, int y, int width, int height, Boolean isTriggeredByEvent)
           
protected  void drawCollapsedTask(String name, int x, int y, int width, int height, boolean thickBorder)
           
 void drawConditionalSequenceFlowIndicator(Line2D.Double line)
           
 void drawConnection(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, String connectionType, org.activiti.bpmn.model.AssociationDirection associationDirection, boolean highLighted)
           
 void drawDefaultSequenceFlowIndicator(Line2D.Double line)
           
 void drawErrorEndEvent(int x, int y, int width, int height)
           
 void drawErrorEndEvent(String name, int x, int y, int width, int height)
           
 void drawErrorStartEvent(int x, int y, int width, int height)
           
 void drawEventBasedGateway(int x, int y, int width, int height)
           
 void drawExclusiveGateway(int x, int y, int width, int height)
           
 void drawExpandedSubProcess(String name, int x, int y, int width, int height, Boolean isTriggeredByEvent)
           
 void drawGateway(int x, int y, int width, int height)
           
 void drawHighLight(int x, int y, int width, int height)
           
 void drawInclusiveGateway(int x, int y, int width, int height)
           
 void drawLabel(String text, int x, int y, int width, int height)
           
 void drawLabel(String text, int x, int y, int width, int height, boolean centered)
           
 void drawManualTask(String name, int x, int y, int width, int height)
           
 void drawMultiInstanceMarker(boolean sequential, int x, int y, int width, int height)
           
protected  void drawMultilineAnnotationText(String text, int x, int y, int boxWidth, int boxHeight)
           
protected  void drawMultilineCentredText(String text, int x, int y, int boxWidth, int boxHeight)
           
protected  void drawMultilineText(String text, int x, int y, int boxWidth, int boxHeight, boolean centered)
           
 void drawNoneEndEvent(int x, int y, int width, int height)
           
 void drawNoneStartEvent(int x, int y, int width, int height)
           
 void drawParallelGateway(int x, int y, int width, int height)
           
 void drawPoolOrLane(String name, int x, int y, int width, int height)
           
 void drawReceiveTask(String name, int x, int y, int width, int height)
           
 void drawScriptTask(String name, int x, int y, int width, int height)
           
 void drawSendTask(String name, int x, int y, int width, int height)
           
 void drawSequenceflow(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, boolean highLighted)
           
 void drawSequenceflow(int srcX, int srcY, int targetX, int targetY, boolean conditional)
           
 void drawSequenceflow(int srcX, int srcY, int targetX, int targetY, boolean conditional, boolean highLighted)
           
 void drawSequenceflowWithoutArrow(int srcX, int srcY, int targetX, int targetY, boolean conditional)
           
 void drawSequenceflowWithoutArrow(int srcX, int srcY, int targetX, int targetY, boolean conditional, boolean highLighted)
           
 void drawServiceTask(String name, int x, int y, int width, int height)
           
 void drawStartEvent(int x, int y, int width, int height, Image image)
           
 void drawTask(String name, int x, int y, int width, int height)
           
protected  void drawTask(String name, int x, int y, int width, int height, boolean thickBorder)
           
 void drawTextAnnotation(String text, int x, int y, int width, int height)
           
 void drawThrowingNoneEvent(int x, int y, int width, int height)
           
 void drawThrowingSignalEvent(int x, int y, int width, int height)
           
 void drawTimerStartEvent(int x, int y, int width, int height)
           
 void drawUserTask(String name, int x, int y, int width, int height)
           
protected  String fitTextToWidth(String original, int width)
           
 InputStream generateImage(String imageType)
          Generates an image of what currently is drawn on the canvas.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

LOGGER

protected static final org.slf4j.Logger LOGGER

ARROW_WIDTH

protected static final int ARROW_WIDTH
另请参见:
常量字段值

CONDITIONAL_INDICATOR_WIDTH

protected static final int CONDITIONAL_INDICATOR_WIDTH
另请参见:
常量字段值

DEFAULT_INDICATOR_WIDTH

protected static final int DEFAULT_INDICATOR_WIDTH
另请参见:
常量字段值

MARKER_WIDTH

protected static final int MARKER_WIDTH
另请参见:
常量字段值

FONT_SIZE

protected static final int FONT_SIZE
另请参见:
常量字段值

FONT_SPACING

protected static final int FONT_SPACING
另请参见:
常量字段值

TEXT_PADDING

protected static final int TEXT_PADDING
另请参见:
常量字段值

ANNOTATION_TEXT_PADDING

protected static final int ANNOTATION_TEXT_PADDING
另请参见:
常量字段值

LINE_HEIGHT

protected static final int LINE_HEIGHT
另请参见:
常量字段值

TASK_BOX_COLOR

protected static Color TASK_BOX_COLOR

SUBPROCESS_BOX_COLOR

protected static Color SUBPROCESS_BOX_COLOR

BOUNDARY_EVENT_COLOR

protected static Color BOUNDARY_EVENT_COLOR

CONDITIONAL_INDICATOR_COLOR

protected static Color CONDITIONAL_INDICATOR_COLOR

HIGHLIGHT_COLOR

protected static Color HIGHLIGHT_COLOR

LABEL_COLOR

protected static Color LABEL_COLOR

LABEL_FONT

protected static Font LABEL_FONT

ANNOTATION_FONT

protected static Font ANNOTATION_FONT

TASK_FONT

protected static Font TASK_FONT

THICK_TASK_BORDER_STROKE

protected static Stroke THICK_TASK_BORDER_STROKE

GATEWAY_TYPE_STROKE

protected static Stroke GATEWAY_TYPE_STROKE

END_EVENT_STROKE

protected static Stroke END_EVENT_STROKE

MULTI_INSTANCE_STROKE

protected static Stroke MULTI_INSTANCE_STROKE

EVENT_SUBPROCESS_STROKE

protected static Stroke EVENT_SUBPROCESS_STROKE

INTERRUPTING_EVENT_STROKE

protected static Stroke INTERRUPTING_EVENT_STROKE

HIGHLIGHT_FLOW_STROKE

protected static Stroke HIGHLIGHT_FLOW_STROKE

ANNOTATION_STROKE

protected static Stroke ANNOTATION_STROKE

ASSOCIATION_STROKE

protected static Stroke ASSOCIATION_STROKE

ICON_SIZE

protected static int ICON_SIZE

ICON_PADDING

protected static int ICON_PADDING

USERTASK_IMAGE

protected static Image USERTASK_IMAGE

SCRIPTTASK_IMAGE

protected static Image SCRIPTTASK_IMAGE

SERVICETASK_IMAGE

protected static Image SERVICETASK_IMAGE

RECEIVETASK_IMAGE

protected static Image RECEIVETASK_IMAGE

SENDTASK_IMAGE

protected static Image SENDTASK_IMAGE

MANUALTASK_IMAGE

protected static Image MANUALTASK_IMAGE

BUSINESS_RULE_TASK_IMAGE

protected static Image BUSINESS_RULE_TASK_IMAGE

TIMER_IMAGE

protected static Image TIMER_IMAGE

ERROR_THROW_IMAGE

protected static Image ERROR_THROW_IMAGE

ERROR_CATCH_IMAGE

protected static Image ERROR_CATCH_IMAGE

SIGNAL_CATCH_IMAGE

protected static Image SIGNAL_CATCH_IMAGE

SIGNAL_THROW_IMAGE

protected static Image SIGNAL_THROW_IMAGE

canvasWidth

protected int canvasWidth

canvasHeight

protected int canvasHeight

minX

protected int minX

minY

protected int minY

processDiagram

protected BufferedImage processDiagram

g

protected Graphics2D g

fontMetrics

protected FontMetrics fontMetrics

closed

protected boolean closed

activityFontName

protected String activityFontName

labelFontName

protected String labelFontName
构造方法详细信息

ProcessDiagramCanvas

public ProcessDiagramCanvas(int width,
                            int height)
Creates an empty canvas with given width and height.


ProcessDiagramCanvas

public ProcessDiagramCanvas(int width,
                            int height,
                            int minX,
                            int minY)
Creates an empty canvas with given width and height. Allows to specify minimal boundaries on the left and upper side of the canvas. This is useful for diagrams that have white space there (eg Signavio). Everything beneath these minimum values will be cropped.

参数:
minX - Hint that will be used when generating the image. Parts that fall below minX on the horizontal scale will be cropped.
minY - Hint that will be used when generating the image. Parts that fall below minX on the horizontal scale will be cropped.
方法详细信息

generateImage

public InputStream generateImage(String imageType)
Generates an image of what currently is drawn on the canvas. Throws an ActivitiException when close() is already called.


close

public void close()
Closes the canvas which dissallows further drawing and releases graphical resources.


drawNoneStartEvent

public void drawNoneStartEvent(int x,
                               int y,
                               int width,
                               int height)

drawTimerStartEvent

public void drawTimerStartEvent(int x,
                                int y,
                                int width,
                                int height)

drawStartEvent

public void drawStartEvent(int x,
                           int y,
                           int width,
                           int height,
                           Image image)

drawNoneEndEvent

public void drawNoneEndEvent(int x,
                             int y,
                             int width,
                             int height)

drawErrorEndEvent

public void drawErrorEndEvent(String name,
                              int x,
                              int y,
                              int width,
                              int height)

drawErrorEndEvent

public void drawErrorEndEvent(int x,
                              int y,
                              int width,
                              int height)

drawErrorStartEvent

public void drawErrorStartEvent(int x,
                                int y,
                                int width,
                                int height)

drawCatchingEvent

public void drawCatchingEvent(int x,
                              int y,
                              int width,
                              int height,
                              boolean isInterrupting,
                              Image image)

drawCatchingTimerEvent

public void drawCatchingTimerEvent(String name,
                                   int x,
                                   int y,
                                   int width,
                                   int height,
                                   boolean isInterrupting)

drawCatchingTimerEvent

public void drawCatchingTimerEvent(int x,
                                   int y,
                                   int width,
                                   int height,
                                   boolean isInterrupting)

drawCatchingErrorEvent

public void drawCatchingErrorEvent(String name,
                                   int x,
                                   int y,
                                   int width,
                                   int height,
                                   boolean isInterrupting)

drawCatchingErrorEvent

public void drawCatchingErrorEvent(int x,
                                   int y,
                                   int width,
                                   int height,
                                   boolean isInterrupting)

drawCatchingSignalEvent

public void drawCatchingSignalEvent(String name,
                                    int x,
                                    int y,
                                    int width,
                                    int height,
                                    boolean isInterrupting)

drawCatchingSignalEvent

public void drawCatchingSignalEvent(int x,
                                    int y,
                                    int width,
                                    int height,
                                    boolean isInterrupting)

drawThrowingSignalEvent

public void drawThrowingSignalEvent(int x,
                                    int y,
                                    int width,
                                    int height)

drawThrowingNoneEvent

public void drawThrowingNoneEvent(int x,
                                  int y,
                                  int width,
                                  int height)

drawSequenceflow

public void drawSequenceflow(int srcX,
                             int srcY,
                             int targetX,
                             int targetY,
                             boolean conditional)

drawSequenceflow

public void drawSequenceflow(int srcX,
                             int srcY,
                             int targetX,
                             int targetY,
                             boolean conditional,
                             boolean highLighted)

drawAssociation

public void drawAssociation(int[] xPoints,
                            int[] yPoints,
                            org.activiti.bpmn.model.AssociationDirection associationDirection,
                            boolean highLighted)

drawSequenceflow

public void drawSequenceflow(int[] xPoints,
                             int[] yPoints,
                             boolean conditional,
                             boolean isDefault,
                             boolean highLighted)

drawConnection

public void drawConnection(int[] xPoints,
                           int[] yPoints,
                           boolean conditional,
                           boolean isDefault,
                           String connectionType,
                           org.activiti.bpmn.model.AssociationDirection associationDirection,
                           boolean highLighted)

drawSequenceflowWithoutArrow

public void drawSequenceflowWithoutArrow(int srcX,
                                         int srcY,
                                         int targetX,
                                         int targetY,
                                         boolean conditional)

drawSequenceflowWithoutArrow

public void drawSequenceflowWithoutArrow(int srcX,
                                         int srcY,
                                         int targetX,
                                         int targetY,
                                         boolean conditional,
                                         boolean highLighted)

drawArrowHead

public void drawArrowHead(Line2D.Double line)

drawDefaultSequenceFlowIndicator

public void drawDefaultSequenceFlowIndicator(Line2D.Double line)

drawConditionalSequenceFlowIndicator

public void drawConditionalSequenceFlowIndicator(Line2D.Double line)

drawTask

public void drawTask(String name,
                     int x,
                     int y,
                     int width,
                     int height)

drawPoolOrLane

public void drawPoolOrLane(String name,
                           int x,
                           int y,
                           int width,
                           int height)

drawTask

protected void drawTask(String name,
                        int x,
                        int y,
                        int width,
                        int height,
                        boolean thickBorder)

drawMultilineCentredText

protected void drawMultilineCentredText(String text,
                                        int x,
                                        int y,
                                        int boxWidth,
                                        int boxHeight)

drawMultilineAnnotationText

protected void drawMultilineAnnotationText(String text,
                                           int x,
                                           int y,
                                           int boxWidth,
                                           int boxHeight)

drawMultilineText

protected void drawMultilineText(String text,
                                 int x,
                                 int y,
                                 int boxWidth,
                                 int boxHeight,
                                 boolean centered)

fitTextToWidth

protected String fitTextToWidth(String original,
                                int width)

drawUserTask

public void drawUserTask(String name,
                         int x,
                         int y,
                         int width,
                         int height)

drawScriptTask

public void drawScriptTask(String name,
                           int x,
                           int y,
                           int width,
                           int height)

drawServiceTask

public void drawServiceTask(String name,
                            int x,
                            int y,
                            int width,
                            int height)

drawReceiveTask

public void drawReceiveTask(String name,
                            int x,
                            int y,
                            int width,
                            int height)

drawSendTask

public void drawSendTask(String name,
                         int x,
                         int y,
                         int width,
                         int height)

drawManualTask

public void drawManualTask(String name,
                           int x,
                           int y,
                           int width,
                           int height)

drawBusinessRuleTask

public void drawBusinessRuleTask(String name,
                                 int x,
                                 int y,
                                 int width,
                                 int height)

drawExpandedSubProcess

public void drawExpandedSubProcess(String name,
                                   int x,
                                   int y,
                                   int width,
                                   int height,
                                   Boolean isTriggeredByEvent)

drawCollapsedSubProcess

public void drawCollapsedSubProcess(String name,
                                    int x,
                                    int y,
                                    int width,
                                    int height,
                                    Boolean isTriggeredByEvent)

drawCollapsedCallActivity

public void drawCollapsedCallActivity(String name,
                                      int x,
                                      int y,
                                      int width,
                                      int height)

drawCollapsedTask

protected void drawCollapsedTask(String name,
                                 int x,
                                 int y,
                                 int width,
                                 int height,
                                 boolean thickBorder)

drawCollapsedMarker

public void drawCollapsedMarker(int x,
                                int y,
                                int width,
                                int height)

drawActivityMarkers

public void drawActivityMarkers(int x,
                                int y,
                                int width,
                                int height,
                                boolean multiInstanceSequential,
                                boolean multiInstanceParallel,
                                boolean collapsed)

drawGateway

public void drawGateway(int x,
                        int y,
                        int width,
                        int height)

drawParallelGateway

public void drawParallelGateway(int x,
                                int y,
                                int width,
                                int height)

drawExclusiveGateway

public void drawExclusiveGateway(int x,
                                 int y,
                                 int width,
                                 int height)

drawInclusiveGateway

public void drawInclusiveGateway(int x,
                                 int y,
                                 int width,
                                 int height)

drawEventBasedGateway

public void drawEventBasedGateway(int x,
                                  int y,
                                  int width,
                                  int height)

drawMultiInstanceMarker

public void drawMultiInstanceMarker(boolean sequential,
                                    int x,
                                    int y,
                                    int width,
                                    int height)

drawHighLight

public void drawHighLight(int x,
                          int y,
                          int width,
                          int height)

drawTextAnnotation

public void drawTextAnnotation(String text,
                               int x,
                               int y,
                               int width,
                               int height)

drawLabel

public void drawLabel(String text,
                      int x,
                      int y,
                      int width,
                      int height)

drawLabel

public void drawLabel(String text,
                      int x,
                      int y,
                      int width,
                      int height,
                      boolean centered)


Copyright © 2013 Alfresco. All rights reserved.