Browse Source

Merge pull request #7440 in DESIGN/design from release/11.0 to feature/x

* commit 'b87ffbde0b473afa5d07891aa4004603101e3e31':
  REPORT-65449 在组件包详情页拖拽组件并修改后,再点到在线组件,标签和内容显示不一致
  REPORT-64811 10.0设计器下载的组件文件无法解压缩
  REPORT-65290 设计器-水印,平台改变水印开关,模板水印变成了模板单独设置 1.修改水印的isvalid
  REPORT-65369 设计器内对macOS12的处理-按钮图标设置-在点击 选择图片时回到了父弹窗界面,没有实时显示出来,而需要再次单机设计器界面
  REPORT-65381 linux_arm设计器-点击菜单栏文件-选项,出现弹窗后再点击 确定按钮,弹窗不消失,无任何反应
  REPORT-65371 【主题边框】附件截图,滚动条显示有问题
  REPORT-65343 FR11-新自适应开发者调试-新建模板,直接点击开发者调试进行模板保存和预览,此时虽然弹出保存路径弹窗,但对话框弹窗还没有点击的时候模板web就打开了且报错,因为模板没保存成功;设计器端可以看到模板被关闭了
  REPORT-65365 【主题边框】多次切换单元格样式后切换自定义,边框线有问题
  REPORT-65358 【主题边框】单元格样式双线显示有问题
  REPORT-65307 二轮冒烟测试-远程模板锁定优化-国际化问题-弹窗显示不全
  REPORT-64009 设计器内对macOS12的处理 fix import
  REPORT-64009 设计器内对macOS12的处理 fix门槛用例的bug
feature/x
superman 3 years ago
parent
commit
484d31ead8
  1. 2
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 25
      designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java
  3. 13
      designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java
  4. 3
      designer-base/src/main/java/com/fr/design/lock/LockInfoDialog.java
  5. 3
      designer-base/src/main/java/com/fr/design/mainframe/ForbiddenPane.java
  6. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java
  7. 41
      designer-base/src/main/java/com/fr/design/web/CustomIconPane.java
  8. 9
      designer-base/src/main/java/com/fr/design/worker/save/CallbackSaveWorker.java
  9. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  10. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  11. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  12. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  13. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  14. 6
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java
  15. 19
      designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java
  16. 4
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

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

@ -809,7 +809,7 @@ public class PreferencePane extends BasicPane {
designerEnvManager.setJoinProductImprove(this.joinProductImproveCheckBox.isSelected());
designerEnvManager.setEmbedServerLazyStartup(this.embedServerLazyStartupCheckBox.isSelected());
designerEnvManager.setImageCompress(this.imageCompressPanelCheckBox.isSelected());
designerEnvManager.setUseOptimizedUPM4Adapter(this.useOptimizedUPMCheckbox.isSelected());
designerEnvManager.setUseOptimizedUPM4Adapter(this.useOptimizedUPMCheckbox != null && this.useOptimizedUPMCheckbox.isSelected());
VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager();
vcsConfigManager.setSaveInterval(this.saveIntervalEditor.getValue());
vcsConfigManager.setVcsEnable(this.vcsEnableCheckBox.isSelected());

25
designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java

@ -19,9 +19,7 @@ import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.util.List;
@ -154,16 +152,16 @@ public class CellStylePreviewPane extends JPanel {
float adjustRight = 0;
float adjustBottom = 0;
if (column == 0) {
adjustLeft = GraphHelper.getLineStyleSize(style.getBorderLeft()) / 2.0F + computeOffset4DoubleStyleBorder(style);
adjustLeft = computeHalfSize4StyledBorder(style.getBorderLeft());
}
if (row == 0) {
adjustTop = GraphHelper.getLineStyleSize(style.getBorderTop()) / 2.0F + computeOffset4DoubleStyleBorder(style);
adjustTop = computeHalfSize4StyledBorder(style.getBorderTop());
}
if (column == columnSpan - 1) {
adjustRight = -GraphHelper.getLineStyleSize(style.getBorderRight()) / 2.0F - computeOffset4DoubleStyleBorder(style);
adjustRight = -computeHalfSize4StyledBorder(style.getBorderRight());
}
if (row == rowSpan - 1) {
adjustBottom = -GraphHelper.getLineStyleSize(style.getBorderBottom()) / 2.0F - computeOffset4DoubleStyleBorder(style);
adjustBottom = -computeHalfSize4StyledBorder(style.getBorderBottom());
}
g2d.translate(adjustLeft, adjustTop);
@ -171,15 +169,16 @@ public class CellStylePreviewPane extends JPanel {
g2d.translate(-adjustLeft, -adjustTop);
}
private float computeOffset4DoubleStyleBorder(Style style) {
float offset = 0F;
if (style.getBorderLeft() == Constants.LINE_DOUBLE) {
offset += GraphHelper.getLineStyleSize(Constants.LINE_THIN) / 2.0F;
} else if (style.getBorderLeft() == Constants.LINE_DOUBLE_DOT) {
offset += GraphHelper.getLineStyleSize(Constants.LINE_DOT) / 2.0F;
private float computeHalfSize4StyledBorder(int border) {
float size = GraphHelper.getLineStyleSize(border) / 2.0F;
if (border == Constants.LINE_DOUBLE) {
size += GraphHelper.getLineStyleSize(Constants.LINE_THIN) / 2.0F;
} else if (border == Constants.LINE_DOUBLE_DOT) {
size += GraphHelper.getLineStyleSize(Constants.LINE_DOT) / 2.0F;
}
return offset;
return size;
}
@Override

13
designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java

@ -4,7 +4,6 @@ package com.fr.design.gui.style;
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
import com.fr.base.BaseUtils;
import com.fr.base.CellBorderStyle;
import com.fr.base.Style;
import com.fr.design.constants.LayoutConstants;
@ -17,8 +16,8 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.NewColorSelectBox;
import com.fr.general.IOUtils;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.general.IOUtils;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
@ -206,6 +205,8 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
}
public void populateLineStyleAndColor(CellBorderStyle cellBorderStyle, boolean onlyInspectTop) {
resetLineStyleAndColorSetting();
if (cellBorderStyle.getTopStyle() != Constants.LINE_NONE) {
this.currentLineCombo.setSelectedLineStyle(cellBorderStyle.getTopStyle());
this.currentLineColorPane.setSelectObject(cellBorderStyle.getTopColor());
@ -225,9 +226,6 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
} else if (cellBorderStyle.getHorizontalStyle() != Constants.LINE_NONE) {
this.currentLineCombo.setSelectedLineStyle(cellBorderStyle.getHorizontalStyle());
this.currentLineColorPane.setSelectObject(cellBorderStyle.getHorizontalColor());
} else {
this.currentLineCombo.setSelectedLineStyle(Constants.LINE_NONE);
this.currentLineColorPane.setSelectObject(Color.BLACK);
}
}
@ -236,6 +234,11 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
}
}
private void resetLineStyleAndColorSetting() {
this.currentLineCombo.setSelectedLineStyle(Constants.LINE_NONE);
this.currentLineColorPane.setSelectObject(null);
}
@Override
public Style update(Style style) {

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

@ -3,6 +3,7 @@ package com.fr.design.lock;
import com.fr.design.file.TemplateTreePane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
@ -44,7 +45,7 @@ public class LockInfoDialog extends JDialog {
panel.add(createControlPane(), BorderLayout.SOUTH);
this.getContentPane().add(panel);
this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Title_Hint"));
this.setSize(400, 160);
this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.lock.LockInfoDialog"));
this.setResizable(false);
this.setModal(true);
GUICoreUtils.centerWindow(this);

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

@ -2,6 +2,7 @@ package com.fr.design.mainframe;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.guide.base.GuideView;
import com.fr.design.utils.gui.GUICoreUtils;
@ -105,7 +106,7 @@ public class ForbiddenPane extends JPanel {
super.paintComponent(g2d);
}
};
refreshButton.setPreferredSize(new Dimension(68, 24));
refreshButton.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.ForbiddenPane.refreshButton"));
refreshButton.setForeground(Color.WHITE);
refreshButton.setBorderPainted(false);
refreshButton.setContentAreaFilled(false);

2
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java

@ -198,7 +198,7 @@ public class CellStyleEditPane extends MultiTabPane<ThemedCellStyle> {
@Override
protected void layoutContentPane() {
super.layoutContentPane();
leftcontentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 5, original));
}
}
}

41
designer-base/src/main/java/com/fr/design/web/CustomIconPane.java

@ -4,14 +4,14 @@ import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.base.Icon;
import com.fr.base.IconManager;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ifilechooser.FileChooserArgs;
import com.fr.design.gui.ifilechooser.FileChooserFactory;
import com.fr.design.gui.ifilechooser.FileChooserProvider;
import com.fr.design.gui.ifilechooser.JavaFxNativeFileChooser;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.iscrollbar.UIScrollBar;
import com.fr.design.gui.itextarea.DescriptionTextArea;
@ -30,23 +30,35 @@ import com.fr.stable.ListMap;
import com.fr.stable.StringUtils;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import javafx.stage.FileChooser;
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Window;
import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JToggleButton;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.plaf.basic.BasicButtonUI;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
/**
* carl自定义Icon编辑
@ -414,7 +426,7 @@ public class CustomIconPane extends BasicPane {
browseButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
onBrowseButtonClicked();
onBrowseButtonClicked(SwingUtilities.getWindowAncestor(EditIconDialog.this));
}
});
@ -449,12 +461,11 @@ public class CustomIconPane extends BasicPane {
this.add(centerPane, BorderLayout.CENTER);
}
private void onBrowseButtonClicked() {
private void onBrowseButtonClicked(Window parent) {
// carl:不知道是否只要png格式,反正导出时全部都转成png了
FileChooserProvider fileChooserProvider = new JavaFxNativeFileChooser.Builder().
filter("Icon Image File", "*.jpg", "*.jpeg", "*.png", "*.gif").
build();
if (JFileChooser.APPROVE_OPTION == fileChooserProvider.showDialog(DesignerContext.getDesignerFrame())) {
FileChooserProvider fileChooserProvider = FileChooserFactory.createFileChooser(FileChooserArgs.newBuilder().
setFilter("Icon Image File", "*.jpg", "*.jpeg", "*.png", "*.gif").build());
if (JFileChooser.APPROVE_OPTION == fileChooserProvider.showDialog(parent)) {
String path = fileChooserProvider.getSelectedFile().getAbsolutePath();
// 图片存储有最大值48*48限制,没有超过最大值时,按原图大小存储,超过最大值后,压缩至最大值存储
Image image = BaseUtils.readImage(path);

9
designer-base/src/main/java/com/fr/design/worker/save/CallbackSaveWorker.java

@ -63,6 +63,15 @@ public class CallbackSaveWorker extends SaveWorker {
}
}
public void addSuccessCallbackBeforeLast(Runnable successRunnable) {
if (successRunnableList == null) {
successRunnableList = new LinkedList<>();
}
if (successRunnable != null) {
successRunnableList.add(successRunnableList.size() - 1, successRunnable);
}
}
public void addFailCallback(Runnable failRunnable) {
if (failRunnableList == null) {
failRunnableList = new LinkedList<>();

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties

@ -12,4 +12,6 @@ com.fr.design.web.pane.text.field=450*20
com.fr.design.actions.server.dialog=800*630
com.fr.design.report.fit.templatePane.dialog=800*400
com.fr.design.report.fit.firstColumn=120*20
com.fr.design.report.fit.column=160*20
com.fr.design.report.fit.column=160*20
com.fr.design.lock.LockInfoDialog=500*180
com.fr.design.mainframe.ForbiddenPane.refreshButton=75*24

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties

@ -11,4 +11,6 @@ com.fr.design.web.pane.text.field=400*20
com.fr.design.actions.server.dialog=700*630
com.fr.design.report.fit.templatePane.dialog=600*400
com.fr.design.report.fit.firstColumn=170*20
com.fr.design.report.fit.column=100*20
com.fr.design.report.fit.column=100*20
com.fr.design.lock.LockInfoDialog=500*180
com.fr.design.mainframe.ForbiddenPane.refreshButton=68*24

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties

@ -11,4 +11,6 @@ com.fr.design.web.pane.text.field=450*20
com.fr.design.actions.server.dialog=700*630
com.fr.design.report.fit.templatePane.dialog=600*400
com.fr.design.report.fit.firstColumn=130*20
com.fr.design.report.fit.column=100*20
com.fr.design.report.fit.column=100*20
com.fr.design.lock.LockInfoDialog=500*180
com.fr.design.mainframe.ForbiddenPane.refreshButton=80*24

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

@ -12,4 +12,6 @@ com.fr.design.web.pane.text.field=450*20
com.fr.design.actions.server.dialog=700*630
com.fr.design.report.fit.templatePane.dialog=600*400
com.fr.design.report.fit.firstColumn=80*20
com.fr.design.report.fit.column=100*20
com.fr.design.report.fit.column=100*20
com.fr.design.lock.LockInfoDialog=400*160
com.fr.design.mainframe.ForbiddenPane.refreshButton=68*24

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

@ -11,4 +11,6 @@ com.fr.design.web.pane.text.field=450*20
com.fr.design.actions.server.dialog=700*630
com.fr.design.report.fit.templatePane.dialog=600*400
com.fr.design.report.fit.firstColumn=80*20
com.fr.design.report.fit.column=100*20
com.fr.design.report.fit.column=100*20
com.fr.design.lock.LockInfoDialog=400*160
com.fr.design.mainframe.ForbiddenPane.refreshButton=68*24

6
designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java

@ -24,6 +24,7 @@ public class OnlineWidgetTabPane extends JPanel {
private static final String COMPONENT = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share");
private static final String COMPONENT_PACKAGE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_Package");
private static final String COMPONENT_EMBED = "COMPONENT_EMBED";
private UITabGroup headGroup;
private CardLayout cardLayout;
private JPanel centerPane;
private boolean packagePaneCreated = false;
@ -43,7 +44,7 @@ public class OnlineWidgetTabPane extends JPanel {
this.centerPane.add(new OnlineWidgetShowPane(sharableWidgets), COMPONENT);
this.centerPane.add( embedFilterShowPane = new OnlineEmbedFilterShowPane(new OnlineWidgetShowPane(sharableWidgets, OnlineWidgetSortType.SALES)), COMPONENT_EMBED);
//延迟组件包面板的初始化,防止组件面板里组件的缩略图和组件包面板里组件的缩略图一起加载
UITabGroup headGroup = new UITabGroup(new String[]{COMPONENT, COMPONENT_PACKAGE}) {
this.headGroup = new UITabGroup(new String[]{COMPONENT, COMPONENT_PACKAGE}) {
public void tabChanged(int newSelectedIndex) {
for (TabChangeListener changeListener : tabChangeListeners) {
changeListener.tabChange(newSelectedIndex);
@ -63,7 +64,7 @@ public class OnlineWidgetTabPane extends JPanel {
}
};
headGroup.setSelectedIndex(0);
this.headGroup.setSelectedIndex(0);
this.centerPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
@ -84,6 +85,7 @@ public class OnlineWidgetTabPane extends JPanel {
}
}
public void refreshPane() {
this.headGroup.setSelectedIndex(0);
this.cardLayout.show(centerPane, ComponentShareUtil.needShowEmbedFilterPane() ? COMPONENT_EMBED : COMPONENT);
}

19
designer-form/src/main/java/com/fr/design/preview/DeveloperPreview.java

@ -6,10 +6,13 @@ import com.fr.design.fun.impl.AbstractPreviewProvider;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.worker.WorkerManager;
import com.fr.design.worker.save.CallbackSaveWorker;
import com.fr.general.web.ParameterConstants;
import java.util.HashMap;
import java.util.Map;
import javax.swing.SwingWorker;
/**
* Created by kerry on 2020-04-23
@ -44,6 +47,22 @@ public class DeveloperPreview extends AbstractPreviewProvider {
@Override
public void onClick(JTemplate<?, ?> jt) {
super.onClick(jt);
SwingWorker worker = WorkerManager.getInstance().getWorker(jt.getRuntimeId());
if (worker instanceof CallbackSaveWorker) {
CallbackSaveWorker callbackSaveWorker = (CallbackSaveWorker) worker;
callbackSaveWorker.addSuccessCallbackBeforeLast(new Runnable() {
@Override
public void run() {
onPreview(jt);
}
});
} else if (jt.getEditingFILE().isEnvFile()) {
// 已经保存在当前工作目录了
onPreview(jt);
}
}
private void onPreview(JTemplate<?, ?> jt) {
MutilTempalteTabPane.getInstance().closeCurrentTpl();
jt.generateForBiddenTemplate();
}

4
designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java

@ -10,6 +10,7 @@ import com.fr.base.theme.migrator.FormThemeConfigMigrator;
import com.fr.base.theme.migrator.ReportThemeConfigMigrator;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.config.MarketConfig;
import com.fr.config.ServerPreferenceConfig;
import com.fr.decision.update.backup.RecoverManager;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
@ -187,6 +188,9 @@ public class DesignerActivator extends Activator implements Prepare {
//生成BasicChartQuickEditor对象,需要用到ChartDesignerActivator的注册信息(DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class);)
//所以不能在registerCellEditor函数中进行注册
ActionFactory.registerCellEditor(ChartCollection.class, new BasicChartQuickEditor());
if (DesignerEnvManager.getEnvManager().isUseOptimizedUPM4Adapter() && WorkContext.getCurrent().isLocal()) {
ServerPreferenceConfig.getInstance().setUseOptimizedUPM(DesignerEnvManager.getEnvManager().isUseOptimizedUPM4Adapter());
}
}
private void loadLogAppender() {

Loading…
Cancel
Save