Package org.flowable.image.impl
Class DefaultProcessDiagramGenerator
java.lang.Object
org.flowable.image.impl.DefaultProcessDiagramGenerator
- All Implemented Interfaces:
ProcessDiagramGenerator
Class to generate an image based the diagram interchange information in a BPMN 2.0 process.
- Author:
- Joram Barrez, Tijs Rademakers, Zheng Ji
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
protected static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<Class<? extends BaseElement>,
DefaultProcessDiagramGenerator.ActivityDrawInstruction> protected Map<Class<? extends BaseElement>,
DefaultProcessDiagramGenerator.ArtifactDrawInstruction> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static List<GraphicInfo>
connectionPerfectionizer
(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, BaseElement sourceElement, BaseElement targetElement, List<GraphicInfo> graphicInfoList) This method makes coordinates of connection flow better.protected void
drawActivity
(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode, List<String> highLightedActivities, List<String> highLightedFlows, double scaleFactor, Boolean drawSequenceFlowNameWithNoLabelDI) protected void
drawArtifact
(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, Artifact artifact) gatherAllArtifacts
(BpmnModel bpmnModel) gatherAllFlowNodes
(BpmnModel bpmnModel) gatherAllFlowNodes
(FlowElementsContainer flowElementsContainer) generateDiagram
(BpmnModel bpmnModel, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, boolean drawSequenceFlowNameWithNoLabelDI) generateDiagram
(BpmnModel bpmnModel, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) generateDiagram
(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, boolean drawSequenceFlowNameWithNoLabelDI) generateDiagram
(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) generateDiagram
(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows, boolean drawSequenceFlowNameWithNoLabelDI) Generates a diagram of the given process definition, using the diagram interchange information of the process.generateDiagram
(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) generateDiagram
(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) Generates a diagram of the given process definition, using the diagram interchange information of the process.generateImage
(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) generateImage
(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) generateJpgDiagram
(BpmnModel bpmnModel) generateJpgDiagram
(BpmnModel bpmnModel, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) generatePngDiagram
(BpmnModel bpmnModel, boolean drawSequenceFlowNameWithNoLabelDI) generatePngDiagram
(BpmnModel bpmnModel, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) generatePngImage
(BpmnModel bpmnModel, double scaleFactor) protected DefaultProcessDiagramCanvas
generateProcessDiagram
(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) protected static GraphicInfo
getLineCenter
(List<GraphicInfo> graphicInfoList) protected static DefaultProcessDiagramCanvas.SHAPE_TYPE
getShapeType
(BaseElement baseElement) This method returns shape type of base element.
Each element can be presented as rectangle, rhombus, or ellipse.protected static DefaultProcessDiagramCanvas
initProcessDiagramCanvas
(BpmnModel bpmnModel, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) protected boolean
isPartOfCollapsedSubProcess
(FlowElement flowElement, BpmnModel model) protected void
prepareBpmnModel
(BpmnModel bpmnModel) void
setActivityDrawInstructions
(Map<Class<? extends BaseElement>, DefaultProcessDiagramGenerator.ActivityDrawInstruction> activityDrawInstructions) void
setArtifactDrawInstructions
(Map<Class<? extends BaseElement>, DefaultProcessDiagramGenerator.ArtifactDrawInstruction> artifactDrawInstructions)
-
Field Details
-
activityDrawInstructions
protected Map<Class<? extends BaseElement>,DefaultProcessDiagramGenerator.ActivityDrawInstruction> activityDrawInstructions -
artifactDrawInstructions
protected Map<Class<? extends BaseElement>,DefaultProcessDiagramGenerator.ArtifactDrawInstruction> artifactDrawInstructions
-
-
Constructor Details
-
DefaultProcessDiagramGenerator
public DefaultProcessDiagramGenerator() -
DefaultProcessDiagramGenerator
public DefaultProcessDiagramGenerator(double scaleFactor)
-
-
Method Details
-
generateDiagram
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) Description copied from interface:ProcessDiagramGenerator
Generates a diagram of the given process definition, using the diagram interchange information of the process.- Specified by:
generateDiagram
in interfaceProcessDiagramGenerator
- Parameters:
bpmnModel
- bpmn model to get diagram forimageType
- type of the image to generate.highLightedActivities
- activities to highlighthighLightedFlows
- flows to highlightactivityFontName
- override the default activity fontlabelFontName
- override the default label fontcustomClassLoader
- provide a custom classloader for retrieving icon imagesdrawSequenceFlowNameWithNoLabelDI
- provide a option to also include the sequence flow name in case there's no Label DI
-
generateDiagram
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows, boolean drawSequenceFlowNameWithNoLabelDI) Description copied from interface:ProcessDiagramGenerator
Generates a diagram of the given process definition, using the diagram interchange information of the process.- Specified by:
generateDiagram
in interfaceProcessDiagramGenerator
- Parameters:
bpmnModel
- bpmn model to get diagram forimageType
- type of the image to generate.highLightedActivities
- activities to highlighthighLightedFlows
- flows to highlightdrawSequenceFlowNameWithNoLabelDI
- provide a option to also include the sequence flow name in case there's no Label DI
-
generateDiagram
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) - Specified by:
generateDiagram
in interfaceProcessDiagramGenerator
-
generateDiagram
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, boolean drawSequenceFlowNameWithNoLabelDI) - Specified by:
generateDiagram
in interfaceProcessDiagramGenerator
-
generateDiagram
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) - Specified by:
generateDiagram
in interfaceProcessDiagramGenerator
-
generateDiagram
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, boolean drawSequenceFlowNameWithNoLabelDI) - Specified by:
generateDiagram
in interfaceProcessDiagramGenerator
-
generateDiagram
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) - Specified by:
generateDiagram
in interfaceProcessDiagramGenerator
-
generatePngDiagram
public InputStream generatePngDiagram(BpmnModel bpmnModel, boolean drawSequenceFlowNameWithNoLabelDI) - Specified by:
generatePngDiagram
in interfaceProcessDiagramGenerator
-
generatePngDiagram
public InputStream generatePngDiagram(BpmnModel bpmnModel, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) - Specified by:
generatePngDiagram
in interfaceProcessDiagramGenerator
-
generateJpgDiagram
- Specified by:
generateJpgDiagram
in interfaceProcessDiagramGenerator
-
generateJpgDiagram
public InputStream generateJpgDiagram(BpmnModel bpmnModel, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) - Specified by:
generateJpgDiagram
in interfaceProcessDiagramGenerator
-
generateImage
public BufferedImage generateImage(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) -
generateImage
-
generatePngImage
- Specified by:
generatePngImage
in interfaceProcessDiagramGenerator
-
generateProcessDiagram
protected DefaultProcessDiagramCanvas generateProcessDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) -
prepareBpmnModel
-
drawActivity
-
connectionPerfectionizer
protected static List<GraphicInfo> connectionPerfectionizer(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, BaseElement sourceElement, BaseElement targetElement, List<GraphicInfo> graphicInfoList) This method makes coordinates of connection flow better.- Parameters:
processDiagramCanvas
-bpmnModel
-sourceElement
-targetElement
-graphicInfoList
-- Returns:
-
getShapeType
This method returns shape type of base element.
Each element can be presented as rectangle, rhombus, or ellipse.- Parameters:
baseElement
-- Returns:
- DefaultProcessDiagramCanvas.SHAPE_TYPE
-
getLineCenter
-
drawArtifact
protected void drawArtifact(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, Artifact artifact) -
initProcessDiagramCanvas
protected static DefaultProcessDiagramCanvas initProcessDiagramCanvas(BpmnModel bpmnModel, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) -
gatherAllArtifacts
-
gatherAllFlowNodes
-
gatherAllFlowNodes
-
isPartOfCollapsedSubProcess
-
getActivityDrawInstructions
public Map<Class<? extends BaseElement>,DefaultProcessDiagramGenerator.ActivityDrawInstruction> getActivityDrawInstructions() -
setActivityDrawInstructions
public void setActivityDrawInstructions(Map<Class<? extends BaseElement>, DefaultProcessDiagramGenerator.ActivityDrawInstruction> activityDrawInstructions) -
getArtifactDrawInstructions
public Map<Class<? extends BaseElement>,DefaultProcessDiagramGenerator.ArtifactDrawInstruction> getArtifactDrawInstructions() -
setArtifactDrawInstructions
public void setArtifactDrawInstructions(Map<Class<? extends BaseElement>, DefaultProcessDiagramGenerator.ArtifactDrawInstruction> artifactDrawInstructions)
-