Browse Source

Merge pull request #11776 in DESIGN/design from release/10.0 to final/10.0

* commit 'e826a708cd2963399254ef73a6019f69139211dc':
  REPORT-82787 图表空数据提示配置页面,默认图片需补充繁中版优化import
  REPORT-82787 图表空数据提示配置页面,默认图片需补充繁中版
  REPORT-91743 设计器通过关闭模板A的方式触发保存,设计器页面显示还是模板A的内容 同步10.0
final/10.0
superman 2 years ago
parent
commit
4547fddc1c
  1. 14
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  2. 37
      designer-chart/src/main/java/com/fr/design/locale/impl/EmptyDataMark.java
  3. 12
      designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStylePane.java
  4. BIN
      designer-chart/src/main/resources/com/fr/design/images/zh_traditional_emptydata.png

14
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -766,8 +766,8 @@ public class MutilTempalteTabPane extends JComponent {
// 如果关闭的模板是当前选中的模板,则重新激活当前 selectIndex 的模板; // 如果关闭的模板是当前选中的模板,则重新激活当前 selectIndex 的模板;
// selectIndex 没有变化,但是对应的模板已经变成了前一张模板 // selectIndex 没有变化,但是对应的模板已经变成了前一张模板
if (closeIconIndex == selectedIndex || isCloseCurrent) { if (closeIconIndex == selectedIndex || isCloseCurrent) {
// 如果 closeIconIndex 是最后一个被渲染画出的,那么预览上一个,防止数组越界 // 如果当前关闭的模板在最右侧,那么预览上一个,防止数组越界
if (closeIconIndex >= maxPaintIndex) { if (selectedIndex >= maxPaintIndex) {
// selectIndex 不会 <0 因为如果关闭的是打开的最后一个模板,那么关闭之后 openedTemplate.isEmpty() = true // selectIndex 不会 <0 因为如果关闭的是打开的最后一个模板,那么关闭之后 openedTemplate.isEmpty() = true
selectedIndex--; selectedIndex--;
} }
@ -953,6 +953,10 @@ public class MutilTempalteTabPane extends JComponent {
return; return;
} }
} }
//参考CloseCurrentTemplateAction,在closeFormat与closeSpecifiedTemplate之前要先设定isCloseCurrent,这样关闭之后才会自动切换tab
if (checkCurrentClose(template)) {
setIsCloseCurrent(true);
}
closeFormat(template); closeFormat(template);
closeSpecifiedTemplate(template); closeSpecifiedTemplate(template);
DesignerContext.getDesignerFrame().getContentFrame().repaint(); DesignerContext.getDesignerFrame().getContentFrame().repaint();
@ -985,6 +989,12 @@ public class MutilTempalteTabPane extends JComponent {
} }
private boolean checkCurrentClose(JTemplate template) {
JTemplate currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
//10.0无JTemplate.isValid
return currentTemplate != null && ComparatorUtils.equals(template.getPath(), currentTemplate.getPath());
}
private class MultiTemplateTabMouseMotionListener implements MouseMotionListener { private class MultiTemplateTabMouseMotionListener implements MouseMotionListener {
/** /**

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

@ -0,0 +1,37 @@
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;
}
}

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

@ -10,12 +10,13 @@ import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; 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.ImageFileChooser;
import com.fr.design.style.background.image.ImagePreviewPane; import com.fr.design.style.background.image.ImagePreviewPane;
import com.fr.design.utils.ImageUtils; import com.fr.design.utils.ImageUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.GeneralContext; import com.fr.general.locale.LocaleCenter;
import com.fr.general.IOUtils; import com.fr.general.locale.LocaleMark;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.CoreGraphHelper; import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -26,7 +27,6 @@ import javax.swing.JFileChooser;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import java.io.File;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
@ -35,6 +35,8 @@ import java.awt.GridLayout;
import java.awt.Image; import java.awt.Image;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
/** /**
* Created by mengao on 2017/11/23. * Created by mengao on 2017/11/23.
@ -63,8 +65,8 @@ public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane {
static { static {
DEFAULT_EMPTY_DATA_IMAGE = GeneralContext.isChineseEnv() ? IOUtils.readImage("com/fr/design/images/zh_emptydata.png") LocaleMark<BufferedImage> localeMark = LocaleCenter.getMark(EmptyDataMark.class);
: IOUtils.readImage("com/fr/design/images/us_emptydata.png"); DEFAULT_EMPTY_DATA_IMAGE = localeMark.getValue();
} }
@Override @Override

BIN
designer-chart/src/main/resources/com/fr/design/images/zh_traditional_emptydata.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Loading…
Cancel
Save