Browse Source

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

* commit '8bca9e9dcbafa7f9cf8778ccf94177ef50621af2':
  CHART-20522 切换主题,会导致模板主题-细节定制里,自定义渐变的首个颜色变成白色
  REPORT-59322 【主题切换】国际化配色方案-主题颜色内容截断
  REPORT-58984 服务器数据集兼容共享数据集
  REPORT-58626 新自适应-报表块-旧模板设为横向自适应,切换成新模板后图片背景不见了
  REPORT-59010 漏传
  REPORT-59143 【设计器适配】模版设置为移动端模版也要支持新旧表单切换
  REPORT-59143 【设计器适配】模版设置为移动端模版也要支持新旧表单切换
  REPORT-58252 报表块单元格行列标识去掉后的弥补方案
  REPORT-59143 【设计器适配】模版设置为移动端模版也要支持新旧表单切换
  CHART-20568 [产品验收]设计器预览页面图表组件鬼畜 & CHART-20627 图表块组件,鼠标双击,会出现图形重影
research/11.0
superman 3 years ago
parent
commit
a4dd980f9f
  1. 10
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  2. 5
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java
  3. 9
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  4. 7
      designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
  5. 8
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  6. 7
      designer-form/src/main/java/com/fr/design/fit/NewJForm.java
  7. 21
      designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java
  8. 21
      designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java
  9. 3
      designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java
  10. 10
      designer-realize/src/main/java/com/fr/grid/Grid.java
  11. 50
      designer-realize/src/main/java/com/fr/grid/GridUI.java

10
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -647,10 +647,12 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
public StrategyConfig find() { public StrategyConfig find() {
StrategyConfig strategyConfig = null; StrategyConfig strategyConfig = null;
if (getTableData() != null) { if (getTableData() != null) {
try { strategyConfig = getTableData().getStrategyConfig();
strategyConfig = getTableData().getStrategyConfig() == null ? null : getTableData().getStrategyConfig().clone(); if (strategyConfig == null) {
} catch (CloneNotSupportedException e) { //共享数据集
FineLoggerFactory.getLogger().error(e.getMessage(), e); if (getTableData().isShare()) {
strategyConfig = StrategyConfigHelper.createStrategyConfig(true, false, true);
}
} }
} }

5
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java

@ -237,6 +237,9 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
double[] rowSize = new double[]{p, p, p}; double[] rowSize = new double[]{p, p, p};
double[] columnSize = {p, p}; double[] columnSize = {p, p};
JPanel colorListContainerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
colorListContainerPane.add(colorListPane, BorderLayout.WEST);
JPanel previewLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel previewLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
previewLabelPane.add(LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Color_Scheme_Preview_Label")), BorderLayout.NORTH); previewLabelPane.add(LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Color_Scheme_Preview_Label")), BorderLayout.NORTH);
@ -244,7 +247,7 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
tipLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); tipLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
JPanel content = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{ JPanel content = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{
{LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Color_Scheme_Edit_Label")), colorListPane}, {LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Color_Scheme_Edit_Label")), colorListContainerPane},
{null, tipLabel}, {null, tipLabel},
{previewLabelPane, extendedContainer}, {previewLabelPane, extendedContainer},
}, },

9
designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java

@ -232,7 +232,14 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
Dimension size = getSize(); Dimension size = getSize();
PaddingMargin margin = toData().getMargin(); PaddingMargin margin = toData().getMargin();
designerEditor.paintEditor(g, size, margin); if (!isEditing) {
// CHART-20568 & CHART-20627
// EditingMouseListener#startEditing会将图表的ChartComponent放入FormDesigner, 作为编辑中的ChartComponent来显示,
// 同时这里又在下层绘制了一遍ChartComponent,导致图表进入编辑状态,会出现两个重叠的ChartComponent。
// 考虑到编辑中,FormDesigner中的ChartComponent位于上层,下层的ChartComponent实际上没什么用,所以可以不用绘制
// 下层的ChartComponent
designerEditor.paintEditor(g, size, margin);
}
if (coverPanel != null) { if (coverPanel != null) {
int horizonMargin = margin != null ? margin.getLeft() + margin.getRight() : 0; int horizonMargin = margin != null ? margin.getLeft() + margin.getRight() : 0;

7
designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java

@ -3,6 +3,8 @@
*/ */
package com.fr.design.designer.creator; package com.fr.design.designer.creator;
import com.fr.base.theme.FineColorFlushUtils;
import com.fr.base.theme.FineColorGather;
import com.fr.base.theme.FineColorManager; import com.fr.base.theme.FineColorManager;
import com.fr.base.theme.FormTheme; import com.fr.base.theme.FormTheme;
import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateTheme;
@ -377,8 +379,7 @@ public class XCreatorUtils {
} }
public static void setupTemplateTheme(XCreator container, final FormTheme currentTemplateUsingTheme, TemplateThemeCompatible compatible) { public static void setupTemplateTheme(XCreator container, final FormTheme currentTemplateUsingTheme, TemplateThemeCompatible compatible) {
FineColorManager.traverse(container.toData(), new FineColorManager.FineColorReplaceByTheme(currentTemplateUsingTheme, compatible)); FineColorGather colorGather = new FineColorManager.FineColorReplaceByTheme(currentTemplateUsingTheme, compatible);
Form.traversalWidget(container.toData(), new WidgetGather() { Form.traversalWidget(container.toData(), new WidgetGather() {
@Override @Override
public void dealWith(Widget widget) { public void dealWith(Widget widget) {
@ -391,5 +392,7 @@ public class XCreatorUtils {
return true; return true;
} }
}, TemplateThemeAware.class); }, TemplateThemeAware.class);
FineColorFlushUtils.replaceCacheObject(container.toData(), colorGather);
FineColorManager.traverse(container.toData(), colorGather);
} }
} }

8
designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java

@ -33,7 +33,7 @@ import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor; import java.beans.PropertyDescriptor;
import java.util.Set; import java.util.Set;
public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider , Releasable { public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider, Releasable {
private UILabel imageLable; private UILabel imageLable;
private FormDesigner designer; private FormDesigner designer;
private static BufferedImage DEFAULT_BACKGROUND; private static BufferedImage DEFAULT_BACKGROUND;
@ -269,6 +269,12 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
return toData().getElementCase(); return toData().getElementCase();
} }
@Override
public void doLayout() {
super.doLayout();
this.updateECImage();
}
public String getElementCaseContainerName() { public String getElementCaseContainerName() {
return toData().getWidgetName(); return toData().getWidgetName();
} }

7
designer-form/src/main/java/com/fr/design/fit/NewJForm.java

@ -73,8 +73,6 @@ public class NewJForm extends JForm {
* @date: 2020/9/13 23:23 * @date: 2020/9/13 23:23
*/ */
private void changePaneSize() { private void changePaneSize() {
if (mobileForm())
return;
NewFormMarkAttr newFormMarkAttr = this.getTarget().getAttrMark(NewFormMarkAttr.XML_TAG); NewFormMarkAttr newFormMarkAttr = this.getTarget().getAttrMark(NewFormMarkAttr.XML_TAG);
if (newFormMarkAttr.isNotSetOriginSize()) { if (newFormMarkAttr.isNotSetOriginSize()) {
newFormMarkAttr.setBodyHeight(LayoutTool.getBodyHeight(this)); newFormMarkAttr.setBodyHeight(LayoutTool.getBodyHeight(this));
@ -284,10 +282,7 @@ public class NewJForm extends JForm {
private UIButton[] addAdaptiveSwitchButton(UIButton[] extraButtons) { private UIButton[] addAdaptiveSwitchButton(UIButton[] extraButtons) {
switchAction = new SwitchAction(); switchAction = new SwitchAction();
if (!mobileForm()) { return ArrayUtils.addAll(extraButtons, new UIButton[]{switchAction.getToolBarButton()});
return ArrayUtils.addAll(extraButtons, new UIButton[]{switchAction.getToolBarButton()});
}
return extraButtons;
} }
public boolean isNewJFrom() { public boolean isNewJFrom() {

21
designer-form/src/main/java/com/fr/design/fit/common/TemplateTool.java

@ -45,15 +45,8 @@ public class TemplateTool {
JFormType currentType = JFormType.OLD_TYPE; JFormType currentType = JFormType.OLD_TYPE;
if (AdaptiveSwitchUtil.isSwitchJFromIng()) { if (AdaptiveSwitchUtil.isSwitchJFromIng()) {
currentType = DesignerUIModeConfig.getInstance().newUIMode() ? JFormType.NEW_TYPE : JFormType.OLD_TYPE; currentType = DesignerUIModeConfig.getInstance().newUIMode() ? JFormType.NEW_TYPE : JFormType.OLD_TYPE;
} else { } else if (isNewJForm(jTemplate)) {
if (jTemplate instanceof NewJForm) { currentType = JFormType.NEW_TYPE;
NewJForm newJForm = (NewJForm) jTemplate;
if (newJForm.mobileForm()) {
currentType = JFormType.OLD_TYPE;
} else if (LightTool.containNewFormFlag(newJForm.getTarget()) || newJForm.getTarget().getTemplateID() == null) {
currentType = JFormType.NEW_TYPE;
}
}
} }
//UI转换 //UI转换
currentType.switchUIMode(); currentType.switchUIMode();
@ -64,6 +57,16 @@ public class TemplateTool {
} }
}; };
private static boolean isNewJForm(JTemplate jTemplate) {
if (jTemplate instanceof NewJForm) {
NewJForm newJForm = (NewJForm) jTemplate;
if (LightTool.containNewFormFlag(newJForm.getTarget()) || newJForm.getTarget().getTemplateID() == null) {
return true;
}
}
return false;
}
public static Listener<JTemplate> getSwitchListener() { public static Listener<JTemplate> getSwitchListener() {
return switchListener; return switchListener;
} }

21
designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java

@ -294,7 +294,6 @@ public class FormSelection {
creator.setBackupBound(backupBounds); creator.setBackupBound(backupBounds);
} }
layoutAdapter.fix(creator); layoutAdapter.fix(creator);
resetElementCaseImage(creator);
} }
i++; i++;
} }
@ -322,26 +321,6 @@ public class FormSelection {
return false; return false;
} }
/**
* @Description 重置报表块缩略图
* @param: creator
* @return void
* @Author Henry.Wang
* @Date 2021/5/21 14:59
**/
public void resetElementCaseImage(XCreator creator) {
if (creator instanceof XWTitleLayout) {
XWTitleLayout xwTitleLayout = (XWTitleLayout) creator;
for (int i = 0; i < xwTitleLayout.getComponentCount(); i++) {
Component component = xwTitleLayout.getComponent(i);
if (component instanceof XElementCase) {
XElementCase xElementCase = (XElementCase) component;
xElementCase.updateECImage();
}
}
}
}
/** /**
* 检查下有没有参数面板如果存在处理下参数面板造成的偏移量 * 检查下有没有参数面板如果存在处理下参数面板造成的偏移量
* @param rectangle * @param rectangle

3
designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java

@ -153,10 +153,13 @@ public class FormElementCaseDesigner
Grid grid = this.elementCasePane != null ? this.elementCasePane.getGrid() : null; Grid grid = this.elementCasePane != null ? this.elementCasePane.getGrid() : null;
if (grid != null) { if (grid != null) {
boolean oldTranslucent = grid.isTranslucent(); boolean oldTranslucent = grid.isTranslucent();
boolean oldShowExtraGridLine = grid.isShowExtraGridLine();
// 截缩图图时grid需支持半透明,不能用默认白色填充画布,否则会遮挡组件样式背景 // 截缩图图时grid需支持半透明,不能用默认白色填充画布,否则会遮挡组件样式背景
grid.setTranslucent(true); grid.setTranslucent(true);
grid.setShowExtraGridLine(false);
grid.paint(g2d); grid.paint(g2d);
grid.setTranslucent(oldTranslucent); grid.setTranslucent(oldTranslucent);
grid.setShowExtraGridLine(oldShowExtraGridLine);
} }
} catch (Exception e) { } catch (Exception e) {

10
designer-realize/src/main/java/com/fr/grid/Grid.java

@ -136,6 +136,8 @@ public class Grid extends BaseGridComponent {
// 截取缩略图时需透明(不能用默认白色填充),否则会遮挡组件样式的背景,其余情况的绘制可以用白色等默认颜色填充 // 截取缩略图时需透明(不能用默认白色填充),否则会遮挡组件样式的背景,其余情况的绘制可以用白色等默认颜色填充
private boolean isTranslucent = false; private boolean isTranslucent = false;
// 是否绘制单元格内容区之外的网格线
private boolean showExtraGridLine = true;
public Grid(int resolution) { public Grid(int resolution) {
this.resolution = resolution; this.resolution = resolution;
@ -1469,4 +1471,12 @@ public class Grid extends BaseGridComponent {
public void setTranslucent(boolean translucent) { public void setTranslucent(boolean translucent) {
isTranslucent = translucent; isTranslucent = translucent;
} }
public boolean isShowExtraGridLine() {
return showExtraGridLine;
}
public void setShowExtraGridLine(boolean showExtraGridLine) {
this.showExtraGridLine = showExtraGridLine;
}
} }

50
designer-realize/src/main/java/com/fr/grid/GridUI.java

@ -288,15 +288,25 @@ public class GridUI extends ComponentUI {
} }
} }
} }
GridRange gridRange = GridRange.range(grid.getHorizontalBeginValue(), horizontalEndValue, grid.getVerticalBeginValue(), verticalEndValue) int xBeginIndex = grid.getHorizontalBeginValue();
int xEndIndex = horizontalEndValue;
int yBeginIndex = grid.getVerticalBeginValue();
int yEndIndex = verticalEndValue;
if (!grid.isShowExtraGridLine()) {
xBeginIndex = 0;
xEndIndex = Math.max(0, report.getColumnCount() - 1);
yBeginIndex = 0;
yEndIndex = Math.max(0, report.getRowCount() - 1);
}
GridRange gridRange = GridRange.range(xBeginIndex, xEndIndex, yBeginIndex, yEndIndex)
.rangeList(rowHeightList, columnWidthList) .rangeList(rowHeightList, columnWidthList)
.realSize(realWidth, realHeight); .realSize(realWidth, realHeight);
new DrawVerticalLineHelper(gridRange, grid.isShowGridLine(), new DrawVerticalLineHelper(gridRange, grid.isShowGridLine(), grid.isShowExtraGridLine(),
isShowVerticalPaginateLine, paperPaintHeight, isShowVerticalPaginateLine, paperPaintHeight,
paginateLineList, resolution).iterateStart2End(g2d); paginateLineList, resolution).iterateStart2End(g2d);
new DrawHorizontalLineHelper(gridRange, grid.isShowGridLine(), new DrawHorizontalLineHelper(gridRange, grid.isShowGridLine(), grid.isShowExtraGridLine(),
isShowHorizontalPaginateLine, paperPaintWidth, isShowHorizontalPaginateLine, paperPaintWidth,
paginateLineList, resolution).iterateStart2End(g2d); paginateLineList, resolution).iterateStart2End(g2d);
} }
@ -320,6 +330,7 @@ public class GridUI extends ComponentUI {
protected GridRange gridRange; protected GridRange gridRange;
protected boolean showGridLine; protected boolean showGridLine;
protected boolean showExtraGridLine;
protected boolean showPaginateLine; protected boolean showPaginateLine;
protected double paperPaintSize; protected double paperPaintSize;
@ -332,11 +343,12 @@ public class GridUI extends ComponentUI {
protected static final double THRESHOLD = 1.0E-4D; protected static final double THRESHOLD = 1.0E-4D;
DrawLineHelper(GridRange gridRange, boolean showGridLine, DrawLineHelper(GridRange gridRange, boolean showGridLine, boolean showExtraGridLine,
boolean showPaginateLine, double paperPaintSize, boolean showPaginateLine, double paperPaintSize,
List paginateLineList, int resolution) { List paginateLineList, int resolution) {
this.gridRange = gridRange; this.gridRange = gridRange;
this.showGridLine = showGridLine; this.showGridLine = showGridLine;
this.showExtraGridLine = showExtraGridLine;
this.showPaginateLine = showPaginateLine; this.showPaginateLine = showPaginateLine;
this.paperPaintSize = paperPaintSize; this.paperPaintSize = paperPaintSize;
@ -353,10 +365,10 @@ public class GridUI extends ComponentUI {
private class DrawVerticalLineHelper extends DrawLineHelper { private class DrawVerticalLineHelper extends DrawLineHelper {
DrawVerticalLineHelper(GridRange gridRange, boolean showGridLine, DrawVerticalLineHelper(GridRange gridRange, boolean showGridLine, boolean discardExtraGridLine,
boolean showPaginateLine, double paperPaintSize, boolean showPaginateLine, double paperPaintSize,
List paginateLineList, int resolution) { List paginateLineList, int resolution) {
super(gridRange, showGridLine, showPaginateLine, super(gridRange, showGridLine, discardExtraGridLine, showPaginateLine,
paperPaintSize, paginateLineList, resolution); paperPaintSize, paginateLineList, resolution);
} }
@ -372,7 +384,7 @@ public class GridUI extends ComponentUI {
@Override @Override
protected void iterateStart2End(Graphics2D g2d) { protected void iterateStart2End(Graphics2D g2d) {
float rowHeight, paperYAxisSumSize = 0, yAxisSumSize = 0; float rowHeight, paperYAxisSumSize = 0, maxXAxisSumSize = 0, yAxisSumSize = 0;
for (int i = 0; i <= gridRange.yEndIndex; i++) { for (int i = 0; i <= gridRange.yEndIndex; i++) {
if (i == 0) { if (i == 0) {
i = gridRange.yBeginIndex; i = gridRange.yBeginIndex;
@ -397,6 +409,9 @@ public class GridUI extends ComponentUI {
} }
xAxisSumSize += columnWidth; xAxisSumSize += columnWidth;
} }
if (xAxisSumSize > maxXAxisSumSize) {
maxXAxisSumSize = xAxisSumSize;
}
} }
if (showPaginateLine && paperYAxisSumSize - paperPaintSize > THRESHOLD) { if (showPaginateLine && paperYAxisSumSize - paperPaintSize > THRESHOLD) {
paginateLineList.add(getPaginateLine2D((int) yAxisSumSize)); paginateLineList.add(getPaginateLine2D((int) yAxisSumSize));
@ -406,17 +421,21 @@ public class GridUI extends ComponentUI {
} }
// paint 最后一个横线.. // paint 最后一个横线..
if (showGridLine) { if (showGridLine) {
drawLastLine(g2d, (int) yAxisSumSize); if (showExtraGridLine) {
drawLastLine(g2d, (int) yAxisSumSize);
} else {
GraphHelper.drawLine(g2d, 0, yAxisSumSize, maxXAxisSumSize, yAxisSumSize);
}
} }
} }
} }
private class DrawHorizontalLineHelper extends DrawLineHelper { private class DrawHorizontalLineHelper extends DrawLineHelper {
DrawHorizontalLineHelper(GridRange gridRange, boolean showGridLine, DrawHorizontalLineHelper(GridRange gridRange, boolean showGridLine, boolean discardExtraGridLine,
boolean showPaginateLine, double paperPaintSize, boolean showPaginateLine, double paperPaintSize,
List paginateLineList, int resolution) { List paginateLineList, int resolution) {
super(gridRange, showGridLine, showPaginateLine, super(gridRange, showGridLine, discardExtraGridLine, showPaginateLine,
paperPaintSize, paginateLineList, resolution); paperPaintSize, paginateLineList, resolution);
} }
@ -432,7 +451,7 @@ public class GridUI extends ComponentUI {
@Override @Override
protected void iterateStart2End(Graphics2D g2d) { protected void iterateStart2End(Graphics2D g2d) {
float columnWidth, paperXAxisSumSize = 0, xAxisSumSize = 0; float columnWidth, paperXAxisSumSize = 0, maxYAxisSumSize = 0, xAxisSumSize = 0;
for (int i = 0; i <= gridRange.xEndIndex; i++) { for (int i = 0; i <= gridRange.xEndIndex; i++) {
if (i == 0) { if (i == 0) {
i = gridRange.xBeginIndex; i = gridRange.xBeginIndex;
@ -456,6 +475,9 @@ public class GridUI extends ComponentUI {
} }
yAxisSumSize += rowHeight; yAxisSumSize += rowHeight;
} }
if (yAxisSumSize > maxYAxisSumSize) {
maxYAxisSumSize = yAxisSumSize;
}
} }
if (showPaginateLine && paperXAxisSumSize - paperPaintSize > THRESHOLD) { if (showPaginateLine && paperXAxisSumSize - paperPaintSize > THRESHOLD) {
paginateLineList.add(getPaginateLine2D((int) xAxisSumSize)); paginateLineList.add(getPaginateLine2D((int) xAxisSumSize));
@ -465,7 +487,11 @@ public class GridUI extends ComponentUI {
} }
// paint 最后一个横线.. // paint 最后一个横线..
if (showGridLine) { if (showGridLine) {
drawLastLine(g2d, (int) xAxisSumSize); if (showExtraGridLine) {
drawLastLine(g2d, (int) xAxisSumSize);
} else {
GraphHelper.drawLine(g2d, xAxisSumSize, 0, xAxisSumSize, maxYAxisSumSize);
}
} }
} }
} }

Loading…
Cancel
Save