Browse Source

Pull request #6306: REPORT-61338 & CHART-21593 & REPORT-61373

Merge in DESIGN/design from ~STARRYI/design:final/11.0 to final/11.0

* commit '900de178295f427720a062a31f66a9d011121e0f':
  REPORT-61415 主题色颜色选择框黑色列不符合设计
  REPORT-61413 【主题切换】cpt预览图里的左上角斜线单元格应该和小标题格式一致
  CHART-21579 模版主题编辑页面-图表-系列-渐变色的色值联动逻辑修改
  CHART-21560 【FR11】图表tab切换按钮切换编辑失效,无法触发保存
  REPORT-61373 【主题获取】11.0的组件下载不了
  CHART-21593 【主题获取】生成跟随主题的组件后,拖到其他主题的模板中,图表还是跟随主题
  REPORT-61338 设计器主题-主题配色修改保存后出现异常空白提示框
final/11.0
starryi 3 years ago
parent
commit
9ba5db89a9
  1. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java
  2. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UITabGroup.java
  3. 3
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java
  4. 42
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java
  5. 48
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java
  6. 60
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPane.java
  7. 8
      designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeGridPagesDialog.java
  8. 5
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java
  9. 6
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartSeriesStylePane.java
  10. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java
  11. 2
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java
  12. 9
      designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
  13. 6
      designer-form/src/main/java/com/fr/design/mainframe/share/util/DownloadUtils.java

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java

@ -314,7 +314,7 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver, UIOb
* @param newSelectedIndex
*/
public void setSelectedIndex(int newSelectedIndex) {
setSelectedIndex(newSelectedIndex, true);
setSelectedIndex(newSelectedIndex, false);
}
private void fireStateChanged() {

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UITabGroup.java

@ -64,7 +64,7 @@ public class UITabGroup extends UIButtonGroup<Integer> {
@Override
protected void setSelectedIndex(int newSelectedIndex, boolean fireChanged) {
super.setSelectedIndex(newSelectedIndex, fireChanged);
super.setSelectedIndex(newSelectedIndex, false);
tabChanged(newSelectedIndex);
}
}

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

@ -17,7 +17,6 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.theme.edit.CellStyleListEditPane;
import com.fr.design.mainframe.theme.edit.ChartStyleEditPane;
import com.fr.design.mainframe.theme.edit.ui.ColorListExtendedPane;
import com.fr.design.mainframe.theme.edit.ui.ColorListPane;
import com.fr.design.mainframe.theme.edit.ui.LabelUtils;
import com.fr.design.mainframe.theme.ui.AutoCheckTextField;
@ -163,8 +162,6 @@ public abstract class TemplateThemeEditorPane<T extends TemplateTheme> extends J
FineColorFlushUtils.replaceCacheObject(theme, replaceByColorScheme);
FineColorManager.traverse(theme, replaceByColorScheme);
populateBean4CustomEditors(theme);
//图表渐变色
chartStyleSettingPane.populateGradientBar(colors);
this.repaint();
}

42
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java

@ -43,6 +43,8 @@ import java.awt.Stroke;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import static com.fr.design.i18n.Toolkit.i18nText;
@ -63,27 +65,31 @@ public class TemplateThemeGridControlPane<T extends TemplateTheme> extends Basic
private final AsyncThemeFetcher<T> asyncThemeFetcher;
public static TemplateThemeGridControlPane<FormTheme> createFormThemesManagerPane() {
private final Window window;
public static TemplateThemeGridControlPane<FormTheme> createFormThemesManagerPane(Window window) {
FormThemeConfig config = FormThemeConfig.getInstance();
FormThemeProfilePane editPane = new FormThemeProfilePane(config);
return new TemplateThemeGridControlPane<>(config, editPane);
return new TemplateThemeGridControlPane<>(window, config, editPane);
}
public static TemplateThemeGridControlPane<ReportTheme> createReportThemesManagerPane() {
public static TemplateThemeGridControlPane<ReportTheme> createReportThemesManagerPane(Window window) {
ReportThemeConfig config = ReportThemeConfig.getInstance();
ReportThemeProfilePane editPane = new ReportThemeProfilePane(config);
return new TemplateThemeGridControlPane<>(config, editPane);
return new TemplateThemeGridControlPane<>(window, config, editPane);
}
public TemplateThemeGridControlPane(TemplateThemeConfig<T> config, TemplateThemeProfilePane<T> profilePane) {
public TemplateThemeGridControlPane(Window window, TemplateThemeConfig<T> config, TemplateThemeProfilePane<T> profilePane) {
this.window = window;
this.config = config;
this.profilePane = profilePane;
this.themeListPane = new TemplateThemeGridPane<>(true, config, profilePane);
this.themeListPane = new TemplateThemeGridPane<>(window, true, config, profilePane);
this.removeAction = new RemoveThemeAction(false);
this.setTheme4NewTemplateButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Pane_Default_Setting"));
this.asyncThemeFetcher = new AsyncThemeFetcher<>(1, config);
initializePane();
registerWindowListener();
}
public TemplateThemeConfig<T> getConfig() {
@ -117,6 +123,16 @@ public class TemplateThemeGridControlPane<T extends TemplateTheme> extends Basic
repaint();
}
private void registerWindowListener() {
window.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
super.windowClosed(e);
asyncThemeFetcher.shutdown();
}
});
}
private void resetEnableRemoveAction(T selectedTheme, RemoveThemeAction removeAction) {
if (selectedTheme == null) {
removeAction.setEnabled(false);
@ -254,7 +270,6 @@ public class TemplateThemeGridControlPane<T extends TemplateTheme> extends Basic
setName(name);
setMnemonic('R');
this.prototypeThemeName = prototypeThemeName;
asyncThemeFetcher.submit(prototypeThemeName, null);
}
@Override
@ -308,17 +323,4 @@ public class TemplateThemeGridControlPane<T extends TemplateTheme> extends Basic
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
}
}
public void startListenThemeConfig() {
themeListPane.startListenThemeConfig();
}
public void stopListenThemeConfig() {
themeListPane.stopListenThemeConfig();
}
public void stopAsyncFetchTheme() {
asyncThemeFetcher.shutdown();
themeListPane.stopAsyncFetchTheme();
}
}

48
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java

@ -38,6 +38,7 @@ import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Stroke;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
@ -61,11 +62,11 @@ public class TemplateThemeGridPagesPane extends JPanel {
private PageChangeListener pageChangeListener;
private TemplateThemeGridPagePane currentTemplateThemeGridPagePane;
public TemplateThemeGridPagesPane() {
initializePane();
public TemplateThemeGridPagesPane(Window window) {
initializePane(window);
}
private void initializePane() {
private void initializePane(Window window) {
setLayout(new BorderLayout());
setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10));
@ -82,9 +83,9 @@ public class TemplateThemeGridPagesPane extends JPanel {
add(contentPane, BorderLayout.CENTER);
themeUsingPane = new TemplateThemeUsingPane();
themeUsingPane = new TemplateThemeUsingPane(window);
contentPane.add(themeUsingPane, themeUsingPane.getTitle());
themeManagingPane = new TemplateThemeManagingPane();
themeManagingPane = new TemplateThemeManagingPane(window);
contentPane.add(themeManagingPane, themeManagingPane.getTitle());
showThemeUsingPane();
@ -189,11 +190,6 @@ public class TemplateThemeGridPagesPane extends JPanel {
return button;
}
public void exit() {
themeUsingPane.exit();
themeManagingPane.exit();
}
public void setPageChangeListener(PageChangeListener changeListener) {
this.pageChangeListener = changeListener;
}
@ -232,15 +228,13 @@ public class TemplateThemeGridPagesPane extends JPanel {
public abstract static class TemplateThemeGridPagePane extends BasicPane {
public abstract TemplateThemeConfig<? extends TemplateTheme> getConfig();
public void exit() { }
}
public static class TemplateThemeUsingPane extends TemplateThemeGridPagePane {
private final JTemplate<?,?> template;
public final TemplateThemeGridPane<? extends TemplateTheme> themeListPane;
public TemplateThemeUsingPane() {
public TemplateThemeUsingPane(Window window) {
super();
setLayout(new BorderLayout());
setBorder(new CompoundBorder(
@ -249,9 +243,7 @@ public class TemplateThemeGridPagesPane extends JPanel {
template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
TemplateThemeConfig<? extends TemplateTheme> config = template.getUsingTemplateThemeConfig();
themeListPane = new TemplateThemeGridPane<>(false, config, null);
themeListPane.startListenThemeConfig();
themeListPane = new TemplateThemeGridPane<>(window, false, config, null);
themeListPane.setSelectedChangeListener(new ChangeListener() {
@Override
@ -272,12 +264,6 @@ public class TemplateThemeGridPagesPane extends JPanel {
return template.getUsingTemplateThemeConfig();
}
@Override
public void exit() {
themeListPane.stopListenThemeConfig();
themeListPane.stopAsyncFetchTheme();
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Using_Dialog_Title");
@ -286,20 +272,16 @@ public class TemplateThemeGridPagesPane extends JPanel {
public static class TemplateThemeManagingPane extends TemplateThemeGridPagePane {
private final UITabbedPane tabbedPane;
private final TemplateThemeGridControlPane<FormTheme> formThemesManagerPane;
private final TemplateThemeGridControlPane<ReportTheme> reportThemesManagerPane;
public TemplateThemeManagingPane() {
public TemplateThemeManagingPane(Window window) {
setLayout(FRGUIPaneFactory.createBorderLayout());
tabbedPane = new UITabbedPane();
tabbedPane.setTabBorderColor(new Color(0xE0E0E1));
add(tabbedPane, BorderLayout.CENTER);
formThemesManagerPane = TemplateThemeGridControlPane.createFormThemesManagerPane();
formThemesManagerPane.startListenThemeConfig();
reportThemesManagerPane = TemplateThemeGridControlPane.createReportThemesManagerPane();
reportThemesManagerPane.startListenThemeConfig();
TemplateThemeGridControlPane<FormTheme> formThemesManagerPane = TemplateThemeGridControlPane.createFormThemesManagerPane(window);
TemplateThemeGridControlPane<ReportTheme> reportThemesManagerPane = TemplateThemeGridControlPane.createReportThemesManagerPane(window);
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Form_Tab"), formThemesManagerPane);
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Report_Tab"), reportThemesManagerPane);
@ -321,14 +303,6 @@ public class TemplateThemeGridPagesPane extends JPanel {
}
}
@Override
public void exit() {
formThemesManagerPane.stopListenThemeConfig();
formThemesManagerPane.stopAsyncFetchTheme();
reportThemesManagerPane.stopListenThemeConfig();
reportThemesManagerPane.stopAsyncFetchTheme();
}
@Override
protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Title");

60
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPane.java

@ -8,8 +8,6 @@ import com.fr.design.event.ChangeEvent;
import com.fr.design.event.ChangeListener;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.design.widget.WidgetBoundsPaneFactory;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
@ -18,8 +16,11 @@ import javax.swing.ScrollPaneConstants;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.Window;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -53,13 +54,17 @@ public class TemplateThemeGridPane<T extends TemplateTheme> extends BasicPane {
private ChangeListener changeListener;
public TemplateThemeGridPane(boolean displayTheme4NewTemplateMarker, TemplateThemeConfig<T> config, TemplateThemeProfilePane<T> profilePane) {
private final Window window;
public TemplateThemeGridPane(Window window, boolean displayTheme4NewTemplateMarker, TemplateThemeConfig<T> config, TemplateThemeProfilePane<T> profilePane) {
this.window = window;
this.displayTheme4NewTemplateMarker = displayTheme4NewTemplateMarker;
this.config = config;
this.profilePane = profilePane;
this.contentListPane = new JPanel();
this.asyncThemeFetcher = new AsyncThemeFetcher<>(ASYNC_FETCH_THEME_THREAD_COUNT, config);
initializePane();
registerWindowListener();
}
private void initializePane() {
@ -84,6 +89,24 @@ public class TemplateThemeGridPane<T extends TemplateTheme> extends BasicPane {
}
private void registerWindowListener() {
window.addWindowListener(new WindowAdapter() {
@Override
public void windowOpened(WindowEvent e) {
super.windowOpened(e);
startListenThemeConfig();
asyncFetchThemes();
}
@Override
public void windowClosed(WindowEvent e) {
super.windowClosed(e);
stopListenThemeConfig();
asyncThemeFetcher.shutdown();
}
});
}
public void fillContentListPane() {
contentListPane.removeAll();
List<String> names = config.getThemeNames();
@ -97,6 +120,7 @@ public class TemplateThemeGridPane<T extends TemplateTheme> extends BasicPane {
}
}
}
private TemplateThemeBlock<T> createCachedTemplateThemeBlock(String name) {
TemplateThemeBlock<T> block = blockCache.get(name);
if (block == null) {
@ -115,19 +139,6 @@ public class TemplateThemeGridPane<T extends TemplateTheme> extends BasicPane {
setSelectedBlock(block);
}
});
asyncThemeFetcher.submit(name, new AsyncThemeFetcher.AsyncThemeFetchCallbackAdapter<T>() {
@Override
public void beforeCachedFetch() {
super.beforeCachedFetch();
block.setTheme(null);
}
@Override
public void afterCachedFetch(T theme) {
super.afterCachedFetch(theme);
block.setTheme(theme);
}
});
return block;
}
@ -154,6 +165,15 @@ public class TemplateThemeGridPane<T extends TemplateTheme> extends BasicPane {
asyncThemeFetcher.submit(themeName, new AsyncThemeListItemFetchCallback(themeName));
}
private void asyncFetchThemes() {
List<String> names = config.getThemeNames();
for (String name: names) {
if (config.contains(name)) {
asyncThemeFetcher.submit(name, new AsyncThemeListItemFetchCallback(name));
}
}
}
@Override
protected String title4PopupWindow() {
return null;
@ -163,7 +183,7 @@ public class TemplateThemeGridPane<T extends TemplateTheme> extends BasicPane {
return selectedBlock != null ? selectedBlock.getTheme() : null;
}
public void startListenThemeConfig() {
private void startListenThemeConfig() {
if (themeConfigChangeListener == null) {
themeConfigChangeListener = new TemplateThemeConfig.ThemeConfigChangeListener() {
@Override
@ -219,17 +239,13 @@ public class TemplateThemeGridPane<T extends TemplateTheme> extends BasicPane {
}
}
public void stopListenThemeConfig() {
private void stopListenThemeConfig() {
if (themeConfigChangeListener != null) {
config.removeThemeConfigChangeListener(themeConfigChangeListener);
themeConfigChangeListener = null;
}
}
public void stopAsyncFetchTheme() {
asyncThemeFetcher.shutdown();
}
private class AsyncThemeListItemFetchCallback extends AsyncThemeFetcher.AsyncThemeFetchCallbackAdapter<T> {
private final String themeName;
public AsyncThemeListItemFetchCallback(String themeName) {

8
designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeGridPagesDialog.java

@ -28,7 +28,7 @@ public class TemplateThemeGridPagesDialog extends TemplateThemeDialog implements
@Override
protected JPanel createContentPane() {
overallPane = new TemplateThemeGridPagesPane();
overallPane = new TemplateThemeGridPagesPane(this);
overallPane.setPageChangeListener(this);
return overallPane;
}
@ -43,12 +43,6 @@ public class TemplateThemeGridPagesDialog extends TemplateThemeDialog implements
return overallPane.createRightButtons();
}
@Override
public void exit() {
overallPane.exit();
super.exit();
}
@Override
public void onPageChangeListener() {
setupActionButtons();

5
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java

@ -13,7 +13,6 @@ import com.fr.design.mainframe.theme.edit.chart.ChartTitleAndBackgroundStylePane
import javax.swing.BorderFactory;
import java.util.ArrayList;
import java.util.List;
import java.awt.Color;
/**
* @author Bjorn
@ -88,10 +87,6 @@ public class ChartStyleEditPane extends MultiTabPane<ThemedChartStyle> {
return chartStyle;
}
public void populateGradientBar(List<Color> colors) {
chartSeriesStylePane.populateGradientBar(colors);
}
@Override
public boolean accept(Object ob) {
return false;

6
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartSeriesStylePane.java

@ -74,12 +74,6 @@ public class ChartSeriesStylePane extends AbstractChartStylePane {
checkTypeButton();
}
public void populateGradientBar(List<Color> colors) {
gradientBar.updateColor(colors.get(0), colors.get(1));
this.repaint();
}
public void update(ThemedChartStyle chartStyle) {
chartStyle.getThemedChartSeriesColor().setCombineColor(colorTypeButton.getSelectedIndex() == 0);
chartStyle.getThemedChartSeriesColor().setBeginColor(gradientBar.getSelectColorPointBtnP1().getColorInner());

2
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java

@ -68,7 +68,7 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview
Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Data"), Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_Row_Name")},
new Point2D[]{new Point(159, 71), new Point(225, 49)});
cornerCell.setPreferredSize(new Dimension(225, 71));
headerCellList.add(cornerCell);
titleCellList.add(cornerCell);
northPane.add(cornerCell, BorderLayout.WEST);
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane();
northPane.add(centerPane, BorderLayout.CENTER);

2
designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java

@ -169,7 +169,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
Color.decode("#CCCCCC"),
// 2列灰度色
Color.decode("#333333"),
Color.decode("#000000"),
Color.decode("#FFFFFF"),
};

9
designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java

@ -3,6 +3,7 @@
*/
package com.fr.design.designer.creator;
import com.fr.base.chart.BaseChartCollection;
import com.fr.base.theme.FineColorFlushUtils;
import com.fr.base.theme.FineColorGather;
import com.fr.base.theme.FineColorManager;
@ -86,6 +87,7 @@ import org.jetbrains.annotations.Nullable;
import javax.swing.Icon;
import java.awt.Container;
import java.awt.Dimension;
import java.util.List;
/**
* XCreator的相关处理
@ -384,7 +386,12 @@ public class XCreatorUtils {
public static void setupTemplateTheme(XCreator container, final boolean forceFollowingTheme, final FormTheme currentTemplateUsingTheme, TemplateThemeCompatible compatible) {
FineColorGather colorGather = new FineColorManager.FineColorReplaceByTheme(currentTemplateUsingTheme, compatible);
Form.traversalWidget(container.toData(), new WidgetGather() {
Widget root = container.toData();
List<BaseChartCollection> chartCollections = root.getChartCollections();
for (BaseChartCollection chartCollection: chartCollections) {
chartCollection.onTemplateUsingThemeChange(currentTemplateUsingTheme, compatible);
}
Form.traversalWidget(root, new WidgetGather() {
@Override
public void dealWith(Widget widget) {
TemplateThemeAware<FormTheme> themedWidget = (TemplateThemeAware) widget;

6
designer-form/src/main/java/com/fr/design/mainframe/share/util/DownloadUtils.java

@ -39,12 +39,14 @@ import java.security.KeyFactory;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.X509EncodedKeySpec;
import static com.fr.form.share.constants.ShareComponentConstants.REU_INFO_PATH;
/**
* created by Harrison on 2020/05/27
**/
public class DownloadUtils {
private static final String REUSES_URL = CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo") + "file/download";
private static final String PACKAGE_REUSES_URL = CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo") + "package/download/";
private static final String REUSES_URL = StableUtils.pathJoin(ShareComponentConstants.REU_INFO_PATH, "file/download");
private static final String PACKAGE_REUSES_URL = StableUtils.pathJoin(ShareComponentConstants.REU_INFO_PATH, "package/download/");
private static final String CERTIFICATE_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCtsz62CPSWXZE/IYZRiAuTSZkw\n" +
"1WOwer8+JFktK0uKLAUuQoBr+UjAMFtRA8W7JgKMDwZy/2liEAiXEOSPU/hrdV8D\n" +
"tT541LnGi1X/hXiRwuttPWYN3L2GYm/d5blU+FBNwghBIrdAxXTzYBc6P4KL/oYX\n" +

Loading…
Cancel
Save