Package org.activiti.image.impl
Class DefaultProcessDiagramCanvas
java.lang.Object
org.activiti.image.impl.DefaultProcessDiagramCanvas
Represents a canvas on which BPMN 2.0 constructs can be drawn.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected static Fontprotected static Strokeprotected static final intprotected Stringprotected static final intprotected static Strokeprotected static TaskIconTypeprotected intprotected intprotected booleanprotected static IconTypeprotected static IconTypeprotected static Colorprotected static final intprotected static Colorprotected static final intprotected static Strokeprotected static IconTypeprotected static IconTypeprotected static Colorprotected static Colorprotected static Strokeprotected static final intprotected static final intprotected FontMetricsprotected ProcessDiagramSVGGraphics2Dprotected static Strokeprotected static Colorprotected static Colorprotected static Colorprotected static Strokeprotected static intprotected static Colorprotected static Fontprotected Stringprotected static final intprotected static IconTypeprotected static IconTypeprotected static final org.slf4j.Loggerprotected static TaskIconTypeprotected static final intprotected static IconTypeprotected intprotected intprotected static Strokeprotected static Strokeprotected static TaskIconTypeprotected static TaskIconTypeprotected static TaskIconTypeprotected static TaskIconTypeprotected static IconTypeprotected static IconTypeprotected static Colorprotected static Colorprotected static Colorprotected static Colorprotected static final intprotected static Strokeprotected static IconTypeprotected static TaskIconType -
Constructor Summary
ConstructorsConstructorDescriptionDefaultProcessDiagramCanvas(int width, int height, int minX, int minY) Creates an empty canvas with given width and height.DefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String activityFontName, String labelFontName, String annotationFontName) Creates an empty canvas with given width and height. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the canvas which dissallows further drawing and releases graphical resources.List<org.activiti.bpmn.model.GraphicInfo> connectionPerfectionizer(DefaultProcessDiagramCanvas.SHAPE_TYPE sourceShapeType, DefaultProcessDiagramCanvas.SHAPE_TYPE targetShapeType, org.activiti.bpmn.model.GraphicInfo sourceGraphicInfo, org.activiti.bpmn.model.GraphicInfo targetGraphicInfo, List<org.activiti.bpmn.model.GraphicInfo> graphicInfoList) This method makes coordinates of connection flow better.voiddrawActivityMarkers(int x, int y, int width, int height, boolean multiInstanceSequential, boolean multiInstanceParallel, boolean collapsed) voiddrawArrowHead(Line2D.Double line) voiddrawAssociation(int[] xPoints, int[] yPoints, org.activiti.bpmn.model.AssociationDirection associationDirection, boolean highLighted) voiddrawBusinessRuleTask(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawCatchingCompensateEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) voiddrawCatchingCompensateEvent(String id, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) voiddrawCatchingErrorEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) voiddrawCatchingErrorEvent(String id, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) voiddrawCatchingEvent(String id, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting, IconType icon, String eventType) voiddrawCatchingLinkEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) voiddrawCatchingMessageEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) voiddrawCatchingMessageEvent(String id, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) voiddrawCatchingSignalEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) voiddrawCatchingSignalEvent(String id, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) voiddrawCatchingTimerEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) voiddrawCatchingTimerEvent(String id, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) voiddrawCollapsedCallActivity(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawCollapsedMarker(int x, int y, int width, int height) voiddrawCollapsedSubProcess(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo, Boolean isTriggeredByEvent) protected voiddrawCollapsedTask(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean thickBorder) voidvoiddrawConnection(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, String connectionType, org.activiti.bpmn.model.AssociationDirection associationDirection, boolean highLighted) voidvoiddrawErrorEndEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawErrorStartEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawEventBasedGateway(String id, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawEventHighLight(org.activiti.bpmn.model.GraphicInfo graphicInfo, Color color) voiddrawEventHighLightCompleted(org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawEventHighLightErrored(org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawExclusiveGateway(String id, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawExpandedSubProcess(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo, Class<?> type) voiddrawGateway(org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawGatewayHighLight(org.activiti.bpmn.model.GraphicInfo graphicInfo, Color color) voiddrawGatewayHighLightCompleted(org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawGatewayHighLightErrored(org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawHighLight(org.activiti.bpmn.model.GraphicInfo graphicInfo, Color color) voiddrawHighLightCompleted(org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawHighLightCurrent(org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawHighLightErrored(org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawInclusiveGateway(String id, org.activiti.bpmn.model.GraphicInfo graphicInfo) voidvoidvoiddrawManualTask(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawMessageStartEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawMultiInstanceMarker(boolean sequential, int x, int y, int width, int height) protected voiddrawMultilineAnnotationText(String text, int x, int y, int boxWidth, int boxHeight) protected voiddrawMultilineCentredText(String text, int x, int y, int boxWidth, int boxHeight) protected voiddrawMultilineText(String text, int x, int y, int boxWidth, int boxHeight, boolean centered) voiddrawNoneEndEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawNoneStartEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawParallelGateway(String id, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawPoolOrLane(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawReceiveTask(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawScriptTask(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawSendTask(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawSequenceflow(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, boolean highLighted) voiddrawSequenceflow(int srcX, int srcY, int targetX, int targetY, boolean conditional) voiddrawSequenceflow(int srcX, int srcY, int targetX, int targetY, boolean conditional, boolean highLighted) voiddrawSequenceflowWithoutArrow(int srcX, int srcY, int targetX, int targetY, boolean conditional) voiddrawSequenceflowWithoutArrow(int srcX, int srcY, int targetX, int targetY, boolean conditional, boolean highLighted) voiddrawServiceTask(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawSignalStartEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawStartEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo, IconType icon) voidprotected voiddrawTask(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean thickBorder) voiddrawTask(TaskIconType icon, String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawTextAnnotation(String id, String text, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawThrowingCompensateEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawThrowingLinkEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawThrowingNoneEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawThrowingSignalEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawTimerStartEvent(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) voiddrawUserTask(String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) protected StringfitTextToWidth(String original, int width) Generates an image of what currently is drawn on the canvas.void
-
Field Details
-
LOGGER
protected static final org.slf4j.Logger LOGGER -
ARROW_WIDTH
protected static final int ARROW_WIDTH- See Also:
-
CONDITIONAL_INDICATOR_WIDTH
protected static final int CONDITIONAL_INDICATOR_WIDTH- See Also:
-
DEFAULT_INDICATOR_WIDTH
protected static final int DEFAULT_INDICATOR_WIDTH- See Also:
-
MARKER_WIDTH
protected static final int MARKER_WIDTH- See Also:
-
FONT_SIZE
protected static final int FONT_SIZE- See Also:
-
FONT_SPACING
protected static final int FONT_SPACING- See Also:
-
TEXT_PADDING
protected static final int TEXT_PADDING- See Also:
-
ANNOTATION_TEXT_PADDING
protected static final int ANNOTATION_TEXT_PADDING- See Also:
-
LINE_HEIGHT
protected static final int LINE_HEIGHT- See Also:
-
TASK_BOX_COLOR
-
SUBPROCESS_BOX_COLOR
-
EVENT_COLOR
-
CONNECTION_COLOR
-
CONDITIONAL_INDICATOR_COLOR
-
HIGHLIGHT_CURRENT_COLOR
-
HIGHLIGHT_COMPLETED_ACTIVITY_COLOR
-
HIGHLIGHT_ERRORED_ACTIVITY_COLOR
-
LABEL_COLOR
-
TASK_BORDER_COLOR
-
EVENT_BORDER_COLOR
-
SUBPROCESS_BORDER_COLOR
-
LABEL_FONT
-
ANNOTATION_FONT
-
THICK_TASK_BORDER_STROKE
-
GATEWAY_TYPE_STROKE
-
END_EVENT_STROKE
-
MULTI_INSTANCE_STROKE
-
EVENT_SUBPROCESS_STROKE
-
NON_INTERRUPTING_EVENT_STROKE
-
HIGHLIGHT_FLOW_STROKE
-
ANNOTATION_STROKE
-
ASSOCIATION_STROKE
-
ICON_PADDING
protected static int ICON_PADDING -
USERTASK_IMAGE
-
SCRIPTTASK_IMAGE
-
SERVICETASK_IMAGE
-
RECEIVETASK_IMAGE
-
SENDTASK_IMAGE
-
MANUALTASK_IMAGE
-
BUSINESS_RULE_TASK_IMAGE
-
TIMER_IMAGE
-
COMPENSATE_THROW_IMAGE
-
COMPENSATE_CATCH_IMAGE
-
ERROR_THROW_IMAGE
-
ERROR_CATCH_IMAGE
-
MESSAGE_CATCH_IMAGE
-
SIGNAL_CATCH_IMAGE
-
SIGNAL_THROW_IMAGE
-
LINK_CATCH_IMAGE
-
LINK_THROW_IMAGE
-
canvasWidth
protected int canvasWidth -
canvasHeight
protected int canvasHeight -
minX
protected int minX -
minY
protected int minY -
g
-
fontMetrics
-
closed
protected boolean closed -
activityFontName
-
labelFontName
-
annotationFontName
-
-
Constructor Details
-
DefaultProcessDiagramCanvas
public DefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String activityFontName, String labelFontName, String annotationFontName) 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. Everything beneath these minimum values will be cropped. It's also possible to pass a specific font name and a class loader for the icon images.
-
DefaultProcessDiagramCanvas
public DefaultProcessDiagramCanvas(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.
- Parameters:
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.
-
-
Method Details
-
initialize
public void initialize() -
generateImage
Generates an image of what currently is drawn on the canvas.Throws an
ActivitiImageExceptionwhenclose()is already called. -
close
public void close()Closes the canvas which dissallows further drawing and releases graphical resources. -
drawNoneStartEvent
-
drawTimerStartEvent
-
drawSignalStartEvent
-
drawMessageStartEvent
-
drawStartEvent
-
drawNoneEndEvent
-
drawErrorEndEvent
-
drawErrorStartEvent
-
drawCatchingEvent
-
drawCatchingCompensateEvent
-
drawCatchingCompensateEvent
public void drawCatchingCompensateEvent(String id, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) -
drawCatchingTimerEvent
-
drawCatchingTimerEvent
public void drawCatchingTimerEvent(String id, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) -
drawCatchingErrorEvent
-
drawCatchingErrorEvent
public void drawCatchingErrorEvent(String id, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) -
drawCatchingSignalEvent
-
drawCatchingSignalEvent
public void drawCatchingSignalEvent(String id, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) -
drawCatchingMessageEvent
public void drawCatchingMessageEvent(String id, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean isInterrupting) -
drawCatchingMessageEvent
-
drawCatchingLinkEvent
-
drawThrowingCompensateEvent
-
drawThrowingSignalEvent
-
drawThrowingLinkEvent
-
drawThrowingNoneEvent
-
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
-
drawDefaultSequenceFlowIndicator
-
drawConditionalSequenceFlowIndicator
-
drawTask
public void drawTask(TaskIconType icon, String id, String name, org.activiti.bpmn.model.GraphicInfo graphicInfo) -
drawTask
-
drawPoolOrLane
-
drawTask
-
drawMultilineCentredText
-
drawMultilineAnnotationText
-
drawMultilineText
protected void drawMultilineText(String text, int x, int y, int boxWidth, int boxHeight, boolean centered) -
fitTextToWidth
-
drawUserTask
-
drawScriptTask
-
drawServiceTask
-
drawReceiveTask
-
drawSendTask
-
drawManualTask
-
drawBusinessRuleTask
-
drawExpandedSubProcess
-
drawCollapsedSubProcess
-
drawCollapsedCallActivity
-
drawCollapsedTask
-
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(org.activiti.bpmn.model.GraphicInfo graphicInfo) -
drawGatewayHighLight
-
drawGatewayHighLightCompleted
public void drawGatewayHighLightCompleted(org.activiti.bpmn.model.GraphicInfo graphicInfo) -
drawGatewayHighLightErrored
public void drawGatewayHighLightErrored(org.activiti.bpmn.model.GraphicInfo graphicInfo) -
drawParallelGateway
-
drawExclusiveGateway
-
drawInclusiveGateway
-
drawEventBasedGateway
-
drawMultiInstanceMarker
public void drawMultiInstanceMarker(boolean sequential, int x, int y, int width, int height) -
drawHighLightCurrent
public void drawHighLightCurrent(org.activiti.bpmn.model.GraphicInfo graphicInfo) -
drawHighLightCompleted
public void drawHighLightCompleted(org.activiti.bpmn.model.GraphicInfo graphicInfo) -
drawHighLightErrored
public void drawHighLightErrored(org.activiti.bpmn.model.GraphicInfo graphicInfo) -
drawHighLight
-
drawEventHighLight
-
drawEventHighLightCompleted
public void drawEventHighLightCompleted(org.activiti.bpmn.model.GraphicInfo graphicInfo) -
drawEventHighLightErrored
public void drawEventHighLightErrored(org.activiti.bpmn.model.GraphicInfo graphicInfo) -
drawTextAnnotation
-
drawLabel
-
drawLabel
public void drawLabel(String text, org.activiti.bpmn.model.GraphicInfo graphicInfo, boolean centered) -
connectionPerfectionizer
public List<org.activiti.bpmn.model.GraphicInfo> connectionPerfectionizer(DefaultProcessDiagramCanvas.SHAPE_TYPE sourceShapeType, DefaultProcessDiagramCanvas.SHAPE_TYPE targetShapeType, org.activiti.bpmn.model.GraphicInfo sourceGraphicInfo, org.activiti.bpmn.model.GraphicInfo targetGraphicInfo, List<org.activiti.bpmn.model.GraphicInfo> graphicInfoList) This method makes coordinates of connection flow better.- Parameters:
sourceShapeType-targetShapeType-sourceGraphicInfo-targetGraphicInfo-graphicInfoList-
-