diff --git a/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java b/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java index 7898b2ad42..75fa28ef1e 100644 --- a/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java +++ b/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java @@ -8,9 +8,12 @@ import com.fr.design.mainframe.SiteCenterToken; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; +import com.fr.general.CloudCenter; +import com.fr.general.GeneralUtils; import com.fr.general.http.HttpToolbox; import com.fr.json.JSONObject; -import com.fr.stable.ProductConstants; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.WorkspaceEvent; @@ -43,11 +46,13 @@ import static com.fr.design.carton.CartonConstants.USERID; */ public class DesignerLatencyMetric { + private String latencyUrl; private ExecutorService executorService; private ScheduledExecutorService scheduler; private static final Map LATENCY_CONTAINER = new ConcurrentHashMap<>(); - private static final String LATENCY_INFO_URL = "https://cloud.fanruan.com/api/monitor/record_of_deisgner_latency/single"; + private static final String DEFAULT_MONITOR_URL = "https://cloud.fanruan.com/api/monitor/"; + private static final String LATENCY_TABLE_SUFFIX = "record_of_designer_latency/single"; private final static class InstanceHolder { static final DesignerLatencyMetric INSTANCE = new DesignerLatencyMetric(); @@ -74,14 +79,15 @@ public class DesignerLatencyMetric { executorService = Executors.newFixedThreadPool(8); // 启动定时埋点 this.scheduler = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("LatencyMetricWorker")); - this.scheduler.scheduleWithFixedDelay(this::collectAndSubmit, 60, 60, TimeUnit.SECONDS); + this.scheduler.scheduleWithFixedDelay(this::collectAndSubmit, 60, 60, TimeUnit.MINUTES); // 注册设计器工作目录切换事件监听 - EventDispatcher.listen(WorkspaceEvent.AfterSwitch, new Listener() { + EventDispatcher.listen(WorkspaceEvent.BeforeSwitch, new Listener() { @Override public void on(Event event, Workspace param) { collectAndSubmit(); } }); + FineLoggerFactory.getLogger().info("[Latency] designer latency metric started."); } } @@ -97,9 +103,19 @@ public class DesignerLatencyMetric { this.scheduler.shutdown(); } collectAndSubmit(); + FineLoggerFactory.getLogger().info("[Latency] designer latency metric stopped."); } } + private String getLatencyUrl() { + if (StringUtils.isEmpty(latencyUrl)) { + String monitorEntry = CloudCenter.getInstance().acquireUrlByKind("cloud.monitor.api.entrypoint"); + latencyUrl = (StringUtils.isNotEmpty(monitorEntry) ? monitorEntry : DEFAULT_MONITOR_URL) + + LATENCY_TABLE_SUFFIX; + } + return latencyUrl; + } + private void initializeContainer() { for (LatencyLevel level : LatencyLevel.values()) { LATENCY_CONTAINER.put(level, new AtomicInteger()); @@ -132,9 +148,10 @@ public class DesignerLatencyMetric { para.put("token", SiteCenterToken.generateToken()); para.put("content", collect()); try { - HttpToolbox.post(LATENCY_INFO_URL, para); - } catch (Throwable ignore) { - // doNothing + HttpToolbox.post(getLatencyUrl(), para); + FineLoggerFactory.getLogger().debug("[Latency] submit latency log to cloud."); + } catch (Throwable t) { + FineLoggerFactory.getLogger().debug(t,"[Latency] failed to submit latency log to cloud."); } resetContainer(); } @@ -145,7 +162,7 @@ public class DesignerLatencyMetric { info.put(APPID, MarketConfig.getInstance().getCloudOperationMaintenanceId()); info.put(USERID, MarketConfig.getInstance().getBbsUid()); info.put(DESIGNER_ID, DesignerEnvManager.getEnvManager().getUUID()); - info.put(DESIGNER_VERSION, ProductConstants.DESIGNER_VERSION); + info.put(DESIGNER_VERSION, GeneralUtils.getVersion()); info.put(DESIGN_METHOD, WorkContext.getCurrent().isLocal() ? LOCAL : REMOTE); info.put(OPERANDS_NUM, LATENCY_CONTAINER.values().stream().mapToInt(AtomicInteger::get).sum()); for (Map.Entry entry : LATENCY_CONTAINER.entrySet()) { diff --git a/designer-base/src/main/java/com/fr/design/carton/latency/LatencyLevel.java b/designer-base/src/main/java/com/fr/design/carton/latency/LatencyLevel.java index 0d40b37d89..f190bb883d 100644 --- a/designer-base/src/main/java/com/fr/design/carton/latency/LatencyLevel.java +++ b/designer-base/src/main/java/com/fr/design/carton/latency/LatencyLevel.java @@ -24,9 +24,7 @@ public enum LatencyLevel { // 非常严重卡顿 EXTREME(2000, 3000, "waitNum7"), // 极度卡顿 - CRITICAL(3000, Long.MAX_VALUE, "waitNum8"), - // 未知场景 - UNDEFINE(-1, -1, "unknown"); + CRITICAL(3000, Long.MAX_VALUE, "waitNum8"); final long start; final long end; @@ -62,6 +60,6 @@ public enum LatencyLevel { return level; } } - return UNDEFINE; + return CRITICAL; } } diff --git a/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java b/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java index 1d2048fa28..9bee877aee 100644 --- a/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java +++ b/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java @@ -421,7 +421,9 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi dialog.setVisible(true); DesignerFrameFileDealerPane.getInstance().getSelectedOperation().refresh(); - LocateAction.gotoEditingTemplateLeaf(targetFile); + SwingUtilities.invokeLater(() -> { + LocateAction.gotoEditingTemplateLeaf(targetFile); + }); } } diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java index 033e2cb07f..21736d77a5 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java @@ -12,6 +12,7 @@ import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -69,7 +70,6 @@ public class UpdateMainDialog extends UIDialog { public static final Dimension DEFAULT = new Dimension(660, 620); private static final Dimension PROGRESSBAR = new Dimension(120, 15); - private static final Dimension UPDATE_BUTTON = new Dimension(80, 24); private static final int UPDATE_PANE_ROW_SIZE = 30; private static final int UPDATE_CONTENT_PANE_ROW_SIZE = 10; private static final int UPDATE_CONTENT_PANE_COLUMN_SIZE = 10; @@ -295,7 +295,7 @@ public class UpdateMainDialog extends UIDialog { loadingLabel = new LoadingLabel(); loadingLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_Checking_Jar_Update")); updateButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_Update")); - updateButton.setPreferredSize(UPDATE_BUTTON); + updateButton.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.update.ui.dialog.UpdateMainDialog.updateButton")); updateButton.setEnabled(false); double[] rowSize = {TableLayout.PREFERRED}; diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index 1f2f91a6ab..18cbcf3df0 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -295,8 +295,9 @@ public class DBManipulationPane extends BasicBeanPane { cr.setForeground(UIConstants.NORMAL_BACKGROUND); JScrollPane jp = new JScrollPane(conditionsTree); addComponent(conditionPane, jp); - - UIButton addSubmitConditionButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Condition")); + String submitCondition = Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Condition"); + UIButton addSubmitConditionButton = new UIButton(submitCondition); + addSubmitConditionButton.setToolTipText(submitCondition); addSubmitConditionButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { 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 1405f81c6a..9a00559eae 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 @@ -29,3 +29,4 @@ 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 +com.fr.design.update.ui.dialog.UpdateMainDialog.updateButton=100*24 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 6af9a798c0..d052ead680 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 @@ -28,3 +28,4 @@ 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 +com.fr.design.update.ui.dialog.UpdateMainDialog.updateButton=160*24 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 98ac411090..525bfe56ad 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 @@ -28,3 +28,4 @@ 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 +com.fr.design.update.ui.dialog.UpdateMainDialog.updateButton=80*24 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 9c9e1bd92a..5b448dd469 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 @@ -28,3 +28,4 @@ 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 +com.fr.design.update.ui.dialog.UpdateMainDialog.updateButton=80*24 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 03972b51c0..e1bcdba473 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 @@ -27,3 +27,4 @@ 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 +com.fr.design.update.ui.dialog.UpdateMainDialog.updateButton=80*24 diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java index 525b3c0ca4..9a30b3266d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java @@ -6,20 +6,21 @@ import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.form.FormECBackgroundAction; import com.fr.design.actions.form.FormECColumnsAction; import com.fr.design.actions.form.FormECFrozenAction; -import com.fr.design.designer.creator.XElementCase; +import com.fr.design.base.mode.DesignModeContext; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.fit.NewUIModeCellElementPainter; -import com.fr.design.fit.common.FormDesignerUtil; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.mainframe.*; import com.fr.design.mainframe.cell.QuickEditorRegion; +import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.MenuDef; import com.fr.design.menu.ShortCut; import com.fr.design.menu.ToolBarDef; import com.fr.design.present.ConditionAttributesGroupPane; +import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.form.fit.common.LightTool; import com.fr.form.main.Form; import com.fr.grid.Grid; @@ -27,6 +28,7 @@ import com.fr.grid.GridColumn; import com.fr.grid.GridCorner; import com.fr.grid.GridRow; import com.fr.page.ReportSettingsProvider; +import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.worksheet.FormElementCase; import com.fr.design.selection.SelectionEvent; @@ -34,7 +36,6 @@ import com.fr.design.selection.SelectionListener; import javax.swing.JComponent; import javax.swing.JPanel; -import java.awt.Insets; import java.awt.Rectangle; /** @@ -69,6 +70,16 @@ public class FormElementCasePaneDelegate extends ElementCasePane { + DefaultTemplateCellElement defaultTemplateCellElement = DefaultThemedTemplateCellElementCase.createInstance(); + // fvs调整单元格默认样式 + AdjustWorkBookDefaultStyleUtils.adjustCellElement(defaultTemplateCellElement); + return defaultTemplateCellElement; + }); + } } private Rectangle getBoundsLineRect(TemplateElementCase elementCase) { 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 4d5fe8a62b..ca95a933df 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 @@ -32,6 +32,7 @@ import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase; import com.fr.design.report.RowColumnPane; import com.fr.design.selection.QuickEditor; +import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.grid.GridUtils; import com.fr.report.cell.CellElement; import com.fr.report.cell.DefaultTemplateCellElement; @@ -562,6 +563,8 @@ public class CellSelection extends Selection { for (int i = 0; i < removeElementList.size(); i++) { CellElement element = removeElementList.get(i); element.setStyle(null); + // fvs调整单元格默认样式 + AdjustWorkBookDefaultStyleUtils.adjustCellElement(element); } break; diff --git a/designer-realize/src/main/java/com/fr/start/MainDesigner.java b/designer-realize/src/main/java/com/fr/start/MainDesigner.java index 4cad30ad77..7cdbab8e4f 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -171,7 +171,7 @@ public class MainDesigner extends BaseDesigner { ServerTray.init(); } FineLoggerFactory.getLogger().info("Designer started.Time used {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS)); - + DesignerStartupContext.getRecorder().stop(); SwitchForSwingChecker.initThreadMonitoring(); DesignerLatencyMetric.getInstance().start(); }