Package org.flowable.image.impl
Class DefaultProcessDiagramCanvas
java.lang.Object
org.flowable.image.impl.DefaultProcessDiagramCanvas
Represents a canvas on which BPMN 2.0 constructs can be drawn.
Some of the icons used are licensed under a Creative Commons Attribution 2.5 License, see http://www.famfamfam.com/lab/icons/silk/
- Author:
- Joram Barrez
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected static Fontprotected static final Strokeprotected static final intprotected Stringprotected static final intprotected static final Strokeprotected static BufferedImageprotected static BufferedImageprotected intprotected intprotected static BufferedImageprotected booleanprotected static BufferedImageprotected static BufferedImageprotected static BufferedImageprotected static final Colorprotected static final intprotected static final Colorprotected ClassLoaderprotected static final intprotected static BufferedImageprotected static final Strokeprotected static BufferedImageprotected static BufferedImageprotected static BufferedImageprotected static BufferedImageprotected static final Colorprotected static final Colorprotected static final Strokeprotected static final intprotected static final intprotected FontMetricsprotected Graphics2Dprotected static final Strokeprotected static final Colorprotected static final Strokeprotected static BufferedImageprotected static final intprotected static final Colorprotected static Fontprotected Stringprotected static final intprotected static final org.slf4j.Loggerprotected static BufferedImageprotected static final intprotected static BufferedImageprotected static BufferedImageprotected intprotected intprotected static final Strokeprotected static final Strokeprotected BufferedImageprotected static BufferedImageprotected static BufferedImageprotected static BufferedImageprotected static BufferedImageprotected static BufferedImageprotected static BufferedImageprotected static BufferedImageprotected static final Colorprotected static final Colorprotected static final Colorprotected static final Colorprotected static final intprotected static final Strokeprotected static BufferedImageprotected static BufferedImage -
Constructor Summary
ConstructorsConstructorDescriptionDefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType) Creates an empty canvas with given width and height.DefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) Creates an empty canvas with given width and height. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the canvas which disallows further drawing and releases graphical resources.connectionPerfectionizer(DefaultProcessDiagramCanvas.SHAPE_TYPE sourceShapeType, DefaultProcessDiagramCanvas.SHAPE_TYPE targetShapeType, GraphicInfo sourceGraphicInfo, GraphicInfo targetGraphicInfo, List<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, double scaleFactor) voiddrawAssociation(int[] xPoints, int[] yPoints, AssociationDirection associationDirection, boolean highLighted, double scaleFactor) voiddrawBusinessRuleTask(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawCamelTask(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawCaseServiceTask(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawCatchingCompensateEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) voiddrawCatchingCompensateEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) voiddrawCatchingConditionalEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) voiddrawCatchingConditionalEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) voiddrawCatchingErrorEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) voiddrawCatchingErrorEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) voiddrawCatchingEscalationEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) voiddrawCatchingEvent(GraphicInfo graphicInfo, boolean isInterrupting, BufferedImage image, String eventType, double scaleFactor) voiddrawCatchingEventRegistryEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) voiddrawCatchingEventRegistryEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) voiddrawCatchingMessageEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) voiddrawCatchingMessageEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) voiddrawCatchingSignalEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) voiddrawCatchingSignalEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) voiddrawCatchingTimerEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) voiddrawCatchingTimerEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) voiddrawCollapsedCallActivity(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawCollapsedMarker(int x, int y, int width, int height) voiddrawCollapsedSubProcess(String name, GraphicInfo graphicInfo, Boolean isTriggeredByEvent, double scaleFactor) protected voiddrawCollapsedTask(String name, GraphicInfo graphicInfo, boolean thickBorder, double scaleFactor) voiddrawConditionalSequenceFlowIndicator(Line2D.Double line, double scaleFactor) voiddrawConditionalStartEvent(GraphicInfo graphicInfo, double scaleFactor) voiddrawConnection(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, String connectionType, AssociationDirection associationDirection, boolean highLighted, double scaleFactor) voiddrawDefaultSequenceFlowIndicator(Line2D.Double line, double scaleFactor) voiddrawDMNTask(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawErrorEndEvent(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawErrorEndEvent(GraphicInfo graphicInfo, double scaleFactor) voiddrawErrorStartEvent(GraphicInfo graphicInfo, double scaleFactor) voiddrawEscalationEndEvent(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawEscalationEndEvent(GraphicInfo graphicInfo, double scaleFactor) voiddrawEscalationStartEvent(GraphicInfo graphicInfo, double scaleFactor) voiddrawEventBasedGateway(GraphicInfo graphicInfo, double scaleFactor) voiddrawEventRegistryStartEvent(GraphicInfo graphicInfo, double scaleFactor) voiddrawExclusiveGateway(GraphicInfo graphicInfo, double scaleFactor) voiddrawExpandedSubProcess(String name, GraphicInfo graphicInfo, boolean isTriggeredByEvent, double scaleFactor) voiddrawExpandedTransaction(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawGateway(GraphicInfo graphicInfo) voiddrawHighLight(int x, int y, int width, int height) voiddrawHttpTask(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawInclusiveGateway(GraphicInfo graphicInfo, double scaleFactor) voiddrawLabel(String text, GraphicInfo graphicInfo) voiddrawLabel(String text, GraphicInfo graphicInfo, boolean centered) voiddrawManualTask(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawMessageStartEvent(GraphicInfo graphicInfo, double scaleFactor) 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(GraphicInfo graphicInfo, double scaleFactor) voiddrawNoneStartEvent(GraphicInfo graphicInfo) voiddrawParallelGateway(GraphicInfo graphicInfo, double scaleFactor) voiddrawPoolOrLane(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawReceiveTask(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawScriptTask(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawSendEventServiceTask(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawSendTask(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawSequenceflow(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, boolean highLighted, double scaleFactor) voiddrawSequenceflow(int srcX, int srcY, int targetX, int targetY, boolean conditional, boolean highLighted, double scaleFactor) voiddrawSequenceflow(int srcX, int srcY, int targetX, int targetY, boolean conditional, double scaleFactor) voiddrawSequenceflowWithoutArrow(int srcX, int srcY, int targetX, int targetY, boolean conditional, boolean highLighted, double scaleFactor) voiddrawSequenceflowWithoutArrow(int srcX, int srcY, int targetX, int targetY, boolean conditional, double scaleFactor) voiddrawServiceTask(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawShellTask(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawSignalStartEvent(GraphicInfo graphicInfo, double scaleFactor) voiddrawStartEvent(GraphicInfo graphicInfo, BufferedImage image, double scaleFactor) voiddrawTask(BufferedImage icon, String name, GraphicInfo graphicInfo, double scaleFactor) protected voiddrawTask(String name, GraphicInfo graphicInfo, boolean thickBorder, double scaleFactor) voiddrawTask(String name, GraphicInfo graphicInfo, double scaleFactor) voiddrawTextAnnotation(String text, GraphicInfo graphicInfo, double scaleFactor) voiddrawThrowingCompensateEvent(GraphicInfo graphicInfo, double scaleFactor) voiddrawThrowingEscalationEvent(GraphicInfo graphicInfo, double scaleFactor) voiddrawThrowingNoneEvent(GraphicInfo graphicInfo, double scaleFactor) voiddrawThrowingSignalEvent(GraphicInfo graphicInfo, double scaleFactor) voiddrawTimerStartEvent(GraphicInfo graphicInfo, double scaleFactor) voiddrawUserTask(String name, GraphicInfo graphicInfo, double scaleFactor) protected StringfitTextToWidth(String original, int width) generateBufferedImage(String imageType) Generates an image of what currently is drawn on the canvas.generateImage(String imageType) Generates an image of what currently is drawn on the canvas.voidinitialize(String imageType)
-
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_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 final int ICON_PADDING- See Also:
-
USERTASK_IMAGE
-
SCRIPTTASK_IMAGE
-
SERVICETASK_IMAGE
-
RECEIVETASK_IMAGE
-
SENDTASK_IMAGE
-
CASETASK_IMAGE
-
MANUALTASK_IMAGE
-
BUSINESS_RULE_TASK_IMAGE
-
SHELL_TASK_IMAGE
-
DMN_TASK_IMAGE
-
CAMEL_TASK_IMAGE
-
HTTP_TASK_IMAGE
-
TIMER_IMAGE
-
COMPENSATE_THROW_IMAGE
-
COMPENSATE_CATCH_IMAGE
-
CONDITIONAL_CATCH_IMAGE
-
ERROR_THROW_IMAGE
-
ERROR_CATCH_IMAGE
-
ESCALATION_THROW_IMAGE
-
ESCALATION_CATCH_IMAGE
-
MESSAGE_THROW_IMAGE
-
MESSAGE_CATCH_IMAGE
-
SIGNAL_CATCH_IMAGE
-
SIGNAL_THROW_IMAGE
-
canvasWidth
protected int canvasWidth -
canvasHeight
protected int canvasHeight -
minX
protected int minX -
minY
protected int minY -
processDiagram
-
g
-
fontMetrics
-
closed
protected boolean closed -
customClassLoader
-
activityFontName
-
labelFontName
-
annotationFontName
-
-
Constructor Details
-
DefaultProcessDiagramCanvas
public DefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) 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
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
-
generateImage
Generates an image of what currently is drawn on the canvas. Throws anFlowableImageExceptionwhenclose()is already called. -
generateBufferedImage
Generates an image of what currently is drawn on the canvas. Throws anFlowableImageExceptionwhenclose()is already called. -
close
public void close()Closes the canvas which disallows further drawing and releases graphical resources. -
drawNoneStartEvent
-
drawTimerStartEvent
-
drawSignalStartEvent
-
drawMessageStartEvent
-
drawEventRegistryStartEvent
-
drawStartEvent
-
drawNoneEndEvent
-
drawErrorEndEvent
-
drawEscalationEndEvent
-
drawErrorEndEvent
-
drawEscalationEndEvent
-
drawErrorStartEvent
-
drawEscalationStartEvent
-
drawConditionalStartEvent
-
drawCatchingEvent
public void drawCatchingEvent(GraphicInfo graphicInfo, boolean isInterrupting, BufferedImage image, String eventType, double scaleFactor) -
drawCatchingCompensateEvent
public void drawCatchingCompensateEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) -
drawCatchingCompensateEvent
public void drawCatchingCompensateEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) -
drawCatchingConditionalEvent
public void drawCatchingConditionalEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) -
drawCatchingConditionalEvent
public void drawCatchingConditionalEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) -
drawCatchingTimerEvent
public void drawCatchingTimerEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) -
drawCatchingTimerEvent
public void drawCatchingTimerEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) -
drawCatchingErrorEvent
public void drawCatchingErrorEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) -
drawCatchingErrorEvent
public void drawCatchingErrorEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) -
drawCatchingEscalationEvent
public void drawCatchingEscalationEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) -
drawCatchingSignalEvent
public void drawCatchingSignalEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) -
drawCatchingSignalEvent
public void drawCatchingSignalEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) -
drawCatchingMessageEvent
public void drawCatchingMessageEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) -
drawCatchingEventRegistryEvent
public void drawCatchingEventRegistryEvent(GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) -
drawCatchingMessageEvent
public void drawCatchingMessageEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) -
drawCatchingEventRegistryEvent
public void drawCatchingEventRegistryEvent(String name, GraphicInfo graphicInfo, boolean isInterrupting, double scaleFactor) -
drawThrowingCompensateEvent
-
drawThrowingSignalEvent
-
drawThrowingEscalationEvent
-
drawThrowingNoneEvent
-
drawSequenceflow
public void drawSequenceflow(int srcX, int srcY, int targetX, int targetY, boolean conditional, double scaleFactor) -
drawSequenceflow
public void drawSequenceflow(int srcX, int srcY, int targetX, int targetY, boolean conditional, boolean highLighted, double scaleFactor) -
drawAssociation
public void drawAssociation(int[] xPoints, int[] yPoints, AssociationDirection associationDirection, boolean highLighted, double scaleFactor) -
drawSequenceflow
public void drawSequenceflow(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, boolean highLighted, double scaleFactor) -
drawConnection
public void drawConnection(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, String connectionType, AssociationDirection associationDirection, boolean highLighted, double scaleFactor) -
drawSequenceflowWithoutArrow
public void drawSequenceflowWithoutArrow(int srcX, int srcY, int targetX, int targetY, boolean conditional, double scaleFactor) -
drawSequenceflowWithoutArrow
public void drawSequenceflowWithoutArrow(int srcX, int srcY, int targetX, int targetY, boolean conditional, boolean highLighted, double scaleFactor) -
drawArrowHead
-
drawDefaultSequenceFlowIndicator
-
drawConditionalSequenceFlowIndicator
-
drawTask
-
drawTask
-
drawPoolOrLane
-
drawTask
protected void drawTask(String name, GraphicInfo graphicInfo, boolean thickBorder, double scaleFactor) -
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
-
drawSendEventServiceTask
-
drawCaseServiceTask
-
drawBusinessRuleTask
-
drawShellTask
-
drawDMNTask
-
drawCamelTask
-
drawHttpTask
-
drawExpandedSubProcess
public void drawExpandedSubProcess(String name, GraphicInfo graphicInfo, boolean isTriggeredByEvent, double scaleFactor) -
drawExpandedTransaction
-
drawCollapsedSubProcess
public void drawCollapsedSubProcess(String name, GraphicInfo graphicInfo, Boolean isTriggeredByEvent, double scaleFactor) -
drawCollapsedCallActivity
-
drawCollapsedTask
protected void drawCollapsedTask(String name, GraphicInfo graphicInfo, boolean thickBorder, double scaleFactor) -
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
-
drawParallelGateway
-
drawExclusiveGateway
-
drawInclusiveGateway
-
drawEventBasedGateway
-
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
-
drawLabel
-
drawLabel
-
connectionPerfectionizer
public List<GraphicInfo> connectionPerfectionizer(DefaultProcessDiagramCanvas.SHAPE_TYPE sourceShapeType, DefaultProcessDiagramCanvas.SHAPE_TYPE targetShapeType, GraphicInfo sourceGraphicInfo, GraphicInfo targetGraphicInfo, List<GraphicInfo> graphicInfoList) This method makes coordinates of connection flow better.- Parameters:
sourceShapeType-targetShapeType-sourceGraphicInfo-targetGraphicInfo-graphicInfoList-
-