Browse Source

Merge remote-tracking branch 'upstream/feature/x' into feature/x

feature/x
Sky.Luo 2 years ago
parent
commit
eedb191cad
  1. 12
      designer-base/src/main/java/com/fr/base/svg/SVGIcon.java
  2. 115
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  3. 2
      designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java
  4. 2
      designer-base/src/main/java/com/fr/design/actions/community/SignAction.java
  5. 2
      designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java
  6. 5
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  7. 20
      designer-base/src/main/java/com/fr/design/constants/UIConstants.java
  8. 5
      designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java
  9. 31
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java
  10. 18
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java
  11. 30
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java
  12. 3
      designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java
  13. 27
      designer-base/src/main/java/com/fr/design/icon/WarningIcon.java
  14. 2
      designer-base/src/main/java/com/fr/design/locale/impl/VideoMark.java
  15. 2
      designer-base/src/main/java/com/fr/design/lock/LockInfoDialog.java
  16. 9
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  17. 3
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  18. 37
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java
  19. 16
      designer-base/src/main/java/com/fr/design/utils/SvgDraw.java
  20. 73
      designer-base/src/main/java/com/fr/design/utils/SvgDrawUtils.java
  21. 28
      designer-base/src/main/java/com/fr/design/utils/SvgPaintUtils.java
  22. 140
      designer-base/src/main/java/com/fr/design/utils/TemplateUtils.java
  23. 14
      designer-base/src/main/java/com/fr/design/worker/save/SaveFailureHandler.java
  24. BIN
      designer-base/src/main/resources/com/fr/design/images/control/down_arrow.png
  25. BIN
      designer-base/src/main/resources/com/fr/design/images/control/east_arrow.png
  26. BIN
      designer-base/src/main/resources/com/fr/design/images/control/up_arrow.png
  27. BIN
      designer-base/src/main/resources/com/fr/design/images/control/west_arrow.png
  28. 4
      designer-base/src/main/resources/com/fr/design/images/lookandfeel/TreeLeafIcon.svg
  29. 3
      designer-base/src/main/resources/com/fr/design/standard/arrowlinear/down_arrow.svg
  30. 3
      designer-base/src/main/resources/com/fr/design/standard/arrowlinear/east_arrow.svg
  31. 3
      designer-base/src/main/resources/com/fr/design/standard/arrowlinear/up_arrow.svg
  32. 3
      designer-base/src/main/resources/com/fr/design/standard/arrowlinear/west_arrow.svg
  33. 2
      designer-base/src/main/resources/com/fr/design/standard/drag/left_normal.svg
  34. 2
      designer-base/src/main/resources/com/fr/design/standard/drag/left_pressed.svg
  35. 2
      designer-base/src/main/resources/com/fr/design/standard/drag/right_normal.svg
  36. 2
      designer-base/src/main/resources/com/fr/design/standard/drag/right_pressed.svg
  37. 6
      designer-base/src/main/resources/com/fr/design/standard/fileicon/minus.svg
  38. 4
      designer-base/src/main/resources/com/fr/design/standard/fileicon/plus.svg
  39. 13
      designer-base/src/main/resources/com/fr/design/standard/floatpop_normal.svg
  40. 10
      designer-base/src/main/resources/com/fr/design/standard/poparrow/pop_down_arrow.svg
  41. 3
      designer-base/src/main/resources/com/fr/design/standard/poparrow/pop_up_arrow.svg
  42. 3
      designer-base/src/main/resources/com/fr/design/standard/preview_down_icon_normal.svg
  43. 6
      designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/down_hover.svg
  44. 4
      designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/down_normal.svg
  45. 4
      designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/up_hover.svg
  46. 4
      designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/up_normal.svg
  47. 14
      designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java
  48. 2
      designer-base/src/test/java/com/fr/design/data/DesignTableDataManagerTest.java
  49. 37
      designer-chart/src/main/java/com/fr/design/locale/impl/EmptyDataMark.java
  50. 11
      designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStylePane.java
  51. 0
      designer-chart/src/main/resources/com/fr/design/images/en_us_emptydata.png
  52. 0
      designer-chart/src/main/resources/com/fr/design/images/zh_cn_emptydata.png
  53. 0
      designer-chart/src/main/resources/com/fr/design/images/zh_tw_emptydata.png
  54. 16
      designer-form/src/main/java/com/fr/design/designer/creator/XNumberEditor.java
  55. 6
      designer-form/src/main/java/com/fr/design/designer/creator/XPassword.java
  56. 11
      designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java
  57. 37
      designer-form/src/main/java/com/fr/design/designer/properties/mobile/NumberEditorMobilePropertyUI.java
  58. 37
      designer-form/src/main/java/com/fr/design/designer/properties/mobile/PasswordMobilePropertyUI.java
  59. 37
      designer-form/src/main/java/com/fr/design/designer/properties/mobile/TextAreaMobilePropertyUI.java
  60. 5
      designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java
  61. 94
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/BaseTextEditorMobileDefinePane.java
  62. 33
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/NumberEditorMobileDefinePane.java
  63. 25
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/PasswordMobileDefinePane.java
  64. 57
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ScanCodeMobileDefinePane.java
  65. 25
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TextAreaAdvancedDefinePane.java
  66. 43
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobilePasswordEditSettingPane.java
  67. 38
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextAreaSettingPane.java
  68. 59
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextEditSettingPane.java
  69. 28
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextFieldInputSettingPane.java
  70. 13
      designer-realize/src/main/java/com/fr/design/cell/bar/DynamicScrollButton.java
  71. 54
      designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java
  72. 11
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsImagePanel.java
  73. 9
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java
  74. 5
      designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortGroupPane.java

12
designer-base/src/main/java/com/fr/base/svg/SVGIcon.java

@ -1,9 +1,12 @@
package com.fr.base.svg;
import com.fr.design.utils.SvgDrawUtils;
import com.fr.general.IOUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.Icon;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@ -34,10 +37,7 @@ public class SVGIcon implements Icon {
public void paintIcon(Component c, Graphics g, int x, int y) {
if (HI_DPI_SURPORT) {
Graphics2D graphics = (Graphics2D) g.create(x, y, image.getWidth(null), image.getHeight(null));
float scale = SYSTEM_SCALE;
graphics.scale(1 / scale, 1 / scale);
graphics.drawImage(image, 0, 0, null);
graphics.scale(1.0D, 1.0D);
SvgDrawUtils.doDrawSVG(graphics, () -> SvgDrawUtils.drawImage(graphics, image, 0, 0, null));
graphics.dispose();
} else {
g.drawImage(image, x, y, null);

115
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -65,6 +65,9 @@ import java.util.HashSet;
import static javax.swing.JOptionPane.QUESTION_MESSAGE;
public class EnvChangeEntrance {
private static final String BRANCH_TAG = "#";
private static final String BRANCH_BEGIN = "-";
private static final int BRANCH_SUB_LENGTH = 13;
public static EnvChangeEntrance getInstance() {
return HOLDER.singleton;
@ -116,19 +119,14 @@ public class EnvChangeEntrance {
if (!checkValid) {
return false;
}
WorkContext.switchTo(workspace, new WorkContextCallback() {
@Override
public void done() {
DesignerEnvManager.getEnvManager().setCurEnvName(envName);
DesignUtils.refreshDesignerFrame();
DesignTableDataManager.fireDSChanged(new HashMap<String, String>());
if (WorkContext.getCurrent().isLocal()) {
//初始化一下serverTray
ServerTray.init();
}
}
});
//如果是相同环境
if (isSameEnv(workspace)) {
//目前切换到相同环境需要更新一下名字,后续如果有别的操作直接往里面加就行了
switch2SameEnv(envName);
} else {
//切换到新环境,做下封装
switch2OtherEnv(workspace, envName);
}
// REPORT-25688如果是war包部署的服务器,给与提示
if (WorkContext.getCurrent().isWarDeploy()) {
FineJOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Basic_War_Deploy_Tip"),
@ -136,7 +134,7 @@ public class EnvChangeEntrance {
}
//REPORT-13810如果只是添加了工作目录,没有切换,这里ToolArea也是要显示新建的工作目录
JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template != null) {
if (JTemplate.isValid(template)) {
template.refreshToolArea();
}
PluginErrorDesignReminder.getInstance().remindStartFailedPlugins();
@ -156,6 +154,47 @@ public class EnvChangeEntrance {
return true;
}
/**
* 切换到其他环境
*
* @param workspace 要切换的环境
* @param envName 要切换的环境名称
*/
private void switch2OtherEnv(Workspace workspace, String envName) {
WorkContext.switchTo(workspace, new WorkContextCallback() {
@Override
public void done() {
DesignerEnvManager.getEnvManager().setCurEnvName(envName);
DesignUtils.refreshDesignerFrame();
DesignTableDataManager.fireDSChanged(new HashMap<String, String>());
if (WorkContext.getCurrent().isLocal()) {
//初始化一下serverTray
ServerTray.init();
}
}
});
}
/**
* 切换到相同环境要做的事情
*
* @param envName 当前的环境名
*/
private void switch2SameEnv(String envName) {
//当前环境名称可能重命名更改过,需要更新一下,防止启动失败
DesignerEnvManager.getEnvManager().setCurEnvName(envName);
}
/**
* 是否切换到相同环境
*
* @param workspace 要切换的环境
* @return 是则返回true
*/
private boolean isSameEnv(Workspace workspace) {
return AssistUtils.equals(WorkContext.getCurrent(), workspace);
}
/**
* 这个功能留着可能会加回来先做注释处理
* 切换远程环境之前进行版本检测当版本不一致的时候提示
@ -201,13 +240,14 @@ public class EnvChangeEntrance {
return true;
}
/**
/**
* 对选择的环境做服务检测
*
* @param selectedEnv 选择的工作环境
*/
public void showServiceDialog(DesignerWorkspaceInfo selectedEnv) throws Exception {
//是否需要做服务校验
if(needCheckBranch(selectedEnv)) {
if (needCheckBranch(selectedEnv)) {
String localBranch;
String remoteBranch;
WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection();
@ -228,18 +268,18 @@ public class EnvChangeEntrance {
StringBuilder textBuilder = new StringBuilder();
for (Class clazz : noExistServiceSet) {
WorkspaceAPI workspaceAPI = (WorkspaceAPI) clazz.getAnnotation(WorkspaceAPI.class);
if(workspaceAPI == null){
if (workspaceAPI == null) {
FineLoggerFactory.getLogger().info("workspace service {} get annotation failed", clazz);
continue;
}
if(workspaceAPI.ignore()){
if (workspaceAPI.ignore()) {
continue;
}
String descriptionOfCN = InterProviderFactory.getProvider().getLocText(workspaceAPI.description());
textBuilder.append(descriptionOfCN).append("\n");
}
String areaText = textBuilder.toString();
if(StringUtils.isEmpty(areaText)){
if (StringUtils.isEmpty(areaText)) {
return;
}
@ -251,24 +291,25 @@ public class EnvChangeEntrance {
* 判断是否需要做版本验证判断依据为
* 1选择的环境为远程环境
* 2一个月内不弹出是否勾选
*
* @param selectedEnv 选择的环境
* @return
*/
private boolean needCheckBranch(DesignerWorkspaceInfo selectedEnv){
if(selectedEnv.getType() == DesignerWorkspaceType.Remote){
private boolean needCheckBranch(DesignerWorkspaceInfo selectedEnv) {
if (selectedEnv.getType() == DesignerWorkspaceType.Remote) {
try {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
if(StringUtils.isEmpty(selectedEnv.getRemindTime())){
if (StringUtils.isEmpty(selectedEnv.getRemindTime())) {
return true;
}
//获取记录的时间
Date remindTime = format.parse(selectedEnv.getRemindTime());
calendar.setTime(remindTime);
//获取一个月后的时间
calendar.add(Calendar.MONTH,1);
calendar.add(Calendar.MONTH, 1);
//与当前时间作对比,然后判断是否提示
if(new Date().after(calendar.getTime())){
if (new Date().after(calendar.getTime())) {
return true;
}
} catch (ParseException e) {
@ -280,21 +321,22 @@ public class EnvChangeEntrance {
/**
* 获取不存在的服务列表
*
* @param info 环境连接信息
* @return 以Set形式返回不存在的服务
*/
public Set<Class> getNoExistServiceSet(WorkspaceConnectionInfo info){
public Set<Class> getNoExistServiceSet(WorkspaceConnectionInfo info) {
Set<Class> noExistServiceSet = new HashSet<Class>();
Set<Class> remoteServiceSet = new HashSet<Class>();
Set<Class> localServiceSet = FineObjectPool.getInstance().getServerPool().keySet();
try {
JSONArray serviceArray = new FunctionalHttpRequest(info).getServiceList();
for(int i = 0; i < serviceArray.size(); i++){
try{
for (int i = 0; i < serviceArray.size(); i++) {
try {
Class clazz = Class.forName((String) serviceArray.get(i));
remoteServiceSet.add(clazz);
} catch (Exception e){
} catch (Exception e) {
continue;
}
}
@ -304,12 +346,12 @@ public class EnvChangeEntrance {
} catch (WorkspaceConnectionException e) {
FineLoggerFactory.getLogger().info(e.getMessage());
//根据本地的服务列表做逐一检测
for(Class clazz : localServiceSet) {
for (Class clazz : localServiceSet) {
Method testMethod = Reflect.on(Method.class).create(clazz, "connectTest", new Class[0], String.class, new Class[0], 1025, 8, null, null, null, null).get();
WorkspaceProxyPool proxyPool = (WorkspaceProxyPool) (((RemoteWorkspace) WorkContext.getCurrent()).getClient()).getPool();
Result result = proxyPool.testInvoker(testMethod);
Exception invokeException = (Exception) result.getException();
if(invokeException != null){
if (invokeException != null) {
Exception cause = (Exception) invokeException.getCause();
//获取被包装最底层的异常
while (cause != null) {
@ -317,26 +359,27 @@ public class EnvChangeEntrance {
cause = (Exception) invokeException.getCause();
}
//该异常表示服务不存在
if(invokeException instanceof ClassNotFoundException){
if (invokeException instanceof ClassNotFoundException) {
noExistServiceSet.add(clazz);
}
}
}
return noExistServiceSet;
} catch (Exception e){
FineLoggerFactory.getLogger().error(e.getMessage(),e);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return noExistServiceSet;
}
}
/**
* 格式化分支版本号
*
* @param branch 初始的分支版本号
* @return 格式化后的版本号
*/
private String formatBranch(String branch){
if(branch.contains("#")){
return branch.substring(branch.lastIndexOf("-") + 1, branch.length() - 13);
private String formatBranch(String branch) {
if (branch.contains(BRANCH_TAG)) {
return branch.substring(branch.lastIndexOf(BRANCH_BEGIN) + 1, branch.length() - BRANCH_SUB_LENGTH);
}
return branch;
}

2
designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java

@ -18,7 +18,7 @@ public class QuestionAction extends AbstractDesignerSSO {
@Override
public String getJumpUrl() {
return CloudCenter.getInstance().acquireUrlByKind("bbs.questions", "http://bbs.fanruan.com/wenda");
return CloudCenter.getInstance().acquireUrlByKind("bbs.questions", "https://home.fanruan.com/finereport/wenda");
}
public static final MenuKeySet QUESTIONS = new MenuKeySet() {

2
designer-base/src/main/java/com/fr/design/actions/community/SignAction.java

@ -18,7 +18,7 @@ public class SignAction extends AbstractDesignerSSO {
@Override
public String getJumpUrl() {
return CloudCenter.getInstance().acquireUrlByKind("bbs.aut", "https://bbs.fanruan.com/certification/");
return CloudCenter.getInstance().acquireUrlByKind("bbs.aut", "https://cert.fanruan.com/");
}
public static final MenuKeySet SIGN = new MenuKeySet() {

2
designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java

@ -20,7 +20,7 @@ public class TechSolutionAction extends AbstractDesignerSSO {
@Override
public String getJumpUrl() {
return CloudCenter.getInstance().acquireUrlByKind("bbs.solution", "http://bbs.fanruan.com/forum-113-1.html");
return CloudCenter.getInstance().acquireUrlByKind("bbs.solution", "https://home.fanruan.com/finereport/forum");
}
public static final MenuKeySet TSO = new MenuKeySet() {

5
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -390,10 +390,7 @@ public class PreferencePane extends BasicPane {
vcsPane.add(enableVcsPanel);
vcsPane.add(intervalPanel);
vcsPane.add(saveCommitCheckBox);
if (VcsHelper.getInstance().isLegacyMode()) {
// 老版本时才显示gc选项
vcsPane.add(gcControlPane);
}
vcsPane.add(gcControlPane);
}
/**

20
designer-base/src/main/java/com/fr/design/constants/UIConstants.java

@ -153,10 +153,10 @@ public interface UIConstants {
public static final BufferedImage DRAG_BAR = IOUtils.readImage("com/fr/design/images/control/bar.png");
public static final BufferedImage DRAG_BAR_LIGHT = IOUtils.readImage("com/fr/design/images/control/bar-light.png");
public static final BufferedImage ARROW_NORTH = IOUtils.readImage("com/fr/design/images/control/up_arrow.png");
public static final BufferedImage ARROW_SOUTH = IOUtils.readImage("com/fr/design/images/control/down_arrow.png");
public static final BufferedImage ARROW_EAST = IOUtils.readImage("com/fr/design/images/control/east_arrow.png");
public static final BufferedImage ARROW_WEST = IOUtils.readImage("com/fr/design/images/control/west_arrow.png");
public static final Image ARROW_NORTH = SVGLoader.load("/com/fr/design/standard/arrowlinear/up_arrow.svg");
public static final Image ARROW_SOUTH = SVGLoader.load("/com/fr/design/standard/arrowlinear/down_arrow.svg");
public static final Image ARROW_EAST = SVGLoader.load("/com/fr/design/standard/arrowlinear/east_arrow.svg");
public static final Image ARROW_WEST = SVGLoader.load("/com/fr/design/standard/arrowlinear/west_arrow.svg");
public static final BufferedImage DRAG_BAR_RIGHT = IOUtils.readImage("com/fr/design/images/control/barm.png");
public static final BufferedImage DRAG_BAR_LEFT = IOUtils.readImage("com/fr/design/images/control/barl.png");
@ -172,24 +172,24 @@ public interface UIConstants {
public static final Image DRAG_LINE = SVGLoader.load("/com/fr/design/standard/dot_line_normal.svg");
public static final BufferedImage ACCESSIBLE_EDITOR_DOT = IOUtils.readImage("com/fr/design/images/control/dot.png");
public static final BufferedImage DRAG_DOT_VERTICAL = IOUtils.readImage("com/fr/design/images/control/dotv.png");
public static final BufferedImage POP_BUTTON_DOWN = IOUtils.readImage("com/fr/design/images/buttonicon/popdownarrow.png");
public static final BufferedImage POP_BUTTON_UP = IOUtils.readImage("com/fr/design/images/buttonicon/popuparrow.png");
public static final Image POP_BUTTON_DOWN = SVGLoader.load("/com/fr/design/standard/poparrow/pop_down_arrow.svg");
public static final Image POP_BUTTON_UP = SVGLoader.load("/com/fr/design/standard/poparrow/pop_up_arrow.svg");
public static final BufferedImage DRAG_DOWN_SELECTED_SMALL = IOUtils.readImage("com/fr/design/images/buttonicon/downSelected.png");
public static final BufferedImage DRAG_LEFT_NORMAL_SMALL = IOUtils.readImage("com/fr/design/images/buttonicon/leftNormal.png");
public static final BufferedImage WATERMARK_BACKGROUND = IOUtils.readImage("/com/fr/design/images/dialog/watermark/" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_WaterMark_Background_Icon_File_Name"));
public static final int MODEL_NORMAL = 0;
public static final int MODEL_PRESS = 1;
public static final Icon ARROW_DOWN_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/arrowdown.png");
public static final Icon ARROW_DOWN_ICON = IconUtils.readIcon("/com/fr/design/standard/arrowlinear/down_arrow.svg");
public static final Icon ARROW_UP_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/arrowup.png");
public static final Icon YES_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/yes.png");
public static final Icon CHOOSEN_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/select_item.png");
public static final Icon PRE_WIDGET_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/prewidget.png");
public static final Icon PRE_WIDGET_NORMAL_ICON = IconUtils.readIcon("com/fr/design/images/buttonicon/prewidget");
public static final Icon EDIT_NORMAL_ICON = IconUtils.readIcon("/com/fr/design/standard/uimode/edit");
public static final Icon EDIT_PRESSED_ICON = IconUtils.readIcon("/com/fr/design/standard/uimode/edit");
public static final Icon EDIT_PRESSED_ICON = IconUtils.readIcon("/com/fr/design/standard/uimode/edit_pressed.svg");
public static final Icon HIDE_NORMAL_ICON = IconUtils.readIcon("/com/fr/design/standard/uimode/hide");
public static final Icon HIDE_PRESSED_ICON = IconUtils.readIcon("/com/fr/design/standard/uimode/hide");
public static final Icon HIDE_PRESSED_ICON = IconUtils.readIcon("/com/fr/design/standard/uimode/hide_pressed.svg");
public static final Icon VIEW_NORMAL_ICON = IconUtils.readIcon("/com/fr/design/standard/uimode/view");
//public static final Icon VIEW_PRESSED_ICON = IconUtils.readIcon("/com/fr/design/standard/uimode/view");
@ -221,7 +221,7 @@ public interface UIConstants {
public static final int BUTTON_GROUP_ARC = 0;
public static final int LARGEARC = 6;
public static final Stroke BS = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 2f, new float[]{3, 1}, 0);
public static final Icon PREVIEW_DOWN = IOUtils.readIcon("com/fr/design/images/buttonicon/prevew_down_icon.png");
public static final Icon PREVIEW_DOWN = IconUtils.readIcon("/com/fr/design/standard/preview_down_icon");
public static final Icon CLOSE_OF_AUTHORITY = IOUtils.readIcon("/com/fr/design/images/m_report/close.png");
public static final Icon CLOSE_OVER_AUTHORITY = IOUtils.readIcon("/com/fr/design/images/m_report/close_over.png");
public static final Icon CLOSE_PRESS_AUTHORITY = IOUtils.readIcon("/com/fr/design/images/m_report/close_press.png");

5
designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java

@ -1,5 +1,6 @@
package com.fr.design.gui;
import com.fr.base.svg.IconUtils;
import com.fr.design.gui.borders.UIFrameBorder;
import com.fr.design.gui.borders.UIInternalFrameBorder;
import com.fr.design.gui.borders.UITableHeaderBorder;
@ -160,10 +161,10 @@ public class UILookAndFeel extends MetalLookAndFeel {
table.put("Tree.collapsedIcon", loadIcon("TreePlusIcon.png", this));
table.put("Tree.openIcon", loadIcon("TreeFolderOpenedIcon.png", this));
table.put("Tree.closedIcon", loadIcon("TreeFolderClosedIcon.png", this));
table.put("Tree.leafIcon", loadIcon("TreeLeafIcon.svg", this));
table.put("Tree.leafIcon", loadIcon("TreeLeafIcon.png", this));
table.put("FileView.directoryIcon", loadIcon("DirectoryIcon.png", this));
table.put("FileView.computerIcon", loadIcon("ComputerIcon.png", this));
table.put("FileView.fileIcon", loadIcon("FileIcon.svg", this));
table.put("FileView.fileIcon", IconUtils.readIcon("/com/fr/design/images/lookandfeel/FileIcon.svg"));
table.put("FileView.floppyDriveIcon", loadIcon("FloppyIcon.png", this));
table.put("FileView.hardDriveIcon", loadIcon("HarddiskIcon.png", this));
table.put("FileChooser.detailsViewIcon", loadIcon("FileDetailsIcon.png", this));

31
designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java

@ -28,14 +28,7 @@ import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.AlphaComposite;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.lang.reflect.Constructor;
@ -146,7 +139,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
}
this.checkButtonEnabled();
refreshEventListWrapperPane();
this.checkGroupPaneSize();
this.updateGroupPaneSize(contentPane);
isPopulating = false;
}
@ -214,7 +207,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
nameEdList.addModNameActionListener(new ModNameActionListener() {
@Override
public void nameModed(int index, String oldName, String newName) {
checkGroupPaneSize();
updateGroupPaneSize(contentPane);
saveSettings();
}
});
@ -304,24 +297,30 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
public void onAddItem(NameableCreator creator) {
updateSelectedNameList(creator);
getCommonHandlers().onAddItem(creator);
checkGroupPaneSize();
updateGroupPaneSize(contentPane);
}
@Override
public void onRemoveItem() {
getCommonHandlers().onRemoveItem();
refreshEventListWrapperPane();
checkGroupPaneSize();
updateGroupPaneSize(contentPane);
}
@Override
public void onCopyItem() {
getCommonHandlers().onCopyItem();
checkGroupPaneSize();
updateGroupPaneSize(contentPane);
}
private void checkGroupPaneSize() {
/**
* 根据父面板更新对应的面板宽度
* 如果小于父面板的宽度就填充到与父面板宽度一致
*
* @param parentPane 父面板
*/
private void updateGroupPaneSize(JPanel parentPane) {
int width = 180;
Iterator<Map.Entry<String, ListWrapperPane>> iterator = nameEdListMap.entrySet().iterator();
while (iterator.hasNext()) {
@ -331,7 +330,9 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
width = Math.max(width, calculateUIListMaxCellWidth(uiList.getModel(), uiList.getFontMetrics(uiList.getFont())));
}
iterator = nameEdListMap.entrySet().iterator();
width += 30;
//contentPane是外层的Panel,如果不进行判断的话宽度就可能会小于contentPanel,右侧会有空隙
//所以需要判断一下,如果外层比较宽就取外层的宽度,防止空隙出现
width = Math.max(width + 30, parentPane == null ? 0 : parentPane.getWidth());
while (iterator.hasNext()) {
Map.Entry<String, ListWrapperPane> entry = iterator.next();
ListWrapperPane wrapperPane = entry.getValue();

18
designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java

@ -5,10 +5,21 @@ import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.SvgDrawUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.LayoutManager;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
@ -313,7 +324,6 @@ public class UIEastResizableContainer extends JPanel {
@Override
public void paint(Graphics g) {
Image button;
if (containerWidth == leftPaneWidth) {
if (model == UIConstants.MODEL_NORMAL) {
button = UIConstants.DRAG_LEFT_NORMAL;
@ -327,7 +337,7 @@ public class UIEastResizableContainer extends JPanel {
button = UIConstants.DRAG_RIGHT_PRESS;
}
}
g.drawImage(button, 18, 7, this);
SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, button, 10, 7, null));
}
}
}

30
designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -3,12 +3,22 @@ package com.fr.design.gui.icontainer;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.SvgPaintUtils;
import com.fr.stable.Constants;
import com.fr.design.utils.SvgDrawUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.Constants;
import javax.swing.*;
import java.awt.*;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.LayoutManager;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
@ -411,11 +421,9 @@ public class UIResizableContainer extends JPanel {
Image upButton = (upModel == UIConstants.MODEL_NORMAL ? UIConstants.DRAG_UP_NORMAL : UIConstants.DRAG_UP_PRESS);
Image downButton = (downModel == UIConstants.MODEL_NORMAL ? UIConstants.DRAG_DOWN_NORMAL : UIConstants.DRAG_DOWN_PRESS);
g.drawImage(UIConstants.DRAG_BAR_LIGHT, 0, 0, getWidth(), getHeight(), null);
SvgPaintUtils.beforePaint((Graphics2D) g);
g.drawImage(UIConstants.DRAG_LINE, (getWidth() - toolPaneHeight) / 2, 3, null);
g.drawImage(upButton, ARROW_MARGIN, 1, null);
g.drawImage(downButton, getWidth() - toolPaneHeight - ARROW_MARGIN, 1, null);
SvgPaintUtils.afterPaint((Graphics2D) g);
SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, UIConstants.DRAG_LINE, (getWidth() - toolPaneHeight) / 2, 3, null));
SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, upButton, ARROW_MARGIN, 0, null));
SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, downButton, (getWidth() - toolPaneHeight - ARROW_MARGIN), 0, null));
}
}
@ -512,7 +520,7 @@ public class UIResizableContainer extends JPanel {
button = UIConstants.DRAG_LEFT_PRESS;
}
}
g.drawImage(button, -1, ARROW_MARGIN_VERTICAL, this);
SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, button, -6, ARROW_MARGIN_VERTICAL, VerticalToolPane.this));
} else {
g.drawImage(UIConstants.DRAG_BAR_LIGHT, 0, 0, toolPaneHeight, getHeight(), null);
if (containerWidth == toolPaneHeight) {
@ -528,7 +536,7 @@ public class UIResizableContainer extends JPanel {
button = UIConstants.DRAG_RIGHT_PRESS;
}
}
g.drawImage(button, 2, ARROW_MARGIN_VERTICAL, this);
SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, button, 10, ARROW_MARGIN_VERTICAL, VerticalToolPane.this));
}
if (isLeftRightDragEnabled) {
g.drawImage(UIConstants.DRAG_DOT_VERTICAL, 2, getHeight() / 2, 5, toolPaneHeight, null);

3
designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java

@ -175,7 +175,8 @@ public class JNameEdList extends UIList implements CellEditorListener {
}
public void setIllegalIndex(int index) {
setNameAt(NameInspector.ILLEGAL_NAME_HOLDER, index);
//环境如果重名会被命名为请重命名,这个请重命名也会重复,后面加个索引区别一下
setNameAt(NameInspector.ILLEGAL_NAME_HOLDER + index, index);
this.repaint();
}

27
designer-base/src/main/java/com/fr/design/icon/WarningIcon.java

@ -1,12 +1,17 @@
package com.fr.design.icon;
import com.fr.base.svg.SVGLoader;
import com.fr.design.utils.SvgPaintUtils;
import com.fr.base.svg.SystemScaleUtils;
import com.fr.design.utils.SvgDrawUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.GrayFilter;
import javax.swing.ImageIcon;
import java.awt.*;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.MediaTracker;
import java.awt.image.ImageObserver;
/**
@ -20,7 +25,8 @@ public class WarningIcon extends ImageIcon {
};
protected final static MediaTracker TRACKER = new MediaTracker(COMPONENT);
private final static Image WARNING_IMAGE = SVGLoader.load("/com/fr/design/standard/warning.svg");
private static final boolean HI_DPI_SUPPORT = SystemScaleUtils.isJreHiDPIEnabled();
public static final float SYSTEM_SCALE = SystemScaleUtils.sysScale();
private Image mainImage = null;
private ImageObserver imageObserver;
private int width = -1;
@ -36,14 +42,15 @@ public class WarningIcon extends ImageIcon {
@Override
public synchronized void paintIcon(Component c, Graphics g, int x, int y) {
SvgPaintUtils.beforePaint((Graphics2D) g);
//裁剪绘制svg的位置,以免影响到图标右侧的文字
Graphics2D graphics = (Graphics2D) g.create(x, y, WARNING_IMAGE.getWidth(null), WARNING_IMAGE.getHeight(null));
if (mainImage != null) {
g.drawImage(mainImage, x, y, c);
SvgDrawUtils.doDrawSVG(graphics, () -> SvgDrawUtils.drawImage(graphics, mainImage, x, y, null));
}
if (WARNING_IMAGE != null) {
g.drawImage(WARNING_IMAGE, x, y, c);
SvgDrawUtils.doDrawSVG(graphics, () -> SvgDrawUtils.drawImage(graphics, WARNING_IMAGE, x, y, null));
}
SvgPaintUtils.afterPaint((Graphics2D) g);
graphics.dispose();
}
/**
@ -91,7 +98,8 @@ public class WarningIcon extends ImageIcon {
* @return the width in pixels of this icon
*/
public int getIconWidth() {
return width;
//如果环境支持高清化,drawImage可能会缩放绘制的图像比例,需要保证svg正常显示的同时调整绘制范围
return HI_DPI_SUPPORT ? (int) (width / SYSTEM_SCALE) : width;
}
/**
@ -100,7 +108,8 @@ public class WarningIcon extends ImageIcon {
* @return the height in pixels of this icon
*/
public int getIconHeight() {
return height;
//如果环境支持高清化,drawImage可能会缩放绘制的图像比例,需要保证svg正常显示的同时调整绘制范围
return HI_DPI_SUPPORT ? (int) (height / SYSTEM_SCALE) : height;
}
{

2
designer-base/src/main/java/com/fr/design/locale/impl/VideoMark.java

@ -16,7 +16,7 @@ public class VideoMark implements LocaleMark<String> {
private Map<Locale, String> map = new HashMap<>();
private static final String VIDEO_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.video.en_US", "http://www.finereport.com/en/Learning-path");
private static final String VIDEO_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.video.zh_CN", "https://edu.fanruan.com/video?class1=16&class2=0");
private static final String VIDEO_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.video.zh_CN", "https://home.fanruan.com/finereport/video");
private static final String VIDEO_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.video.zh_TW", "http://www.finereport.com/tw/video");
public VideoMark() {

2
designer-base/src/main/java/com/fr/design/lock/LockInfoDialog.java

@ -99,7 +99,7 @@ public class LockInfoDialog extends JDialog {
return;
}
final String selectedFilePath = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, TemplateTreePane.getInstance().getFilePath());
TemplateUtils.createAndOpenTemplate(
TemplateUtils.createAndReOpenTemplate(
Toolkit.i18nText("Fine_Design_Template_Lock_Copy"),
new FileNodeFILE(new FileNode(selectedFilePath, false)),
false,

9
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -325,7 +325,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
if (VcsHelper.getInstance().needInit()) {
vcsAction = new VcsAction();
if (!isLegacyOnCluster()) {
if (!WorkContext.getCurrent().isCluster()) {
vcsAction.setName(Toolkit.i18nText("Fine-Design_Vcs_Title"));
} else {
vcsAction.setName(Toolkit.i18nText("Fine-Design_Vcs_NotSupportRemote"));
@ -509,7 +509,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
private void fireVcsActionChange(boolean enable) {
if (!DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()
|| VcsHelper.getInstance().isUnSelectedTemplate()
|| isLegacyOnCluster()) {
|| WorkContext.getCurrent().isCluster()) {
setEnabled(false);
return;
}
@ -810,11 +810,6 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
}
}
private boolean isLegacyOnCluster() {
// 老模式且为集群,用于代替之前的只判断集群逻辑
return WorkContext.getCurrent().isCluster() && VcsHelper.getInstance().isLegacyMode();
}
private String doCheck (String userInput, String suffix) {
String errorMsg = StringUtils.EMPTY;
if (selectedOperation.duplicated(userInput, suffix, true)) {

3
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -19,6 +19,7 @@ import com.fr.design.notification.SnapChat;
import com.fr.design.notification.SnapChatFactory;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.SvgDrawUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.log.FineLoggerFactory;
@ -1313,7 +1314,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
} else {
button = UIConstants.POP_BUTTON_UP;
}
g.drawImage(button, ARROW_RANGE_START + 8, 4, 16, 16, null);
SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, button, (ARROW_RANGE_START + 8), 4, null));
}
}

37
designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

@ -12,9 +12,6 @@ import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.JTemplateActionListener;
import com.fr.design.mainframe.vcs.VcsConfigManager;
import com.fr.design.mainframe.vcs.ui.FileVersionTable;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginContext;
@ -23,14 +20,11 @@ import com.fr.report.entity.VcsEntity;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent;
import com.fr.workspace.server.vcs.VcsOperator;
import com.fr.workspace.server.vcs.filesystem.VcsFileSystem;
import com.fr.workspace.server.vcs.git.config.GcConfig;
import javax.swing.Icon;
import javax.swing.SwingUtilities;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import java.util.List;
@ -61,22 +55,10 @@ public class VcsHelper implements JTemplateActionListener {
private final static String SERVICE_NAME_MOVE = "moveVcs";
private static final VcsHelper INSTANCE = new VcsHelper();
private volatile boolean legacyMode;
public static VcsHelper getInstance() {
return INSTANCE;
}
private VcsHelper() {
legacyMode = WorkContext.getCurrent().get(VcsOperator.class).isLegacyMode();
EventDispatcher.listen(WorkspaceEvent.AfterSwitch, new Listener<Workspace>() {
@Override
public void on(Event event, Workspace param) {
legacyMode = WorkContext.getCurrent().get(VcsOperator.class).isLegacyMode();
}
});
}
private int containsFolderCounts() {
TemplateFileTree fileTree = TemplateTreePane.getInstance().getTemplateFileTree();
if (fileTree.getSelectionPaths() == null) {
@ -155,18 +137,20 @@ public class VcsHelper implements JTemplateActionListener {
String fileName = getEditingFilename();
VcsOperator operator = WorkContext.getCurrent().get(VcsOperator.class);
VcsEntity entity = operator.getFileVersionByIndex(fileName, 0);
boolean replace = needDeleteVersion(entity);
int latestFileVersion = 0;
if (entity != null) {
latestFileVersion = entity.getVersion();
}
if (jt.getEditingFILE() instanceof VcsCacheFileNodeFile) {
operator.saveVersionFromCache(getCurrentUsername(), fileName, StringUtils.EMPTY, latestFileVersion + 1, replace);
operator.saveVersionFromCache(getCurrentUsername(), fileName, StringUtils.EMPTY, latestFileVersion + 1);
String path = DesignerFrameFileDealerPane.getInstance().getSelectedOperation().getFilePath();
List<VcsEntity> updatedList = WorkContext.getCurrent().get(VcsOperator.class).getVersions(path.replaceFirst(VCS_FILE_SLASH, StringUtils.EMPTY));
SwingUtilities.invokeLater(() -> FileVersionTable.getInstance().updateModel(1, updatedList));
FileVersionTable.getInstance().updateModel(1, WorkContext.getCurrent().get(VcsOperator.class).getVersions(path.replaceFirst(VCS_FILE_SLASH, StringUtils.EMPTY)));
} else {
operator.saveVersion(getCurrentUsername(), fileName, StringUtils.EMPTY, latestFileVersion + 1, replace);
operator.saveVersion(getCurrentUsername(), fileName, StringUtils.EMPTY, latestFileVersion + 1);
}
VcsEntity oldEntity = WorkContext.getCurrent().get(VcsOperator.class).getFileVersionByIndexAndUsername(fileName, getCurrentUsername(), 1);
if (needDeleteVersion(oldEntity)) {
operator.deleteVersion(oldEntity.getFilename(), oldEntity.getVersion());
}
if (GcConfig.getInstance().isGcEnable()) {
operator.gc();
@ -204,13 +188,6 @@ public class VcsHelper implements JTemplateActionListener {
moveVcs.shutdown();
}
/**
* 判断是否为老模式
* @return 是否为老模式
*/
public boolean isLegacyMode() {
return legacyMode;
}
@Override
public void templateOpened(JTemplate<?, ?> jt) {

16
designer-base/src/main/java/com/fr/design/utils/SvgDraw.java

@ -0,0 +1,16 @@
package com.fr.design.utils;
/**
* 绘制SVG图标的函数式接口
*
* @author obo
* @since 11.0
* Created on 2023/3/24
*/
public interface SvgDraw<T> {
/**
* 绘制svg图标的具体逻辑,方法体
* */
void drawSVG();
}

73
designer-base/src/main/java/com/fr/design/utils/SvgDrawUtils.java

@ -0,0 +1,73 @@
package com.fr.design.utils;
import com.fr.base.svg.SVGLoader;
import com.fr.base.svg.SystemScaleUtils;
import org.jetbrains.annotations.NotNull;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.ImageObserver;
/**
* 用于绘制svg图片缩放(高分屏下)
*
* @author hades
* @since 11.0
* Created on 2022/5/6
*/
public class SvgDrawUtils {
private static final boolean HI_DPI_ENABLED = SystemScaleUtils.isJreHiDPIEnabled();
/**
* 绘制svg前若环境支持高清化则对缩放比例进行适配
* */
public static void beforeDraw(Graphics2D g2) {
if (HI_DPI_ENABLED) {
g2.scale(1 / SVGLoader.SYSTEM_SCALE, 1 / SVGLoader.SYSTEM_SCALE);
}
}
/**
* 绘制svg后还原缩放矩阵
* */
public static void afterDraw(Graphics2D g2) {
if (HI_DPI_ENABLED) {
g2.scale(SVGLoader.SYSTEM_SCALE, SVGLoader.SYSTEM_SCALE);
}
}
/**
* 计算高缩放下绘制svg图标时新的的位置x,y
* @param position 旧坐标的值
* @return 新的position值
* */
public static int calculatePosition(int position) {
return HI_DPI_ENABLED ? (int) (position * SVGLoader.SYSTEM_SCALE) : position;
}
/**
* 绘制svg图像的完整逻辑
* @param graphics 绘图
* @param svgDraw 具体绘制逻辑
* */
public static void doDrawSVG(@NotNull Graphics graphics, @NotNull final SvgDraw<Graphics> svgDraw) {
SvgDrawUtils.beforeDraw((Graphics2D) graphics);
svgDraw.drawSVG();
SvgDrawUtils.afterDraw((Graphics2D) graphics);
}
/**
* 绘制前对坐标x和y进行处理
* @param graphics 绘图
* @param image svg的Image对象
* @param x x坐标
* @param y y坐标
* @param imageObserver 图像观察器
* */
public static void drawImage(Graphics graphics, Image image, int x, int y, ImageObserver imageObserver) {
//如果环境支持高清化,在调整缩放比例时绘制svg会影响到位置的变化,若图标无确定裁剪位置,则需要进行调整
graphics.drawImage(image, SvgDrawUtils.calculatePosition(x), SvgDrawUtils.calculatePosition(y), imageObserver);
}
}

28
designer-base/src/main/java/com/fr/design/utils/SvgPaintUtils.java

@ -1,28 +0,0 @@
package com.fr.design.utils;
import com.fr.base.svg.SVGLoader;
import com.fr.base.svg.SystemScaleUtils;
import java.awt.Graphics2D;
/**
* 用于绘制svg图片缩放(高分屏下)
*
* @author hades
* @version 11.0
* Created by hades on 2022/5/6
*/
public class SvgPaintUtils {
public static void beforePaint(Graphics2D g2) {
if (SystemScaleUtils.isJreHiDPIEnabled()) {
g2.scale(1 / SVGLoader.SYSTEM_SCALE, 1 / SVGLoader.SYSTEM_SCALE);
}
}
public static void afterPaint(Graphics2D g2) {
if (SystemScaleUtils.isJreHiDPIEnabled()) {
g2.scale(SVGLoader.SYSTEM_SCALE, SVGLoader.SYSTEM_SCALE);
}
}
}

140
designer-base/src/main/java/com/fr/design/utils/TemplateUtils.java

@ -16,8 +16,10 @@ import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.CoreConstants;
import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.lock.TplOperator;
import org.jetbrains.annotations.Nullable;
import javax.swing.SwingWorker;
import java.io.OutputStream;
@ -33,22 +35,63 @@ public class TemplateUtils {
/**
* 创建新的模板文件并打开模板
* @param prefix 模板文件名称前缀
* @param file 模板文件
*
* @param prefix 模板文件名称前缀
* @param file 模板文件
* @param createByEditingTemplate 是否根据 当前编辑模板 来创建新模板
* 为true时以CurrentEditingTemplate为准创建新模板
* 为false时以传入的File文件为准创建新模板此文件可以不是编辑状态
* @param openNewTemplate 是否需要在创建后打开模板
* @param openNewTemplate 是否需要在创建后打开模板
*/
public static void createAndOpenTemplate(String prefix, FILE file, boolean createByEditingTemplate, boolean openNewTemplate) {
String fileName = file.getName();
createAndOpenTemplate(prefix, file, createByEditingTemplate, openNewTemplate, () -> {});
}
/**
* 创建新的模板文件并并判断新的模板文件是否之前已经被开打如果已经打开需要reOpen
*
* @param prefix 模板文件名称前缀
* @param file 模板文件
* @param createByEditingTemplate 是否根据 当前编辑模板 来创建新模板
* 为true时以CurrentEditingTemplate为准创建新模板
* 为false时以传入的File文件为准创建新模板此文件可以不是编辑状态
* @param openNewTemplate 是否需要在创建后打开模板
*/
public static void createAndReOpenTemplate(String prefix, FILE file, boolean createByEditingTemplate, boolean openNewTemplate) {
String oldPath = file.getPath();
file = getSavedFile(prefix, file);
if (file == null) {
return;
}
Runnable doAfterCreateTemplate;
//判断一下要保存的文件是否已打开
int index = HistoryTemplateListCache.getInstance().contains(file);
if (index == -1) {
doAfterCreateTemplate = () -> {};
} else {
JTemplate template = HistoryTemplateListCache.getInstance().getHistoryList().get(index);
doAfterCreateTemplate = () -> HistoryTemplateListCache.getInstance().closeSelectedReport(template);
}
createAndOpenTemplate0(file, oldPath, createByEditingTemplate, openNewTemplate, doAfterCreateTemplate);
}
/**
* 返回值可以为null, 为null表示没有点击保存按钮或者传递进来的文件file本身不满足格式要求
*
* @param prefix 模板文件名称前缀
* @param file 模板文件
* @return 最后选择的要保存的文件
*/
@Nullable
private static FILE getSavedFile(String prefix, FILE file) {
String fileName = file.getName();
int indexOfLastDot = fileName.lastIndexOf(CoreConstants.DOT);
if (indexOfLastDot < 0) {
return;
return null;
}
String suffix = fileName.substring(indexOfLastDot + 1);
FILEChooserPane fileChooserPane = FILEChooserPane.getInstance(true, true);
FILEChooserPane fileChooserPane = FILEChooserPane.getInstance(true, true);
fileChooserPane.setFileNameTextField(prefix + fileName, suffix);
FileExtension fileExtension = FileExtension.parse(suffix);
fileChooserPane.addChooseFILEFilter(new ChooseFileFilter(fileExtension, ProductConstants.APP_NAME + Toolkit.i18nText("Fine-Design_Report_Template_File")));
@ -57,36 +100,52 @@ public class TemplateUtils {
fileChooserPane.enableFileNameTextFiled();
if (isCancel(result)) {
return;
return null;
}
if (isOk(result)) {
file = fileChooserPane.getSelectedFILE();
_createAndOpenTemplate(file, oldPath, createByEditingTemplate, openNewTemplate);
return fileChooserPane.getSelectedFILE();
}
return null;
}
/**
* 创建新的模板文件并打开模板并在创建备份模板成功后执行doAfterCreate
*
* @param prefix 模板文件名称前缀
* @param file 模板文件
* @param createByEditingTemplate 是否根据 当前编辑模板 来创建新模板
* 为true时以CurrentEditingTemplate为准创建新模板
* 为false时以传入的File文件为准创建新模板此文件可以不是编辑状态
* @param openNewTemplate 是否需要在创建后打开模板
* @param doAfterCreateTemplate 创建备份模板成功后调用
*/
public static void createAndOpenTemplate(String prefix, FILE file, boolean createByEditingTemplate, boolean openNewTemplate, Runnable doAfterCreateTemplate) {
String oldPath = file.getPath();
file = getSavedFile(prefix, file);
if (file == null) {
return;
}
private static void _createAndOpenTemplate(FILE file, String oldPath, boolean createByEditingTemplate, boolean openNewTemplate){
new SwingWorker<Void, Void>() {
createAndOpenTemplate0(file, oldPath, createByEditingTemplate, openNewTemplate, doAfterCreateTemplate);
}
private static void createAndOpenTemplate0(FILE file, String oldPath, boolean createByEditingTemplate, boolean openNewTemplate, Runnable doAfterCreateTemplate) {
new SwingWorker<Boolean, Void>() {
@Override
protected Void doInBackground() throws Exception {
byte[] content = new byte[0];
if (createByEditingTemplate) {
// 从当前编辑模板中生成备份文件
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
content = template.exportData();
} else {
content = WorkContext.getWorkResource().readFully(oldPath);
}
if (ArrayUtils.isEmpty(content)) {
throw new Exception(oldPath + " content is empty" );
}
protected Boolean doInBackground() throws Exception {
// 读取模板数据
byte[] content = getTemplateData(createByEditingTemplate, oldPath);
OutputStream out = null;
try {
// 加锁
WorkContext.getCurrent().get(TplOperator.class).saveAs(file.getPath());
boolean saveAsLock = WorkContext.getCurrent().get(TplOperator.class).saveAs(file.getPath());
if (!saveAsLock) {
// 加锁失败时,直接返回
return false;
}
out = file.asOutputStream();
out.write(content);
} finally {
@ -98,15 +157,18 @@ public class TemplateUtils {
// 解锁
WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(file.getPath());
}
}
return null;
return true;
}
@Override
protected void done() {
try {
get();
if (!get()) {
throw new Exception("[RemoteDesign] back up template file failed");
}
// 创建备份成功后,关闭原模板
doAfterCreateTemplate.run();
if (openNewTemplate) {
DesignerContext.getDesignerFrame().openTemplate(file);
}
@ -118,7 +180,31 @@ public class TemplateUtils {
}
}
}.execute();
}
/**
* 读取模板文件数据
*
* @param readCurrentEditingTemplate 是否读取当前编辑模板
* @param path 模板路径
* @return 模板文件数据
*/
private static byte[] getTemplateData(boolean readCurrentEditingTemplate, String path) throws Exception {
byte[] content = new byte[0];
if (readCurrentEditingTemplate) {
// 从当前编辑模板中读取模板文件数据
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (JTemplate.isValid(template)) {
content = template.exportData();
}
} else {
// 从给定的模板路径中读取模板文件数据
content = WorkContext.getWorkResource().readFully(path);
}
if (ArrayUtils.isEmpty(content)) {
throw new Exception(StringUtils.messageFormat("{} content is empty", path));
}
return content;
}
private static boolean isCancel(int result) {

14
designer-base/src/main/java/com/fr/design/worker/save/SaveFailureHandler.java

@ -113,12 +113,14 @@ public class SaveFailureHandler implements ThrowableHandler {
new Object[] {Toolkit.i18nText("Fine_Design_Template_SaveAs_Backup"), Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")}, null);
if (option == JOptionPane.YES_OPTION) {
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template != null) {
if (JTemplate.isValid(template)) {
TemplateUtils.createAndOpenTemplate(
Toolkit.i18nText("Fine_Design_Template_Backup"),
new FileNodeFILE(new FileNode(template.getPath(), false)),
true,
false);
true,
// 创建并打开备份模板后,关闭原模板,无需释放原模板锁(因为已经被超管手动清除了)
() -> HistoryTemplateListCache.getInstance().closeSelectedReport(template));
}
}
}
@ -133,14 +135,14 @@ public class SaveFailureHandler implements ThrowableHandler {
new Object[] {Toolkit.i18nText("Fine_Design_Template_SaveAs_Backup"), Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")}, null);
if (option == JOptionPane.YES_OPTION) {
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template != null) {
if (JTemplate.isValid(template)) {
TemplateUtils.createAndOpenTemplate(
Toolkit.i18nText("Fine_Design_Template_Backup"),
new FileNodeFILE(new FileNode(template.getPath(), false)),
true,
true);
// 创建并打开备份模板后,关闭原模板
HistoryTemplateListCache.getInstance().closeSelectedReport(template);
true,
// 创建并打开备份模板后,关闭原模板,无需释放原模板锁(锁定信息不一致 = 此用户模板锁信息已被清除)
() -> HistoryTemplateListCache.getInstance().closeSelectedReport(template));
}
}
}

BIN
designer-base/src/main/resources/com/fr/design/images/control/down_arrow.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 B

BIN
designer-base/src/main/resources/com/fr/design/images/control/east_arrow.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

BIN
designer-base/src/main/resources/com/fr/design/images/control/up_arrow.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 B

BIN
designer-base/src/main/resources/com/fr/design/images/control/west_arrow.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 B

4
designer-base/src/main/resources/com/fr/design/images/lookandfeel/TreeLeafIcon.svg

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 15V1H10L14 5.001V15H2ZM9 2H3V14H13V6.0002H10H9V5.0002V2ZM10 2.41412V5.0002H12.5853L10 2.41412Z" fill="#333334"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 3H4V13H6H8H12V7H8V3Z" fill="#FEF6DE"/>
</svg>

After

Width:  |  Height:  |  Size: 366 B

3
designer-base/src/main/resources/com/fr/design/standard/arrowlinear/down_arrow.svg

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 9.29289L11.6464 5.64645C11.8417 5.45118 12.1583 5.45118 12.3536 5.64645C12.5488 5.84171 12.5488 6.15829 12.3536 6.35355L8.35355 10.3536C8.15829 10.5488 7.84171 10.5488 7.64645 10.3536L3.64645 6.35355C3.45118 6.15829 3.45118 5.84171 3.64645 5.64645C3.84171 5.45118 4.15829 5.45118 4.35355 5.64645L8 9.29289Z" fill="#333334"/>
</svg>

After

Width:  |  Height:  |  Size: 443 B

3
designer-base/src/main/resources/com/fr/design/standard/arrowlinear/east_arrow.svg

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.29289 8L5.64645 11.6464C5.45118 11.8417 5.45118 12.1583 5.64645 12.3536C5.84171 12.5488 6.15829 12.5488 6.35355 12.3536L10.3536 8.35355C10.5488 8.15829 10.5488 7.84171 10.3536 7.64645L6.35355 3.64645C6.15829 3.45118 5.84171 3.45118 5.64645 3.64645C5.45118 3.84171 5.45118 4.15829 5.64645 4.35355L9.29289 8Z" fill="#333334"/>
</svg>

After

Width:  |  Height:  |  Size: 443 B

3
designer-base/src/main/resources/com/fr/design/standard/arrowlinear/up_arrow.svg

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.5 7.20711L4.85355 10.8536C4.65829 11.0488 4.34171 11.0488 4.14645 10.8536C3.95118 10.6583 3.95118 10.3417 4.14645 10.1464L8.14645 6.14645C8.34171 5.95118 8.65829 5.95118 8.85355 6.14645L12.8536 10.1464C13.0488 10.3417 13.0488 10.6583 12.8536 10.8536C12.6583 11.0488 12.3417 11.0488 12.1464 10.8536L8.5 7.20711Z" fill="#333334"/>
</svg>

After

Width:  |  Height:  |  Size: 447 B

3
designer-base/src/main/resources/com/fr/design/standard/arrowlinear/west_arrow.svg

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.70711 8L10.3536 11.6464C10.5488 11.8417 10.5488 12.1583 10.3536 12.3536C10.1583 12.5488 9.84171 12.5488 9.64645 12.3536L5.64645 8.35355C5.45118 8.15829 5.45118 7.84171 5.64645 7.64645L9.64645 3.64645C9.84171 3.45118 10.1583 3.45118 10.3536 3.64645C10.5488 3.84171 10.5488 4.15829 10.3536 4.35355L6.70711 8Z" fill="#333334"/>
</svg>

After

Width:  |  Height:  |  Size: 443 B

2
designer-base/src/main/resources/com/fr/design/standard/drag/left_normal.svg

@ -1,3 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.4" fill-rule="evenodd" clip-rule="evenodd" d="M10 4.48284C10 4.30466 9.78457 4.21543 9.65858 4.34142L6 8L9.65858 11.6586C9.78457 11.7846 10 11.6953 10 11.5172V4.48284Z" fill="#333334"/>
</svg>

Before

Width:  |  Height:  |  Size: 309 B

After

Width:  |  Height:  |  Size: 309 B

2
designer-base/src/main/resources/com/fr/design/standard/drag/left_pressed.svg

@ -1,3 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 4.48284C10 4.30466 9.78457 4.21543 9.65858 4.34142L6 8L9.65858 11.6586C9.78457 11.7846 10 11.6953 10 11.5172V4.48284Z" fill="#333334"/>
</svg>

Before

Width:  |  Height:  |  Size: 295 B

After

Width:  |  Height:  |  Size: 295 B

2
designer-base/src/main/resources/com/fr/design/standard/drag/right_normal.svg

@ -1,3 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.4" fill-rule="evenodd" clip-rule="evenodd" d="M6 4.48284C6 4.30466 6.21543 4.21543 6.34142 4.34142L10 8L6.34142 11.6586C6.21543 11.7846 6 11.6953 6 11.5172V4.48284Z" fill="#333334"/>
</svg>

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 306 B

2
designer-base/src/main/resources/com/fr/design/standard/drag/right_pressed.svg

@ -1,3 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 4.48284C6 4.30466 6.21543 4.21543 6.34142 4.34142L10 8L6.34142 11.6586C6.21543 11.7846 6 11.6953 6 11.5172V4.48284Z" fill="#333334"/>
</svg>

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 292 B

6
designer-base/src/main/resources/com/fr/design/standard/fileicon/minus.svg

@ -1,3 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.5858 5C12.4767 5 12.9229 6.07714 12.2929 6.70711L8 11L3.70711 6.70711C3.07714 6.07714 3.52331 5 4.41421 5L11.5858 5Z" fill="#AEAEAE"/>
</svg>
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.51716 2C7.69534 2 7.78457 2.21543 7.65858 2.34142L4 6L0.341421 2.34142C0.215428 2.21543 0.304662 2 0.482843 2L7.51716 2Z" fill="#AEAEAE"/>
</svg>

Before

Width:  |  Height:  |  Size: 295 B

After

Width:  |  Height:  |  Size: 293 B

4
designer-base/src/main/resources/com/fr/design/standard/fileicon/plus.svg

@ -1,3 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 4.41421C5 3.52331 6.07714 3.07714 6.70711 3.70711L11 8L6.70711 12.2929C6.07714 12.9229 5 12.4767 5 11.5858V4.41421Z" fill="#AEAEAE"/>
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 0.482843C2 0.304662 2.21543 0.215428 2.34142 0.341421L6 4L2.34142 7.65858C2.21543 7.78457 2 7.69534 2 7.51716V0.482843Z" fill="#AEAEAE"/>
</svg>

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 292 B

13
designer-base/src/main/resources/com/fr/design/standard/floatpop_normal.svg

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="22px" height="16px" viewBox="0 0 22 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_悬浮元素&amp;三角_normal</title>
<g id="icon_悬浮元素&amp;三角_normal" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M2,0 L2,1 L14,1 L14,0 L15,0 L15,1 L16,1 L16,2 L15,2 L15,14 L16,14 L16,15 L15,15 L15,16 L14,16 L14,15 L2,15 L2,16 L1,16 L1,15 L0,15 L0,14 L1,14 L1,2 L0,2 L0,1 L1,1 L1,0 L2,0 Z M14,14 L14,2 L2,2 L2,14 L14,14 Z" id="Combined-Shape" fill="#333334"></path>
<polygon id="Fill-5" fill="#EEEEEF" points="2 14 14 14 14 2 2 2"></polygon>
<path d="M21.5741668,7.5 C21.9938502,7.5 22.0986659,7.73540497 21.797731,8.03633988 L19.3340709,10.5 L16.8704108,8.03633988 C16.5741985,7.74012754 16.6738481,7.5 17.0939751,7.5 L21.5741668,7.5 Z" id="Rectangle-6" fill="#333334"></path>
<svg width="26" height="16" viewBox="0 0 26 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Property 1=&#230;&#173;&#163;&#229;&#184;&#184;">
<path id="Combined Shape" fill-rule="evenodd" clip-rule="evenodd" d="M1 16H2V15H14V16H15V15H16V14H15V2H16V1H15V0H14V1H2V0H1V1H0V2H1V14H0V15H1V16ZM14 2H2V14H14V2Z" fill="#333334"/>
<path id="Fill 5" fill-rule="evenodd" clip-rule="evenodd" d="M2 14H14V2H2V14Z" fill="#F0F0F3"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M25.003 6.5C25.5537 6.5 25.6862 6.81387 25.2941 7.20591L22 10.5L18.706 7.20591C18.3161 6.81605 18.4531 6.5 18.9971 6.5H25.003Z" fill="#333334"/>
</g>
</svg>
</svg>

Before

Width:  |  Height:  |  Size: 964 B

After

Width:  |  Height:  |  Size: 705 B

10
designer-base/src/main/resources/com/fr/design/standard/poparrow/pop_down_arrow.svg

@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_102_14157)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.45974 10.0667L3.95113 8.55807C3.89838 8.50533 3.82468 8.47786 3.74623 8.48172C3.58286 8.48975 3.44392 8.6287 3.43588 8.79207L3.19669 13.6556L8.06019 13.4164C8.13864 13.4125 8.21541 13.3776 8.27361 13.3194C8.3948 13.1982 8.40401 13.011 8.29418 12.9011L6.78557 11.3925L13.7347 4.44336C14.1387 4.03937 14.1694 3.41507 13.8033 3.04895C13.4372 2.68284 12.8129 2.71354 12.4089 3.11753L5.45974 10.0667Z" fill="#419BF9"/>
</g>
<defs>
<clipPath id="clip0_102_14157">
<rect width="16" height="16" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 766 B

3
designer-base/src/main/resources/com/fr/design/standard/poparrow/pop_up_arrow.svg

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.5403 6.63783L13.0489 8.14644C13.1016 8.19919 13.1753 8.22665 13.2538 8.22279C13.4171 8.21476 13.5561 8.07581 13.5641 7.91245L13.8033 3.04896L8.93981 3.28815C8.86136 3.292 8.78459 3.32687 8.72639 3.38507C8.6052 3.50627 8.59599 3.69355 8.70582 3.80339L10.2144 5.312L3.26528 12.2612C2.86129 12.6651 2.83059 13.2894 3.1967 13.6556C3.56282 14.0217 4.18712 13.991 4.59111 13.587L11.5403 6.63783Z" fill="#419BF9"/>
</svg>

After

Width:  |  Height:  |  Size: 567 B

3
designer-base/src/main/resources/com/fr/design/standard/preview_down_icon_normal.svg

@ -0,0 +1,3 @@
<svg width="32" height="8" viewBox="0 0 32 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.2071 2C12.7617 2 12.5386 2.53857 12.8536 2.85355L15.6464 5.64645C15.8417 5.84171 16.1583 5.84171 16.3536 5.64645L19.1464 2.85355C19.4614 2.53857 19.2383 2 18.7929 2H13.2071Z" fill="#AEAEAE"/>
</svg>

After

Width:  |  Height:  |  Size: 349 B

6
designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/down_hover.svg

@ -1,3 +1,3 @@
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.58579 2C6.47669 2 6.92286 3.07714 6.29289 3.70711L4 6L1.70711 3.70711C1.07714 3.07714 1.52331 2 2.41421 2L5.58579 2Z" fill="#62646E"/>
</svg>
<svg width="10" height="10" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.51716 2C7.69534 2 7.78457 2.21543 7.65858 2.34142L4 6L0.341421 2.34142C0.215428 2.21543 0.304662 2 0.482843 2L7.51716 2Z" fill="#62646E"/>
</svg>

Before

Width:  |  Height:  |  Size: 286 B

After

Width:  |  Height:  |  Size: 295 B

4
designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/down_normal.svg

@ -1,3 +1,3 @@
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.58579 2C6.47669 2 6.92286 3.07714 6.29289 3.70711L4 6L1.70711 3.70711C1.07714 3.07714 1.52331 2 2.41421 2L5.58579 2Z" fill="#AEAEAE"/>
<svg width="10" height="10" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.51716 2C7.69534 2 7.78457 2.21543 7.65858 2.34142L4 6L0.341421 2.34142C0.215428 2.21543 0.304662 2 0.482843 2L7.51716 2Z" fill="#AEAEAE"/>
</svg>

Before

Width:  |  Height:  |  Size: 285 B

After

Width:  |  Height:  |  Size: 295 B

4
designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/up_hover.svg

@ -1,3 +1,3 @@
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.58579 6C6.47669 6 6.92286 4.92286 6.29289 4.29289L4 2L1.70711 4.29289C1.07714 4.92286 1.52331 6 2.41421 6H5.58579Z" fill="#62646E"/>
<svg width="10" height="10" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.51716 6C7.69534 6 7.78457 5.78457 7.65858 5.65858L4 2L0.341421 5.65858C0.215428 5.78457 0.304662 6 0.482843 6L7.51716 6Z" fill="#62646E"/>
</svg>

Before

Width:  |  Height:  |  Size: 287 B

After

Width:  |  Height:  |  Size: 295 B

4
designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/up_normal.svg

@ -1,3 +1,3 @@
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.58579 6C6.47669 6 6.92286 4.92286 6.29289 4.29289L4 2L1.70711 4.29289C1.07714 4.92286 1.52331 6 2.41421 6H5.58579Z" fill="#AEAEAE"/>
<svg width="10" height="10" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.51716 6C7.69534 6 7.78457 5.78457 7.65858 5.65858L4 2L0.341421 5.65858C0.215428 5.78457 0.304662 6 0.482843 6L7.51716 6Z" fill="#AEAEAE"/>
</svg>

Before

Width:  |  Height:  |  Size: 283 B

After

Width:  |  Height:  |  Size: 295 B

14
designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java

@ -50,19 +50,19 @@ public class BasicTableDataUtilsTest extends TestCase {
TableDataSource source = EasyMock.mock(TableDataSource.class);
TableData tableData = EasyMock.mock(TableData.class);
EasyMock.expect(source.getTableData("ds1")).andReturn(tableData).anyTimes();
EasyMock.expect(source.getTableData("test-ds1")).andReturn(tableData).anyTimes();
EasyMock.expect(source.getTableData("test-ds11")).andReturn(null).anyTimes();
EasyMock.expect(source.getTableData("test_ds1")).andReturn(tableData).anyTimes();
EasyMock.expect(source.getTableData("test_ds11")).andReturn(null).anyTimes();
EasyMock.replay(source, tableData);
Assert.assertEquals("test-ds1", BasicTableDataUtils.getTableDataName(true, source, "ds1", "test", false));
Assert.assertEquals("test-ds11", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", false));
Assert.assertEquals("test_ds1", BasicTableDataUtils.getTableDataName(true, source, "ds1", "test", false));
Assert.assertEquals("test_ds11", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", false));
source = EasyMock.mock(TableDataSource.class);
EasyMock.expect(source.getTableData("ds1")).andReturn(null).anyTimes();
EasyMock.expect(source.getTableData("test-ds1")).andReturn(null).anyTimes();
EasyMock.expect(source.getTableData("test_ds1")).andReturn(null).anyTimes();
EasyMock.replay(source);
Assert.assertEquals("test-ds1", BasicTableDataUtils.getTableDataName(true, source, "ds1", "test", false));
Assert.assertEquals("test_ds1", BasicTableDataUtils.getTableDataName(true, source, "ds1", "test", false));
Assert.assertEquals("ds1", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", false));
Assert.assertEquals("test-ds1", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", true));
Assert.assertEquals("test_ds1", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", true));
}

2
designer-base/src/test/java/com/fr/design/data/DesignTableDataManagerTest.java

@ -23,7 +23,7 @@ import java.util.HashMap;
import java.util.Map;
@RunWith(PowerMockRunner.class)
@PrepareForTest({TableDataFactory.class, StoreProcedure.class, TableDataConfig.class, ProcedureConfig.class})
@PrepareForTest({TableDataFactory.class, StoreProcedure.class, TableDataConfig.class, ProcedureConfig.class, TemplateTableDataWrapper.class})
@SuppressStaticInitializationFor({"com.fr.design.data.tabledata.wrapper.TableDataFactory"})
public class DesignTableDataManagerTest {

37
designer-chart/src/main/java/com/fr/design/locale/impl/EmptyDataMark.java

@ -1,37 +0,0 @@
package com.fr.design.locale.impl;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.locale.LocaleMark;
import java.awt.image.BufferedImage;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/**
* 根据本地化信息设置服务器图表空数据提示图标
*
* @author obo
* @version 11.0
* Created by obo on 2023/3/22
*/
public class EmptyDataMark implements LocaleMark<BufferedImage> {
private Map<Locale, BufferedImage> map = new HashMap<>();
private static final BufferedImage ZH_EMPTY_DATA = IOUtils.readImage("com/fr/design/images/zh_emptydata.png");
private static final BufferedImage US_EMPTY_DATA = IOUtils.readImage("/com/fr/design/images/us_emptydata.png");
private static final BufferedImage ZH_TRADITIONAL_EMPTY_DATA = IOUtils.readImage("/com/fr/design/images/zh_traditional_emptydata.png");
public EmptyDataMark() {
map.put(Locale.CHINA, ZH_EMPTY_DATA);
map.put(Locale.US, US_EMPTY_DATA);
map.put(Locale.TAIWAN, ZH_TRADITIONAL_EMPTY_DATA);
}
@Override
public BufferedImage getValue() {
BufferedImage result = map.get(GeneralContext.getLocale());
return result == null ? US_EMPTY_DATA : result;
}
}

11
designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStylePane.java

@ -10,13 +10,12 @@ import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.locale.impl.EmptyDataMark;
import com.fr.design.style.background.image.ImageFileChooser;
import com.fr.design.style.background.image.ImagePreviewPane;
import com.fr.design.utils.ImageUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark;
import com.fr.general.locale.image.LocaleImageFactory;
import com.fr.general.locale.image.LocaleImageMark;
import com.fr.stable.Constants;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StringUtils;
@ -35,7 +34,6 @@ import java.awt.GridLayout;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
/**
@ -63,10 +61,11 @@ public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane {
private Image emptyDataImage = DEFAULT_EMPTY_DATA_IMAGE;
private SwingWorker<Void, Void> imageWorker;
private static final String EMPTY_DATA_IMAGE_PATH = "/com/fr/design/images/emptydata.png";
static {
LocaleMark<BufferedImage> localeMark = LocaleCenter.getMark(EmptyDataMark.class);
DEFAULT_EMPTY_DATA_IMAGE = localeMark.getValue();
LocaleImageMark localeImageMark = LocaleImageFactory.getOrCreateLocaleMark(EMPTY_DATA_IMAGE_PATH);
DEFAULT_EMPTY_DATA_IMAGE = localeImageMark.getValue();
}
@Override

0
designer-chart/src/main/resources/com/fr/design/images/us_emptydata.png → designer-chart/src/main/resources/com/fr/design/images/en_us_emptydata.png

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

0
designer-chart/src/main/resources/com/fr/design/images/zh_emptydata.png → designer-chart/src/main/resources/com/fr/design/images/zh_cn_emptydata.png

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

0
designer-chart/src/main/resources/com/fr/design/images/zh_traditional_emptydata.png → designer-chart/src/main/resources/com/fr/design/images/zh_tw_emptydata.png

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

16
designer-form/src/main/java/com/fr/design/designer/creator/XNumberEditor.java

@ -6,7 +6,9 @@ package com.fr.design.designer.creator;
import com.fr.base.BaseUtils;
import com.fr.base.ScreenResolution;
import com.fr.base.Style;
import com.fr.design.designer.properties.mobile.NumberEditorMobilePropertyUI;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.mainframe.widget.editors.InChangeBooleanEditor;
import com.fr.design.mainframe.widget.editors.SpinnerMaxNumberEditor;
import com.fr.design.mainframe.widget.editors.SpinnerMinNumberEditor;
@ -91,15 +93,19 @@ public class XNumberEditor extends XWrapperedFieldEditor {
}
}
@Override
@Override
protected JComponent initEditor() {
setBorder(FIELDBORDER);
return this;
}
@Override
protected String getIconName() {
return "number_field_16.png";
}
@Override
protected String getIconName() {
return "number_field_16.png";
}
@Override
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() {
return new WidgetPropertyUIProvider[]{new NumberEditorMobilePropertyUI(this)};
}
}

6
designer-form/src/main/java/com/fr/design/designer/creator/XPassword.java

@ -3,7 +3,9 @@
*/
package com.fr.design.designer.creator;
import com.fr.design.designer.properties.mobile.PasswordMobilePropertyUI;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.gui.ibutton.UIPasswordField;
import com.fr.design.mainframe.widget.editors.RegexEditor;
import com.fr.design.mainframe.widget.editors.WidgetValueEditor;
@ -68,4 +70,8 @@ public class XPassword extends XWrapperedFieldEditor {
(CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, waterMark});
}
@Override
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() {
return new WidgetPropertyUIProvider[]{new PasswordMobilePropertyUI(this)};
}
}

11
designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java

@ -6,7 +6,9 @@ package com.fr.design.designer.creator;
import com.fr.base.BaseUtils;
import com.fr.base.ScreenResolution;
import com.fr.base.Style;
import com.fr.design.designer.properties.mobile.TextAreaMobilePropertyUI;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.mainframe.widget.editors.RegexEditor;
import com.fr.design.mainframe.widget.editors.WidgetValueEditor;
import com.fr.design.mainframe.widget.renderer.RegexCellRencerer;
@ -25,8 +27,9 @@ import java.beans.IntrospectionException;
/**
* @author richer
* @since 6.5.3
* Created on 2016/3/29
*/
public class XTextArea extends XFieldEditor {
public class XTextArea extends XWrapperedFieldEditor {
public XTextArea(TextArea widget, Dimension initSize) {
super(widget, initSize);
@ -81,4 +84,10 @@ public class XTextArea extends XFieldEditor {
protected String getIconName() {
return "text_area_16.png";
}
@Override
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() {
return new WidgetPropertyUIProvider[]{new TextAreaMobilePropertyUI(this)};
}
}

37
designer-form/src/main/java/com/fr/design/designer/properties/mobile/NumberEditorMobilePropertyUI.java

@ -0,0 +1,37 @@
package com.fr.design.designer.properties.mobile;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider;
import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.widget.ui.designer.mobile.NumberEditorMobileDefinePane;
/**
* 数字控件属性面板注册
*
* @author Coral.Chen
* @since 11.0
* Created on 2023/3/30
*/
public class NumberEditorMobilePropertyUI extends AbstractWidgetPropertyUIProvider {
private XCreator xCreator;
public NumberEditorMobilePropertyUI(XCreator xCreator) {
this.xCreator = xCreator;
}
@Override
public AbstractPropertyTable createWidgetAttrTable() {
return null;
}
@Override
public BasicPane createWidgetAttrPane() {
return new NumberEditorMobileDefinePane(xCreator);
}
@Override
public String tableTitle() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr");
}
}

37
designer-form/src/main/java/com/fr/design/designer/properties/mobile/PasswordMobilePropertyUI.java

@ -0,0 +1,37 @@
package com.fr.design.designer.properties.mobile;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider;
import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.widget.ui.designer.mobile.PasswordMobileDefinePane;
/**
* 密码控件移动端属性注册
*
* @author Coral.Chen
* @since 11.0
* Created on 2023/3/30
*/
public class PasswordMobilePropertyUI extends AbstractWidgetPropertyUIProvider {
private XCreator xCreator;
public PasswordMobilePropertyUI(XCreator xCreator) {
this.xCreator = xCreator;
}
@Override
public AbstractPropertyTable createWidgetAttrTable() {
return null;
}
@Override
public BasicPane createWidgetAttrPane() {
return new PasswordMobileDefinePane(xCreator);
}
@Override
public String tableTitle() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr");
}
}

37
designer-form/src/main/java/com/fr/design/designer/properties/mobile/TextAreaMobilePropertyUI.java

@ -0,0 +1,37 @@
package com.fr.design.designer.properties.mobile;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider;
import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.widget.ui.designer.mobile.TextAreaAdvancedDefinePane;
/**
* 文本域控件移动端属性
*
* @author Coral.Chen
* @since 11.0
* Created on 2023/3/29
*/
public class TextAreaMobilePropertyUI extends AbstractWidgetPropertyUIProvider {
private XCreator xCreator;
public TextAreaMobilePropertyUI(XCreator xCreator) {
this.xCreator = xCreator;
}
@Override
public AbstractPropertyTable createWidgetAttrTable() {
return null;
}
@Override
public BasicPane createWidgetAttrPane() {
return new TextAreaAdvancedDefinePane(xCreator);
}
@Override
public String tableTitle() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr");
}
}

5
designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java

@ -368,12 +368,11 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
wParameterLayout.setParamsFireStopEdit(fireAfterEditor.isSelected());
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
jTemplate.needAddTemplateIdAttr(useParamsTemplate.isSelected());
wParameterLayout.setBackground((Background) background.getValue());
if (extraPaneList.isEmpty()) {
background.setValue(wParameterLayout.getBackground());
wParameterLayout.setBackground((Background) background.getValue());
} else {
for (BasicBeanPane<WParameterLayout> pane : extraPaneList) {
pane.populateBean(wParameterLayout);
pane.updateBean(wParameterLayout);
}
}
//设置参数模板面板的高度

94
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/BaseTextEditorMobileDefinePane.java

@ -0,0 +1,94 @@
package com.fr.design.widget.ui.designer.mobile;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.widget.ui.designer.mobile.component.MobileTextEditSettingPane;
import com.fr.form.ui.TextEditor;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
/**
* <p> 文本类组件移动端高级属性的定义面板基础扩展可以直接继承此面板
* <p> 往内部添加其他配置
*
* @author Coral.Chen
* @since 11.0
* Created on 2023/3/30
*/
public class BaseTextEditorMobileDefinePane extends MobileWidgetDefinePane {
private XCreator xCreator;
protected MobileTextEditSettingPane textSettingPane;
public BaseTextEditorMobileDefinePane(XCreator xCreator) {
this.xCreator = xCreator;
}
@Override
public void initPropertyGroups(Object source) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel container = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 5);
addPropertyPanesToContainer(container);
this.add(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, container), BorderLayout.NORTH);
this.repaint();
}
/**
* 添加其他属性面板
*
* @param container 展开容器
*/
protected void addPropertyPanesToContainer(JPanel container) {
initSettingPane(container);
}
/**
* 初始化文本类基础面板
*
* @param container
*/
protected void initSettingPane(JPanel container) {
textSettingPane = new MobileTextEditSettingPane();
container.add(textSettingPane);
}
@Override
public void populate(FormDesigner designer) {
TextEditor textEditor = (TextEditor) xCreator.toData();
textSettingPane.populateBean(textEditor.getMobileTextEditAttr());
this.bindListeners2Widgets();
}
protected void bindListeners2Widgets() {
reInitAllListeners();
AttributeChangeListener changeListener = new AttributeChangeListener() {
@Override
public void attributeChange() {
update();
}
};
this.addAttributeChangeListener(changeListener);
}
private void reInitAllListeners() {
initListener(this);
}
@Override
public void update() {
TextEditor textEditor = (TextEditor) xCreator.toData();
textSettingPane.updateBean(textEditor.getMobileTextEditAttr());
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
public XCreator getxCreator() {
return xCreator;
}
}

33
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/NumberEditorMobileDefinePane.java

@ -0,0 +1,33 @@
package com.fr.design.widget.ui.designer.mobile;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner;
import com.fr.form.ui.NumberEditor;
/**
* 数字控件
*
* @author Coral.Chen
* @since 11.0
* Created on 2023/3/30
*/
public class NumberEditorMobileDefinePane extends BaseTextEditorMobileDefinePane {
public NumberEditorMobileDefinePane(XCreator xCreator) {
super(xCreator);
}
@Override
public void populate(FormDesigner designer) {
NumberEditor numberEditor = (NumberEditor) getxCreator().toData();
textSettingPane.populateBean(numberEditor.getMobileTextEditAttr());
this.bindListeners2Widgets();
}
@Override
public void update() {
NumberEditor numberEditor = (NumberEditor) getxCreator().toData();
textSettingPane.updateBean(numberEditor.getMobileTextEditAttr());
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
}

25
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/PasswordMobileDefinePane.java

@ -0,0 +1,25 @@
package com.fr.design.widget.ui.designer.mobile;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.widget.ui.designer.mobile.component.MobilePasswordEditSettingPane;
import javax.swing.JPanel;
/**
* 密码控件移动端高级属性
*
* @author Coral.Chen
* @since 11.0
* Created on 2023/3/30
*/
public class PasswordMobileDefinePane extends BaseTextEditorMobileDefinePane {
public PasswordMobileDefinePane(XCreator xCreator) {
super(xCreator);
}
@Override
protected void initSettingPane(JPanel container) {
textSettingPane = new MobilePasswordEditSettingPane();
container.add(textSettingPane);
}
}

57
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ScanCodeMobileDefinePane.java

@ -1,61 +1,50 @@
package com.fr.design.widget.ui.designer.mobile;
import com.fr.base.mobile.MobileScanCodeAttr;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.widget.ui.designer.mobile.component.MobileTextEditSettingPane;
import com.fr.design.widget.ui.designer.mobile.component.MobileTextFieldInputSettingPane;
import com.fr.form.ui.TextEditor;
import java.awt.BorderLayout;
import javax.swing.JPanel;
public class ScanCodeMobileDefinePane extends MobileWidgetDefinePane {
/**
* 输入方式
*
* @author hades
* @since 11.0
* Created on 2018/11/27
*/
public class ScanCodeMobileDefinePane extends BaseTextEditorMobileDefinePane {
private XCreator xCreator;
private MobileTextFieldInputSettingPane settingPane;
private MobileTextFieldInputSettingPane inputSettingPane;
public ScanCodeMobileDefinePane(XCreator xCreator) {
this.xCreator = xCreator;
super(xCreator);
}
@Override
public void initPropertyGroups(Object source) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
settingPane = new MobileTextFieldInputSettingPane();
this.add(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, settingPane), BorderLayout.NORTH);
this.repaint();
protected void initSettingPane(JPanel container) {
inputSettingPane = new MobileTextFieldInputSettingPane();
textSettingPane = new MobileTextEditSettingPane();
container.add(inputSettingPane);
container.add(textSettingPane);
}
private void bindListeners2Widgets() {
reInitAllListeners();
AttributeChangeListener changeListener = new AttributeChangeListener() {
@Override
public void attributeChange() {
update();
}
};
this.addAttributeChangeListener(changeListener);
}
private void reInitAllListeners() {
initListener(this);
}
@Override
public void populate(FormDesigner designer) {
MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) xCreator.toData()).getMobileScanCodeAttr();
settingPane.populateBean(mobileScanCodeAttr);
super.populate(designer);
TextEditor textEditor = (TextEditor) getxCreator().toData();
inputSettingPane.populateBean(textEditor.getMobileScanCodeAttr());
this.bindListeners2Widgets();
}
@Override
public void update() {
MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) xCreator.toData()).getMobileScanCodeAttr();
settingPane.updateBean(mobileScanCodeAttr);
super.update();
TextEditor textEditor = (TextEditor) getxCreator().toData();
inputSettingPane.updateBean(textEditor.getMobileScanCodeAttr());
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}

25
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TextAreaAdvancedDefinePane.java

@ -0,0 +1,25 @@
package com.fr.design.widget.ui.designer.mobile;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.widget.ui.designer.mobile.component.MobileTextAreaSettingPane;
import javax.swing.JPanel;
/**
* 文本域控件
*
* @author Coral.Chen
* @since 11.0
* Created on 2023/3/29
*/
public class TextAreaAdvancedDefinePane extends BaseTextEditorMobileDefinePane {
public TextAreaAdvancedDefinePane(XCreator xCreator) {
super(xCreator);
}
@Override
protected void initSettingPane(JPanel container) {
textSettingPane = new MobileTextAreaSettingPane();
container.add(textSettingPane);
}
}

43
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobilePasswordEditSettingPane.java

@ -0,0 +1,43 @@
package com.fr.design.widget.ui.designer.mobile.component;
import com.fr.base.mobile.MobileTextEditAttr;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.i18n.Toolkit;
import java.awt.BorderLayout;
/**
* 密码控件编辑属性设置面板
*
* @author Coral.Chen
* @since 11.0
* Created on 2023/3/30
*/
public class MobilePasswordEditSettingPane extends MobileTextEditSettingPane {
// 显示字数统计
private UICheckBox showPassword;
public MobilePasswordEditSettingPane() {
super();
showPassword = new UICheckBox(Toolkit.i18nText("Fine-Design_Mobile_Show_Password"), false);
this.add(showPassword, BorderLayout.NORTH);
}
@Override
protected boolean getClearDefaultState() {
return true;
}
@Override
public void populateBean(MobileTextEditAttr ob) {
super.populateBean(ob);
// 要兼容处理一下,为null 的话赋默认值,默认开启
this.showPassword.setSelected(ob.isShowPassword() == null || ob.isShowPassword());
}
@Override
public void updateBean(MobileTextEditAttr ob) {
super.updateBean(ob);
ob.setShowPassword(showPassword.isSelected());
}
}

38
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextAreaSettingPane.java

@ -0,0 +1,38 @@
package com.fr.design.widget.ui.designer.mobile.component;
import com.fr.base.mobile.MobileTextEditAttr;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.i18n.Toolkit;
import java.awt.BorderLayout;
/**
* 文本域控件
*
* @author Coral.Chen
* @since 11.0
* Created on 2023/3/29
*/
public class MobileTextAreaSettingPane extends MobileTextEditSettingPane {
// 显示字数统计
private UICheckBox showWordCount;
public MobileTextAreaSettingPane() {
super();
showWordCount = new UICheckBox(Toolkit.i18nText("Fine-Design_Mobile_Show_Word_Count"), false);
this.add(showWordCount, BorderLayout.NORTH);
}
@Override
public void populateBean(MobileTextEditAttr ob) {
super.populateBean(ob);
// 要兼容处理一下,为null 的话赋默认值,默认不开启
this.showWordCount.setSelected(ob.isShowWordCount() != null && ob.isShowWordCount());
}
@Override
public void updateBean(MobileTextEditAttr ob) {
super.updateBean(ob);
ob.setShowWordCount(showWordCount.isSelected());
}
}

59
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextEditSettingPane.java

@ -0,0 +1,59 @@
package com.fr.design.widget.ui.designer.mobile.component;
import com.fr.base.mobile.MobileTextEditAttr;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.VerticalFlowLayout;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
/**
* 文本类基础设置
*
* @author Coral.Chen
* @since 11.0
* Created on 2023/3/29
*/
public class MobileTextEditSettingPane extends BasicBeanPane<MobileTextEditAttr> {
// 允许一键清空
protected UICheckBox allowOneClickClear;
public MobileTextEditSettingPane() {
initLayout();
allowOneClickClear = new UICheckBox(Toolkit.i18nText("Fine-Design_Mobile_Allow_One_Click_Clear"), getClearDefaultState());
this.add(allowOneClickClear, BorderLayout.NORTH);
}
protected boolean getClearDefaultState() {
return false;
}
protected void initLayout() {
VerticalFlowLayout verticalFlowLayout = new VerticalFlowLayout(FlowLayout.LEADING, 0, 5);
verticalFlowLayout.setAlignLeft(true);
this.setLayout(verticalFlowLayout);
}
@Override
public void populateBean(MobileTextEditAttr ob) {
allowOneClickClear.setSelected(ob.isAllowOneClickClear() != null && ob.isAllowOneClickClear());
}
@Override
public MobileTextEditAttr updateBean() {
// do nothing
return null;
}
@Override
public void updateBean(MobileTextEditAttr ob) {
ob.setAllowOneClickClear(allowOneClickClear.isSelected());
}
@Override
protected String title4PopupWindow() {
return null;
}
}

28
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextFieldInputSettingPane.java

@ -2,12 +2,17 @@ package com.fr.design.widget.ui.designer.mobile.component;
import com.fr.base.mobile.MobileScanCodeAttr;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
/**
* @author hades
@ -22,13 +27,24 @@ public class MobileTextFieldInputSettingPane extends BasicBeanPane<MobileScanCod
public MobileTextFieldInputSettingPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel settingPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 5);
manualInputCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Mobile_Manual_Input"), true);
scanCodeCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Mobile_Scan_Code_Input"), true);
nfcInputCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Mobile_NFC_Input"), false);
settingPane.add(manualInputCheckBox);
settingPane.add(scanCodeCheckBox);
settingPane.add(nfcInputCheckBox);
initComponents();
}
private void initComponents() {
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Input_Way")), manualInputCheckBox},
new Component[]{null, scanCodeCheckBox},
new Component[]{null, nfcInputCheckBox}
};
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
JPanel settingPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.HGAP_LARGE, LayoutConstants.VGAP_LARGE);
this.add(settingPane, BorderLayout.NORTH);
}

13
designer-realize/src/main/java/com/fr/design/cell/bar/DynamicScrollButton.java

@ -1,11 +1,18 @@
package com.fr.design.cell.bar;
import com.fr.design.constants.UIConstants;
import com.fr.design.utils.SvgDrawUtils;
import com.fr.general.ComparatorUtils;
import javax.swing.*;
import javax.swing.SwingConstants;
import javax.swing.plaf.basic.BasicArrowButton;
import java.awt.*;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Insets;
import java.awt.image.BufferedImage;
import java.util.HashMap;
@ -62,6 +69,7 @@ public class DynamicScrollButton extends BasicArrowButton {
private void paintArrow(Graphics g, Dimension size) {
SvgDrawUtils.beforeDraw((Graphics2D) g);
switch (direction) {
case SwingConstants.NORTH:
g.drawImage(UIConstants.ARROW_NORTH, 0, 0, this);
@ -76,6 +84,7 @@ public class DynamicScrollButton extends BasicArrowButton {
g.drawImage(UIConstants.ARROW_WEST, 0, 0, this);
break;
}
SvgDrawUtils.afterDraw((Graphics2D) g);
}

54
designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java

@ -1,30 +1,7 @@
package com.fr.design.mainframe;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.GeneralPath;
import java.awt.geom.Path2D;
import java.util.ArrayList;
import java.util.List;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.base.svg.IconUtils;
import com.fr.base.theme.ReportTheme;
import com.fr.base.theme.TemplateTheme;
@ -44,7 +21,6 @@ import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.main.impl.WorkBook;
import com.fr.poly.PolyDesigner;
@ -52,6 +28,34 @@ import com.fr.report.poly.PolyWorkSheet;
import com.fr.report.report.TemplateReport;
import com.fr.report.worksheet.WorkSheet;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.GeneralPath;
import java.awt.geom.Path2D;
import java.util.ArrayList;
import java.util.List;
/**
* NameTabPane of sheets
*
@ -67,7 +71,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
private static final Icon WORK_SHEET_ICON = IconUtils.readIcon("/com/fr/design/standard/worksheet");
private static final Icon POLY_SHEET_ICON = IconUtils.readIcon("/com/fr/design/standard/polysheet");
private static final Icon LEFT_ICON = IconUtils.readIcon("/com/fr/design/standard/prepage/pre_page");
private static final Icon RIGHT_ICON = IconUtils.readIcon("/com/fr/design/standard/nextpage");
private static final Icon RIGHT_ICON = IconUtils.readIcon("/com/fr/design/standard/nextpage/next_page");
private static final Icon DISABLED_LEFT_ICON = IconUtils.readIcon("/com/fr/design/standard/prepage/pre_page_disabled.svg");
private static final Icon DISABLED_RIGHT_ICON = IconUtils.readIcon("/com/fr/design/standard/nextpage/next_page_disabled.svg");
private static final int NUM = 10;

11
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsImagePanel.java

@ -2,19 +2,18 @@ package com.fr.design.mainframe.alphafine.component;
import com.fr.base.GraphHelper;
import com.fr.base.svg.SVGLoader;
import com.fr.base.svg.SystemScaleUtils;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.alphafine.model.ProductNews;
import com.fr.design.utils.SvgPaintUtils;
import com.fr.design.utils.SvgDrawUtils;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.RenderingHints;
import java.util.Set;
import javax.swing.JPanel;
/**
* @author hades
@ -58,9 +57,9 @@ public class ProductNewsImagePanel extends JPanel {
}
Set<Long> readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet();
if (!readSet.contains(productNews.getId())) {
SvgPaintUtils.beforePaint(g2);
SvgDrawUtils.beforeDraw(g2);
g2.drawImage(NEW_TIP_IMAGE, 0, 0, this);
SvgPaintUtils.afterPaint(g2);
SvgDrawUtils.afterDraw(g2);
}
g2.setColor(BACKGROUND_COLOR);

9
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java

@ -4,13 +4,14 @@ import com.fr.base.svg.SVGLoader;
import com.fr.base.svg.SystemScaleUtils;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.alphafine.AlphaFineUtil;
import com.fr.design.utils.SvgPaintUtils;
import com.fr.design.utils.SvgDrawUtils;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import javax.swing.JPanel;
/**
* @author hades
@ -33,7 +34,7 @@ public class QuestionPane extends JPanel {
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
SvgPaintUtils.beforePaint(g2);
SvgDrawUtils.beforeDraw(g2);
// 宽高保持
int width = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getWidth() * SVGLoader.SYSTEM_SCALE) : getWidth();
int height = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getHeight() * SVGLoader.SYSTEM_SCALE) : getHeight();
@ -47,7 +48,7 @@ public class QuestionPane extends JPanel {
int imageWidth = QUESTION_IMAGE.getWidth(this);
int imageHeight = QUESTION_IMAGE.getHeight(this);
g2.drawImage(QUESTION_IMAGE, (width - imageWidth) / 2 - 2, (height - imageHeight) / 2 - 2,this);
SvgPaintUtils.afterPaint(g2);
SvgDrawUtils.afterDraw(g2);
}

5
designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortGroupPane.java

@ -8,6 +8,8 @@ import com.fr.design.sort.common.AbstractSortItemPane;
import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.core.sort.sortexpression.SortExpression;
import java.util.Map;
public class CellDSColumnSortGroupPane extends AbstractSortGroupPane {
DSColumn dsColumn;
@ -24,7 +26,8 @@ public class CellDSColumnSortGroupPane extends AbstractSortGroupPane {
CellDSColumnSortItemPane cellDSColumnSortItemPane = new CellDSColumnSortItemPane(sortItemPaneWidth, sortItemPaneRightWidth);
java.util.Map<String, TableDataWrapper> tableDataWrapperMap =
DesignTableDataManager.getAllEditingDataSet(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget());
TableDataWrapper tableDataWrapper = tableDataWrapperMap.get(dsColumn.getDSName());
Map<String, TableDataWrapper> allDataSetIncludingProcedure = DesignTableDataManager.getAllDataSetIncludingProcedure(tableDataWrapperMap);
TableDataWrapper tableDataWrapper = allDataSetIncludingProcedure.get(dsColumn.getDSName());
if (tableDataWrapper != null) {
java.util.List<String> columnNameList = tableDataWrapper.calculateColumnNameList();
String[] columnNames = new String[columnNameList.size()];

Loading…
Cancel
Save