package com.pointlion.back.oa.service.flowImg;
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;
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.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;
/**
* @Description: CustomProcessDiagramCanvas
* @Author: 丶Lion
* @Date: 2019/10/15 0015 9:55
* @Version 1.0
*/
public class CustomProcessDiagramCanvas {
private static final Logger LOG = LoggerFactory.getLogger(CustomProcessDiagramCanvas.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 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 RUNNING_HIGHLIGHT_COLOR = Color.RED;
protected static Color HIGHLIGHT_COLOR = Color.GREEN;
protected static Color LABEL_COLOR = new Color(112, 146, 190);
// protected static Color LABEL_COLOR = Color.blue;
protected static Color TASK_BORDER_COLOR = new Color(187, 187, 187);
protected static Color EVENT_BORDER_COLOR = new Color(88, 88, 88);
protected static Color SUBPROCESS_BORDER_COLOR = new Color(0, 0, 0);
// Fonts
protected static Font LABEL_FONT = new Font("微软雅黑", Font.ITALIC, 11);
protected static Font ANNOTATION_FONT = new Font("Arial", Font.PLAIN, FONT_SIZE);
protected static Font TASK_FONT = new Font("Arial", Font.PLAIN, FONT_SIZE);
// Strokes
//TODO 边框宽度修改
//protected static Stroke THICK_TASK_BORDER_STROKE = new BasicStroke(3.0f);
protected static Stroke THICK_TASK_BORDER_STROKE = new BasicStroke(2.0f);
protected static Stroke GATEWAY_TYPE_STROKE = new BasicStroke(3.0f);
protected static Stroke END_EVENT_STROKE = new BasicStroke(3.0f);
protected static Stroke MULTI_INSTANCE_STROKE = new BasicStroke(1.3f);
protected static Stroke EVENT_SUBPROCESS_STROKE = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1.0f, new float[]{1.0f}, 0.0f);
protected static 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 Stroke HIGHLIGHT_FLOW_STROKE = new BasicStroke(1.3f);
protected static Stroke ANNOTATION_STROKE = new BasicStroke(2.0f);
protected static 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 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 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";
/**
* 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 CustomProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType, String activityFontName, String labelFontName, 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;
}
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 CustomProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType) {
this.canvasWidth = width;
this.canvasHeight = height;
this.minX = minX;
this.minY = minY;
initialize(imageType);
}
public void initialize(String imageType) {
if ("png".equalsIgnoreCase(imageType)) {
this.processDiagram = new BufferedImage(canvasWidth, canvasHeight, BufferedImage.TYPE_INT_ARGB);
} else {
this.processDiagram = new BufferedImage(canvasWidth, canvasHeight, BufferedImage.TYPE_INT_RGB);
}
this.g = processDiagram.createGraphics();
if ("png".equalsIgnoreCase(imageType) == false) {
this.g.setBackground(new Color(255, 255, 255, 0));
this.g.clearRect(0, 0, canvasWidth, canvasHeight);
}
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.setPaint(Color.black);
Font font = new Font(activityFontName, Font.BOLD, FONT_SIZE);
g.setFont
没有合适的资源?快使用搜索试试~ 我知道了~
基于RuoYi-VUE版本开发的OA协同办公系统源码 集成Flowable流程引擎
共415个文件
java:300个
xml:43个
png:34个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
1 下载量 49 浏览量
2023-08-12
09:19:07
上传
评论
收藏 10.06MB ZIP 举报
温馨提示
1.用户管理:用户是系统操作者,该功能主要完成系统用户配置。 2.部门管理:配置系统组织机构,树结构展现支持数据权限。 3.岗位管理:配置系统用户所属担任职务。 4.菜单管理:配置系统菜单,操作权限,按钮权限标识等。 5.角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。 6.字典管理:对系统中经常使用的一些较为固定的数据进行维护。 7.参数管理:对系统动态配置常用参数。 8.通知公告:系统通知公告信息发布维护。 9.操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。 10.登录日志:系统登录日志记录查询包含登录异常。 11.在线用户:当前系统中活跃用户状态监控。 12.定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。 13.代码生成:前后端代码的生成(java、html、xml、sql)支持CRUD下载 。 14.系统接口:根据业务代码自动生成相关的api接口文档。 15.服务监控:监视当前系统CPU、内存、磁盘、堆栈等相关信息。 16.缓存监控:对系统的缓存信息查询,命令统计等。 17.在线构建器:拖动表单元素生成相应的html代码
资源推荐
资源详情
资源评论
收起资源包目录
基于RuoYi-VUE版本开发的OA协同办公系统源码 集成Flowable流程引擎 (415个子文件)
run.bat 229B
package.bat 141B
clean.bat 102B
.gitignore 233B
.gitignore 180B
404.html 4KB
CustomProcessDiagramCanvas.java 56KB
CustomProcessDiagramGenerator.java 49KB
ExcelUtil.java 46KB
Convert.java 25KB
HTMLFilter.java 19KB
FlowImgService.java 17KB
GenTableServiceImpl.java 17KB
SysUserServiceImpl.java 15KB
UUID.java 15KB
StringUtils.java 15KB
SysMenuServiceImpl.java 14KB
ReflectUtils.java 14KB
VelocityUtils.java 14KB
ActReModelService.java 13KB
SysRoleServiceImpl.java 11KB
FlowProcessInstanceService.java 10KB
ActReProcdefService.java 10KB
SysUserController.java 9KB
HttpUtils.java 9KB
SysDeptServiceImpl.java 9KB
Base64.java 9KB
SysRoleController.java 8KB
FileUtils.java 8KB
GenUtils.java 8KB
FileUploadUtils.java 8KB
GenTableColumn.java 8KB
GenTable.java 8KB
LogAspect.java 7KB
GenController.java 7KB
SysJobController.java 7KB
IpUtils.java 7KB
SysUser.java 7KB
SysJobServiceImpl.java 7KB
CommonController.java 7KB
Server.java 6KB
SysConfigServiceImpl.java 6KB
TokenService.java 6KB
SysDictTypeServiceImpl.java 6KB
SecurityConfig.java 6KB
RedisCache.java 6KB
SysDeptController.java 6KB
JobInvokeUtil.java 6KB
BaseController.java 5KB
WorkflowConstants.java 5KB
SysProfileController.java 5KB
SysRole.java 5KB
SysMenu.java 5KB
MyBatisConfig.java 5KB
TestController.java 5KB
DictUtils.java 5KB
SysOperLog.java 5KB
SysMenuController.java 5KB
SysDictTypeController.java 5KB
DateUtils.java 5KB
DruidConfig.java 5KB
DataScopeAspect.java 5KB
SysLoginService.java 5KB
SerialService.java 5KB
FlowReProcdefController.java 5KB
ScheduleUtils.java 5KB
SysConfigController.java 5KB
PermissionService.java 5KB
FlowReModelController.java 5KB
ISysUserService.java 5KB
CacheController.java 5KB
SwaggerConfig.java 5KB
SysJob.java 5KB
SysPostController.java 5KB
LoginUser.java 4KB
SpringUtils.java 4KB
ServletUtils.java 4KB
EscapeUtil.java 4KB
VTasklistController.java 4KB
SysDictData.java 4KB
SysDept.java 4KB
SysPostServiceImpl.java 4KB
CaptchaConfig.java 4KB
ActHiTaskinst.java 4KB
SysDictDataController.java 4KB
BillTypeEnum.java 4KB
Excel.java 4KB
FlowHiTaskinstController.java 4KB
SameUrlDataInterceptor.java 4KB
GlobalExceptionHandler.java 4KB
SysRegisterService.java 4KB
GlobalProcistEndListener.java 4KB
AsyncFactory.java 4KB
GenConstants.java 4KB
ISysRoleService.java 4KB
SerialController.java 4KB
VTasklistService.java 4KB
SysUserOnlineController.java 3KB
StrFormatter.java 3KB
AjaxResult.java 3KB
共 415 条
- 1
- 2
- 3
- 4
- 5
资源评论
源码头
- 粉丝: 255
- 资源: 504
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功