Browse Source

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

* commit 'f06122ef98329ede1e1cc9bdb26f6192412798b6':
  CHART-23245 fix:模板锁定备份fvs
  CHART-22994 图表背景色控件需要更换为支持透明色的控件
feature/x
superman 3 years ago
parent
commit
407dec20ae
  1. 11
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  2. 12
      designer-base/src/main/java/com/fr/design/utils/TemplateUtils.java
  3. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithThemeStyle.java

11
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -1016,6 +1016,17 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
}
}
public byte[] exportData() throws Exception {
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
BaseBook target = getTarget();
if (target != null) {
target.export(outputStream);
return outputStream.toByteArray();
}
}
return new byte[0];
}
protected boolean export() throws Exception {
return this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(getEditingFILE()));

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

@ -1,7 +1,6 @@
package com.fr.design.utils;
import com.fr.base.extension.FileExtension;
import com.fr.base.io.BaseBook;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.TemplateTreePane;
import com.fr.design.i18n.Toolkit;
@ -17,9 +16,9 @@ import com.fr.stable.CoreConstants;
import com.fr.stable.ProductConstants;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.lock.TplOperator;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import javax.swing.SwingWorker;
import java.io.OutputStream;
/**
* @author hades
@ -65,12 +64,7 @@ public class TemplateUtils {
if (!needOpen) {
// 从当前编辑模板中生成备份文件
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
BaseBook target = template.getTarget();
if (target != null) {
target.export(outputStream);
content = outputStream.toByteArray();
}
content = template.exportData();
} else {
content = WorkContext.getWorkResource().readFully(oldPath);
}

2
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithThemeStyle.java

@ -25,7 +25,7 @@ public class VanChartBackgroundPaneWithThemeStyle extends VanChartBackgroundPane
}
});
paneList.add(new NullBackgroundQuickPane());
paneList.add(new ColorBackgroundQuickPane());
paneList.add(new ColorBackgroundQuickPane(true));
paneList.add(new ImageBackgroundQuickPane(false));
paneList.add(new VanChartGradientPane());
}

Loading…
Cancel
Save