Browse Source

Merge pull request #8483 in DESIGN/design from release/11.0 to feature/x

* commit 'dd07f8d8fb8133bfeee348dd8f823d2a655453e0':
  REPORT-68455 && REPORT-69108 【问题原因】 1.工具栏面板与其他面板(设计器菜单栏-模板或远程设计-切换工作目录)重叠时会显示异常是因为之前的这个工具栏面板手误写成了继承Panel 2.搜索结果显示不正确是因为之前改卡死问题没改好,把搜索计数放到了处理UI的外面,会优先于数据集树的刷新而变化,导致搜索计数完成了,但是结果没更新的问题 【改动思路】1.改成继承JPanel;2.搜索计数放到处理UI中,确定处理UI完成才算是一次计数完成;3.添加部分debug日志,方便以后排查问题 【review建议】无
  REPORT-68602 系列堆积和条件属性弹框多了“保存”和“取消”设置项 && 系列REPORT-69013 双击fvs文件,唤起设计器后不会自动打开模板
  REPORT-68244 【下拉树重构】新多选下拉树控件不能用了
  REPORT-68886 design fix:fvs.cpt.chart 不支持主题 isThemed一直等于false
  REPORT-69229 设计器偶发启动不了
feature/x
superman 3 years ago
parent
commit
0fb2b9df74
  1. 14
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java
  2. 8
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchCallBack.java
  3. 3
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchTask.java
  4. 3
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchTask.java
  5. 3
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/pane/TreeSearchToolbarPane.java
  6. 2
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  7. 7
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  8. 26
      designer-base/src/main/java/com/fr/start/BaseDesigner.java
  9. 35
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataHelper.java
  10. 3
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java
  11. 3
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java
  12. 26
      designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java
  13. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java
  14. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisStyleSettingPane.java
  15. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  16. 4
      designer-form/src/main/java/com/fr/design/designer/creator/XTreeEditor.java

14
designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java

@ -10,6 +10,7 @@ import com.fr.design.data.datapane.management.search.searcher.TableDataSearchMod
import com.fr.design.data.datapane.management.search.searcher.TableDataTreeSearcher;
import com.fr.design.data.datapane.management.search.searcher.TreeSearchStatus;
import com.fr.design.data.datapane.management.search.view.TreeSearchRendererHelper;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.swing.SwingUtilities;
@ -102,6 +103,7 @@ public class TableDataTreeSearchManager {
rendererHelper = new TreeSearchRendererHelper();
rendererHelper.save(getCurrentTableDataTree());
treeSearcher = new TableDataTreeSearcher();
FineLoggerFactory.getLogger().debug("switch to table data search for mode: {}", searchMode.name());
treeSearcher.beforeSearch(searchMode, tableDataSource);
}
@ -132,6 +134,7 @@ public class TableDataTreeSearchManager {
setTreeSearchStatus(TreeSearchStatus.SEARCHING);
rendererHelper.replaceTreeRenderer(getCurrentTableDataTree(), searchText);
count = new AtomicInteger(treeSearcher.getAllWrappersSize());
FineLoggerFactory.getLogger().debug("start table data search for search text: {}", searchText);
treeSearcher.startSearch(searchText);
}
@ -150,11 +153,9 @@ public class TableDataTreeSearchManager {
}
private boolean isRepeatSearch(String searchText) {
if (StringUtils.isEmpty(lastSearchText)) {
lastSearchText = searchText;
return false;
}
return StringUtils.equals(lastSearchText, searchText);
boolean repeat = StringUtils.equals(lastSearchText, searchText);
lastSearchText = searchText;
return repeat;
}
/**
@ -170,6 +171,7 @@ public class TableDataTreeSearchManager {
public void stopSearch() {
setTreeSearchStatus(TreeSearchStatus.SEARCH_STOPPED);
count = null;
FineLoggerFactory.getLogger().debug("stop table data search for search text: {}", lastSearchText);
treeSearcher.stopSearch();
}
@ -179,6 +181,7 @@ public class TableDataTreeSearchManager {
public void completeSearch() {
setTreeSearchStatus(TreeSearchStatus.SEARCH_COMPLETED);
count = null;
FineLoggerFactory.getLogger().debug("complete table data search for search text: {}", lastSearchText);
treeSearcher.completeSearch();
}
@ -187,6 +190,7 @@ public class TableDataTreeSearchManager {
*/
public void restoreToolBarAndTreePane() {
setTreeSearchStatus(TreeSearchStatus.NOT_IN_SEARCH_MODE);
FineLoggerFactory.getLogger().info("out of table data search");
if (treeSearcher != null) {
treeSearcher.afterSearch();
}

8
designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchCallBack.java

@ -24,14 +24,12 @@ public class TableDataSearchCallBack implements TreeSearchCallback {
if (TableDataTreeSearchManager.getInstance().getTreeSearchStatus() != TreeSearchStatus.SEARCHING) {
return;
}
// 搜索计数
TableDataTreeSearchManager.getInstance().decreaseCount();
if (treeSearchResult.isSuccess()) {
// 添加结果
addToTreeSearcher(treeSearchResult);
// 处理UI
updateTableDataTree();
}
// 处理UI
updateTableDataTree();
}
protected void updateTableDataTree() {
@ -40,6 +38,8 @@ public class TableDataSearchCallBack implements TreeSearchCallback {
return;
}
TableDataTreeSearchManager.getInstance().updateTableDataTree();
// 搜索计数
TableDataTreeSearchManager.getInstance().decreaseCount();
});
}

3
designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchTask.java

@ -43,8 +43,9 @@ public class TableDataSearchTask implements TreeSearchTask {
} else {
result = dealWithCommonTableDataWrapper(tableDataWrapper);
}
FineLoggerFactory.getLogger().debug("calculate {}'s columns succeeded", tableDataWrapper.getTableDataName());
} catch (Throwable e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
FineLoggerFactory.getLogger().error(e, "calculate {}'s columns failed", tableDataWrapper.getTableDataName());
result = dealWithErrorTableDataWrapper(tableDataWrapper);
}
callback.done(result);

3
designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchTask.java

@ -33,8 +33,9 @@ public class TableDataPreSearchTask implements TreeSearchTask {
result = new TableDataSearchResult.Builder()
.buildSuccess(true)
.build();
FineLoggerFactory.getLogger().debug("pre calculate {}'s columns succeeded", tableDataWrapper.getTableDataName());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e, "calculate table data {} failed", tableDataWrapper.getTableDataName());
FineLoggerFactory.getLogger().error(e, "pre calculate {}'s columns failed", tableDataWrapper.getTableDataName());
result = new TableDataSearchResult.Builder()
.buildSuccess(false)
.build();

3
designer-base/src/main/java/com/fr/design/data/datapane/management/search/pane/TreeSearchToolbarPane.java

@ -23,7 +23,6 @@ import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Panel;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.KeyAdapter;
@ -34,7 +33,7 @@ import java.awt.event.MouseEvent;
/**
* @author Yvan
*/
public class TreeSearchToolbarPane extends Panel implements TreeSearchStatusChangeListener {
public class TreeSearchToolbarPane extends JPanel implements TreeSearchStatusChangeListener {
public static final String TOOLBAR_PANE = "toolbarPane";

2
designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java

@ -212,7 +212,7 @@ public abstract class UIControlPane extends JControlPane {
}
// 点击"编辑"按钮,弹出面板
class PopupEditDialog extends JDialog {
protected class PopupEditDialog extends JDialog {
private JComponent editPane;
private PopupToolPane popupToolPane;
private static final int WIDTH = 570;

7
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -371,7 +371,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
public void fireDesignerOpened() {
for (DesignerOpenedListener listener : designerOpenedListenerList) {
listener.designerOpened();
// 捕获下异常 避免造成启动过程监听触发异常导致设计器闪退
try {
listener.designerOpened();
} catch (Throwable e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
designerOpened = true;

26
designer-base/src/main/java/com/fr/start/BaseDesigner.java

@ -3,6 +3,7 @@
*/
package com.fr.start;
import com.fr.base.extension.FileExtension;
import com.fr.common.report.ReportState;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
@ -34,6 +35,7 @@ import com.fr.stable.OperatingSystem;
import com.fr.start.event.LazyStartupEvent;
import com.fr.workspace.base.WorkspaceStatus;
import java.awt.Window;
import java.io.File;
import java.lang.reflect.Method;
@ -121,14 +123,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
}
File f = new File(arg);
String path = f.getAbsolutePath();
boolean pathends1 = path.endsWith(".cpt")
|| path.endsWith(".xls");
boolean pathends2 = path.endsWith(".xlsx")
|| path.endsWith(".frm");
boolean pathends3 = path.endsWith(".form")
|| path.endsWith(".cht");
boolean pathends4 = pathends1 || pathends2 || pathends3;
if (pathends4 || path.endsWith(".chart")) {
if (isAcceptFilePathEnd(path)) {
file = new FileFILE(f);
}
}
@ -148,6 +143,21 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
}
}
private boolean isAcceptFilePathEnd(String path) {
FileExtension[] acceptFileExtensions = new FileExtension[]{
FileExtension.CPT, FileExtension.XLS, FileExtension.XLSX, FileExtension.FRM, FileExtension.CHT, FileExtension.VIS
};
for (FileExtension acceptFileExtension : acceptFileExtensions) {
String[] extensions = acceptFileExtension.getExtensions();
for (String extension : extensions) {
if (path.endsWith("." + extension)) {
return true;
}
}
}
return false;
}
private boolean openFile(final DesignerFrame df, boolean isException, FILE file) {
//启动时打开指定文件的接口

35
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataHelper.java

@ -0,0 +1,35 @@
package com.fr.design.mainframe.chart.gui.data;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartAxisLabelStyle;
import com.fr.plugin.chart.attr.plot.VanChartAxisPlot;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
/**
* @author shine
* @version 10.0
* Created by shine on 2022/4/6
*/
public class ChartDataHelper {
/**
* 在update数据集分类的时候需要联动update一下样式-坐标轴里面的分层样式设置,来自CHART-22873
*/
public static void updateAxisCategoryStyles(ChartCollection chartCollection) {
TopDefinitionProvider definition = chartCollection.getSelectedChart().getFilterDefinition();
int size = definition == null ? 1 : definition.getMoreCateSize() + 1;
Plot plot = chartCollection.getSelectedChart().getPlot();
if (plot instanceof VanChartAxisPlot) {
for (VanChartAxis axis : ((VanChartAxisPlot) plot).getXAxisList()) {
axis.clearCategoryStyles();
for (int i = 0; i < size; i++) {
axis.addCategoryStyle(DefaultStyleHelper4Van.dealAxisCheckTheme(new VanChartAxisLabelStyle()));
}
}
}
}
}

3
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java

@ -13,6 +13,7 @@ import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataHelper;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -192,7 +193,7 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
NormalReportDataDefinition reportDefinition = (NormalReportDataDefinition) definition;
reportDefinition.clearMoreCate();
updateMoreCate(reportDefinition, plot);
collection.updateAxisCategoryStyles();
ChartDataHelper.updateAxisCategoryStyles(collection);
}
}

3
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java

@ -13,6 +13,7 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
@ -246,7 +247,7 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
normal.clearMoreCate();
updateMoreCate(normal, plot);
}
collection.updateAxisCategoryStyles();
ChartDataHelper.updateAxisCategoryStyles(collection);
}
protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) {

26
designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java

@ -5,6 +5,7 @@ import com.fr.base.ChartPreStyleConfig;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.base.AttrFillStyle;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.base.ChartThemeStyleProvider;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.DataSheet;
@ -14,6 +15,7 @@ import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartAxisLabelStyle;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.base.AttrLabel;
@ -24,6 +26,9 @@ import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.plugin.chart.vanchart.VanChart;
import java.util.ArrayList;
import java.util.List;
/**
* @author shine
* @version 10.0
@ -82,7 +87,28 @@ public class DefaultStyleHelper4Van {
}
private static void dealAxisCheckTheme(VanChartAxis axis) {
if (!ChartEditContext.supportTheme()) {
List<ChartThemeStyleProvider> chartThemeStyleProviders = new ArrayList<>();
VanChartRectanglePlot.getAxisChartPreStyleProvider(axis, chartThemeStyleProviders);
for (ChartThemeStyleProvider themeStyleProvider : chartThemeStyleProviders) {
themeStyleProvider.setThemeCustom();
}
}
}
public static VanChartAxisLabelStyle dealAxisCheckTheme(VanChartAxisLabelStyle labelStyle) {
if (!ChartEditContext.supportTheme()) {
labelStyle.getTextAttr().setThemeCustom();
}
return labelStyle;
}
public static VanChartAxis dealAxisDefault(VanChartAxis axis) {
dealAxisCheckTheme(axis);
if (!duchampMode()) {
return axis;
}

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

@ -128,7 +128,7 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem
public void populate(Nameable[] nameableArray) {
//特殊处理,使用instanceof判断,弹出不同的面板
if (SwingUtilities.getWindowAncestor(this) instanceof JDialog) {
if (SwingUtilities.getWindowAncestor(this) instanceof PopupEditDialog) {
popupEditDialog = new HyperDialog(cardPane);
}
super.populate(nameableArray);
@ -136,7 +136,7 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem
protected void popupEditDialog(Point mousePos) {
//特殊处理,处理连续弹窗情况,弹出面板定为方式不同
if (SwingUtilities.getWindowAncestor(this) instanceof JDialog) {
if (SwingUtilities.getWindowAncestor(this) instanceof PopupEditDialog) {
GUICoreUtils.centerWindow(popupEditDialog);
popupEditDialog.setVisible(true);
return;

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisStyleSettingPane.java

@ -13,6 +13,7 @@ import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.attr.axis.VanChartAxisLabelStyle;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.axis.component.AxisLabelDisplayComboBox;
@ -125,6 +126,7 @@ public class VanChartAxisStyleSettingPane extends BasicBeanPane<VanChartAxisLabe
@Override
public VanChartAxisLabelStyle updateBean() {
VanChartAxisLabelStyle style = new VanChartAxisLabelStyle();
DefaultStyleHelper4Van.dealAxisCheckTheme(style);
style.setLabelDisplay(labelDisplayComboBox.updateBean());
TextAttr textAttr = style.getTextAttr();
labelTextAttrPane.update(textAttr);

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

@ -32,6 +32,7 @@ import com.fr.plugin.chart.type.AxisTickLineType;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartHtmlLabelPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
@ -607,6 +608,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
private VanChartAxisLabelStyle getAxisLabelStyle(VanChartAxis axis) {
VanChartAxisLabelStyle style = new VanChartAxisLabelStyle();
DefaultStyleHelper4Van.dealAxisCheckTheme(style);
style.setLabelDisplay(axis.getLabelDisplay());
style.setTextAttr(axis.getTextAttr());
style.setAutoLabelGap(axis.isAutoLabelGap());
@ -663,6 +665,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
style = axis.getCategoryStyle(index);
} else {
style = new VanChartAxisLabelStyle();
DefaultStyleHelper4Van.dealAxisCheckTheme(style);
axis.addCategoryStyle(style);
}
return style;

4
designer-form/src/main/java/com/fr/design/designer/creator/XTreeEditor.java

@ -41,7 +41,7 @@ public class XTreeEditor extends XWidgetCreator {
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Value")).setEditorClass(WidgetValueEditor.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"),
new CRPropertyDescriptor("model", this.data.getClass(), "getNodeOrDict", "setNodeOrDict").setI18NName(
new CRPropertyDescriptor("model", this.data.getClass(), "getBuildModelConfig", "setBuildModelConfig").setI18NName(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")).setEditorClass(TreeModelEditor.class).setRendererClass(
TreeModelRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"),
new CRPropertyDescriptor("allowBlank", this.data.getClass()).setI18NName(
@ -55,7 +55,7 @@ public class XTreeEditor extends XWidgetCreator {
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Value")).setEditorClass(WidgetValueEditor.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"),
new CRPropertyDescriptor("model", this.data.getClass(), "getNodeOrDict", "setNodeOrDict").setI18NName(
new CRPropertyDescriptor("model", this.data.getClass(), "getBuildModelConfig", "setBuildModelConfig").setI18NName(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")).setEditorClass(TreeModelEditor.class).setRendererClass(
TreeModelRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"),
new CRPropertyDescriptor("allowBlank", this.data.getClass()).setI18NName(

Loading…
Cancel
Save