diff --git a/build.gradle b/build.gradle index f824ef2e37..885826a0de 100644 --- a/build.gradle +++ b/build.gradle @@ -79,7 +79,8 @@ allprojects { implementation 'com.fr.third:fine-third:' + frVersion implementation 'com.fr.core:fine-core:' + frDevVersion implementation 'com.fr.activator:fine-activator:' + frVersion - implementation 'com.fr.datasource:fine-datasource:' + frVersion + implementation 'com.fr.datasource:fine-datasource-api:4.1-SNAPSHOT' + implementation 'com.fr.datasource:fine-datasource-core:4.1-SNAPSHOT' implementation 'com.fr.decision:fine-decision:' + frVersion implementation 'com.fr.schedule:fine-schedule:' + frVersion implementation 'com.fr.report:engine-report:' + frDevVersion diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java index 99a294fdde..ce76a77751 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java @@ -355,7 +355,6 @@ public class ChoosePane extends BasicBeanPane implements Refresha */ @Override public void refresh() { - DBUtils.refreshDatabase(); String schema = StringUtils.isEmpty(schemaBox.getSelectedItem()) ? null : schemaBox.getSelectedItem(); DataCoreUtils.refreshTables(getConnection(), TableProcedure.TABLE, schema); FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh_Successfully") + "!", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh_Database"), diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java index d37ed152d2..54b139a3dd 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java @@ -18,9 +18,13 @@ import com.fr.stable.StringUtils; import com.fr.stable.collections.CollectionUtils; import javax.swing.AbstractCellEditor; +import javax.swing.BorderFactory; +import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTable; +import javax.swing.SwingConstants; import javax.swing.SwingUtilities; +import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; import java.awt.CardLayout; @@ -132,6 +136,16 @@ public class DesensitizationRuleChoosePane extends JPanel { this.setDefaultRenderer(DesensitizationRuleStatusPane.class, new DesensitizationRuleStatusPane()); this.createTable().getColumnModel().getColumn(0).setMaxWidth(20); this.createTable().getColumnModel().getColumn(3).setMaxWidth(60); + this.createTable().getColumnModel().getColumn(3).setHeaderRenderer(new DefaultTableCellRenderer() { + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + JLabel headerLabel = new JLabel(value != null ? value.toString() : ""); + headerLabel.setToolTipText((String) value); + headerLabel.setHorizontalAlignment(SwingConstants.CENTER); + headerLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 3, 0, new Color(216, 216, 216, 175))); + return headerLabel; + } + }); } @Override diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java index 5a0515a59e..76b032ee3d 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleEditPane.java @@ -1,5 +1,7 @@ package com.fr.design.data.datapane.preview.desensitization.view.rule; +import com.fine.swing.ui.layout.Column; +import com.fine.swing.ui.layout.Layouts; import com.fr.data.desensitize.rule.base.DesensitizationCondition; import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.data.desensitize.rule.base.DesensitizationRuleSource; @@ -28,6 +30,10 @@ import java.awt.event.FocusListener; import java.util.Arrays; import java.util.Set; +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; + /** * 脱敏规则编辑页 * @@ -157,26 +163,29 @@ public class DesensitizationRuleEditPane extends BasicBeanPane column = column( + 4, + row( + cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Part_One") + StringUtils.BLANK)), + cell(retainFrontTextField), + cell(new UILabel(StringUtils.BLANK + Toolkit.i18nText("Fine-Design_Report_Desensitization_Part_Two") + StringUtils.BLANK)), + cell(retainBackTextField), + cell(new UILabel(StringUtils.BLANK + Toolkit.i18nText("Fine-Design_Report_Desensitization_Part_Four") + StringUtils.BLANK)) + ), + row( + cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Part_Three") + StringUtils.BLANK)), + cell(firstSymbolTextField) + ) + ); // 整体替换 JPanel characterAllReplacePane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); UILabel allReplaceLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_All_Character_Replace_By") + StringUtils.BLANK); @@ -186,7 +195,7 @@ public class DesensitizationRuleEditPane extends BasicBeanPane> generateTemplateId(); } + /** + * 如果没有 forkId, 则计算 forkId + * 要求在 templateId, 创建后执行。 + */ + protected void computeForkIdIfAbsent() { + + ForkIdAttrMark forkIdAttrMark = this.template.getAttrMark(ForkIdAttrMark.XML_TAG); + if (forkIdAttrMark == null || StringUtils.isEmpty(forkIdAttrMark.getForkId())) { + this.template.addAttrMark(new ForkIdAttrMark(this.template.getTemplateID())); + } + } + /** * 收集图表信息 */ @@ -971,6 +984,7 @@ public abstract class JTemplate> } // 在保存之前,初始化 templateID generateNewTemplateIdForSaveAs(); + computeForkIdIfAbsent(); this.editingFILE = editingFILE; TemplateSaveInfoContext.getInstance().startCollect(template); @@ -1855,6 +1869,8 @@ public abstract class JTemplate> } // 在保存之前,初始化 templateID generateNewTemplateIdForSaveAs(); + computeForkIdIfAbsent(); + this.editingFILE = editingFILE; boolean result = this.saveToNewRealFile(oldName); if (result) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java index 8008c5ce8e..e1af0670a8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java @@ -8,6 +8,7 @@ import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; @@ -210,7 +211,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { private UILabel createConfigLabel(String title) { UILabel label = new UILabel(title + ":", UILabel.RIGHT); - label.setPreferredSize(new Dimension(75, 20)); + label.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel")); return label; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/utils/DesignerUtils.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/utils/DesignerUtils.java index a2e8d0656f..fae27d5e93 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/utils/DesignerUtils.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/utils/DesignerUtils.java @@ -4,6 +4,7 @@ import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.widget.UITitleSplitLine; import com.fr.design.style.color.NewColorSelectBox; @@ -44,7 +45,7 @@ public class DesignerUtils { public static UILabel createConfigLabel(String title) { UILabel label = new UILabel(title, UILabel.RIGHT); - label.setPreferredSize(new Dimension(100, 20)); + label.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel")); return label; } diff --git a/designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java b/designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java index a4ddfcd4e8..e2c94a8f10 100644 --- a/designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java +++ b/designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java @@ -88,8 +88,9 @@ public class MonitorAdvice implements DesignerAnalyzerAdvice { MessageRecorderFactory.getInstance().syncSubmit(message); } } - } catch (Exception ignore) { + } catch (Exception ex) { //埋点信息入库失败应该不能影响业务流程 + FineLoggerFactory.getLogger().debug("[Metric] failed to log message.", ex); } finally { sessionBinder.detachSession(); } @@ -113,7 +114,11 @@ public class MonitorAdvice implements DesignerAnalyzerAdvice { } public static void recordSQLDetail(String uuid) { - DBMeterFactory.getMeter().submit(uuid); + try { + DBMeterFactory.getMeter().submit(uuid); + } catch (Exception e) { + FineLoggerFactory.getLogger().debug("[Metric] failed to log sql detail.", e); + } } public static void recordSQL(Compute once, MeasureObject measureObject) { diff --git a/designer-base/src/main/java/com/fr/design/style/background/image/ImagePreviewPane.java b/designer-base/src/main/java/com/fr/design/style/background/image/ImagePreviewPane.java index bc4f3f41cc..f24fed4ba0 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/image/ImagePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/image/ImagePreviewPane.java @@ -9,6 +9,7 @@ import com.fr.base.Style; import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.general.ImageWithSuffix; +import com.fr.log.FineLoggerFactory; import com.fr.stable.CoreGraphHelper; import javax.swing.JComponent; @@ -92,9 +93,14 @@ public class ImagePreviewPane extends JComponent implements Scrollable, ImagePre isLoading = false; CoreGraphHelper.waitForImage(image); - imageWidth = image.getWidth(null); - imageHeight = image.getHeight(null); - + if (image.getFineImage() != null && image.getImage() != null) { + try { + imageWidth = image.getWidth(null); + imageHeight = image.getHeight(null); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } this.setToolTipText("Image Size: " + imageWidth + "x" + imageHeight + "px"); } fireChangeListener(); diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index fb8e419fbe..e8c528ade2 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -345,7 +345,7 @@ public class DesignUtils { @Override protected FRFont compute() { FRFont guiFRFont; - Locale defaultLocale = Locale.getDefault(); + Locale defaultLocale = GeneralContext.getLocale(); // JDK9 之后宋体在计算label中字母的空间上出现问题,暂时先用雅黑兼容,以后再统一字体 if (StableUtils.getMajorJavaVersion() >= 9 && OperatingSystem.isWindows()) { guiFRFont = getNamedFont("Microsoft YaHei"); diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties index bf7aba4f40..1405f81c6a 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties @@ -27,3 +27,5 @@ com.fr.design.file.MultiTemplateTabPane.popUpMenu=350*65 com.fr.design.data.datapane.preview.desensitization.view.rule.DesensitizationRuleChoosePane.ruleEditPane=800*600 com.fr.design.formula.FormulaPane=900*600 com.fr.design.formula.FormulaPaneWhenReserveFormula=1200*600 +com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel=130*20 +com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel=140*20 diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties index d070015063..6af9a798c0 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties @@ -26,3 +26,5 @@ com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65 com.fr.design.data.datapane.preview.desensitization.view.rule.DesensitizationRuleChoosePane.ruleEditPane=800*600 com.fr.design.formula.FormulaPane=900*600 com.fr.design.formula.FormulaPaneWhenReserveFormula=900*600 +com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel=100*20 +com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel=130*20 diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties index 3fd1ffcad1..98ac411090 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties @@ -14,7 +14,7 @@ com.fr.design.report.fit.firstColumn=130*20 com.fr.design.report.fit.column=100*20 com.fr.design.lock.LockInfoDialog=500*180 com.fr.design.mainframe.ForbiddenPane.refreshButton=80*24 -com.fr.start.common.DesignerOpenEmptyPanel.createButton=70*24 +com.fr.start.common.DesignerOpenEmptyPanel.createButton=90*24 com.fr.design.cell.expand.sort.pane=267*165 com.fr.design.sort.rule.item=125*20 com.fr.design.ds.column.sort.pane=250*180 @@ -26,3 +26,5 @@ com.fr.design.file.MultiTemplateTabPane.popUpMenu=240*65 com.fr.design.data.datapane.preview.desensitization.view.rule.DesensitizationRuleChoosePane.ruleEditPane=800*600 com.fr.design.formula.FormulaPane=900*600 com.fr.design.formula.FormulaPaneWhenReserveFormula=900*600 +com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel=75*20 +com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel=100*20 diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties index 2a10d13c7f..9c9e1bd92a 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties @@ -26,3 +26,5 @@ com.fr.design.report.WatermarkSettingPane=720*600 com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65 com.fr.design.formula.FormulaPane=900*600 com.fr.design.formula.FormulaPaneWhenReserveFormula=900*600 +com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel=75*20 +com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel=100*20 diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index faa620cfc8..03972b51c0 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -25,3 +25,5 @@ com.fr.design.report.WatermarkSettingPane=720*600 com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65 com.fr.design.formula.FormulaPane=900*600 com.fr.design.formula.FormulaPaneWhenReserveFormula=900*600 +com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel=75*20 +com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel=100*20 diff --git a/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java b/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java index cab7037cd2..dd7617d95c 100644 --- a/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java +++ b/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java @@ -49,7 +49,7 @@ public class EnvChangeEntranceTest { EasyMock.expect(selectedEnv.getRemindTime()).andReturn(null); FunctionalHttpRequest request = EasyMock.mock(FunctionalHttpRequest.class); - EasyMock.expect(request.getServiceList()).andReturn(null); + EasyMock.expect(request.getServiceList(connectionInfo)).andReturn(null); PowerMock.expectNew(FunctionalHttpRequest.class, connectionInfo).andReturn(request).anyTimes(); EasyMock.expect(request.getServerBranch()).andReturn(remoteBranch); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java index cde6e8fd6e..d662289006 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java @@ -100,7 +100,7 @@ public abstract class AbstractChartTypePane extends Fur } } - double[] columnSize = {p, vs, f}; + double[] columnSize = {f}; double[] rowSize = {p, p, p, p, p, p, p}; if (styleList != null && !styleList.isEmpty()) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/MapStatusPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/MapStatusPane.java index 668a9b7745..d97122037a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/MapStatusPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/MapStatusPane.java @@ -81,8 +81,8 @@ public class MapStatusPane extends JPanel { double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; double[] rowSize = {p, p, p}; - double[] columnSize = {d, e}; - double[] column = {d, s}; + double[] columnSize = {p, e}; + double[] column = {p, s}; Component[][] comps = new Component[][]{ new Component[]{null, null}, diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java index 5be437619c..f8b03105d0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -36,7 +36,7 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { this.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); double p = TableLayout.PREFERRED; - double[] columnSize = {230}; + double[] columnSize = {TableLayout.FILL}; double[] rowSize = {p, p, p, p, p, p, p, p}; JPanel panel = new JPanel(new BorderLayout()); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java index 900072b7c0..583346868b 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java @@ -27,7 +27,7 @@ public class ComboBoxDefinePane extends DictEditorDefinePane { public Component[] createWaterMarkPane() { waterMarkField = new UITextField(); - return new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")), waterMarkField}; + return new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_PlaceHolder")), waterMarkField}; } protected void populateSubDictionaryEditorBean(ComboBox ob){