//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package org.activiti.image.impl;
import org.activiti.bpmn.model.AssociationDirection;
import org.activiti.bpmn.model.GraphicInfo;
import org.activiti.image.exception.ActivitiImageException;
import org.activiti.image.util.ReflectUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.font.FontRenderContext;
import java.awt.font.LineBreakMeasurer;
import java.awt.font.TextAttribute;
import java.awt.font.TextLayout;
import java.awt.geom.*;
import java.awt.geom.Ellipse2D.Double;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.text.AttributedCharacterIterator;
import java.text.AttributedString;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class DefaultProcessDiagramCanvas {
protected static final Logger LOGGER = LoggerFactory.getLogger(DefaultProcessDiagramCanvas.class);
protected static final int ARROW_WIDTH = 5;
protected static final int CONDITIONAL_INDICATOR_WIDTH = 16;
protected static final int DEFAULT_INDICATOR_WIDTH = 10;
protected static final int MARKER_WIDTH = 12;
protected static final int FONT_SIZE = 11;
protected static final int FONT_SPACING = 2;
protected static final int TEXT_PADDING = 3;
protected static final int ANNOTATION_TEXT_PADDING = 7;
protected static final int LINE_HEIGHT = 13;
protected static Color TASK_BOX_COLOR = new Color(249, 249, 249);
protected static Color SUBPROCESS_BOX_COLOR = new Color(255, 255, 255);
protected static Color EVENT_COLOR = new Color(255, 255, 255);
protected static Color CONNECTION_COLOR = new Color(88, 88, 88);
protected static Color CONDITIONAL_INDICATOR_COLOR = new Color(255, 255, 255);
protected static Color HIGHLIGHT_COLOR;
protected static Color HIGHLIGHT_RED_COLOR;
protected static Color LABEL_COLOR;
protected static Color TASK_BORDER_COLOR;
protected static Color EVENT_BORDER_COLOR;
protected static Color SUBPROCESS_BORDER_COLOR;
protected static Font LABEL_FONT;
protected static Font ANNOTATION_FONT;
protected static Stroke THICK_TASK_BORDER_STROKE;
protected static Stroke GATEWAY_TYPE_STROKE;
protected static Stroke END_EVENT_STROKE;
protected static Stroke MULTI_INSTANCE_STROKE;
protected static Stroke EVENT_SUBPROCESS_STROKE;
protected static Stroke NON_INTERRUPTING_EVENT_STROKE;
protected static Stroke HIGHLIGHT_FLOW_STROKE;
protected static Stroke ANNOTATION_STROKE;
protected static Stroke ASSOCIATION_STROKE;
protected static int ICON_PADDING;
protected static BufferedImage USERTASK_IMAGE;
protected static BufferedImage SCRIPTTASK_IMAGE;
protected static BufferedImage SERVICETASK_IMAGE;
protected static BufferedImage RECEIVETASK_IMAGE;
protected static BufferedImage SENDTASK_IMAGE;
protected static BufferedImage MANUALTASK_IMAGE;
protected static BufferedImage BUSINESS_RULE_TASK_IMAGE;
protected static BufferedImage SHELL_TASK_IMAGE;
protected static BufferedImage MULE_TASK_IMAGE;
protected static BufferedImage CAMEL_TASK_IMAGE;
protected static BufferedImage TIMER_IMAGE;
protected static BufferedImage COMPENSATE_THROW_IMAGE;
protected static BufferedImage COMPENSATE_CATCH_IMAGE;
protected static BufferedImage ERROR_THROW_IMAGE;
protected static BufferedImage ERROR_CATCH_IMAGE;
protected static BufferedImage MESSAGE_THROW_IMAGE;
protected static BufferedImage MESSAGE_CATCH_IMAGE;
protected static BufferedImage SIGNAL_CATCH_IMAGE;
protected static BufferedImage SIGNAL_THROW_IMAGE;
protected int canvasWidth = -1;
protected int canvasHeight = -1;
protected int minX = -1;
protected int minY = -1;
protected BufferedImage processDiagram;
protected Graphics2D g;
protected FontMetrics fontMetrics;
protected boolean closed;
protected ClassLoader customClassLoader;
protected String activityFontName = "Arial";
protected String labelFontName = "Arial";
protected String annotationFontName = "Arial";
public DefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) {
this.canvasWidth = width;
this.canvasHeight = height;
this.minX = minX;
this.minY = minY;
if (activityFontName != null) {
this.activityFontName = activityFontName;
}
if (labelFontName != null) {
this.labelFontName = labelFontName;
}
if (annotationFontName != null) {
this.annotationFontName = annotationFontName;
}
this.customClassLoader = customClassLoader;
this.initialize(imageType);
}
public DefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType) {
this.canvasWidth = width;
this.canvasHeight = height;
this.minX = minX;
this.minY = minY;
this.initialize(imageType);
}
public void initialize(String imageType) {
if ("png".equalsIgnoreCase(imageType)) {
this.processDiagram = new BufferedImage(this.canvasWidth, this.canvasHeight, 2);
} else {
this.processDiagram = new BufferedImage(this.canvasWidth, this.canvasHeight, 1);
}
this.g = this.processDiagram.createGraphics();
if (!"png".equalsIgnoreCase(imageType)) {
this.g.setBackground(new Color(255, 255, 255, 0));
this.g.clearRect(0, 0, this.canvasWidth, this.canvasHeight);
}
this.g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
this.g.setPaint(Color.black);
Font font = new Font(this.activityFontName, 1, 11);
this.g.setFont(font);
this.fontMetrics = this.g.getFontMetrics();
LABEL_FONT = new Font(this.labelFontName, 2, 10);
ANNOTATION_FONT = new Font(this.annotationFontName, 0, 11);
try {
USERTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/userTask.png", this.customClassLoader));
SCRIPTTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/scriptTask.png", this.customClassLoader));
SERVICETASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/serviceTask.png", this.customClassLoader));
RECEIVETASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/receiveTask.png", this.customClassLoader));
SENDTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/sendTask.png", this.customClassLoader));
MANUALTASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/manualTask.png", this.customClassLoader));
BUSINESS_RULE_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/businessRuleTask.png", this.customClassLoader));
SHELL_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/shellTask.png", this.customClassLoader));
CAMEL_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/camelTask.png", this.customClassLoader));
MULE_TASK_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/muleTask.png", this.customClassLoader));
TIMER_IMAGE = ImageIO.read(ReflectUtil.getResource("org/activiti/icons/timer.png", this.customClassLoader));
COMPENSATE_THROW_IMAGE = ImageIO.read(Re
没有合适的资源?快使用搜索试试~ 我知道了~
clouddo-activiti.zip
共67个文件
class:39个
java:14个
bpmn:4个
1星 需积分: 49 47 下载量 129 浏览量
2019-12-23
16:30:19
上传
评论 4
收藏 46.17MB ZIP 举报
温馨提示
在springcloud中集成activiti springcloud中拆分的代码见博客https://blog.csdn.net/u010740917/article/details/97629963
资源推荐
资源详情
资源评论
收起资源包目录
clouddo-activiti.zip (67个子文件)
clouddo-activiti
src
main
resources
holiday.bpmn 5KB
META-INF
MANIFEST.MF 5KB
bx.bpmn 8KB
application.yml 740B
java
com
bootdo
clouddoactiviti
service
admin
MenuService.java 593B
ClouddoActivitiApplication.java 676B
controller
BXController.java 8KB
taskController.java 17KB
ActivitiController.java 5KB
ADController.java 8KB
util
ActivitiUtils.java 697B
config
AuthConfig.java 1KB
ActivitiConfig.java 5KB
WebConfig.java 670B
vo
ActivitiDo.java 2KB
taskDo.java 1KB
org
activiti
image
impl
DefaultProcessDiagramCanvas.java 54KB
DefaultProcessDiagramGenerator.java 45KB
target
maven-status
maven-compiler-plugin
compile
default-compile
createdFiles.lst 2KB
inputFiles.lst 1KB
generated-sources
annotations
classes
holiday.bpmn 5KB
com
bootdo
clouddoactiviti
admin
MenuService.class 686B
controller
ADController.class 9KB
ActivitiController.class 8KB
BXController.class 9KB
taskController.class 17KB
util
ActivitiUtils.class 749B
config
ActivitiConfig.class 4KB
WebConfig.class 2KB
AuthConfig.class 2KB
ClouddoActivitiApplication.class 1KB
vo
taskDo.class 2KB
ActivitiDo.class 2KB
META-INF
MANIFEST.MF 5KB
bx.bpmn 8KB
org
activiti
image
impl
DefaultProcessDiagramGenerator$7.class 2KB
DefaultProcessDiagramGenerator$2.class 2KB
DefaultProcessDiagramCanvas.class 39KB
DefaultProcessDiagramGenerator$12.class 2KB
DefaultProcessDiagramGenerator$19.class 2KB
DefaultProcessDiagramGenerator$16.class 2KB
DefaultProcessDiagramGenerator$20.class 2KB
DefaultProcessDiagramGenerator$6.class 2KB
DefaultProcessDiagramGenerator$15.class 2KB
DefaultProcessDiagramGenerator$18.class 2KB
DefaultProcessDiagramGenerator$21.class 2KB
DefaultProcessDiagramGenerator$8.class 2KB
DefaultProcessDiagramGenerator$ActivityDrawInstruction.class 508B
DefaultProcessDiagramGenerator$13.class 2KB
DefaultProcessDiagramGenerator$9.class 2KB
DefaultProcessDiagramGenerator$22.class 3KB
DefaultProcessDiagramGenerator.class 28KB
DefaultProcessDiagramGenerator$3.class 2KB
DefaultProcessDiagramGenerator$10.class 2KB
DefaultProcessDiagramGenerator$1.class 3KB
DefaultProcessDiagramCanvas$SHAPE_TYPE.class 1KB
DefaultProcessDiagramGenerator$17.class 3KB
DefaultProcessDiagramGenerator$14.class 2KB
DefaultProcessDiagramGenerator$11.class 2KB
DefaultProcessDiagramGenerator$4.class 2KB
DefaultProcessDiagramGenerator$ArtifactDrawInstruction.class 508B
DefaultProcessDiagramGenerator$5.class 2KB
application.yml 740B
clouddo-activiti-0.0.1-SNAPSHOT.jar.original 82KB
clouddo-activiti-0.0.1-SNAPSHOT.jar 51.68MB
maven-archiver
pom.properties 105B
pom.xml 4KB
共 67 条
- 1
资源评论
- qq_375076712021-03-18你这个没有common啊代码不全啊
刘献盎
- 粉丝: 135
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功