Browse Source

Pull request #1: 无JIRA,自己合自己的仓库同步arabic分支

Merge in ~OBO/design from release/11.0 to arabic

* commit '2d46316661e6c2bb9526b7bfcd0a0ce3a2547c86':
  Revert "REPORT-128652 开启模板认证后,新建fvs模板报错。"
  REPORT-128652 开启模板认证后,新建fvs模板报错。 【问题原因】主jar修改了sessionID相关的校验,导致fvs插件的部分接口无法通过校验。 【改动思路】更新jar强制FVS插件升级,通过提高fvs独占接口api level实现
  REPORT-125641 fix:设计器显示问题-英语显示不全
  REPORT-128068 fix:设计器按钮显示不全且无tooltips
  REPORT-111995 【NewUI】文件-选项和帮助面板翻新
  REPORT-125224 fix:补充设计器启动计时器关闭
  REPORT-125241 fix:修复模板从内层目录移动到最外层目录时显示异常问题
  REPORT-127241 设计器性能埋点字段调整
  REPORT-117002 设计器性能埋点监控 调整代码
  REPORT-117002 设计器性能埋点监控 调整代码
  REPORT-77878 fix: fvs插件-表格默认字体颜色是白色,但是右键清除单元格格式,字体会变为黑色
  REPORT-70155 fix: fvs根据主题样式创建默认单元格
persist/11.0-arabic
Obo-王学仁 4 months ago
parent
commit
de26d800ea
  1. 33
      designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java
  2. 6
      designer-base/src/main/java/com/fr/design/carton/latency/LatencyLevel.java
  3. 2
      designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java
  4. 4
      designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java
  5. 5
      designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java
  6. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  7. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  8. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  9. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  10. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  11. 17
      designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java
  12. 3
      designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java
  13. 2
      designer-realize/src/main/java/com/fr/start/MainDesigner.java

33
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.Event;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.event.Listener; import com.fr.event.Listener;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralUtils;
import com.fr.general.http.HttpToolbox; import com.fr.general.http.HttpToolbox;
import com.fr.json.JSONObject; 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.WorkContext;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent; import com.fr.workspace.WorkspaceEvent;
@ -43,11 +46,13 @@ import static com.fr.design.carton.CartonConstants.USERID;
*/ */
public class DesignerLatencyMetric { public class DesignerLatencyMetric {
private String latencyUrl;
private ExecutorService executorService; private ExecutorService executorService;
private ScheduledExecutorService scheduler; private ScheduledExecutorService scheduler;
private static final Map<LatencyLevel, AtomicInteger> LATENCY_CONTAINER = new ConcurrentHashMap<>(); private static final Map<LatencyLevel, AtomicInteger> 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 { private final static class InstanceHolder {
static final DesignerLatencyMetric INSTANCE = new DesignerLatencyMetric(); static final DesignerLatencyMetric INSTANCE = new DesignerLatencyMetric();
@ -74,14 +79,15 @@ public class DesignerLatencyMetric {
executorService = Executors.newFixedThreadPool(8); executorService = Executors.newFixedThreadPool(8);
// 启动定时埋点 // 启动定时埋点
this.scheduler = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("LatencyMetricWorker")); 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<Workspace>() { EventDispatcher.listen(WorkspaceEvent.BeforeSwitch, new Listener<Workspace>() {
@Override @Override
public void on(Event event, Workspace param) { public void on(Event event, Workspace param) {
collectAndSubmit(); collectAndSubmit();
} }
}); });
FineLoggerFactory.getLogger().info("[Latency] designer latency metric started.");
} }
} }
@ -97,9 +103,19 @@ public class DesignerLatencyMetric {
this.scheduler.shutdown(); this.scheduler.shutdown();
} }
collectAndSubmit(); 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() { private void initializeContainer() {
for (LatencyLevel level : LatencyLevel.values()) { for (LatencyLevel level : LatencyLevel.values()) {
LATENCY_CONTAINER.put(level, new AtomicInteger()); LATENCY_CONTAINER.put(level, new AtomicInteger());
@ -132,9 +148,10 @@ public class DesignerLatencyMetric {
para.put("token", SiteCenterToken.generateToken()); para.put("token", SiteCenterToken.generateToken());
para.put("content", collect()); para.put("content", collect());
try { try {
HttpToolbox.post(LATENCY_INFO_URL, para); HttpToolbox.post(getLatencyUrl(), para);
} catch (Throwable ignore) { FineLoggerFactory.getLogger().debug("[Latency] submit latency log to cloud.");
// doNothing } catch (Throwable t) {
FineLoggerFactory.getLogger().debug(t,"[Latency] failed to submit latency log to cloud.");
} }
resetContainer(); resetContainer();
} }
@ -145,7 +162,7 @@ public class DesignerLatencyMetric {
info.put(APPID, MarketConfig.getInstance().getCloudOperationMaintenanceId()); info.put(APPID, MarketConfig.getInstance().getCloudOperationMaintenanceId());
info.put(USERID, MarketConfig.getInstance().getBbsUid()); info.put(USERID, MarketConfig.getInstance().getBbsUid());
info.put(DESIGNER_ID, DesignerEnvManager.getEnvManager().getUUID()); 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(DESIGN_METHOD, WorkContext.getCurrent().isLocal() ? LOCAL : REMOTE);
info.put(OPERANDS_NUM, LATENCY_CONTAINER.values().stream().mapToInt(AtomicInteger::get).sum()); info.put(OPERANDS_NUM, LATENCY_CONTAINER.values().stream().mapToInt(AtomicInteger::get).sum());
for (Map.Entry<LatencyLevel, AtomicInteger> entry : LATENCY_CONTAINER.entrySet()) { for (Map.Entry<LatencyLevel, AtomicInteger> entry : LATENCY_CONTAINER.entrySet()) {

6
designer-base/src/main/java/com/fr/design/carton/latency/LatencyLevel.java

@ -24,9 +24,7 @@ public enum LatencyLevel {
// 非常严重卡顿 // 非常严重卡顿
EXTREME(2000, 3000, "waitNum7"), EXTREME(2000, 3000, "waitNum7"),
// 极度卡顿 // 极度卡顿
CRITICAL(3000, Long.MAX_VALUE, "waitNum8"), CRITICAL(3000, Long.MAX_VALUE, "waitNum8");
// 未知场景
UNDEFINE(-1, -1, "unknown");
final long start; final long start;
final long end; final long end;
@ -62,6 +60,6 @@ public enum LatencyLevel {
return level; return level;
} }
} }
return UNDEFINE; return CRITICAL;
} }
} }

2
designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java

@ -421,7 +421,9 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi
dialog.setVisible(true); dialog.setVisible(true);
DesignerFrameFileDealerPane.getInstance().getSelectedOperation().refresh(); DesignerFrameFileDealerPane.getInstance().getSelectedOperation().refresh();
SwingUtilities.invokeLater(() -> {
LocateAction.gotoEditingTemplateLeaf(targetFile); LocateAction.gotoEditingTemplateLeaf(targetFile);
});
} }
} }

4
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.ActionLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -69,7 +70,6 @@ public class UpdateMainDialog extends UIDialog {
public static final Dimension DEFAULT = new Dimension(660, 620); public static final Dimension DEFAULT = new Dimension(660, 620);
private static final Dimension PROGRESSBAR = new Dimension(120, 15); 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_PANE_ROW_SIZE = 30;
private static final int UPDATE_CONTENT_PANE_ROW_SIZE = 10; private static final int UPDATE_CONTENT_PANE_ROW_SIZE = 10;
private static final int UPDATE_CONTENT_PANE_COLUMN_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 = new LoadingLabel();
loadingLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_Checking_Jar_Update")); 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 = 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); updateButton.setEnabled(false);
double[] rowSize = {TableLayout.PREFERRED}; double[] rowSize = {TableLayout.PREFERRED};

5
designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java

@ -295,8 +295,9 @@ public class DBManipulationPane extends BasicBeanPane<DBManipulation> {
cr.setForeground(UIConstants.NORMAL_BACKGROUND); cr.setForeground(UIConstants.NORMAL_BACKGROUND);
JScrollPane jp = new JScrollPane(conditionsTree); JScrollPane jp = new JScrollPane(conditionsTree);
addComponent(conditionPane, jp); addComponent(conditionPane, jp);
String submitCondition = Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Condition");
UIButton addSubmitConditionButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Condition")); UIButton addSubmitConditionButton = new UIButton(submitCondition);
addSubmitConditionButton.setToolTipText(submitCondition);
addSubmitConditionButton.addActionListener(new ActionListener() { addSubmitConditionButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {

1
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.formula.FormulaPaneWhenReserveFormula=1200*600
com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel=130*20 com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel=130*20
com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel=140*20 com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel=140*20
com.fr.design.update.ui.dialog.UpdateMainDialog.updateButton=100*24

1
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.formula.FormulaPaneWhenReserveFormula=900*600
com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel=100*20 com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel=100*20
com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel=130*20 com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel=130*20
com.fr.design.update.ui.dialog.UpdateMainDialog.updateButton=160*24

1
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.formula.FormulaPaneWhenReserveFormula=900*600
com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel=75*20 com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel=75*20
com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel=100*20 com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel=100*20
com.fr.design.update.ui.dialog.UpdateMainDialog.updateButton=80*24

1
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.formula.FormulaPaneWhenReserveFormula=900*600
com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel=75*20 com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel=75*20
com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel=100*20 com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel=100*20
com.fr.design.update.ui.dialog.UpdateMainDialog.updateButton=80*24

1
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.formula.FormulaPaneWhenReserveFormula=900*600
com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel=75*20 com.fr.design.mainframe.mobile.ui.MobileStyleDefinePane.configLabel=75*20
com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel=100*20 com.fr.design.mainframe.mobile.utils.DesignerUtils.configLabel=100*20
com.fr.design.update.ui.dialog.UpdateMainDialog.updateButton=80*24

17
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.FormECBackgroundAction;
import com.fr.design.actions.form.FormECColumnsAction; import com.fr.design.actions.form.FormECColumnsAction;
import com.fr.design.actions.form.FormECFrozenAction; 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.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener; import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.fit.NewUIModeCellElementPainter; import com.fr.design.fit.NewUIModeCellElementPainter;
import com.fr.design.fit.common.FormDesignerUtil;
import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.mainframe.*; import com.fr.design.mainframe.*;
import com.fr.design.mainframe.cell.QuickEditorRegion; 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.KeySetUtils;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.design.present.ConditionAttributesGroupPane; import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.form.fit.common.LightTool; import com.fr.form.fit.common.LightTool;
import com.fr.form.main.Form; import com.fr.form.main.Form;
import com.fr.grid.Grid; import com.fr.grid.Grid;
@ -27,6 +28,7 @@ import com.fr.grid.GridColumn;
import com.fr.grid.GridCorner; import com.fr.grid.GridCorner;
import com.fr.grid.GridRow; import com.fr.grid.GridRow;
import com.fr.page.ReportSettingsProvider; import com.fr.page.ReportSettingsProvider;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.worksheet.FormElementCase; import com.fr.report.worksheet.FormElementCase;
import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionEvent;
@ -34,7 +36,6 @@ import com.fr.design.selection.SelectionListener;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.Insets;
import java.awt.Rectangle; import java.awt.Rectangle;
/** /**
@ -69,6 +70,16 @@ public class FormElementCasePaneDelegate extends ElementCasePane<FormElementCase
} }
} }
}); });
// fvs根据主题样式创建默认单元格
if (DesignModeContext.isDuchampMode()) {
sheet.setDefaultCellElementSupplier(() -> {
DefaultTemplateCellElement defaultTemplateCellElement = DefaultThemedTemplateCellElementCase.createInstance();
// fvs调整单元格默认样式
AdjustWorkBookDefaultStyleUtils.adjustCellElement(defaultTemplateCellElement);
return defaultTemplateCellElement;
});
}
} }
private Rectangle getBoundsLineRect(TemplateElementCase elementCase) { private Rectangle getBoundsLineRect(TemplateElementCase elementCase) {

3
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.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.report.RowColumnPane; import com.fr.design.report.RowColumnPane;
import com.fr.design.selection.QuickEditor; import com.fr.design.selection.QuickEditor;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.grid.GridUtils; import com.fr.grid.GridUtils;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.DefaultTemplateCellElement;
@ -562,6 +563,8 @@ public class CellSelection extends Selection {
for (int i = 0; i < removeElementList.size(); i++) { for (int i = 0; i < removeElementList.size(); i++) {
CellElement element = removeElementList.get(i); CellElement element = removeElementList.get(i);
element.setStyle(null); element.setStyle(null);
// fvs调整单元格默认样式
AdjustWorkBookDefaultStyleUtils.adjustCellElement(element);
} }
break; break;

2
designer-realize/src/main/java/com/fr/start/MainDesigner.java

@ -171,7 +171,7 @@ public class MainDesigner extends BaseDesigner {
ServerTray.init(); ServerTray.init();
} }
FineLoggerFactory.getLogger().info("Designer started.Time used {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS)); FineLoggerFactory.getLogger().info("Designer started.Time used {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS));
DesignerStartupContext.getRecorder().stop();
SwitchForSwingChecker.initThreadMonitoring(); SwitchForSwingChecker.initThreadMonitoring();
DesignerLatencyMetric.getInstance().start(); DesignerLatencyMetric.getInstance().start();
} }

Loading…
Cancel
Save