diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java index b87a70b5b6..3b6e80874b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java @@ -7,6 +7,7 @@ import com.fr.design.file.NodeAuthProcessor; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.mainframe.App; import com.fr.design.mainframe.manager.search.TemplateTreeSearchManager; +import com.fr.file.filetree.AppTypeFilter; import com.fr.file.filetree.FileNode; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; @@ -19,6 +20,7 @@ import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.List; @@ -38,6 +40,8 @@ public class TemplateFileTree extends EnvFileTree { private static final int MAX_NODE_EXPAND_NUM = 50; private static final int MAX_MATCHED_NODE_NUM = 500; + protected AppTypeFilter appTypeFilter; + public TemplateFileTree() { super(ProjectConstants.REPORTLETS_NAME, null, null); } @@ -155,12 +159,17 @@ public class TemplateFileTree extends EnvFileTree { supportTypes.add(FileExtension.parse(temp)); } } - Set apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); - for (App temp : apps) { - for (String extendsion : temp.defaultExtensions()) { - supportTypes.add(FileExtension.parse(extendsion)); + if (appTypeFilter != null) { + Collections.addAll(supportTypes, appTypeFilter.getSupportedTypes()); + } else { + Set apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); + for (App temp : apps) { + for (String extendsion : temp.defaultExtensions()) { + supportTypes.add(FileExtension.parse(extendsion)); + } } } + return supportTypes; } @@ -360,6 +369,10 @@ public class TemplateFileTree extends EnvFileTree { } } + public void setAppTypeFilter(AppTypeFilter filter) { + appTypeFilter = filter; + } + private boolean notContained(String parentPath, ExpandMutableTreeNode treeNode) { List childList = currentTreeMode.getOrDefault(parentPath, new ArrayList<>()); String name = ((FileNode) (treeNode.getUserObject())).getName(); diff --git a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java index 6c2e46e985..dc9907f237 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java @@ -968,6 +968,7 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane new FileExtension[]{}); cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE"); this.refreshEnv(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 1357b48354..314e2dc1c2 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -84,7 +84,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30; // 弹出对话框高度 private static final int POPUP_MIN_HEIGHT = 145; - private static final int POPUP_DEFAULT_HEIGHT = 356; + private static final int POPUP_DEFAULT_HEIGHT = 600; public static final String KEY_CELL_ELEMENT = "cellElement"; public static final String KEY_CELL_ATTR = "cellAttr"; public static final String KEY_FLOAT_ELEMENT = "floatElement"; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index def6cc51fa..7c65b923f7 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -725,7 +725,7 @@ public abstract class JTemplate> public void undo() { this.getUndoManager().undo(); // 撤销前模版使用主题可能已经被删除或修改,需要重置模版样式 - checkAndResetTheme(); + checkAndResetTheme(true); fireSuperTargetModified(); } @@ -735,7 +735,7 @@ public abstract class JTemplate> public void redo() { this.getUndoManager().redo(); // 重做前模版使用主题可能已经被删除或修改,需要重置模版样式 - checkAndResetTheme(); + checkAndResetTheme(true); fireSuperTargetModified(); } diff --git a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java index 4af7b9b6d1..f57b995186 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java @@ -63,7 +63,7 @@ public class DesktopWidgetStyleEditPane extends WidgetS new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Radius")), borderRadiusSpinner}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Icon_Color")), iconColorSelectBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Text_Style")), fontNameSelectBox}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Text_Style")), WidgetStyleComponentCombiner.combineTextStyleComponent(fontSizePane, fontColorButton, italic, bold)}, + new Component[]{new UILabel(), WidgetStyleComponentCombiner.combineTextStyleComponent(fontSizePane, fontColorButton, italic, bold)}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Background_Select_Box")), selectBackgroundColorBox} }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java index 67369d826f..438af39695 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java @@ -57,14 +57,13 @@ public class WMSLayerPane extends JPanel implements UIObserver { public WMSLayerPane() { final double p = TableLayout.PREFERRED; double[] rowSize = {p}; - double[] COLUMN_SIZE = {TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH, 84, 44}; + double[] COLUMN_SIZE = {TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH, 84, 95}; wmsUrl = new UITextArea(); connectButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Connect_WMP")); - Component[][] comps = new Component[][]{ - new Component[]{new UILabel("url"), wmsUrl, connectButton} + new Component[]{new UILabel("URL"), wmsUrl, connectButton} }; JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps, rowSize, COLUMN_SIZE); northPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js index ec4de690d8..54a268c63d 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js @@ -128,6 +128,9 @@ if (key === "src") { return; } + + value = window.transformI18nText(value); + str += " " + key + "=\"" + value + "\""; if (key === "alt" && dataIdMap[value.trim()]) { diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js b/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js index 205117f3cd..f80cc05e7c 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js @@ -21,7 +21,12 @@ "BI-Basic_Save": "保存", "BI-Basic_More": "更多", "BI-Custom_Color": "自定义颜色", - "BI-Transparent_Color": "透明" + "BI-Transparent_Color": "透明", + "Fine-Design_Chart_Category_Use_Name": "分类名", + "Fine-Design_Chart_Series_Name": "系列名", + "Fine-Design_Chart_Use_Value": "值", + "Fine-Design_Chart_Use_Percent": "百分比", + "Fine-Design_Chart_Use_Summary_Value": "汇总值" }; var taiwan = { @@ -45,7 +50,12 @@ "BI-Basic_Save": "保存", "BI-Basic_More": "更多", "BI-Custom_Color": "自定義顏色", - "BI-Transparent_Color": "透明" + "BI-Transparent_Color": "透明", + "Fine-Design_Chart_Category_Use_Name": "分類名", + "Fine-Design_Chart_Series_Name": "系列名", + "Fine-Design_Chart_Use_Value": "值", + "Fine-Design_Chart_Use_Percent": "百分比", + "Fine-Design_Chart_Use_Summary_Value": "匯總值" }; var english = { @@ -69,7 +79,12 @@ "BI-Basic_Save": "Save", "BI-Basic_More": "More", "BI-Custom_Color": "Custom Color", - "BI-Transparent_Color": "Transparent Color" + "BI-Transparent_Color": "Transparent Color", + "Fine-Design_Chart_Category_Use_Name": "Category Name", + "Fine-Design_Chart_Series_Name": "Series", + "Fine-Design_Chart_Use_Value": "Value", + "Fine-Design_Chart_Use_Percent": "Percentage", + "Fine-Design_Chart_Use_Summary_Value": "Summary Value" }; var japanese = { @@ -93,7 +108,12 @@ "BI-Basic_Save": "セーブ", "BI-Basic_More": "もっと", "BI-Custom_Color": "カスタムカラー", - "BI-Transparent_Color": "トランスペアレント" + "BI-Transparent_Color": "トランスペアレント", + "Fine-Design_Chart_Category_Use_Name": "分類名", + "Fine-Design_Chart_Series_Name": "系列名", + "Fine-Design_Chart_Use_Value": "値", + "Fine-Design_Chart_Use_Percent": "パーセンテージ", + "Fine-Design_Chart_Use_Summary_Value": "まとめ値" }; var korean = { @@ -117,7 +137,12 @@ "BI-Basic_Save": "저장", "BI-Basic_More": "더", "BI-Custom_Color": "맞춤 색상", - "BI-Transparent_Color": "투명한" + "BI-Transparent_Color": "투명한", + "Fine-Design_Chart_Category_Use_Name": "카테고리 명", + "Fine-Design_Chart_Series_Name": "표시값", + "Fine-Design_Chart_Use_Value": "값", + "Fine-Design_Chart_Use_Percent": "백분율", + "Fine-Design_Chart_Use_Summary_Value": "요약 값" }; function transformI18n(language) { @@ -144,5 +169,56 @@ } } + /** + * 将一个text转换成当前国际化语言环境的text + * @param text + * @returns {*} + */ + function transformI18nText(text) { + var i18nKey = _findI18nKey(text); + return window.BI.i18nText(i18nKey); + } + + /** + * 根据text找到i18n的key + * @param text + * @returns {string} + * @private + */ + function _findI18nKey(text) { + for (var [key, value] of Object.entries(chinese)) { + if (value === text) { + return key; + } + } + + for ([key, value] of Object.entries(taiwan)) { + if (value === text) { + return key; + } + } + + for ([key, value] of Object.entries(english)) { + if (value === text) { + return key; + } + } + + for ([key, value] of Object.entries(japanese)) { + if (value === text) { + return key; + } + } + + for ([key, value] of Object.entries(korean)) { + if (value === text) { + return key; + } + } + + return ''; + } + window.transformI18n = transformI18n; + window.transformI18nText = transformI18nText; }()); \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 97488e7d83..eabbbbfcb1 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -686,7 +686,7 @@ public class JForm extends JTemplate implements BaseJForm { protected void applyUndoState(WorkBookUndoState u) { try { WorkBook undoWorkBook = (WorkBook) u.getWorkBook().clone(); - undoWorkBook.checkAndResetTheme(); + undoWorkBook.checkAndResetTheme(true); undoWorkBook = (WorkBook) FineColorSynchronizer.flush(undoWorkBook, undoWorkBook.getTemplateTheme()); this.setTarget(undoWorkBook); if (!DesignerMode.isAuthorityEditing()) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java index 818a26205d..c65a7eee73 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe.cell.settingpane.desensitization.model; -import com.fr.base.operator.org.OrganizationOperator; import com.fr.data.desensitize.rule.DesensitizationRuleManager; import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.data.desensitize.rule.base.DesensitizationRuleSource; @@ -10,27 +9,19 @@ import com.fr.design.data.datapane.preview.desensitization.view.rule.Desensitiza import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.event.UIObserverListener; -import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombocheckbox.UIComboCheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.layout.VerticalFlowLayout; -import com.fr.design.mainframe.JTemplate; -import com.fr.design.mainframe.JTemplateActionListener; import com.fr.report.cell.desensitization.CellDesensitizationBean; import com.fr.stable.StringUtils; import com.fr.third.org.apache.commons.collections4.map.HashedMap; -import com.fr.workspace.WorkContext; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.SwingUtilities; -import javax.swing.SwingWorker; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -43,7 +34,10 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.Set; -import java.util.concurrent.ExecutionException; + +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; +import static com.fine.swing.ui.layout.Layouts.row; /** * 单元格脱敏规则设置面板 @@ -78,12 +72,10 @@ public class DesensitizationCellPane extends BasicBeanPane { } private void initComponent() { - editPanel = new JPanel(); - editPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true)); + editPanel = new JPanel(new BorderLayout()); label = new UILabel(); label.setEnabled(false); - editPanel.add(label); ruleButton = new UIButton(APOSTROPHE); @@ -102,25 +94,25 @@ public class DesensitizationCellPane extends BasicBeanPane { emptyTextField.setEnabled(false); emptyTextField.setOpaque(false); - editPanel.add(initTableCellPanel()); + editPanel.add( + column( + row(cell(label)), + cell(initTableCellPanel()).weight(2) + ).weight(1).getComponent() + ); + } /** * 初始化单元格中的panel */ - private JPanel initTableCellPanel() { - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; - - double[] rowSize = new double[]{f, f}; - double[] columnSize = new double[]{p, f}; - - Component[][] components = new Component[][]{ - new Component[]{ruleButton, ruleTextField}, - new Component[]{emptyTextField, rolesComboBox} - }; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 0); + private Component initTableCellPanel() { + + return column( + row(cell(ruleButton).weight(1), cell(ruleTextField).weight(4)), + row(cell(emptyTextField).weight(1), cell(rolesComboBox).weight(4)) + ).getComponent(); } private void addListener() { diff --git a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java index ca95a933df..30790428b5 100644 --- a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java +++ b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java @@ -407,7 +407,9 @@ public class CellSelection extends Selection { if (hasCellElement) { ec.merge(row, row + rowSpan - 1, column, column + columnSpan - 1); } else { - ec.addCellElement(DefaultThemedTemplateCellElementCase.createInstance(column, row, columnSpan, rowSpan, null), true); + TemplateCellElement cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row, columnSpan, rowSpan, null); + AdjustWorkBookDefaultStyleUtils.adjustCellElement(cellElement); + ec.addCellElement(cellElement, true); } return true;