Browse Source

Merge pull request #3268 in DESIGN/design from feature/10.0 to research/10.0

* commit '89ac9e8ff5f42c0fbb4dc8100b6451ee6ce2253a':
  REPORT-44410 加个判断
  REPORT-44410 远程设计数据集点击确认卡顿
  REPORT-44577 添加注释
  REPORT-44577 对于容器型插件创建的组件,在粘贴到空的容器的时候,没有成功粘贴到容器中
  REPORT-44733 代码回退,改动可能会导致其他问题,和产品确认了下,具体逻辑暂时未定,后续再迭代任务里面处理
  CHART-17758 埋点数据保存时按时间排序
  REPORT-46347 jdk11-设计器内图标优化-tab块图标变了 【问题原因】视觉组同学给我导出的tab块图标是另一个,我没检查就给替换了 【改动思路】替换为原来的tab图标样式
  REPORT-46347 jdk11-设计器内图标优化-tab块图标变了 【问题原因】视觉组同学给我导出的tab块图标是另一个,我没检查就给替换了 【改动思路】替换为原来的tab图标样式
  REPORT-42238 JDK11设计器图标模糊问题优化 单独提交到release
  REPORT-42238 【10.0.13】JDK11设计器图标模糊问题优化 单独提交到release
research/10.0
superman 4 years ago
parent
commit
1e37de65b8
  1. 8
      designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java
  2. 5
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java
  3. 19
      designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java
  4. 8
      designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java
  5. 2
      designer-base/src/main/resources/com/fr/design/images/buttonicon/card_layout_16_normal.svg
  6. 14
      designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java
  7. 29
      designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java
  8. 22
      designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java
  9. 2
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

8
designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java

@ -23,4 +23,12 @@ public interface FormWidgetOptionProvider extends ParameterWidgetOptionProvider
*/
<T> void paste2Container(T t);
/**
* 往扩展容器本身中添加粘贴内容
* @param r
* @param <T> 粘贴板选中的组件
* @param <R> 容器布局适配器
*/
<T, R> void formWidgetPaste(T t, R r, int x, int y);
}

5
designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java

@ -30,4 +30,9 @@ public abstract class AbstractFormWidgetOptionProvider extends AbstractProvider
public <T> void paste2Container(T t) {
// do nothing
}
@Override
public <T, R> void formWidgetPaste(T t, R r, int x, int y) {
// do nothing
}
}

19
designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java

@ -19,6 +19,8 @@ import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader;
import com.fr.third.joda.time.DateTime;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
@ -27,7 +29,7 @@ import java.util.Map;
* @version 10.0
* Created by Bjorn on 2020-02-17
*/
public class ChartInfo extends AbstractPointInfo {
public class ChartInfo extends AbstractPointInfo implements Comparable<ChartInfo> {
public static final String XML_TAG = "ChartInfo";
private static final String CHART_CONSUMING_URL = CloudCenter.getInstance().acquireUrlByKind("chartinfo.consuming") + "/single";
private static final String CHART_FUNCTION_URL = CloudCenter.getInstance().acquireUrlByKind("chart.info.function") + "/single";
@ -338,4 +340,19 @@ public class ChartInfo extends AbstractPointInfo {
chartInfo.chartConfigInfo = chartConfigInfo.clone();
return chartInfo;
}
@Override
public int compareTo(ChartInfo chartInfo) {
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
return format.parse(this.getCompareDate()).compareTo(format.parse(chartInfo.getCompareDate()));
} catch (Exception ex) {
return 1;
}
}
private String getCompareDate() {
return StringUtils.isNotEmpty(chartConsumingMap.get(ATTR_CHART_PROPERTY_END_TIME)) ?
chartConsumingMap.get(ATTR_CHART_PROPERTY_END_TIME) : chartConsumingMap.get(ATTR_CHART_TYPE_TIME);
}
}

8
designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java

@ -13,7 +13,10 @@ import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader;
import com.fr.third.joda.time.DateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -269,7 +272,10 @@ public class ChartInfoCollector extends AbstractPointCollector<ChartInfo> {
writer.end();
writer.startTAG(XML_CHART_INFO_LIST);
for (ChartInfo chartInfo : pointInfoMap.values()) {
List<ChartInfo> list = new ArrayList<>(pointInfoMap.values());
Collections.sort(list);
for (ChartInfo chartInfo : list) {
chartInfo.writeXML(writer);
}
writer.end();

2
designer-base/src/main/resources/com/fr/design/images/buttonicon/card_layout_16_normal.svg

@ -2,6 +2,6 @@
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_tab块_normal</title>
<g id="icon_tab块_normal" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M7,1 L7,2 L15,2 L15,15 L1,15 L1,1 L7,1 Z M6,2 L2,2 L2,14 L14,14 L14,7 L6,7 L6,2 Z M12,11 L12,12 L4,12 L4,11 L12,11 Z M12,9 L12,10 L4,10 L4,9 L12,9 Z M10,3 L7,3 L7,6 L10,6 L10,3 Z M14,3 L11,3 L11,6 L14,6 L14,3 Z" id="Combined-Shape" fill="#333334" fill-rule="nonzero"></path>
<path d="M15,2 L15,15 L1,15 L1,1 L7,1 L7,2 L15,2 Z M10,3 L7,3 L7,6 L10,6 L10,3 Z M14,3 L11,3 L11,6 L14,6 L14,3 Z" id="Combined-Shape" fill="#333334" fill-rule="nonzero"></path>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 624 B

After

Width:  |  Height:  |  Size: 517 B

14
designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java

@ -399,8 +399,10 @@ public class SelectionModel {
boolean relativeEditor = selectionXCreator.getClass().equals(XWFitLayout.class);
//选中的参数面板编辑器本身
boolean parameterEditor = selectionXCreator.getClass().equals(XWParameterLayout.class);
// 选中的是扩展容器布局本身
boolean extraEditor = isSelectedExtraEditor(selectionXCreator);
return !(tabEditor || absoluteEditor || absoluteCanvas || relativeEditor || parameterEditor);
return !(tabEditor || absoluteEditor || absoluteCanvas || relativeEditor || parameterEditor || extraEditor);
} else {
return false;
}
@ -410,6 +412,16 @@ public class SelectionModel {
}
}
private boolean isSelectedExtraEditor(XCreator selectionXCreator) {
Set<FormWidgetOptionProvider> set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG);
for (FormWidgetOptionProvider provider : set) {
if (provider.isContainer() && ComparatorUtils.equals(provider.appearanceForWidget(), selectionXCreator.getClass())) {
return true;
}
}
return false;
}
/**
* 是否有组件被选择如果所选组件是最底层容器也视为无选择
*

29
designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java

@ -569,35 +569,6 @@ public class XWAbsoluteLayout extends XLayoutContainer {
}
}
/**
* 重新调整子组件宽度
* @param width 宽度
* @param actualSize 是否按照实际大小计算
*/
@Override
public void recalculateChildWidth(int width, boolean actualSize){
int componentCount = getComponentCount();
for (int i = 0; i < componentCount; i++) {
XCreator creator = (XCreator) getComponent(i);
creator.recalculateChildWidth(width, actualSize);
}
}
/**
* 重新调整子组件高度
* @param height 高度
* @param actualSize 是否按照实际大小计算
*/
@Override
public void recalculateChildHeight(int height, boolean actualSize){
int componentCount = getComponentCount();
for (int i = 0; i < componentCount; i++) {
XCreator creator = (XCreator) getComponent(i);
creator.recalculateChildHeight(height, actualSize);
}
}
/**
* body大小手动调整的时候
* 按照比例调整组件的高度

22
designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.AbstractLayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRTabFitLayoutAdapter;
@ -12,6 +13,7 @@ import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.XWScaleLayout;
import com.fr.design.designer.creator.XWTitleLayout;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
import com.fr.design.fun.FormWidgetOptionProvider;
import com.fr.design.utils.ComponentUtils;
import com.fr.form.main.Form;
import com.fr.form.ui.Widget;
@ -26,6 +28,7 @@ import java.awt.Toolkit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
/**
* 表单选中工具类
@ -46,6 +49,8 @@ public class FormSelectionUtils {
*/
private static final String POSTFIX = "_c";
private static FormWidgetOptionProvider optionProvider;
private FormSelectionUtils() {
}
@ -64,10 +69,27 @@ public class FormSelectionUtils {
//相对布局
relativePaste(designer, clipboard, adapter, x, y);
return;
} else if (isExtraContainer(parent)) {
// 扩展布局
optionProvider.formWidgetPaste(clipboard, adapter, x, y);
return;
}
Toolkit.getDefaultToolkit().beep();
}
private static boolean isExtraContainer(XLayoutContainer parent) {
if (parent != null) {
Set<FormWidgetOptionProvider> set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG);
for (FormWidgetOptionProvider provider : set) {
if (provider.isContainer() && ComparatorUtils.equals(provider.appearanceForWidget(), parent.getClass())) {
optionProvider = provider;
return true;
}
}
}
return false;
}
public static void rebuildSelection(FormDesigner designer) {
ArrayList<XCreator> newSelection = new ArrayList<>();

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

@ -261,7 +261,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
}
//丢掉icon,修改按钮名称为编辑
condition.setSmallIcon(UIConstants.BLACK_ICON);
condition.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"));
condition.setName(Toolkit.i18nText("Fine-Design_Basic_Edit"));
conditionUIButton = new UIButton(condition);
Component[][] components = new Component[][]{
new Component[]{uiLabel, UIComponentUtils.wrapWithBorderLayoutPane(conditionUIButton)}

Loading…
Cancel
Save