package org.flowable.image.impl;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Point;
import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.font.FontRenderContext;
import java.awt.font.LineBreakMeasurer;
import java.awt.font.TextAttribute;
import java.awt.font.TextLayout;
import java.awt.geom.AffineTransform;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.Path2D;
import java.awt.geom.PathIterator;
import java.awt.geom.Rectangle2D;
import java.awt.geom.RoundRectangle2D;
import java.awt.image.BufferedImage;
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.List;
import javax.imageio.ImageIO;
import org.flowable.bpmn.model.AssociationDirection;
import org.flowable.bpmn.model.GraphicInfo;
import org.flowable.image.exception.FlowableImageException;
import org.flowable.image.util.ReflectUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 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/
*
* @see DefaultProcessDiagramGenerator
* @author Joram Barrez
*/
public class DefaultProcessDiagramCanvas {
protected static final Logger LOGGER = LoggerFactory.getLogger(DefaultProcessDiagramCanvas.class);
public enum SHAPE_TYPE {
Rectangle, Rhombus, Ellipse
}
// Predefined sized
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 = FONT_SIZE + FONT_SPACING;
// Colors
protected static final Color TASK_BOX_COLOR = new Color(249, 249, 249);
protected static final Color SUBPROCESS_BOX_COLOR = new Color(255, 255, 255);
protected static final Color EVENT_COLOR = new Color(255, 255, 255);
protected static final Color CONNECTION_COLOR = new Color(88, 88, 88);
protected static final Color CONDITIONAL_INDICATOR_COLOR = new Color(255, 255, 255);
protected static final Color HIGHLIGHT_COLOR = new Color(32, 160, 95);
protected static final Color LABEL_COLOR = new Color(112, 146, 190);
protected static final Color TASK_BORDER_COLOR = new Color(187, 187, 187);
protected static final Color EVENT_BORDER_COLOR = new Color(88, 88, 88);
protected static final Color SUBPROCESS_BORDER_COLOR = new Color(0, 0, 0);
protected static final Color BG_COLOR_RED =new Color(200, 173, 169);
// Fonts
protected static Font LABEL_FONT;
protected static Font ANNOTATION_FONT;
// Strokes
protected static final Stroke THICK_TASK_BORDER_STROKE = new BasicStroke(3.0f);
protected static final Stroke GATEWAY_TYPE_STROKE = new BasicStroke(3.0f);
protected static final Stroke END_EVENT_STROKE = new BasicStroke(3.0f);
protected static final Stroke MULTI_INSTANCE_STROKE = new BasicStroke(1.3f);
protected static final Stroke EVENT_SUBPROCESS_STROKE = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1.0f, new float[] { 1.0f }, 0.0f);
protected static final Stroke NON_INTERRUPTING_EVENT_STROKE = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1.0f, new float[] { 4.0f, 3.0f }, 0.0f);
protected static final Stroke HIGHLIGHT_FLOW_STROKE = new BasicStroke(1.3f);
protected static final Stroke ANNOTATION_STROKE = new BasicStroke(2.0f);
protected static final Stroke ASSOCIATION_STROKE = new BasicStroke(2.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1.0f, new float[] { 2.0f, 2.0f }, 0.0f);
// icons
protected static final int ICON_PADDING = 5;
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 CASETASK_IMAGE;
protected static BufferedImage MANUALTASK_IMAGE;
protected static BufferedImage BUSINESS_RULE_TASK_IMAGE;
protected static BufferedImage SHELL_TASK_IMAGE;
protected static BufferedImage DMN_TASK_IMAGE;
protected static BufferedImage MULE_TASK_IMAGE;
protected static BufferedImage CAMEL_TASK_IMAGE;
protected static BufferedImage HTTP_TASK_IMAGE;
protected static BufferedImage TIMER_IMAGE;
protected static BufferedImage COMPENSATE_THROW_IMAGE;
protected static BufferedImage COMPENSATE_CATCH_IMAGE;
protected static BufferedImage CONDITIONAL_CATCH_IMAGE;
protected static BufferedImage ERROR_THROW_IMAGE;
protected static BufferedImage ERROR_CATCH_IMAGE;
protected static BufferedImage ESCALATION_THROW_IMAGE;
protected static BufferedImage ESCALATION_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";
/**
* 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.
*
*/
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;
initialize(imageType);
}
/**
* 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.
*
* @param minX
* Hint that will be used when generating the image. Parts that fall below minX on the horizontal scale will be cropped.
* @param minY
* Hint that will be used when generating the image. Parts that fall below minX on the horizontal scale will be cropped.
*/
public DefaultProcessDiagramCanvas(int width, int he
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
springboot-flowable-cims基于工作流引擎flowable、spring boot开发的工作流服务平台,完美整合官方flowable modeler 进行流程设计、表单设计。提供flowable rest api 接口 供后台业务系统流程调用。提供前后端分离后台管理进行模拟流程测试、流程管理
资源推荐
资源详情
资源评论
收起资源包目录
springboot-flowable-cims基于工作流引擎flowable、spring boot开发的工作流服务平台 (679个子文件)
index.css 414KB
app.542b4956.css 271KB
app.b1334f68.css 271KB
chunk-1a3ad8c9.3bb3170f.css 103KB
chunk-94af4408.37fa2802.css 45KB
chunk-libs.df747a7a.css 45KB
chunk-libs.a5aff469.css 45KB
chunk-91590938.b043920c.css 5KB
chunk-11468d72.49d5031f.css 4KB
chunk-6c84ca5b.054914a3.css 2KB
chunk-c8ad366c.7f37e696.css 2KB
chunk-commons.814b519d.css 1KB
waves.css 825B
chunk-5165f4b0.a1904cee.css 745B
.env.development 633B
.editorconfig 244B
fontawesome-webfont.674f50d2.eot 162KB
bpmn.08b5f281.eot 47KB
.eslintignore 34B
401.gif 160KB
401.089007e7.gif 160KB
.gitignore 534B
.gitignore 256B
index.hbs 302B
index.hbs 302B
index.hbs 185B
index.html 5KB
index.html 488B
favicon.ico 66KB
favicon.ico 66KB
DefaultProcessDiagramCanvas.java 62KB
FlowableTaskServiceImpl.java 27KB
BCrypt.java 27KB
FlowableProcessInstanceServiceImpl.java 24KB
FlowableBpmnModelServiceImpl.java 17KB
AbstractRememberMeServices.java 15KB
FlowApiService.java 12KB
SecurityConfiguration.java 10KB
ApiFlowableModelResource.java 10KB
DatabaseConfiguration.java 9KB
ApiFormDetailReource.java 9KB
CustomPersistentRememberMeServices.java 8KB
MultiRequestBodyArgumentResolver.java 8KB
RemoteIdmServiceImpl.java 8KB
ProcessInstanceTest.java 8KB
FlowableModelServiceImpl.java 7KB
BaseProcessService.java 6KB
SysUserServiceImpl.java 6KB
LeaveApiService.java 5KB
CodeGenerator.java 5KB
SpringContextUtil.java 5KB
ApiFlowableTaskResource.java 4KB
ApiCommonResource.java 4KB
AddCommentCmd.java 4KB
TransactionConfig.java 4KB
XssHttpServletRequestWrapper.java 4KB
MyWebMvcConfigurerAdapter.java 4KB
ApiFlowableProcessInstanceResource.java 4KB
Oauth2Filter.java 4KB
IFormApiService.java 4KB
FlowApiRest.java 4KB
ApiFlowableProcessDefinitionResource.java 4KB
ApiSysUserResource.java 4KB
ShiroConfig.java 4KB
LeaveService.java 3KB
ApiFlowableGroupResource.java 3KB
RemoteAccountResource.java 3KB
AutoCompleteFirstTaskListener.java 3KB
ApiFlowableUserResource.java 3KB
GlobalRequestBodyAdvice.java 3KB
IFlowableTaskService.java 3KB
ILeaveDao.java 3KB
SecurityUtils.java 3KB
FormApiRest.java 3KB
CommentVo.java 3KB
TaskVo.java 3KB
CustomDaoAuthenticationProvider.java 3KB
XssUtils.java 3KB
HrtoOrgInfoServiceImpl.java 3KB
AddHisCommentCmd.java 3KB
ProcessInstanceVo.java 3KB
ApplicationConfiguration.java 3KB
BruceUserTaskJsonConverter.java 3KB
IFlowableProcessInstanceService.java 3KB
IFlowApi.java 3KB
FlowableConfig.java 2KB
IFlowableBpmnModelService.java 2KB
SysUserTokenServiceImpl.java 2KB
DeleteFlowableProcessInstanceCmd.java 2KB
ApplicationConfiguration.java 2KB
Oauth2Realm.java 2KB
ApiLoginResource.java 2KB
BCryptPasswordEncoder.java 2KB
DatabaseConfiguration.java 2KB
FlowProcessDiagramGenerator.java 2KB
ApiFlowablePrivilegeResource.java 2KB
GlobalResponseBodyAdvice.java 2KB
HttpContextUtils.java 2KB
ProcessDefinitionVo.java 2KB
RequestLogAspect.java 2KB
共 679 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
- xulei_198503222024-03-15资源不错,很实用,内容全面,介绍详细,很好用,谢谢分享。
- sc9011112024-02-26内容与描述一致,超赞的资源,值得借鉴的内容很多,支持!
- kingsam_sue2024-01-17资源很实用,对我启发很大,有很好的参考价值,内容详细。
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6651
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功