Browse Source

Merge pull request #6642 in DESIGN/design from final/11.0 to persist/11.0

* commit 'ca1e8ff987ee37524e20d34ba792686f0da5caa9': (45 commits)
  CHART-21844 fix:悬浮窗图表 属性也要全部设置成自定义
  CHART-21844 fix:折线雷达图切换到堆积雷达图&组合图新增图表 属性也要全部设置成自定义
  CHART-21829 fix:fvs.cpt.chart 图表切换 也要重置图表属性
  CHART-21786:不限制图片标记点大小
  CHART-21570 fix:fvs.cpt.chart 默认自动
  CHART-21570 fix:fvs.cpt.chart 默认自动
  CHART-21570 fix:fvs.cpt.chart 默认自动
  CHART-21805 fix:cpt组件中的图表 主题中有的属性 不跟随属性 全部设置成自定义
  update
  CHART-21570 大屏模板中的图表默认自定义
  CHART-21570 大屏模板 cpt组件中的图表也不支持跟随主题
  CHART-21570 适配11.0 大屏模板中的cpt组件 不支持跟随主题
  CHART-21737 fix:大屏模板中的图表组件 设置第一个配色不生效
  REPORT-61736 release/11.0->final/11.0
  REPORT-61410 数据集预览时可复制-表头复制问题 && REPORT-61409 数据集预览时可复制-赋值空值时显示成Null
  REPORT-57521 回退代码-远程设计时websocket断开情况下的提示优化
  REPORT-60528 修复之前在弹窗提示tablayout高度有问题的时候,判断处理逻辑不正确的问题
  REPORT-58836 自定义导出二期
  REPORT-61618 复用组件生成时带“-”,导致部分公式失效@Jaimme
  REPORT-59744 聚合报表块手动修改位置以后,点击空白处位置偏移
  ...
fix-lag
superman 3 years ago
parent
commit
69d49b3abf
  1. 2
      designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java
  2. 55
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
  3. 38
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  4. 51
      designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java
  5. 52
      designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java
  6. 42
      designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java
  7. 2
      designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java
  8. 950
      designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java
  9. 10
      designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java
  10. 0
      designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditMode.java
  11. 6
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java
  12. 8
      designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java
  13. 4
      designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java
  14. 38
      designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java
  15. 2
      designer-base/src/main/java/com/fr/design/report/fit/AdaptiveFrmFitAttrModel.java
  16. 2
      designer-base/src/main/java/com/fr/design/report/fit/FrmFitAttrModel.java
  17. 8
      designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java
  18. 11
      designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java
  19. 13
      designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java
  20. 11
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java
  21. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  22. 20
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ColorSelectBoxWithThemeStyle.java
  23. 18
      designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java
  24. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java
  25. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java
  26. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java
  27. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  28. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  29. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  30. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java
  31. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java
  32. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanChartDataSheetPane.java
  33. 13
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  34. 17
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java
  35. 4
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java
  36. 17
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java
  37. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java
  38. 50
      designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java
  39. 6
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java
  40. 4
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  41. 1
      designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java
  42. 6
      designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java
  43. 18
      designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java
  44. 4
      designer-realize/src/main/java/com/fr/poly/group/PolyBoundsGroup.java

2
designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java

@ -11,7 +11,7 @@ import com.fr.stable.StringUtils;
* Created by hades on 2020/4/27
*/
public abstract class BasicTableDataUtils {
private static final String SEPARATOR = "-";
private static final String SEPARATOR = "_";
private static final int LEN = 2;

55
designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java

@ -9,7 +9,6 @@ import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.design.data.BasicTableDataUtils;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.NameInspector;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.ilist.ListModelElement;
@ -25,18 +24,18 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.third.org.apache.commons.collections4.MapUtils;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import javax.swing.DefaultListModel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* TableDataList Pane.
@ -52,15 +51,12 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
@Override
public void propertyChange() {
isNamePermitted = true;
String tempName = getEditingName();
if (ComparatorUtils.equals(tempName, selectedName)) {
//说明双击之后又取消了,啥也不用做
if (!checkName()) {
isNamePermitted = false;
return;
}
Set<String> allDSNames = DesignTableDataManager.getGlobalDataSet().keySet();
String[] allListNames = nameableList.getAllNames();
allListNames[editingIndex] = StringUtils.EMPTY;
String tempName = getEditingName();
Object editingType = getEditingType();
if (!BasicTableDataUtils.checkName(tempName)) {
@ -70,35 +66,36 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
return;
}
if (StringUtils.isEmpty(tempName)) {
isNamePermitted = false;
nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this),
Toolkit.i18nText("Fine-Design_Basic_Table_Data_Empty_Name_Tips"),
Toolkit.i18nText("Fine-Design_Report_Alert"),
JOptionPane.WARNING_MESSAGE);
setIllegalIndex(editingIndex);
return;
}
boolean isRepeated = isNameRepeated(new Collection[]{allDSNames, Arrays.asList(allListNames)}, tempName);
if (isRepeated) {
isNamePermitted = false;
nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Table_Data_Duplicate_Name_Tips", tempName));
setIllegalIndex(editingIndex);
} else if (editingType instanceof StoreProcedure && isIncludeUnderline(tempName)) {
if (editingType instanceof StoreProcedure && isIncludeUnderline(tempName)) {
isNamePermitted = false;
nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Stored_Procedure_Name_Tips"));
setIllegalIndex(editingIndex);
return;
}
if (nameableList.getSelectedValue() instanceof ListModelElement) {
rename(selectedName, isRepeated ? NameInspector.ILLEGAL_NAME_HOLDER : tempName);
rename(selectedName, tempName);
}
}
});
}
@Override
public String getEmptyNameTip() {
return Toolkit.i18nText("Fine-Design_Basic_Table_Data_Empty_Name_Tips");
}
@Override
public String getDuplicatedNameTip() {
return Toolkit.i18nText("Fine-Design_Basic_Table_Data_Duplicate_Name_Tips", getEditingName());
}
@Override
public Collection getExtraItemsToCheckNameRepeat() {
return DesignTableDataManager.getGlobalDataSet().keySet();
}
@Override
public void rename(String oldName, String newName) {
//如果a改成了b,b又被改成了c,就认为是a改成了c

38
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -7,7 +7,6 @@ import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.fun.ConnectionProvider;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
@ -15,21 +14,18 @@ import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.i18n.Toolkit;
import com.fr.event.EventDispatcher;
import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils;
import com.fr.file.ConnectionOperator;
import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.third.org.apache.commons.collections4.MapUtils;
import com.fr.workspace.WorkContext;
import com.fr.file.ConnectionOperator;
import java.awt.Window;
import javax.swing.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -48,32 +44,24 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
this.addEditingListener(new PropertyChangeAdapter() {
public void propertyChange() {
isNamePermitted = true;
String[] allListNames = nameableList.getAllNames();
allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY;
String tempName = getEditingName();
if (StringUtils.isEmpty(tempName)) {
nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Empty_Name"));
setIllegalIndex(editingIndex);
if (!checkName()) {
isNamePermitted = false;
return;
}
if (!ComparatorUtils.equals(tempName, selectedName)
&& isNameRepeated(new List[]{Arrays.asList(allListNames)}, tempName)) {
isNamePermitted = false;
nameableList.stopEditing();
String message = Toolkit.i18nText("Fine-Design_Basic_Connection_Duplicate_Name", tempName);
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), message);
setIllegalIndex(editingIndex);
}
if (isNamePermitted && !ComparatorUtils.equals(tempName, selectedName)) {
rename(selectedName, tempName);
}
rename(selectedName, getEditingName());
}
});
}
@Override
public String getEmptyNameTip() {
return Toolkit.i18nText("Fine-Design_Basic_Connection_Empty_Name");
}
@Override
public String getDuplicatedNameTip() {
return Toolkit.i18nText("Fine-Design_Basic_Connection_Duplicate_Name", getEditingName());
}
protected void rename(String oldName, String newName) {
//如果a改成了b,b又被改成了c,就认为是a改成了c

51
designer-base/src/main/java/com/fr/design/data/datapane/preview/CopyableJTable.java

@ -106,6 +106,7 @@ public class CopyableJTable extends SortableJTable {
self.updateEndPoint(-1, column);
self.refreshTable();
}
self.requestFocusInWindow();
}
private int getColumn(MouseEvent e) {
@ -249,26 +250,9 @@ public class CopyableJTable extends SortableJTable {
FineLoggerFactory.getLogger().info("copy cell value");
java.util.List<java.util.List<Object>> table = new ArrayList<>();
if ((startRow != endRow || startCol != endCol) && Math.min(startCol, endCol) > -1) {
for (int i = Math.min(startRow, endRow); i <= Math.max(startRow, endRow); i++) {
table.add(new ArrayList<>());
for (int j = Math.min(startCol, endCol); j <= Math.max(startCol, endCol); j++) {
Object text = this.getTableValue(i, j);
table.get(table.size() - 1).add(text);
}
}
copyAreaData(table);
} else if (pointList.size() > 0) {
Collections.sort(pointList, Comparator.comparing(Point::getX).thenComparing(Point::getY));
int startRow = pointList.get(0).x;
int currentRow = startRow;
table.add(new ArrayList<>());
for (Point point : pointList) {
while (currentRow < point.x) {
table.add(new ArrayList<>());
currentRow++;
}
Object text = this.getTableValue(point.x, point.y);
table.get(table.size() - 1).add(text);
}
copyPointsData(table);
}
Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard();
@ -276,6 +260,35 @@ public class CopyableJTable extends SortableJTable {
clip.setContents(tText, null);
}
private void copyAreaData(java.util.List<java.util.List<Object>> table) {
for (int i = Math.min(startRow, endRow); i <= Math.max(startRow, endRow); i++) {
table.add(new ArrayList<>());
for (int j = Math.min(startCol, endCol); j <= Math.max(startCol, endCol); j++) {
Object text = this.getTableValue(i, j);
if (text != null) {
table.get(table.size() - 1).add(text);
}
}
}
}
private void copyPointsData(java.util.List<java.util.List<Object>> table) {
Collections.sort(pointList, Comparator.comparing(Point::getX).thenComparing(Point::getY));
int startRow = pointList.get(0).x;
int currentRow = startRow;
table.add(new ArrayList<>());
for (Point point : pointList) {
while (currentRow < point.x) {
table.add(new ArrayList<>());
currentRow++;
}
Object text = this.getTableValue(point.x, point.y);
if (text != null) {
table.get(table.size() - 1).add(text);
}
}
}
private Object getTableValue(int row, int col) {
Object value = null;
if (col > -1) {

52
designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java

@ -1,10 +1,12 @@
package com.fr.design.gui.controlpane;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilist.JNameEdList;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.ilist.ModNameActionListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.event.Listener;
import com.fr.general.ComparatorUtils;
@ -12,6 +14,7 @@ import com.fr.general.IOUtils;
import com.fr.invoke.Reflect;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.DefaultListCellRenderer;
@ -23,12 +26,16 @@ import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.util.Collection;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import static javax.swing.JOptionPane.WARNING_MESSAGE;
public abstract class JListControlPane extends JControlPane implements ListControlPaneProvider {
private static final String LIST_NAME = "JControl_List";
@ -424,4 +431,47 @@ public abstract class JListControlPane extends JControlPane implements ListContr
}
public boolean checkName() {
String tempName = getEditingName();
if (ComparatorUtils.equals(tempName, selectedName)) {
return false;
}
if (StringUtils.isEmpty(tempName)) {
nameableList.stopEditing();
showWarningDialog(getEmptyNameTip());
setIllegalIndex(editingIndex);
return false;
}
String[] allListNames = nameableList.getAllNames();
allListNames[editingIndex] = StringUtils.EMPTY;
if (isNameRepeated(new Collection[]{getExtraItemsToCheckNameRepeat(), Arrays.asList(allListNames)}, tempName)) {
nameableList.stopEditing();
showWarningDialog(getDuplicatedNameTip());
setIllegalIndex(editingIndex);
return false;
}
return true;
}
public String getEmptyNameTip() {
return Toolkit.i18nText("Fine-Design_Basic_Not_Null_Des");
}
public String getDuplicatedNameTip() {
return StringUtils.EMPTY;
}
public Collection getExtraItemsToCheckNameRepeat() {
return new ArrayList();
}
private void showWarningDialog(String tip) {
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(JListControlPane.this),
tip,
Toolkit.i18nText("Fine-Design_Basic_Alert"),
WARNING_MESSAGE);
}
}

42
designer-base/src/main/java/com/fr/design/gui/icombobox/ColorSchemeComboBox.java

@ -8,17 +8,12 @@ import com.fr.cert.token.lang.Collections;
import com.fr.chart.base.ChartConstants;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.general.GeneralUtils;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JLabel;
import javax.swing.JList;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
@ -27,6 +22,12 @@ import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.LinearGradientPaint;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* @author Bjorn
@ -69,21 +70,22 @@ public class ColorSchemeComboBox extends UIComboBox {
Iterator names = config.names();
if (preDefined) {
ColorInfo colorInfo = new ColorInfo();
List<Color> list = new ArrayList<>();
colorInfo.setColors(list);
TemplateTheme templateTheme = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateTheme();
ThemedChartSeriesColor themedChartSeriesColor = templateTheme.getChartStyle().getThemedChartSeriesColor();
if (themedChartSeriesColor.isCombineColor()) {
colorInfo.setGradient(false);
list.addAll(templateTheme.getColorScheme().getColors());
} else {
colorInfo.setGradient(true);
list.add(themedChartSeriesColor.getBeginColor());
list.add(themedChartSeriesColor.getEndColor());
if (ChartEditContext.supportTheme()) {
ColorInfo colorInfo = new ColorInfo();
List<Color> list = new ArrayList<>();
colorInfo.setColors(list);
TemplateTheme templateTheme = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplateTheme();
ThemedChartSeriesColor themedChartSeriesColor = templateTheme.getChartStyle().getThemedChartSeriesColor();
if (themedChartSeriesColor.isCombineColor()) {
colorInfo.setGradient(false);
list.addAll(templateTheme.getColorScheme().getColors());
} else {
colorInfo.setGradient(true);
list.add(themedChartSeriesColor.getBeginColor());
list.add(themedChartSeriesColor.getEndColor());
}
colorSchemes.put(Toolkit.i18nText("Fine-Design_Chart_Follow_Theme"), colorInfo);
}
colorSchemes.put(Toolkit.i18nText("Fine-Design_Chart_Follow_Theme"), colorInfo);
} else {
//添加默认的方案和第一个方案
String defaultName = config.getCurrentStyle();

2
designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java

@ -163,6 +163,8 @@ public class JavaFxNativeFileChooser implements FileChooserProvider {
try {
latch.await();
} catch (InterruptedException ignore) {
} finally {
setShowDialogState(false);
}
return selectedFiles.length > 0 ? JFileChooser.APPROVE_OPTION : JFileChooser.CANCEL_OPTION;
}

950
designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java

File diff suppressed because it is too large Load Diff

10
designer-chart/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java → designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.chart.mode;
import com.fr.common.annotations.Open;
import com.fr.design.base.mode.DesignModeContext;
/**
* @author shine
@ -23,4 +24,13 @@ public class ChartEditContext {
public static boolean normalMode() {
return current == ChartEditMode.NORMAL;
}
/**
* 是否支持 主题样式 设置
*
* @return duchamp大屏模板模式 不支持 图表组件&cpt组件中的图表 都不支持
*/
public static boolean supportTheme() {
return !DesignModeContext.isDuchampMode();
}
}

0
designer-chart/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditMode.java → designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditMode.java

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

@ -139,7 +139,7 @@ public class TemplateThemeGridPagesPane extends JPanel {
public UIButton[] createRightButtons() {
UIButton[] buttons = new UIButton[] {};
buttons = ArrayUtils.addAll(buttons, createExtraButtons());
buttons = ArrayUtils.addAll(buttons, createCompleteButton());
buttons = ArrayUtils.addAll(buttons, createCloseButton());
return buttons;
}
@ -180,8 +180,8 @@ public class TemplateThemeGridPagesPane extends JPanel {
return uiButtonList.toArray(new UIButton[]{});
}
private UIButton createCompleteButton() {
UIButton button = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Complete"));
private UIButton createCloseButton() {
UIButton button = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Close"));
button.setName(COMPLETE_BUTTON);
button.addActionListener(new ActionListener() {
@Override

8
designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java

@ -6,17 +6,17 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.stable.Constants;
import java.awt.Dialog;
import java.awt.Frame;
import java.awt.Window;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JEditorPane;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Window;
/**
* Created by kerry on 5/6/21
@ -118,4 +118,4 @@ public class DesignerToastMsgUtil {
.toString();
}
}
}

4
designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java

@ -5,8 +5,8 @@ import com.fr.design.dialog.UIDialog;
import com.fr.design.mainframe.DesignerContext;
import com.fr.module.ModuleContext;
import java.awt.Dialog;
import javax.swing.JPanel;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Point;
@ -160,4 +160,4 @@ public class ToastMsgDialog extends UIDialog {
}
}
}

38
designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java

@ -2,20 +2,16 @@ package com.fr.design.parameter;
import com.fr.base.Parameter;
import com.fr.base.ParameterConfig;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.NameableSelfCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.design.i18n.Toolkit;
import com.fr.general.ComparatorUtils;
import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.*;
import java.util.Arrays;
import java.util.List;
import java.util.Collection;
public class ParameterArrayPane extends JListControlPane {
@ -29,27 +25,25 @@ public class ParameterArrayPane extends JListControlPane {
this.addModNameActionListener((index, oldName, newName) -> populateSelectedValue());
this.addEditingListener(new PropertyChangeAdapter() {
public void propertyChange() {
Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters();
String[] allListNames = nameableList.getAllNames();
allListNames[editingIndex] = StringUtils.EMPTY;
String tempName = getEditingName();
if (StringUtils.isEmpty(tempName)) {
nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name"));
setIllegalIndex(editingIndex);
return;
}
if (!ComparatorUtils.equals(tempName, selectedName)
&& isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) {
nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this),
Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name"));
setIllegalIndex(editingIndex);
}
checkName();
}
});
}
@Override
public String getEmptyNameTip() {
return Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name");
}
@Override
public String getDuplicatedNameTip() {
return Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name");
}
@Override
public Collection getExtraItemsToCheckNameRepeat() {
return Arrays.asList(ParameterConfig.getInstance().getGlobalParameters());
}
@Override
protected String title4PopupWindow() {

2
designer-base/src/main/java/com/fr/design/report/fit/AdaptiveFrmFitAttrModel.java

@ -26,7 +26,7 @@ public class AdaptiveFrmFitAttrModel extends AbstractFitAttrModelProvider {
@Override
public String getModelName() {
return Toolkit.i18nText("Fine-Design_New_Decision_Report");
return Toolkit.i18nText("Fine-Design_Basic_Decision_Report");
}
@Override

2
designer-base/src/main/java/com/fr/design/report/fit/FrmFitAttrModel.java

@ -12,7 +12,7 @@ public class FrmFitAttrModel implements FitAttrModel {
@Override
public String getModelName() {
return Toolkit.i18nText("Fine-Design_Basic_Decision_Report");
return Toolkit.i18nText("Fine-Design_Old_Decision_Report");
}
@Override

8
designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java

@ -70,11 +70,15 @@ public class ReportFitAttrAction extends JTemplateAction {
UIDialog dialog = attrPane.showWindowWithCustomSize(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
wbTpl.setReportFitAttr(attrPane.updateBean());
jwb.fireTargetModified();
fireEditingOk(jwb, wbTpl, attrPane.updateBean(), fitAttr);
}
}, DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.templatePane.dialog"));
dialog.setVisible(true);
}
private void fireEditingOk(final JTemplate jwb, final FitProvider wbTpl, ReportFitAttr newReportFitAttr, ReportFitAttr oldReportFitAttr) {
wbTpl.setReportFitAttr(newReportFitAttr);
jwb.fireTargetModified();
}
}

11
designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java

@ -43,4 +43,15 @@ public class AdjustWorkBookDefaultStyleUtils {
return DesignModeContext.isDuchampMode() ? TEMPLATE_BACKGROUND : color;
}
/**
* cpt模板是否支持跟随主题选项
* 单元格样式
* 悬浮元素样式
* 纸张背景入口大屏模板屏蔽掉了 忽略
* @return 大屏模板中cpt组件不支持
*/
public static boolean supportTheme() {
return !DesignModeContext.isDuchampMode();
}
}

13
designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java

@ -11,8 +11,10 @@ import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.vanchart.VanChart;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer;
@ -23,10 +25,10 @@ import javax.swing.JSplitPane;
import javax.swing.ListCellRenderer;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.awt.Color;
import java.awt.Component;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class ChartTypePane extends ChartCommonWizardPane implements CallbackEvent {
private static final long serialVersionUID = -1175602484968520546L;
@ -153,6 +155,13 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven
}
}
if (!ChartEditContext.supportTheme() && chart4Update instanceof VanChart) {
//主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义
((VanChart) chart4Update).setThemeCustom();
// //主题中没有的 根据主题深浅色自动 的属性 默认自动
// ((VanChart) chart4Update).setAutoThemeCustom();
}
update(chart4Update);
}

11
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java

@ -12,8 +12,10 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.hyperlink.AbstractHyperLinkPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.ChartHyperEditPane;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.vanchart.VanChart;
import java.util.HashMap;
import java.awt.BorderLayout;
@ -70,7 +72,14 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPopli
ChartProvider chart = ChartTypeManager.getInstanceWithCheck().getFirstChart();
if (chart != null) {
try {
cc.addChart((ChartProvider) chart.clone());
ChartProvider clone = (ChartProvider) chart.clone();
if (!ChartEditContext.supportTheme() && clone instanceof VanChart) {
//主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义
((VanChart) clone).setThemeCustom();
// //主题中没有的 根据主题深浅色自动 的属性 默认自动
// ((VanChart) chart4Update).setAutoThemeCustom();
}
cc.addChart(clone);
} catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -18,6 +18,7 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartTypePane.ComboBoxPane;
import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.vanchart.VanChart;
@ -154,6 +155,12 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
addButton.addActionListener((e) -> {
String name = getNewChartName();
ChartProvider chart = getChangeStateNewChart();
if (!ChartEditContext.supportTheme() && chart instanceof VanChart) {
//主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义
((VanChart) chart).setThemeCustom();
// //主题中没有的 根据主题深浅色自动 的属性 默认自动
// ((VanChart) chart4Update).setAutoThemeCustom();
}
checkInForm(chart);
addNewChart(chart, name, editingCollection.getChartCount());
});

20
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ColorSelectBoxWithThemeStyle.java

@ -5,7 +5,7 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -39,18 +39,16 @@ public class ColorSelectBoxWithThemeStyle extends BasicPane {
}
private void initContent() {
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p};
UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color"), SwingConstants.LEFT);
Component[][] components = {
Component[][] components = ChartEditContext.supportTheme() ? new Component[][]{
new Component[]{text, preButton},
new Component[]{null, colorSelectBox},
} : new Component[][]{
new Component[]{text, colorSelectBox}
};
JPanel gapTableLayoutPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
JPanel gapTableLayoutPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components);
this.setLayout(new BorderLayout());
this.add(gapTableLayoutPane, BorderLayout.CENTER);
}
@ -66,7 +64,7 @@ public class ColorSelectBoxWithThemeStyle extends BasicPane {
private void checkPreButton() {
colorSelectBox.setVisible(preButton.getSelectedIndex() == CUSTOM);
this.setPreferredSize(preButton.getSelectedIndex() == CUSTOM ? new Dimension(0, 55) : new Dimension(0, 23));
this.setPreferredSize(ChartEditContext.supportTheme() && preButton.getSelectedIndex() == CUSTOM ? new Dimension(0, 55) : new Dimension(0, 23));
}
public String title4PopupWindow() {
@ -74,14 +72,14 @@ public class ColorSelectBoxWithThemeStyle extends BasicPane {
}
public void populate(ColorWithThemeStyle colorWithPreStyle) {
preButton.setSelectedIndex(colorWithPreStyle.isThemed() ? PREDEFINED_STYLE : CUSTOM);
preButton.setSelectedIndex(ChartEditContext.supportTheme() && colorWithPreStyle.isThemed() ? PREDEFINED_STYLE : CUSTOM);
colorSelectBox.setSelectObject(colorWithPreStyle.getColor());
checkPreButton();
}
public ColorWithThemeStyle update() {
ColorWithThemeStyle colorWithPreStyle = new ColorWithThemeStyle();
colorWithPreStyle.setThemed(preButton.getSelectedIndex() == PREDEFINED_STYLE);
colorWithPreStyle.setThemed(ChartEditContext.supportTheme() && preButton.getSelectedIndex() == PREDEFINED_STYLE);
colorWithPreStyle.setColor(colorSelectBox.getSelectObject());
return colorWithPreStyle;
}

18
designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java

@ -1,12 +1,13 @@
package com.fr.van.chart.custom.component;
import com.fr.chart.base.ChartThemeStyleProvider;
import com.fr.chart.chartattr.Chart;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.custom.CustomPlotFactory;
@ -264,6 +265,13 @@ public class VanChartCustomPlotSelectPane extends BasicBeanPane<Chart> {
//设置公共属性
setCommonAttr(vanChartPlot, customPlot);
if (!ChartEditContext.supportTheme()) {
//主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义
setThemeCustom(vanChartPlot);
// //主题中没有的 根据主题深浅色自动 的属性 默认自动
// ((VanChart) chart4Update).setAutoThemeCustom();
}
newCustomPlotList.add(vanChartPlot);
}
}
@ -271,6 +279,14 @@ public class VanChartCustomPlotSelectPane extends BasicBeanPane<Chart> {
customPlot.setCustomPlotList(newCustomPlotList);
}
private void setThemeCustom(VanChartPlot customPlot) {
List<ChartThemeStyleProvider> chartThemeStyleProviders = new ArrayList<>();
customPlot.getChartPreStyleProvider(chartThemeStyleProviders);
for (ChartThemeStyleProvider chartThemeStyleProvider : chartThemeStyleProviders) {
chartThemeStyleProvider.setThemeCustom();
}
}
private void setCommonAttr(VanChartPlot vanChartPlot, VanChartCustomPlot customPlot) {
//坐标轴公共属性
dealAxisAttr(vanChartPlot, customPlot);

3
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java

@ -6,6 +6,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerBean;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.mainframe.predefined.ui.detail.ColorFillStylePane;
import com.fr.design.utils.gui.GUICoreUtils;
@ -63,7 +64,7 @@ public class VanChartFillStylePane extends ColorFillStylePane implements Designe
}
public void updateBean(AttrFillStyle attrFillStyle) {
if (getStyleSelectBox().getSelectedIndex() == 0) {
if (getStyleSelectBox().getSelectedIndex() == 0 && ChartEditContext.supportTheme()) {
attrFillStyle.setThemed(true);
return;
}

5
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java

@ -1,6 +1,7 @@
package com.fr.van.chart.designer.component;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.type.TextAlign;
import com.fr.van.chart.designer.style.VanChartStylePane;
@ -25,7 +26,7 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane {
}
public JPanel createCommonStylePane() {
if (isInCondition()) {
if (isInCondition() || !ChartEditContext.supportTheme()) {
return super.createCommonStylePane();
}
setTextAttrPane(new ChartTextAttrPaneWithThemeStyle());
@ -37,7 +38,7 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane {
}
public void updateTextAttr(AttrTooltipContent attrTooltipContent) {
if (isInCondition()) {
if (isInCondition() || !ChartEditContext.supportTheme()) {
super.updateTextAttr(attrTooltipContent);
return;
}

4
designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java

@ -31,8 +31,8 @@ public class VanChartImageMarkerPane extends BasicBeanPane<VanChartAttrMarker> {
public VanChartImageMarkerPane() {
imageBackgroundPane = new ImageBackgroundQuickPane(false);
imageBackgroundPane.setPreferredSize(getImageBackgroundPreferredSize(imageBackgroundPane.getPreferredSize()));
width = new UISpinnerWithPx(0, 100, 0.5, 30);
height = new UISpinnerWithPx(0, 100, 0.5, 30);
width = new UISpinnerWithPx(0, Integer.MAX_VALUE, 0.5, 30);
height = new UISpinnerWithPx(0, Integer.MAX_VALUE, 0.5, 30);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;

3
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java

@ -16,6 +16,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartLegend;
import com.fr.plugin.chart.type.LayoutType;
@ -288,7 +289,7 @@ public class VanChartPlotLegendPane extends BasicPane {
}
private JPanel createTitleStylePane() {
textAttrPane = new ChartTextAttrPaneWithThemeStyle();
textAttrPane = ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() : new ChartTextAttrPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane);
}

6
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java

@ -17,8 +17,10 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartTitle;
import com.fr.plugin.chart.vanchart.VanChart;
@ -57,7 +59,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private JPanel titlePane;
private TinyFormulaPane titleContent;
private ChartTextAttrPaneWithThemeStyle textAttrPane;
private ChartTextAttrPane textAttrPane;
private UIButtonGroup<Integer> alignmentPane;
private VanChartBackgroundWithOutShadowWithRadiusPane backgroundPane;
private UIToggleButton useHtml;
@ -188,7 +190,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
}
private JPanel createTitleStylePane() {
textAttrPane = new ChartTextAttrPaneWithThemeStyle();
textAttrPane = ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() : new ChartTextAttrPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane);
}

14
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

@ -22,6 +22,7 @@ import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.design.mainframe.chart.gui.style.ColorSelectBoxWithThemeStyle;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
@ -380,10 +381,21 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
}
protected ChartTextAttrPane getChartTextAttrPane() {
return new ChartTextAttrPaneWithThemeStyle() {
return ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() {
protected double getEdithAreaWidth() {
return TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
}
} : new ChartTextAttrPane() {
@Override
protected JPanel getContentPane(JPanel buttonPane) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p};
return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize);
}
};
}

3
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java

@ -9,6 +9,7 @@ import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartGaugeAxis;
@ -103,7 +104,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane {
if (isMulti(gaugeStyle)) {
return new ChartTextAttrPaneWithAuto(FontAutoType.SIZE_AND_COLOR);
} else {
return new ChartTextAttrPaneWithThemeStyle();
return ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() : new ChartTextAttrPane();
}
}

3
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java

@ -8,6 +8,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.background.VanChartBackgroundPane;
@ -49,7 +50,7 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
if(isPlot) {
chartBackgroundPane = new VanChartBackgroundPane();
} else {
chartBackgroundPane = new VanChartBackgroundPaneWithThemeStyle();
chartBackgroundPane = ChartEditContext.supportTheme() ? new VanChartBackgroundPaneWithThemeStyle() : new VanChartBackgroundPane();
}
double p = TableLayout.PREFERRED;

5
designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanChartDataSheetPane.java

@ -12,6 +12,7 @@ import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
@ -106,11 +107,11 @@ public class VanChartDataSheetPane extends AbstractVanChartScrollPane<Chart> {
}
protected VanChartBorderPane createBorderPanePane() {
return new VanChartBorderPaneWithPreStyle();
return ChartEditContext.supportTheme() ? new VanChartBorderPaneWithPreStyle() : new VanChartBorderPane();
}
protected ChartTextAttrPane createChartTextAttrPane() {
return new ChartTextAttrPaneWithThemeStyle();
return ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() : new ChartTextAttrPane();
}
@Override

13
designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java

@ -24,6 +24,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.general.Background;
import com.fr.js.NameJavaScriptGroup;
import com.fr.log.FineLoggerFactory;
@ -144,6 +145,12 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Van
chart.setPlot(cloneOldPlot2New(oldPlot, newPlot));
resetChartAttr4SamePlot(chart);
ChartInfoCollector.getInstance().updateChartMiniType(chart);
if (!ChartEditContext.supportTheme()) {
//主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义
chart.setThemeCustom();
// //主题中没有的 根据主题深浅色自动 的属性 默认自动
// ((VanChart) chart4Update).setAutoThemeCustom();
}
} else if (!samePlot) {
//不同的图表类型切換
resetChartAttr(chart, newPlot);
@ -151,6 +158,12 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Van
newPlot.setCategoryNum(oldPlot.getCategoryNum());
//切换类型埋点
ChartInfoCollector.getInstance().updateChartTypeTime(chart, oldPlot.getPlotID());
if (!ChartEditContext.supportTheme()) {
//主题中有的属性 界面上屏蔽不跟随主题 属性全部设置成自定义
chart.setThemeCustom();
// //主题中没有的 根据主题深浅色自动 的属性 默认自动
// ((VanChart) chart4Update).setAutoThemeCustom();
}
}
if (!acceptDefinition(chart.getChartDataDefinition(), newPlot)) {
chart.setChartDataDefinition(null);

17
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java

@ -9,6 +9,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.base.GisLayer;
import com.fr.plugin.chart.map.VanChartMapPlot;
@ -236,9 +237,19 @@ public class GisLayerPane extends JPanel implements UIObserver {
}
public void resetGisLayer(VanChartMapPlot mapPlot) {
GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer();
mapPlot.setGisLayer(defaultGisLayer);
populate(defaultGisLayer);
// if (ChartEditContext.supportTheme()) {
GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer();
mapPlot.setGisLayer(defaultGisLayer);
populate(defaultGisLayer);
// } else {
// GaoDeGisType gaoDeGisType = mapPlot.getDefaultGisLayerType();
//
// mapPlot.getGisLayer().setGisLayerType(GISLayerType.GAO_DE_API);
// mapPlot.getGisLayer().setLayerName(gaoDeGisType.getTypeName());
// mapPlot.getGisLayer().setGaoDeGisType(gaoDeGisType);
// populate(mapPlot.getGisLayer());
// }
}
public void populate(GisLayer layer) {

4
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java

@ -1,6 +1,8 @@
package com.fr.van.chart.scatter;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.van.chart.designer.component.VanChartHtmlLabelPane;
import com.fr.van.chart.designer.component.VanChartHtmlLabelPaneWithBackGroundLabel;
@ -28,7 +30,7 @@ public class VanChartScatterLabelContentPane extends VanChartScatterTooltipCont
if (isInCondition()) {
return super.createCommonStylePane();
}
setTextAttrPane(new ChartTextAttrPaneWithThemeStyle());
setTextAttrPane(ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() : new ChartTextAttrPane());
JPanel stylePanel = new JPanel(new BorderLayout());
stylePanel.add(getTextAttrPane(), BorderLayout.CENTER);

17
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java

@ -64,21 +64,18 @@ public class FRCardMainBorderLayoutAdapter extends FRBorderLayoutAdapter {
private boolean isBeyondMinConstraint(int minConstraint, int value) {
if (minConstraint > value) {
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds"));
if (container.getBackupBound() != null) {
// 手动拖动导致变矮的场景
container.setSize(container.getBackupBound().getSize());
} else {
// 自适应布局平分高度导致变矮的场景
JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jt != null && jt.getUndoManager().canUndo()) {
// 自适应布局平分高度导致变矮的场景,优先做撤销
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jt != null) {
jt.undo();
}
jt.undo();
}
});
} else if (container.getBackupBound() != null) {
// 手动拖动导致变矮的场景
container.setSize(container.getBackupBound().getSize());
}
return true;
} else {

2
designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -176,4 +176,4 @@ public class FormWidgetDetailPane extends FormDockView{
paneList.add(OnlineWidgetRepoPane.getInstance());
}
}
}

50
designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java

@ -19,9 +19,10 @@ import java.io.InputStream;
* @Date: 2020/12/4
*/
public class InstallComponentHelper {
private static final String PRE_INSTALL_PATH = "/com/fr/form/share/components";
private static final String[] PRE_INSTALL_COMPONENTS = new String[]{
private static String sharePath = ComponentPath.SHARE_PATH.path();
private static final String[] OLD_PRE_INSTALL_COMPONENTS = new String[]{
"单行指标卡.f3df58b3-4302-4cab-ab77-caaf225de60a.reu",
"分层雷达图-深色.49f8397c-e6a6-482a-acc7-46d8cec353a4.reu",
"红绿灯表格-浅色.d0466992-328a-4ccf-ad67-6cbc844d669c.reu",
@ -29,12 +30,24 @@ public class InstallComponentHelper {
"三列指标卡.61a83d18-a162-4dc3-aa57-3b954edaf82e.reu",
"透明按钮切换图表.e373e13a-3da0-4c29-91bc-9ae804241023.reu"
};
private static final String[] PRE_INSTALL_COMPONENTS = new String[]{
"三色指标卡-酷炫蓝.d96f451f-c74c-45df-b056-0906b42870c7.reu",
"刻度槽型仪表盘-酷炫蓝.982ba9a3-f38b-48df-a7ae-80fcce0d74d1.reu",
"大屏标题-酷炫蓝.35f08184-2339-4a7d-9a6a-ea5bacc6829a.reu",
"柱形折线组合图-酷炫蓝.b7d66ba1-2a51-4640-a50e-2869694b748a.reu",
"渐变柱形图-酷炫蓝.786a4e7a-22d5-4f55-a857-42e3ddd54b70.reu",
"环形饼图-酷炫蓝.c9258ee9-7dee-4f56-aa2e-31b9fd7de818.reu"
};
public static void installPreComponent() {
if (needPreInstallComponent()) {
String[] components = WorkContext.getWorkResource().list(sharePath, new ReuFilter());
String[] dirs = WorkContext.getWorkResource().list(sharePath, new DirFilter());
if (needPreInstallComponent(components, dirs)) {
installShareComponents(PRE_INSTALL_PATH, PRE_INSTALL_COMPONENTS);
} else if (needReplaceOldComponent(components, dirs)) {
clearOldComponent(OLD_PRE_INSTALL_COMPONENTS);
installShareComponents(PRE_INSTALL_PATH, PRE_INSTALL_COMPONENTS);
}
}
public static void installShareComponents(String resourcePath, String[] components) {
@ -42,18 +55,36 @@ public class InstallComponentHelper {
try {
InputStream inputStream = InstallComponentHelper.class.getResourceAsStream(StableUtils.pathJoin(resourcePath, componentPath));
byte[] data = ResourceIOUtils.inputStream2Bytes(inputStream);
WorkContext.getWorkResource().write(StableUtils.pathJoin(ComponentPath.SHARE_PATH.path(), componentPath), data);
WorkContext.getWorkResource().write(StableUtils.pathJoin(sharePath, componentPath), data);
} catch (Exception e) {
FineLoggerFactory.getLogger().error("install Component filed" + e.getMessage(), e);
}
}
}
private static boolean needPreInstallComponent() {
private static boolean needReplaceOldComponent(String[] components, String[] dirs) {
if ((dirs != null && ArrayUtils.isNotEmpty(dirs)) || (components != null && components.length != 6)) {
return false;
}
for (String componentPath : components) {
if (!ArrayUtils.contains(OLD_PRE_INSTALL_COMPONENTS, componentPath)) {
return false;
}
}
return true;
}
private static void clearOldComponent(String[] components) {
for(String componentPath : components) {
WorkContext.getWorkResource().delete(StableUtils.pathJoin(sharePath, componentPath));
}
}
private static boolean needPreInstallComponent(String[] components, String[] dirs) {
try {
//老用户或者组件库里已有组件,不预装组件
SnapChat snapChat = SnapChatFactory.createSnapChat(false, SnapChatKeys.COMPONENT);
return !snapChat.hasRead() && !hasComponentInstalled();
return !snapChat.hasRead() && !hasComponentInstalled(components, dirs);
} catch (Throwable e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
@ -63,10 +94,7 @@ public class InstallComponentHelper {
/**
* 判断是否已有组件被安装
*/
private static boolean hasComponentInstalled() {
String sharePath = ComponentPath.SHARE_PATH.path();
String[] components = WorkContext.getWorkResource().list(sharePath, new ReuFilter());
String[] dirs = WorkContext.getWorkResource().list(sharePath, new DirFilter());
private static boolean hasComponentInstalled(String[] components, String[] dirs) {
return components != null && ArrayUtils.isNotEmpty(components)
|| (dirs != null && ArrayUtils.isNotEmpty(dirs));
}

6
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java

@ -13,6 +13,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
@ -38,6 +39,7 @@ public class StylePane extends BasicPane implements UIObserver {
public static final int DEFAULT_SELECTED_INDEX = 0;
private final UIButtonGroup<String> followingThemeButtonGroup;
private JPanel followingThemePane;
private final CustomStylePane customStylePane;
private final ThemedCellStyleListPane themedCellStyleListPane;
private final CardLayout cardLayout;
@ -64,7 +66,7 @@ public class StylePane extends BasicPane implements UIObserver {
private void initializePane() {
setLayout(new BorderLayout(0, IntervalConstants.INTERVAL_L1));
add(createFollowingThemePane(), BorderLayout.NORTH);
add(followingThemePane = createFollowingThemePane(), BorderLayout.NORTH);
contentPane = createTabbedContentPane();
add(contentPane, BorderLayout.CENTER);
}
@ -226,6 +228,8 @@ public class StylePane extends BasicPane implements UIObserver {
setSelectedIndex(1);
customStylePane.populateBean(style);
}
//单元格配置界面是单例 所以直接在populate的时候把跟随主题的按钮组设置不可见
followingThemePane.setVisible(AdjustWorkBookDefaultStyleUtils.supportTheme());
}
private void fireStateChanged() {

4
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -132,7 +132,7 @@ public class DesignerSocketIO {
String certPath = connection.getCertPath();
String certSecretKey = connection.getCertSecretKey();
if (StringUtils.isBlank(certPath) || StringUtils.isBlank(certSecretKey)) {
return SSLContexts.createDefault();
return SSLContexts.createDefault();
}
KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
try (FileInputStream keystore = new FileInputStream(new File(certPath))) {
@ -317,4 +317,4 @@ public class DesignerSocketIO {
};
}
}
}

1
designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

@ -104,6 +104,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
engineSettingPane.setBounds(0, 0, 570, 240);
createEngineXSettingPane();
createLineEngineSettingPane();
outLineEngineSettingPane.setVisible(false);
engineSettingPane.add(outEngineXSettingPane, JLayeredPane.DEFAULT_LAYER);
engineSettingPane.add(outLineEngineSettingPane, JLayeredPane.DEFAULT_LAYER);
engineSettingPane.moveToFront(outEngineXSettingPane);

6
designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java

@ -27,6 +27,7 @@ import com.fr.design.style.BorderUtils;
import com.fr.design.style.FRFontPane;
import com.fr.design.style.FormatPane;
import com.fr.design.style.background.BackgroundPane;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.general.FRFont;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
@ -66,6 +67,7 @@ public class ReportStylePane extends BasicPane {
private final CellStylePreviewPane previewArea;
private final UIButtonGroup<String> followingThemeButtonGroup;
private JPanel followingThemePane;
private final CustomFloatStyleSettingPane customStylePane;
private final ThemedFloatStyleSettingPane themedFloatStyleSettingPane;
private final CardLayout cardLayout;
@ -106,7 +108,7 @@ public class ReportStylePane extends BasicPane {
add(createPreviewPane(), BorderLayout.NORTH);
JPanel settingContainer = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel followingThemePane = createFollowingThemePane();
followingThemePane = createFollowingThemePane();
followingThemePane.setBorder(BorderFactory.createEmptyBorder(20, 0, 10, 0));
settingContainer.add(followingThemePane, BorderLayout.NORTH);
settingContainer.add(contentPane, BorderLayout.CENTER);
@ -319,6 +321,8 @@ public class ReportStylePane extends BasicPane {
setSelectedIndex(1);
customStylePane.populateBean(style);
}
followingThemePane.setVisible(AdjustWorkBookDefaultStyleUtils.supportTheme());
}
public void updatePreviewArea() {

18
designer-realize/src/main/java/com/fr/design/widget/WidgetConfigPane.java

@ -4,11 +4,13 @@ import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.core.WidgetConstants;
import com.fr.design.i18n.Toolkit;
import com.fr.form.ui.UserDefinedWidgetConfig;
import com.fr.form.ui.WidgetConfig;
import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.NameObject;
import com.fr.stable.Nameable;
import com.fr.stable.core.PropertyChangeAdapter;
import java.util.ArrayList;
import java.util.Iterator;
@ -19,7 +21,21 @@ import java.util.List;
*/
public class WidgetConfigPane extends JListControlPane {
/**
public WidgetConfigPane() {
super();
this.addEditingListener(new PropertyChangeAdapter() {
public void propertyChange() {
checkName();
}
});
}
@Override
public String getDuplicatedNameTip() {
return Toolkit.i18nText("Fine_Design_Predefine_Widget_Name_Duplicated");
}
/**
* 创建用户自定义widget组件
*
* @return 组件面板

4
designer-realize/src/main/java/com/fr/poly/group/PolyBoundsGroup.java

@ -52,7 +52,7 @@ public class PolyBoundsGroup implements GroupModel {
@Override
public Object getValue(int row, int column) {
UnitRectangle ur = block.getBounds();
Rectangle r = ur.toRectangle(resolution);
Rectangle r = ur.toRoundRectangle(resolution);
if (column == 0) {
switch (row) {
case 0:
@ -83,7 +83,7 @@ public class PolyBoundsGroup implements GroupModel {
if (column == 1) {
int v = value == null ? 0 : ((Number) value).intValue();
UnitRectangle ur = block.getBounds();
Rectangle r = ur.toRectangle(resolution);
Rectangle r = ur.toRoundRectangle(resolution);
switch (row) {
case 0:
r.x = v;

Loading…
Cancel
Save