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 interfaceprotected 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 voiddrawActivity(DefaultProcessDiagramCanvas processDiagramCanvas, BpmnModel bpmnModel, FlowNode flowNode, List<String> highLightedActivities, List<String> highLightedFlows, double scaleFactor, Boolean drawSequenceFlowNameWithNoLabelDI) protected voiddrawArtifact(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 DefaultProcessDiagramCanvasgenerateProcessDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, List<String> highLightedFlows, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) protected static GraphicInfogetLineCenter(List<GraphicInfo> graphicInfoList) protected static DefaultProcessDiagramCanvas.SHAPE_TYPEgetShapeType(BaseElement baseElement) This method returns shape type of base element.
Each element can be presented as rectangle, rhombus, or ellipse.protected static DefaultProcessDiagramCanvasinitProcessDiagramCanvas(BpmnModel bpmnModel, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) protected booleanisPartOfCollapsedSubProcess(FlowElement flowElement, BpmnModel model) protected voidprepareBpmnModel(BpmnModel bpmnModel) voidsetActivityDrawInstructions(Map<Class<? extends BaseElement>, DefaultProcessDiagramGenerator.ActivityDrawInstruction> activityDrawInstructions) voidsetArtifactDrawInstructions(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:ProcessDiagramGeneratorGenerates a diagram of the given process definition, using the diagram interchange information of the process.- Specified by:
generateDiagramin 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:ProcessDiagramGeneratorGenerates a diagram of the given process definition, using the diagram interchange information of the process.- Specified by:
generateDiagramin 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:
generateDiagramin interfaceProcessDiagramGenerator
-
generateDiagram
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, boolean drawSequenceFlowNameWithNoLabelDI) - Specified by:
generateDiagramin interfaceProcessDiagramGenerator
-
generateDiagram
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, List<String> highLightedActivities, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) - Specified by:
generateDiagramin interfaceProcessDiagramGenerator
-
generateDiagram
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, boolean drawSequenceFlowNameWithNoLabelDI) - Specified by:
generateDiagramin interfaceProcessDiagramGenerator
-
generateDiagram
public InputStream generateDiagram(BpmnModel bpmnModel, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) - Specified by:
generateDiagramin interfaceProcessDiagramGenerator
-
generatePngDiagram
public InputStream generatePngDiagram(BpmnModel bpmnModel, boolean drawSequenceFlowNameWithNoLabelDI) - Specified by:
generatePngDiagramin interfaceProcessDiagramGenerator
-
generatePngDiagram
public InputStream generatePngDiagram(BpmnModel bpmnModel, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) - Specified by:
generatePngDiagramin interfaceProcessDiagramGenerator
-
generateJpgDiagram
- Specified by:
generateJpgDiagramin interfaceProcessDiagramGenerator
-
generateJpgDiagram
public InputStream generateJpgDiagram(BpmnModel bpmnModel, double scaleFactor, boolean drawSequenceFlowNameWithNoLabelDI) - Specified by:
generateJpgDiagramin 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:
generatePngImagein 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)
-