Browse Source

Merge pull request #3293 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit '4e637a97bd654b83a4a2e862177f62b89293033c':
  REPORT-46713 && REPORT-46469 && REPORT-46735 【问题原因】release已经验收,提一份到final,10.0.12.1中间版本发布 【改动思路】release已经验收,提一份到final,10.0.12.1中间版本发布
  REPORT-45689  顶部参数界面样式优化
  REPORT-46713 && REPORT-46469 && REPORT-46735 删去注释代码
  REPORT-46713 && REPORT-46469 && REPORT-46735 【问题原因】由REPORT-44961中的改动引起 【改动思路】引起了两个客户bug,需要在明天的中间版本发布,因此还没仔细排查原因,暂时先回退掉REPORT-44961中的改动,赶一下明天的发布,后续继续修改REPORT-44961的时候再排查原因
  CHART-17805 饼图面板美化
  REPORT-46683 【冒烟】数据库查询,选中表并拖动的时候,弹窗变化了 在UIConstants中添加一个EMPTY_ICON代表无图标,然后在UpdateAction的setSmallIcon方法中对传过来的资源路径进行判断,如果为"",就把null作为Icon 的Value值put到map中,与之前的逻辑一致
  REPORT-46589 把单独过滤的类抽出来 以过滤器形式调用
  REPORT-46683 【冒烟】数据库查询,选中表并拖动的时候,弹窗变化了 SQLEitPane的分隔符误传成CR了,改为LF重新上传
  REPORT-46683 【冒烟】数据库查询,选中表并拖动的时候,弹窗变化了 【问题原因】之前做迭代任务的时候重载了UpdateAction的setSmallIcon方法,然后原先设计器中的setSmallIcon(null)就会报错,当时想错了,以为不能传null,就给改成了UIConstant.BLACK_ICON,其实是因为重载了方法后,传入null,jdk不能判断是调用哪个方法,然后导致了一些场景里本来没图标,变成了一个空白的占位图标,因此显示发生了变化 【改动思路】把迭代任务中由null改为BLACK_ICON的地方,回退为null,再为这个null加上个Icon类型,以便于绑定方法,且与此前逻辑保持一致
research/11.0
superman 4 years ago
parent
commit
a21c147aaf
  1. 8
      designer-base/src/main/java/com/fr/design/actions/UpdateAction.java
  2. 4
      designer-base/src/main/java/com/fr/design/constants/UIConstants.java
  3. 195
      designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java
  4. 4
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  5. 34
      designer-base/src/main/java/com/fr/design/file/filter/ClassFilter.java
  6. 2
      designer-base/src/main/java/com/fr/design/fun/MobileParamUIProvider.java
  7. 4
      designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java
  8. 91
      designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java
  9. 21
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java
  10. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  11. 3
      designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java
  12. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java
  13. 2
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
  14. 3
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java
  15. 3
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java

8
designer-base/src/main/java/com/fr/design/actions/UpdateAction.java

@ -180,9 +180,15 @@ public abstract class UpdateAction extends ShortCut implements Action {
* 如果a_disabled.svg或者a_pressed.svg缺失则不会被设置成灰化状态或者按压状态图标
* 如果a_normal.svg缺失则会读到a.png这也就不是一个SVGIcon了
* 如果连 a.png 也不存在那么这个action的图标就是空白的
* @param resource
*
* 如果想让这个Action没有图标可以传入""
* @param resource 图标资源路径
*/
public void setSmallIcon(String resource) {
if (StringUtils.equals(resource, StringUtils.EMPTY)) {
this.putValue(Action.SMALL_ICON, null);
return;
}
this.putValue(Action.SMALL_ICON, IconUtils.readIcon(resource));
this.putValue(UpdateAction.DISABLED_ICON, IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_DISABLED));
}

4
designer-base/src/main/java/com/fr/design/constants/UIConstants.java

@ -4,11 +4,14 @@
package com.fr.design.constants;
import com.fr.base.svg.IconUtils;
import com.fr.base.svg.SVGIcon;
import com.fr.general.IOUtils;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.border.Border;
import java.awt.BasicStroke;
import java.awt.Color;
@ -26,6 +29,7 @@ public interface UIConstants {
public static final Icon CPT_ICON = IOUtils.readIcon("/com/fr/base/images/oem/cpt.png");
public static final Icon BLACK_ICON = IOUtils.readIcon("/com/fr/base/images/cell/blank.gif");
public static final String EMPTY_ICON = StringUtils.EMPTY;
public static final Image APPFIT_V0 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/V0.png");
public static final Image APPFIT_V1 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/V1.png");

195
designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java

File diff suppressed because one or more lines are too long

4
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -5,11 +5,11 @@ import com.fr.base.io.BaseBook;
import com.fr.design.DesignerEnvManager;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.file.filter.ClassFilter;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.JTemplateFactory;
import com.fr.design.mainframe.JVirtualTemplate;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.ui.util.UIUtil;
@ -474,7 +474,7 @@ public class HistoryTemplateListCache implements CallbackEvent {
String name = template.getEditingFILE().getName();
String pluginId = context.getID();
long start = System.currentTimeMillis();
Set<ClassLoader> set = ClassHelper.getClassLoaders(baseBook);
Set<ClassLoader> set = ClassHelper.getClassLoadersByFilter(baseBook, ClassFilter.getInstance());
FineLoggerFactory.getLogger().info("{} find plugin classloader spend: {} ms", name, (System.currentTimeMillis() - start));
if (set != null) {
for (ClassLoader classLoader : set) {

34
designer-base/src/main/java/com/fr/design/file/filter/ClassFilter.java

@ -0,0 +1,34 @@
package com.fr.design.file.filter;
import com.fr.stable.Filter;
import java.util.HashSet;
import java.util.Set;
/**
* 过滤无需遍历的jdk class
*
* @author hades
* @version 10.0
* Created by hades on 2021/1/7
*/
public class ClassFilter implements Filter<String> {
private static final Set<String> FILTER_SET = new HashSet<>();
private static final Filter<String> INSTANCE = new ClassFilter();
public static Filter<String> getInstance() {
return INSTANCE;
}
static {
FILTER_SET.add("java.awt.image.BufferedImage");
FILTER_SET.add("sun.awt.AppContext");
}
@Override
public boolean accept(String s) {
return FILTER_SET.contains(s);
}
}

2
designer-base/src/main/java/com/fr/design/fun/MobileParamUIProvider.java

@ -26,7 +26,7 @@ public interface MobileParamUIProvider extends Mutable {
* 移动端参数面板中扩展项的面板
* @return
*/
Class<? extends BasicBeanPane<MobileParamStyle>> classForMobileParamAppearance();
Class<? extends BasicBeanPane<? extends MobileParamStyle>> classForMobileParamAppearance();
/**
* 扩展项的名称描述

4
designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java

@ -27,10 +27,6 @@ public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCr
public DictionaryPane() {
}
public DictionaryPane(boolean needTableDataChange) {
this.tableDataDictPane.setNeedTableDataChange(needTableDataChange);
}
@Override
protected void initLayout() {
this.setLayout(new BorderLayout(0, 4));

91
designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java

@ -64,7 +64,6 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
private ItemListener itemListener;
private UIObserverListener uiObserverListener;
private FormulaEditor localFormulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula"));
private boolean needTableDataChange = true;
public TableDataDictPane() {
initBasicComponets();
@ -72,14 +71,6 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
iniListener();
}
/**
* 设置为true后一旦触发TableDataComboBox的itemChange就会通过数据连接更换当前数据字典的列名List
* @param needTableDataChange
*/
public void setNeedTableDataChange(boolean needTableDataChange) {
this.needTableDataChange = needTableDataChange;
}
public static void main(String[] args) {
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
@ -169,58 +160,38 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
if (tableDataWrappe == null) {
return;
}
if (itemListener != null) {
itemListener.itemStateChanged(e);
localFormulaEditor.addChangeListener(event -> itemListener.itemStateChanged(e));
}
if (isNeedTableDataChange()) {
changeColumnsName();
List<String> namelist = tableDataWrappe.calculateColumnNameList();
String[] columnNames = null;
if (!namelist.isEmpty()) {
columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
} else {
columnNames = new String[]{StringUtils.EMPTY};
}
}
private void changeColumnsName() {
TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem();
SwingWorker<List<String>, Object> worker = new SwingWorker<List<String>, Object>() {
@Override
protected List<String> doInBackground() {
if (tableDataWrappe == null) {
return new ArrayList<>();
}
return tableDataWrappe.calculateColumnNameList();
}
// 实际值列名
ColumnNameEditor actualColumnNameEditor = new ColumnNameEditor(columnNames);
actualColumnNameEditor.addItemListener(itemListener);
// 实际值列序号
ColumnIndexEditor actualColumnIndexEditor = new ColumnIndexEditor(columnNames.length);
actualColumnIndexEditor.addItemListener(itemListener);
keyColumnPane.setEditors(new Editor[]{actualColumnNameEditor, actualColumnIndexEditor}, columnNames[0]);
@Override
protected void done() {
try {
List<String> namelist = get();
String[] columnNames = null;
if (!namelist.isEmpty()) {
columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
} else {
columnNames = new String[]{StringUtils.EMPTY};
}
// 实际值列名
ColumnNameEditor actualColumnNameEditor = new ColumnNameEditor(columnNames);
actualColumnNameEditor.addItemListener(itemListener);
// 实际值列序号
ColumnIndexEditor actualColumnIndexEditor = new ColumnIndexEditor(columnNames.length);
actualColumnIndexEditor.addItemListener(itemListener);
keyColumnPane.setEditors(new Editor[]{actualColumnNameEditor, actualColumnIndexEditor}, columnNames[0]);
localFormulaEditor.setEnabled(true);
// 显示值列名
ColumnNameEditor displayColumnNameEditor = new ColumnNameEditor(columnNames);
displayColumnNameEditor.addItemListener(itemListener);
// 显示值列序号
ColumnIndexEditor displayColumnIndexEditor = new ColumnIndexEditor(columnNames.length);
displayColumnIndexEditor.addItemListener(itemListener);
valueDictPane.setEditors(new Editor[]{displayColumnNameEditor, displayColumnIndexEditor, localFormulaEditor}, columnNames[0]);
} catch (InterruptedException | ExecutionException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula"));
formulaEditor.setEnabled(true);
formulaEditor.addChangeListener(ee -> {
if (itemListener != null) {
itemListener.itemStateChanged(e);
}
};
worker.execute();
});
// 显示值列名
ColumnNameEditor displayColumnNameEditor = new ColumnNameEditor(columnNames);
displayColumnNameEditor.addItemListener(itemListener);
// 显示值列序号
ColumnIndexEditor displayColumnIndexEditor = new ColumnIndexEditor(columnNames.length);
displayColumnIndexEditor.addItemListener(itemListener);
valueDictPane.setEditors(new Editor[]{displayColumnNameEditor, displayColumnIndexEditor, formulaEditor}, columnNames[0]);
if (itemListener != null) {
itemListener.itemStateChanged(e);
}
}
@Override
@ -404,8 +375,4 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
public void registerDSChangeListener() {
tableDataNameComboBox.registerGlobalDSChangeListener();
}
public boolean isNeedTableDataChange() {
return needTableDataChange;
}
}

21
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java

@ -13,6 +13,7 @@ import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.pie.style.VanChartPieValueLabelContentPane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
/**
@ -34,6 +35,14 @@ public class VanChartPieValueLabelDetailPane extends VanChartPlotLabelDetailPane
return panel;
}
protected JPanel createBorderAndBackgroundPane() {
JPanel jPanel = new JPanel();
jPanel.setLayout(new BorderLayout(0, 10));
jPanel.add(createLabelBorderPane(), BorderLayout.NORTH);
jPanel.add(createLabelBackgroundPane(), BorderLayout.CENTER);
return jPanel;
}
protected JPanel createLabelBorderPane() {
VanChartBorderWithShapePane borderPane = new VanChartBorderWithShapePane() {
@Override
@ -58,6 +67,18 @@ public class VanChartPieValueLabelDetailPane extends VanChartPlotLabelDetailPane
protected JPanel createLabelBackgroundPane() {
VanChartBackgroundWithOutImagePane backgroundPane = new VanChartBackgroundWithOutImagePane() {
@Override
protected JPanel initContentPanel() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p};
return TableLayout4VanChartHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize);
}
@Override
protected Component[][] getPaneComponents() {
return new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Utils_Background")), typeComboBox},

6
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -23,6 +23,7 @@ import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutI
import com.fr.van.chart.designer.component.border.VanChartBorderWithShapePane;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
@ -242,6 +243,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
if (plot.isSupportLeadLine()) {
tractionLine = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Show_Guideline"));
tractionLinePane = TableLayout4VanChartHelper.createGapTableLayoutPane("", tractionLine);
tractionLinePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
panel.add(tractionLinePane, BorderLayout.SOUTH);
initPositionListener();
} else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) {
@ -350,7 +352,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
}
private void checkPosition() {
tractionLine.setSelected(position.getSelectedItem() == Constants.OUTSIDE);
tractionLine.setSelected(position.getSelectedItem() != null && position.getSelectedItem() == Constants.OUTSIDE);
checkPositionEnabled();
}
@ -364,7 +366,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
}
private void checkPositionEnabled() {
tractionLinePane.setVisible(position.getSelectedItem() == Constants.OUTSIDE);
tractionLinePane.setVisible(position.getSelectedItem() != null && position.getSelectedItem() == Constants.OUTSIDE);
}
protected void checkPane() {

3
designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java

@ -28,8 +28,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override
protected void initComponents() {
super.initComponents();
dictPane = new DictionaryPane(false);
dictPane = new DictionaryPane();
}
@Override

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java

@ -82,7 +82,7 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane {
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Parameter_Panel")), mobileParamEditor},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Param_Style")), mobileParamEditor},
new Component[]{tipLabel, null},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1);

2
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -260,7 +260,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
condition.setEditingComponent(tc);
}
//丢掉icon,修改按钮名称为编辑
condition.setSmallIcon(UIConstants.BLACK_ICON);
condition.setSmallIcon(UIConstants.EMPTY_ICON);
condition.setName(Toolkit.i18nText("Fine-Design_Basic_Edit"));
conditionUIButton = new UIButton(condition);
Component[][] components = new Component[][]{

3
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java

@ -9,6 +9,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.quickeditor.CellQuickEditor;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -48,7 +49,7 @@ public class CellRichTextEditor extends CellQuickEditor {
protected void refreshDetails() {
RichTextCellAction subReportCellAction = new RichTextCellAction(tc);
subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit"));
subReportCellAction.setSmallIcon(UIConstants.BLACK_ICON);
subReportCellAction.setSmallIcon(UIConstants.EMPTY_ICON);
richTextButton.setAction(subReportCellAction);
}

3
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java

@ -9,6 +9,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.quickeditor.CellQuickEditor;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -44,7 +45,7 @@ public class CellSubReportEditor extends CellQuickEditor {
protected void refreshDetails() {
SubReportCellAction subReportCellAction = new SubReportCellAction(tc);
subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit"));
subReportCellAction.setSmallIcon(UIConstants.BLACK_ICON);
subReportCellAction.setSmallIcon(UIConstants.EMPTY_ICON);
subReportButton.setAction(subReportCellAction);
}

Loading…
Cancel
Save