Browse Source

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

* commit 'e628896a90d5b43b8b88bb0d15ad189483b9e099':
  REPORT-58577【回归测试】map公式合法性检测错误 && REPORT-58124 公式编辑器优化:不支持实时计算的功能提示处理 1.map的参数类型调整; 2.对内置参数不支持提示。
  CHART-20515  渐变风格关闭
  REPORT-58579【回归测试】rank的带参模拟计算值不正确 1.数字类型转换
  REPORT-56134 js提交事件报错中添加定位信息
  REPORT-58124 公式编辑器优化:不支持实时计算的功能提示处理 1.添加ds1.select类型的识别
  REPORT-55048 websocket使用代理的情况处理下
  KERNEL-8776 绝对布局下拖动组件,会生成新的XCreator
  REPORT-58398 【主题切换】新单元格的默认样式确定
  REPORT-58536 【主题切换】新建cpt,增加sheet页,设计器里主题配置的背景只在第一个sheet生效
  REPORT-58403 【主题切换】组件右侧边框标题部分,间距有点大
  REPORT-58411 【FR11二轮回归】主题样式-body右侧设置面板按交互文档预期是提示“背景设置”,现在是“样式设置”
  REPORT-55748 处理下import 问题
  REPORT-58535 【稳定共创】附件模板概率出现2个编辑按钮
  KERNEL-8879 自适应预览下 给报表块增加自适应逻辑接口
research/11.0
superman 3 years ago
parent
commit
ecc9ec3a38
  1. 51
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  2. 5
      designer-base/src/main/java/com/fr/design/formula/UnsupportedFormulaScanner.java
  3. 19
      designer-base/src/main/java/com/fr/design/fun/PcFitProvider.java
  4. 19
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractPcFitProvider.java
  5. 2
      designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java
  6. 11
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java
  7. 8
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java
  8. 45
      designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java
  9. 94
      designer-form/src/main/java/com/fr/design/designer/beans/location/AccessDirection.java
  10. 2
      designer-form/src/main/java/com/fr/design/fit/attrpane/FRAbsoluteBodyLayoutExtendDefinePane.java
  11. 2
      designer-form/src/main/java/com/fr/design/fit/attrpane/FRFitLayoutExtendDefinePane.java
  12. 95
      designer-form/src/main/java/com/fr/design/fit/attrpane/PcFitExpandablePane.java
  13. 18
      designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java
  14. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java
  15. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  16. 5
      designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java
  17. 6
      designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java
  18. 4
      designer-realize/src/main/java/com/fr/design/actions/cell/NewPresentAction.java
  19. 4
      designer-realize/src/main/java/com/fr/design/actions/columnrow/DSColumnBasicAction.java
  20. 6
      designer-realize/src/main/java/com/fr/design/actions/utils/ReportActionUtils.java
  21. 4
      designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnPane.java
  22. 5
      designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java
  23. 4
      designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java
  24. 6
      designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java
  25. 4
      designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java
  26. 9
      designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java
  27. 6
      designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java
  28. 13
      designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java
  29. 5
      designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java
  30. 4
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/AbstractCellAttrPane.java
  31. 4
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java
  32. 4
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  33. 4
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellPresentPane.java
  34. 6
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java
  35. 6
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  36. 4
      designer-realize/src/main/java/com/fr/design/present/CellWriteAttrPane.java
  37. 4
      designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java
  38. 4
      designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java
  39. 6
      designer-realize/src/main/java/com/fr/design/style/BorderUtils.java
  40. 4
      designer-realize/src/main/java/com/fr/design/style/StylePane.java
  41. 84
      designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java
  42. 86
      designer-realize/src/main/java/com/fr/design/widget/WidgetEventPane.java
  43. 6
      designer-realize/src/main/java/com/fr/grid/Grid.java
  44. 6
      designer-realize/src/main/java/com/fr/grid/IntelliElements.java
  45. 7
      designer-realize/src/main/java/com/fr/grid/dnd/ElementCasePaneDropTarget.java
  46. 11
      designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java
  47. 4
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java
  48. 4
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellStringQuickEditor.java
  49. 7
      designer-realize/src/test/java/com.fr/design/mainframe/JFileTest.java

51
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -5,6 +5,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.Parameter;
import com.fr.base.ParameterMapNameSpace;
import com.fr.base.TableDataNameSpace;
import com.fr.base.Utils;
import com.fr.base.io.IOFile;
import com.fr.data.TableDataSource;
import com.fr.design.actions.UpdateAction;
@ -39,6 +40,7 @@ import com.fr.parser.BlockIntervalLiteral;
import com.fr.parser.ColumnRowRangeInPage;
import com.fr.parser.FRLexer;
import com.fr.parser.FRParser;
import com.fr.parser.NumberLiteral;
import com.fr.parser.SheetIntervalLiteral;
import com.fr.report.core.namespace.SimpleCellValueNameSpace;
import com.fr.script.Calculator;
@ -98,7 +100,9 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringReader;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@ -784,9 +788,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
return scanner.getUnSupportFormula();
}
UnsupportedSimulationFormulaHunter unsupportedSimulationFormulaHunter = new UnsupportedSimulationFormulaHunter();
UnsupportedSimulationNodeHunter unsupportedSimulationFormulaHunter = new UnsupportedSimulationNodeHunter();
expression.traversal4Tiny(unsupportedSimulationFormulaHunter);
return unsupportedSimulationFormulaHunter.isSupported() ? null : unsupportedSimulationFormulaHunter.getUnSupportFormula();
return unsupportedSimulationFormulaHunter.isSupported() ? null : unsupportedSimulationFormulaHunter.getUnSupportedNode();
} catch (Exception e) {
FineLoggerFactory.getLogger().error("", e);
}
@ -817,8 +821,24 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
if (entry.getValue().toString().startsWith("[") && entry.getValue().toString().endsWith("]")) {
Expression parse = calculator.parse(entry.getValue());
ArrayExpression arrayExpression = (ArrayExpression) parse.getConditionalExpression();
FArray<Node> fArray = new FArray<>(arrayExpression.getArrays());
Node[] arrays = arrayExpression.getArrays();
List<Object> arrayList = new ArrayList<>();
for (Node array : arrays) {
if (array instanceof NumberLiteral) {
arrayList.add(NumberFormat.getInstance().parse(array.toString()));
} else {
arrayList.add(array);
}
}
FArray<Object> fArray = new FArray<>(arrayList);
parameterMap.put(entry.getKey(), fArray);
} else if (Utils.isNumeric(entry.getValue().toString())) {
try {
Number number = NumberFormat.getInstance().parse(entry.getValue().toString());
parameterMap.put(entry.getKey(), number);
} catch (Exception e) {
FineLoggerFactory.getLogger().warn("", e);
}
}
}
} catch (Exception e) {
@ -838,7 +858,11 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
public void hunter4Tiny(Tiny tiny) {
String statement = tiny.getStatement();
if (StringUtils.isNotBlank(statement) && statement.startsWith(ScriptConstants.DETAIL_TAG)) {
parameterList.add(new Parameter(statement.substring(1)));
if (statement.startsWith(ScriptConstants.SUMMARY_TAG)) {
parameterList.add(new Parameter(statement));
} else {
parameterList.add(new Parameter(statement.substring(1)));
}
} else if (tiny.getClass() == ColumnRowRange.class ||
tiny.getClass() == SheetIntervalLiteral.class || tiny.getClass() == BlockIntervalLiteral.class) {
parameterList.add(new Parameter(tiny.toString()));
@ -846,25 +870,30 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
}
}
private static class UnsupportedSimulationFormulaHunter extends TinyHunter {
private static class UnsupportedSimulationNodeHunter extends TinyHunter {
private boolean supported = true;
private String unSupportFormula;
private String unSupportedNode;
private String[] curReportVariables;
public UnsupportedSimulationNodeHunter() {
curReportVariables = VariableResolver.DEFAULT.resolveCurReportVariables();
}
public boolean isSupported() {
return supported;
}
public String getUnSupportFormula() {
return unSupportFormula;
public String getUnSupportedNode() {
return unSupportedNode;
}
public void hunter4Tiny(Tiny tiny) {
if (tiny.getClass() == ColumnRowRangeInPage.class) {
if (tiny.getClass() == ColumnRowRangeInPage.class || Arrays.asList(curReportVariables).contains(tiny.toString())) {
supported = false;
unSupportFormula = tiny.toString();
unSupportedNode = tiny.toString();
}
}
}

5
designer-base/src/main/java/com/fr/design/formula/UnsupportedFormulaScanner.java

@ -1,6 +1,7 @@
package com.fr.design.formula;
import com.fr.parser.BinaryExpression;
import com.fr.parser.DatasetFunctionCall;
import com.fr.parser.FunctionCall;
import com.fr.stable.script.Node;
@ -35,6 +36,10 @@ public class UnsupportedFormulaScanner {
return false;
}
}
} else if (node instanceof DatasetFunctionCall) {
DatasetFunctionCall datasetFunctionCall = (DatasetFunctionCall) node;
unSupportFormula = datasetFunctionCall.getSourceName() + "." + datasetFunctionCall.getFnName() + "()";
return false;
}
return true;
}

19
designer-base/src/main/java/com/fr/design/fun/PcFitProvider.java

@ -0,0 +1,19 @@
package com.fr.design.fun;
import com.fr.stable.fun.mark.Mutable;
public interface PcFitProvider extends Mutable {
String XML_TAG = "PcFitProvider";
int CURRENT_LEVEL = 1;
//设计器上看到的选项
String getContentDisplayValue();
//返回给前端的值
int getContentDisplayKey();
//设计器上的提示信息
String getContentDisplayTip();
}

19
designer-base/src/main/java/com/fr/design/fun/impl/AbstractPcFitProvider.java

@ -0,0 +1,19 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.PcFitProvider;
import com.fr.stable.fun.mark.API;
@API(level = PcFitProvider.CURRENT_LEVEL)
public abstract class AbstractPcFitProvider implements PcFitProvider {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public String mark4Provider() {
return getClass().getName();
}
}

2
designer-base/src/main/java/com/fr/design/gui/style/ComponentTitleStylePane.java

@ -307,7 +307,7 @@ public class ComponentTitleStylePane extends AbstractBorderPackerPane {
if (component != null) {
container.add(component, BorderLayout.NORTH);
JPanel nextContainer = new JPanel(FRGUIPaneFactory.createBorderLayout());
component.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0));
nextContainer.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0));
container.add(nextContainer, BorderLayout.CENTER);
container = nextContainer;
}

11
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java

@ -3,7 +3,6 @@ package com.fr.design.mainframe.theme.preview;
import com.fr.base.BaseFormula;
import com.fr.base.background.ColorBackground;
import com.fr.base.theme.FormTheme;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Title;
import com.fr.chart.chartdata.NormalChartData;
@ -19,17 +18,19 @@ import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.plugin.chart.type.GradientType;
import com.fr.plugin.chart.type.RadiusType;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import javax.swing.JPanel;
import java.awt.AlphaComposite;
import java.awt.Composite;
import java.awt.Graphics2D;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
/**
@ -124,7 +125,7 @@ public class FormThemePreviewPane extends TemplateThemePreviewPane<FormTheme> {
plot.getConditionCollection().getDefaultAttr().addDataSeriesCondition(defaultAttrLabel);
plot.getLegend().setPosition(Constants.TOP);
plot.setPlotStyle(ChartConstants.STYLE_NONE);
plot.getGradientStyle().setGradientType(GradientType.NONE);
plot.setSeriesOverlapPercent(30);
plot.setCategoryIntervalPercent(30);
@ -178,7 +179,7 @@ public class FormThemePreviewPane extends TemplateThemePreviewPane<FormTheme> {
PiePlot4VanChart plot = chart.getPlot();
plot.getLegend().setPosition(Constants.BOTTOM);
plot.setPlotStyle(ChartConstants.STYLE_NONE);
plot.getGradientStyle().setGradientType(GradientType.NONE);
plot.setInnerRadiusPercent(75);
plot.getRadius().setRadiusType(RadiusType.FIXED);
plot.getRadius().setRadius(80);

8
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java

@ -3,7 +3,6 @@ package com.fr.design.mainframe.theme.preview;
import com.fr.base.BaseFormula;
import com.fr.base.background.ColorBackground;
import com.fr.base.theme.ReportTheme;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Title;
import com.fr.chart.chartdata.NormalChartData;
@ -18,11 +17,12 @@ import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.plugin.chart.type.GradientType;
import com.fr.plugin.chart.vanchart.VanChart;
import java.awt.Graphics2D;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
/**
@ -37,7 +37,7 @@ public class ReportThemePreviewPane extends TemplateThemePreviewPane<ReportTheme
private final ChartPreviewPane chartPreviewPane;
public ReportThemePreviewPane(){
public ReportThemePreviewPane() {
setLayout(FRGUIPaneFactory.createBorderLayout());
chartPreviewPane = new ChartPreviewPane();
chartPreviewPane.populate(initColumnChart());
@ -80,7 +80,7 @@ public class ReportThemePreviewPane extends TemplateThemePreviewPane<ReportTheme
defaultAttrLabel.getAttrLabelDetail().getBackground().setBackground(null);
plot.getConditionCollection().getDefaultAttr().addDataSeriesCondition(defaultAttrLabel);
plot.setPlotStyle(ChartConstants.STYLE_NONE);
plot.getGradientStyle().setGradientType(GradientType.NONE);
plot.setSeriesOverlapPercent(30);
plot.setCategoryIntervalPercent(30);

45
designer-base/src/main/java/com/fr/design/mainframe/theme/utils/DefaultThemedTemplateCellElementCase.java

@ -0,0 +1,45 @@
package com.fr.design.mainframe.theme.utils;
import com.fr.base.NameStyle;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.settings.ThemedCellStyle;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.JTemplate;
import com.fr.report.cell.DefaultTemplateCellElement;
/**
* @author Starryi
* @version 1.0
* Created by Starryi on 2021/8/31
*/
public class DefaultThemedTemplateCellElementCase {
public static DefaultTemplateCellElement createInstance() {
return themingCellElement(new DefaultTemplateCellElement());
}
public static DefaultTemplateCellElement createInstance(int column, int row) {
return themingCellElement(new DefaultTemplateCellElement(column, row));
}
public static DefaultTemplateCellElement createInstance(int column, int row, Object value) {
return themingCellElement(new DefaultTemplateCellElement(column, row, value));
}
public static DefaultTemplateCellElement createInstance(int column, int row, int columnSpan, int rowSpan, Object value) {
return themingCellElement(new DefaultTemplateCellElement(column, row, columnSpan, rowSpan, value));
}
private static DefaultTemplateCellElement themingCellElement(DefaultTemplateCellElement cellElement) {
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template != null) {
TemplateTheme theme = template.getTemplateTheme();
ThemedCellStyle themedCellStyle = theme.getCellStyleList().getDefaultCellStyle4New();
if (themedCellStyle != null) {
NameStyle nameStyle = NameStyle.getPassiveInstance(themedCellStyle.getName(), themedCellStyle.getStyle());
cellElement.setStyle(nameStyle);
}
}
return cellElement;
}
}

94
designer-form/src/main/java/com/fr/design/designer/beans/location/AccessDirection.java

@ -16,6 +16,7 @@ import com.fr.design.utils.ComponentUtils;
import com.fr.env.utils.DesignerInteractionHistory;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.form.ui.container.WBorderLayout;
import java.awt.*;
@ -29,7 +30,7 @@ public abstract class AccessDirection implements Direction {
private int ymin;
private int xmin;
abstract int getCursor();
abstract int getCursor();
protected abstract Rectangle getDraggedBounds(int dx, int dy, Rectangle currentBounds, FormDesigner designer,
Rectangle oldBounds);
@ -56,14 +57,14 @@ public abstract class AccessDirection implements Direction {
x = designer.getRootComponent().getWidth();
}
//参数面板可以无下限拉长
if (y < 0) {
y = 0;
} else if (y > designer.getRootComponent().getHeight() + designer.getParaHeight() && designer.getSelectionModel().hasSelectionComponent()
if (y < 0) {
y = 0;
} else if (y > designer.getRootComponent().getHeight() + designer.getParaHeight() && designer.getSelectionModel().hasSelectionComponent()
&& !designer.getSelectionModel().getSelection().getSelectedCreator().acceptType(XWParameterLayout.class)) {
y = designer.getRootComponent().getHeight() + designer.getParaHeight();
}
return new Point(x, y);
}
y = designer.getRootComponent().getHeight() + designer.getParaHeight();
}
return new Point(x, y);
}
protected void sorptionPoint(Point point, Rectangle currentBounds, FormDesigner designer) {
boolean findInX = currentBounds.getWidth() <= MoveUtils.SORPTION_UNIT;
@ -100,10 +101,10 @@ public abstract class AccessDirection implements Direction {
findInY = true;
}
}
if (findInX && findInY) {
break;
}
}
if (findInX && findInY) {
break;
}
}
setDesignerStateModelProperties(designer, findInX, findInY, currentBounds, point);
@ -129,11 +130,10 @@ public abstract class AccessDirection implements Direction {
}
private WAbsoluteLayout getLayout(final FormDesigner designer){
XLayoutContainer formLayoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(
designer.getTarget().getContainer());
private WAbsoluteLayout getLayout(final FormDesigner designer) {
WAbsoluteLayout layout;
if (formLayoutContainer.acceptType(XWBorderLayout.class)) {//看起来这边的作用应该是为了区别cpt(得到XWParameterLayout)还是frm(得到XWBorderLayout)的参数界面
//看起来这边的作用应该是为了区别cpt(得到XWParameterLayout)还是frm(得到XWBorderLayout)的参数界面
if (designer.getTarget().getContainer().acceptType(WBorderLayout.class)) {
Container container = designer.getSelectionModel().getSelection().getSelectedCreator().getParent();
if (container instanceof XWAbsoluteLayout) {
layout = ((XWAbsoluteLayout) container).toData();
@ -161,49 +161,49 @@ public abstract class AccessDirection implements Direction {
return;
}
//设定控件最小高度21,因每次拖曳至少移动1,防止控件高度等于21时,拖曳导致rec.y的变化使得控件不停的向上或向下移动。
if(rec.height == MINHEIGHT){
if (rec.height == MINHEIGHT) {
ymin = rec.y;
}
if(rec.height == MINHEIGHT - 1){
if (rec.height == MINHEIGHT - 1) {
ymin = ymin == rec.y ? rec.y : rec.y - 1;
}
if(rec.height < MINHEIGHT){
if (rec.height < MINHEIGHT) {
rec.height = MINHEIGHT;
rec.y = ymin;
}
// 增加下宽度也设最小为21
if (rec.width == MINWIDTH) {
xmin = rec.x;
xmin = rec.x;
}
if(rec.width == MINWIDTH - 1){
xmin = xmin == rec.x ? rec.x : rec.x - 1;
if (rec.width == MINWIDTH - 1) {
xmin = xmin == rec.x ? rec.x : rec.x - 1;
}
if (rec.width < MINWIDTH) {
rec.width = MINWIDTH;
rec.x = xmin;
rec.width = MINWIDTH;
rec.x = xmin;
}
}
/**
* 更新鼠标指针形状
* @param formEditor 设计界面组件
*/
public void updateCursor(FormDesigner formEditor) {
/**
* 更新鼠标指针形状
* @param formEditor 设计界面组件
*/
public void updateCursor(FormDesigner formEditor) {
// 调用位置枚举的多态方法getCursor获取鼠标形状
int type = getCursor();
// 调用位置枚举的多态方法getCursor获取鼠标形状
int type = getCursor();
if (type != formEditor.getCursor().getType()) {
// 设置当前形状
formEditor.setCursor(Cursor.getPredefinedCursor(type));
if (type != formEditor.getCursor().getType()) {
// 设置当前形状
formEditor.setCursor(Cursor.getPredefinedCursor(type));
// 显示/改变Tooltip
// 显示/改变Tooltip
showTooltip(formEditor);
}
}
}
}
private void showTooltip(FormDesigner formEditor) {
private void showTooltip(FormDesigner formEditor) {
// 显示拖拽改变组件尺寸相关的提示信息
int cursorType = formEditor.getCursor().getType();
if (Cursor.SW_RESIZE_CURSOR <= cursorType && cursorType <= Cursor.E_RESIZE_CURSOR) {
@ -217,15 +217,15 @@ public abstract class AccessDirection implements Direction {
}
}
public String getTooltip() {
return null;
public String getTooltip() {
return null;
}
/**
* 生成组件备用的bound
* @param formEditor 设计界面组件
*/
public void backupBounds(FormDesigner formEditor) {
formEditor.getSelectionModel().getSelection().backupBounds();
}
/**
* 生成组件备用的bound
* @param formEditor 设计界面组件
*/
public void backupBounds(FormDesigner formEditor) {
formEditor.getSelectionModel().getSelection().backupBounds();
}
}

2
designer-form/src/main/java/com/fr/design/fit/attrpane/FRAbsoluteBodyLayoutExtendDefinePane.java

@ -81,7 +81,7 @@ public class FRAbsoluteBodyLayoutExtendDefinePane extends FRAbsoluteLayoutDefine
public JPanel createAdvancePane() {
JPanel advancedContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
themePane = new FollowingThemePane(Toolkit.i18nText("Fine-Design_Form_Widget_Style_Setting"));
themePane = new FollowingThemePane(Toolkit.i18nText("Fine-Design_Form_Body_Style_Setting"));
stylePane = new LayoutStylePane();
themePane.addFollowThemePane(stylePane, new FollowingThemePane.FollowingThemeActionChangeListener() {
@Override

2
designer-form/src/main/java/com/fr/design/fit/attrpane/FRFitLayoutExtendDefinePane.java

@ -92,7 +92,7 @@ public class FRFitLayoutExtendDefinePane extends AbstractFRLayoutDefinePane<WFit
public JPanel createAdvancePane() {
JPanel contentPane0 = FRGUIPaneFactory.createBorderLayout_S_Pane();
themePane = new FollowingThemePane(Toolkit.i18nText("Fine-Design_Form_Widget_Style_Setting"));
themePane = new FollowingThemePane(Toolkit.i18nText("Fine-Design_Form_Body_Style_Setting"));
stylePane = new LayoutStylePane();
themePane.addFollowThemePane(stylePane, new FollowingThemePane.FollowingThemeActionChangeListener() {
@Override

95
designer-form/src/main/java/com/fr/design/fit/attrpane/PcFitExpandablePane.java

@ -1,9 +1,12 @@
package com.fr.design.fit.attrpane;
import com.finebi.cbb.utils.CompareUtils;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.fit.FitStateCompatible;
import com.fr.design.fun.PcFitProvider;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.DataModify;
@ -17,23 +20,30 @@ import java.awt.Color;
import java.awt.Component;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* Created by kerry on 2020-04-22
*/
public class PcFitExpandablePane extends JPanel {
UIComboBox comboBox = new UIComboBox(
new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Ec_Double_Fit"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Ec_Hor_Fit"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Ec_No_Fit")});
UILabel tipLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Ec_No_Fit_Tip"));
Item[] defaultItems = new Item[]{new Item(Toolkit.i18nText("Fine-Designer_Fit_Ec_Double_Fit"), 2, Toolkit.i18nText("Fine-Designer_Fit_Ec_Double_Fit_Tip")),
new Item(Toolkit.i18nText("Fine-Designer_Fit_Ec_Hor_Fit"), 1, Toolkit.i18nText("Fine-Designer_Fit_Ec_Hor_Fit_Tip")),
new Item(Toolkit.i18nText("Fine-Designer_Fit_Ec_No_Fit"), 3, Toolkit.i18nText("Fine-Designer_Fit_Ec_No_Fit_Tip"))};
UIComboBox comboBox = new UIComboBox();
UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Designer_Fit_Ec_No_Fit_Tip"));
Map<Integer, String> contentDisplayType = new HashMap<>();
Map<String, String> contentDisplayTip = new HashMap<>();
public PcFitExpandablePane(DataModify attrPane) {
init(attrPane);
}
public void init(final DataModify attrPane) {
initComboBox();
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel pcFitPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -42,11 +52,11 @@ public class PcFitExpandablePane extends JPanel {
comboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
tipLabel.setText(ScaleTipType.getScaleTip(comboBox.getSelectedIndex()).getTip());
tipLabel.setText(contentDisplayTip.get(comboBox.getSelectedItem()));
}
});
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Ec_Content_Display_Type")), comboBox},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Designer_Fit_Ec_Content_Display_Type")), comboBox},
new Component[]{tipLabel, null},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_W0);
@ -58,50 +68,61 @@ public class PcFitExpandablePane extends JPanel {
this.add(pcFitPane, BorderLayout.CENTER);
}
private void initComboBox() {
for (Item item : defaultItems) {
comboBox.addItem(item.value);
contentDisplayType.put(item.key, item.value);
contentDisplayTip.put(item.value, item.tip);
}
Set<PcFitProvider> pcFitProviders = ExtraDesignClassManager.getInstance().getArray(PcFitProvider.XML_TAG);
for (PcFitProvider pcFitProvider : pcFitProviders) {
comboBox.addItem(pcFitProvider.getContentDisplayValue());
contentDisplayType.put(pcFitProvider.getContentDisplayKey(), pcFitProvider.getContentDisplayValue());
contentDisplayTip.put(pcFitProvider.getContentDisplayValue(), pcFitProvider.getContentDisplayTip());
}
}
public ReportFitAttr update() {
ReportFitAttr fitAttr = getReportFitAttr();
fitAttr.setFitStateInPC(FitStateCompatible.getOldTypeFromNew(comboBox.getSelectedIndex()));
ReportFitAttr fitAttr = getDefaultReportFitAttr();
String selectType = (String) comboBox.getSelectedItem();
for (Integer key : contentDisplayType.keySet()) {
if (CompareUtils.isEqual(contentDisplayType.get(key), selectType)) {
fitAttr.setFitStateInPC(key);
}
}
return fitAttr;
}
public void populate(ReportFitAttr fitAttr) {
if (fitAttr == null) {
fitAttr = getReportFitAttr();
if (fitAttr == null || !contentDisplayType.keySet().contains(fitAttr.fitStateInPC())) {
fitAttr = getDefaultReportFitAttr();
}
String selectType = contentDisplayType.get(fitAttr.fitStateInPC());
for (int i = 0; i < comboBox.getItemCount(); i++) {
if (CompareUtils.isEqual(selectType, comboBox.getItemAt(i))) {
comboBox.setSelectedIndex(i);
tipLabel.setText(contentDisplayTip.get(selectType));
}
}
int selectIndex = FitStateCompatible.getNewTypeFromOld(fitAttr.fitStateInPC());
comboBox.setSelectedIndex(selectIndex);
tipLabel.setText(ScaleTipType.getScaleTip(selectIndex).getTip());
}
private ReportFitAttr getReportFitAttr() {
private ReportFitAttr getDefaultReportFitAttr() {
ReportFitAttr fitAttr = new ReportFitAttr();
fitAttr.setFitStateInPC(FitAttrState.NOT_FIT.getState());
return fitAttr;
}
private enum ScaleTipType {
EC_DOUBLE_FIT(0, com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Ec_Double_Fit_Tip")),
EC_HOR_FIT(1, com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Ec_Hor_Fit_Tip")),
EC_NO_FIT(2, com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Ec_No_Fit_Tip"));
private int index;
private String tip;
class Item {
public String value;
public int key;
public String tip;
ScaleTipType(int index, String tip) {
this.index = index;
Item(String value, int key, String tip) {
this.value = value;
this.key = key;
this.tip = tip;
}
public String getTip() {
return tip;
}
public static ScaleTipType getScaleTip(int selectIndex) {
for (ScaleTipType tipType : values()) {
if (selectIndex == tipType.index) {
return tipType;
}
}
return EC_NO_FIT;
}
}
}

18
designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java

@ -34,6 +34,7 @@ import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.general.ComparatorUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import javax.swing.BorderFactory;
@ -645,16 +646,15 @@ public class EditingMouseListener extends MouseInputAdapter {
selectionModel.selectACreatorAtMouseEvent(e);
refreshTopXCreator();
XCreator[] xCreators = selectionModel.getSelection().getSelectedCreators();
// 放到事件队尾执行
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
for (XCreator xCreator : xCreators) {
xCreator.setSelected(!e.isShiftDown() && !e.isControlDown());
if (ArrayUtils.getLength(xCreators) == 1) {
// 放到事件队尾执行
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
xCreators[0].setSelected(!e.isShiftDown() && !e.isControlDown());
}
}
});
});
}
} else if (clickedNonCardButton && uneditedTab && responseTabLayout(oldCreator, e)) {
// do nothing
} else {

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java

@ -83,7 +83,7 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
public JPanel createAdvancePane() {
JPanel advancedContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
themePane = new FollowingThemePane(Toolkit.i18nText("Fine-Design_Form_Widget_Style_Setting"));
themePane = new FollowingThemePane(Toolkit.i18nText("Fine-Design_Form_Body_Style_Setting"));
stylePane = new LayoutStylePane();
themePane.addFollowThemePane(stylePane, new FollowingThemePane.FollowingThemeActionChangeListener() {
@Override

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

@ -88,7 +88,7 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
public JPanel createAdvancePane() {
JPanel contentPane0 = FRGUIPaneFactory.createBorderLayout_S_Pane();
themePane = new FollowingThemePane(Toolkit.i18nText("Fine-Design_Form_Widget_Style_Setting"));
themePane = new FollowingThemePane(Toolkit.i18nText("Fine-Design_Form_Body_Style_Setting"));
stylePane = new LayoutStylePane();
themePane.addFollowThemePane(stylePane, new FollowingThemePane.FollowingThemeActionChangeListener() {
@Override

5
designer-form/src/test/java/com/fr/design/mainframe/template/info/JFormProcessInfoTest.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe.template.info;
import com.fr.base.background.ColorBackground;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.form.main.Form;
import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.ChartEditor;
@ -41,11 +42,11 @@ public class JFormProcessInfoTest {
boolean result = Reflect.on(jFormProcessInfo).call("hasTestECReport").get();
Assert.assertTrue(result);
elementCase.addCellElement(new DefaultTemplateCellElement());
elementCase.addCellElement(DefaultThemedTemplateCellElementCase.createInstance());
result = Reflect.on(jFormProcessInfo).call("hasTestECReport").get();
Assert.assertTrue(result);
DefaultTemplateCellElement templateCellElement = new DefaultTemplateCellElement();
DefaultTemplateCellElement templateCellElement = DefaultThemedTemplateCellElementCase.createInstance();
templateCellElement.setValue(123);
elementCase.addCellElement(templateCellElement);

6
designer-realize/src/main/java/com/fr/design/actions/cell/AbstractCellElementAction.java

@ -6,9 +6,9 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.grid.GridUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.core.SheetUtils;
import com.fr.report.elementcase.TemplateElementCase;
@ -35,7 +35,7 @@ public abstract class AbstractCellElementAction extends CellSelectionAction {
final TemplateElementCase tplEC = ePane.getEditingElementCase();
TemplateCellElement editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
editCellElement = DefaultThemedTemplateCellElementCase.createInstance(cs.getColumn(), cs.getRow());
tplEC.addCellElement(editCellElement);
}
SheetUtils.calculateDefaultParent(tplEC);
@ -52,7 +52,7 @@ public abstract class AbstractCellElementAction extends CellSelectionAction {
int row = j + finalCS.getRow();
TemplateCellElement editCellElement = tplEC.getTemplateCellElement(column, row);
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(column, row);
editCellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
tplEC.addCellElement(editCellElement);
}
// alex:不加这一句话会导致跨行跨列的格子被多次update

4
designer-realize/src/main/java/com/fr/design/actions/cell/NewPresentAction.java

@ -4,12 +4,12 @@ import com.fr.base.present.Present;
import com.fr.design.actions.PresentCheckBoxAction;
import com.fr.design.mainframe.CellElementPropertyPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.StableUtils;
@ -46,7 +46,7 @@ public class NewPresentAction extends PresentCheckBoxAction {
int row = j + cellRectangle.y;
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row);
cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
elementCase.addCellElement(cellElement);
} else if (cellElement.getPresent() != null) {
cellElement.setPresent(null);

4
designer-realize/src/main/java/com/fr/design/actions/columnrow/DSColumnBasicAction.java

@ -9,8 +9,8 @@ import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.grid.selection.CellSelection;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.core.SheetUtils;
import com.fr.report.elementcase.TemplateElementCase;
@ -61,7 +61,7 @@ public class DSColumnBasicAction extends CellSelectionAction {
editCellElement = report.getTemplateCellElement(column, row);
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(column, row);
editCellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
report.addCellElement(editCellElement);
}
// update cell attributes

6
designer-realize/src/main/java/com/fr/design/actions/utils/ReportActionUtils.java

@ -4,12 +4,12 @@ import com.fr.base.Style;
import com.fr.design.actions.cell.style.StyleActionInterface;
import com.fr.design.mainframe.DesignOperationEvent;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.event.EventDispatcher;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.FloatElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.ElementCase;
@ -42,7 +42,7 @@ public class ReportActionUtils {
TemplateElementCase report = reportPane.getEditingElementCase();
TemplateCellElement editCellElement = report.getTemplateCellElement(((CellSelection) sel).getColumn(), ((CellSelection) sel).getRow());
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(((CellSelection) sel).getColumn(), ((CellSelection) sel).getRow());
editCellElement = DefaultThemedTemplateCellElementCase.createInstance(((CellSelection) sel).getColumn(), ((CellSelection) sel).getRow());
report.addCellElement(editCellElement);
}
@ -75,7 +75,7 @@ public class ReportActionUtils {
TemplateCellElement editCellElement = report.getTemplateCellElement(column, row);
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(column, row);
editCellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
report.addCellElement(editCellElement);
} else {
// 对于合并的格子,我们不多次计算的Style.

4
designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnPane.java

@ -5,9 +5,9 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.log.FineLoggerFactory;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import javax.swing.JPanel;
@ -127,7 +127,7 @@ public class DSColumnPane extends BasicPane {
if (tds == null || cellElement == null) {
// _denny: 我不认为这种情况应该出现,以防万一
this.cellElement = new DefaultTemplateCellElement();
this.cellElement = DefaultThemedTemplateCellElementCase.createInstance();
return;
}
// _denny: 这边需要克隆一下,因为在设置时,可能改变字段cellElement,但改变真实值是不被期望的

5
designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java

@ -189,7 +189,10 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
@Override
public Listener updateBean() {
String actionLocaleName = ReportEngineEventMapping.getLocaleName(listener.getEventName());
javaScriptActionPane.setResourceInfo(new JavaScriptResourceInfo(JavaScriptResourceInfo.Type.WEB_CONFIG, Toolkit.i18nText(actionLocaleName)));
JavaScriptResourceInfo.PathNode pathNode = JavaScriptResourceInfo.PathNode.create(JavaScriptResourceInfo.Type.WEB_CONFIG, Toolkit.i18nText(actionLocaleName));
JavaScriptResourceInfo javaScriptResourceInfo = new JavaScriptResourceInfo().addFirstPathNode(pathNode);
javaScriptActionPane.setResourceInfo(javaScriptResourceInfo);
this.listener.setEventName(this.nameText.getText());
FurtherBasicBeanPane<? extends JavaScript> pane = this.cards.get(this.styleBox.getSelectedIndex());
this.listener.setAction(pane.updateBean());

4
designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java

@ -15,6 +15,7 @@ import com.fr.design.gui.frpane.UITitlePanel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itabpane.TitleChangeListener;
import com.fr.design.mainframe.cell.CellElementEditPane;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.general.GeneralContext;
import com.fr.grid.selection.CellSelection;
@ -25,7 +26,6 @@ import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.Elem;
import com.fr.report.elementcase.TemplateElementCase;
@ -138,7 +138,7 @@ public class CellElementPropertyPane extends DockingView {
}
if (element == null) {
element = new DefaultTemplateCellElement(0, 0);
element = DefaultThemedTemplateCellElementCase.createInstance(0, 0);
}
return element;
}

6
designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe;
import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.dialog.BasicPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.widget.WidgetPane;
import com.fr.form.ui.NoneWidget;
import com.fr.form.ui.Widget;
@ -11,7 +12,6 @@ import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory;
import com.fr.privilege.finegrain.WidgetPrivilegeControl;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
@ -59,7 +59,7 @@ public class CellWidgetPropertyPane extends BasicPane {
public void populate(TemplateCellElement cellElement) {
if (cellElement == null) {// 利用默认的CellElement.
cellElement = new DefaultTemplateCellElement(0, 0, null);
cellElement = DefaultThemedTemplateCellElementCase.createInstance(0, 0, null);
}
Widget cellWidget = cellElement.getWidget();
@ -88,7 +88,7 @@ public class CellWidgetPropertyPane extends BasicPane {
final TemplateElementCase tplEC = ePane.getEditingElementCase();
TemplateCellElement editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
editCellElement = DefaultThemedTemplateCellElementCase.createInstance(cs.getColumn(), cs.getRow());
}
this.cellElement = editCellElement;
this.populate(editCellElement);

4
designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java

@ -72,6 +72,7 @@ import com.fr.design.fun.ElementUIProvider;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UIPopupMenu;
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.MenuDef;
import com.fr.design.menu.NameSeparator;
@ -96,7 +97,6 @@ import com.fr.page.PageAttributeGetter;
import com.fr.page.ReportPageAttrProvider;
import com.fr.poly.creator.PolyElementCasePane;
import com.fr.report.ReportHelper;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.FloatElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.core.RichText;
@ -569,7 +569,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
int row = j + cellRectangle.y;
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row);
cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
elementCase.addCellElement(cellElement);
}
Style style = cellElement.getStyle();

9
designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java

@ -11,6 +11,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.mainframe.toolbar.AuthorityEditToolBarComponent;
import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
@ -291,7 +292,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
int row = j + cellRectangle.y;
TemplateCellElement editCellElement = elementCase.getTemplateCellElement(column, row);
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(column, row);
editCellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
elementCase.addCellElement(editCellElement);
} else {
// 对于合并的格子,我们不多次计算的权限.
@ -371,7 +372,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
Rectangle cellRectangle = cellSelection.getCellRectangle(0);
DefaultTemplateCellElement cellElement = (DefaultTemplateCellElement) elementCase.getCellElement(cellRectangle.x, cellRectangle.y);
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(cellRectangle.x, cellRectangle.y);
cellElement = DefaultThemedTemplateCellElementCase.createInstance(cellRectangle.x, cellRectangle.y);
}
boolean firstCellDoneaAuthority = cellElement.isDoneAuthority(
ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName());
@ -507,7 +508,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
int row = j + cellRectangle.y;
DefaultTemplateCellElement cellElement = (DefaultTemplateCellElement) elementCase.getCellElement(column, row);
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(cellSelection.getColumn(), cellSelection.getRow());
cellElement = DefaultThemedTemplateCellElementCase.createInstance(cellSelection.getColumn(), cellSelection.getRow());
}
if (cellElement.getCellWidgetAttr() == null) {
isAllHasWidget = false;
@ -562,7 +563,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
final TemplateElementCase elementCase = elementCasePane.getEditingElementCase();
DefaultTemplateCellElement cellElement = (DefaultTemplateCellElement) elementCase.getCellElement(cellSelection.getColumn(), cellSelection.getRow());
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(cellSelection.getColumn(), cellSelection.getRow());
cellElement = DefaultThemedTemplateCellElementCase.createInstance(cellSelection.getColumn(), cellSelection.getRow());
}
//单元格带控件
if (cellElement.getCellWidgetAttr() != null) {

6
designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java

@ -4,9 +4,9 @@ import com.fr.base.Style;
import com.fr.design.actions.ElementCaseAction;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
@ -129,7 +129,7 @@ public class FormatBrushAction extends ElementCaseAction {
int row = j + cs.getRow();
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row);
cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
elementCase.addCellElement(cellElement);
}
cellElement.setStyle(referencedStyle[i % columnSpan][j % rowSpan]);
@ -152,7 +152,7 @@ public class FormatBrushAction extends ElementCaseAction {
int row = j + cellRectangle.y;
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row);
cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
elementCase.addCellElement(cellElement);
}
Style style = cellElement.getStyle();

13
designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java

@ -26,6 +26,9 @@ import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.base.svg.IconUtils;
import com.fr.base.theme.ReportTheme;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.TemplateThemeCompatible;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.actions.UpdateAction;
import com.fr.design.constants.UIConstants;
@ -807,7 +810,15 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
scrollIndex++;
}
reportComposite.getEditingWorkBook().addReport(insertPos, newTemplateReport());
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
TemplateTheme theme = template.getTemplateTheme();
TemplateReport templateReport = newTemplateReport();
if (theme instanceof ReportTheme) {
templateReport.onTemplateUsingThemeChange((ReportTheme) theme, TemplateThemeCompatible.NONE);
}
reportComposite.getEditingWorkBook().addReport(insertPos, templateReport);
setSelectedIndex(insertPos);
// sheet名字的公式也需要做相应的变化.

5
designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java

@ -8,13 +8,12 @@ import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.itabpane.TitleChangeListener;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.cell.settingpane.*;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.utils.DesignUtils;
import com.fr.general.ComparatorUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
@ -112,7 +111,7 @@ public class CellElementEditPane extends BasicPane {
CellElement cellElement = elementCase.getCellElement(cs.getColumn(), cs.getRow());
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
cellElement = DefaultThemedTemplateCellElementCase.createInstance(cs.getColumn(), cs.getRow());
//默认选中的是A1单元格,所以若是A1单元格没有加到列表时要加上,否则在聚合报表时会出错
if (cs.isSelectedOneCell(elementCasePane) && (cs.getColumn() + cs.getRow() == 0)) {
elementCase.addCellElement((TemplateCellElement) cellElement);

4
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/AbstractCellAttrPane.java

@ -2,9 +2,9 @@ package com.fr.design.mainframe.cell.settingpane;
import com.fr.design.mainframe.AbstractAttrPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
@ -52,7 +52,7 @@ public abstract class AbstractCellAttrPane extends AbstractAttrPane {
TemplateElementCase elementCase = elementCasePane.getEditingElementCase();
TemplateCellElement cellElement = elementCase.getTemplateCellElement(cs.getColumn(), cs.getRow());
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
cellElement = DefaultThemedTemplateCellElementCase.createInstance(cs.getColumn(), cs.getRow());
}
this.cellElement = cellElement;
elementCase.addCellElement(this.cellElement);

4
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java

@ -12,9 +12,9 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.report.elementcase.TemplateElementCase;
@ -239,7 +239,7 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
int row = j + cellRectangle.y;
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row);
cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
elementCase.addCellElement(cellElement);
}
updateBean(cellElement);

4
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java

@ -17,10 +17,10 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellGUIAttr;
import com.fr.report.cell.cellattr.CellInsertPolicyAttr;
@ -570,7 +570,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
int row = j + cellRectangle.y;
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row);
cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
elementCase.addCellElement(cellElement);
}
updateBean(cellElement);

4
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellPresentPane.java

@ -2,9 +2,9 @@ package com.fr.design.mainframe.cell.settingpane;
import com.fr.base.present.Present;
import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.present.PresentPane;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
@ -67,7 +67,7 @@ public class CellPresentPane extends AbstractCellAttrPane {
int row = j + cellRectangle.y;
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row);
cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
elementCase.addCellElement(cellElement);
}
cellElement.setPresent(present);

6
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java

@ -4,10 +4,10 @@ import com.fr.base.Style;
import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.cell.settingpane.style.StylePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.style.BorderUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
@ -82,7 +82,7 @@ public class CellStylePane extends AbstractCellAttrPane {
int row = j + cellRectangle.y;
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row);
cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
elementCase.addCellElement(cellElement);
}
cellElement.setStyle(s);
@ -100,7 +100,7 @@ public class CellStylePane extends AbstractCellAttrPane {
int row = j + cellRectangle.y;
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row);
cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
elementCase.addCellElement(cellElement);
}
Style style = cellElement.getStyle();

6
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -156,11 +156,15 @@ public class DesignerSocketIO {
private static String[] getSocketUri() throws IOException {
Workspace current = WorkContext.getCurrent();
URL url = new URL(current.getPath());
Integer[] ports = current.get(SocketInfoOperator.class).getPort();
Integer[] ports = WebSocketConfig.getInstance().getAvailablePorts();
WorkspaceConnection connection = current.getConnection();
// 服务器配置https webSocket可能是wss也可能是ws webSocket的协议可以单独配置
WebSocketProtocol webSocketProtocol = WebSocketConfig.getInstance().getProtocol();
currentProtocol = webSocketProtocol == WebSocketProtocol.PLAIN ? HTTP : HTTPS;
if (WebSocketConfig.getInstance().isUsingProxy()) {
// 如果配置了代理服务器跟随服务器协议
currentProtocol = url.getProtocol();
}
String[] result = new String[ports.length];
for (int i = 0; i < ports.length; i++) {
result[i] = String.format("%s://%s:%s%s?%s=%s&%s=%s",

4
designer-realize/src/main/java/com/fr/design/present/CellWriteAttrPane.java

@ -6,6 +6,7 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.widget.WidgetPane;
import com.fr.form.ui.NoneWidget;
import com.fr.form.ui.Widget;
@ -13,7 +14,6 @@ import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory;
import com.fr.privilege.finegrain.WidgetPrivilegeControl;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
@ -67,7 +67,7 @@ public class CellWriteAttrPane extends BasicPane {
public void populate(TemplateCellElement cellElement) {
if (cellElement == null) {// 利用默认的CellElement.
cellElement = new DefaultTemplateCellElement(0, 0, null);
cellElement = DefaultThemedTemplateCellElementCase.createInstance(0, 0, null);
}
Widget cellWidget = cellElement.getWidget();

4
designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java

@ -7,12 +7,12 @@ import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.general.NameObject;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.highlight.DefaultHighlight;
import com.fr.report.cell.cellattr.highlight.Highlight;
@ -82,7 +82,7 @@ public class ConditionAttributesGroupPane extends UIListControlPane {
final TemplateElementCase tplEC = ePane.getEditingElementCase();
editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
editCellElement = DefaultThemedTemplateCellElementCase.createInstance(cs.getColumn(), cs.getRow());
}
SheetUtils.calculateDefaultParent(tplEC); // 不知道这行代码的作用,怕去掉之后会出问题,先放在这里

4
designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java

@ -20,6 +20,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.cell.settingpane.style.ThemedCellStyleListPane;
import com.fr.design.mainframe.theme.ui.NoEdgeTitleBorder;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.style.AlignmentPane;
import com.fr.design.style.BorderPane;
import com.fr.design.style.BorderUtils;
@ -33,7 +34,6 @@ import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.solution.sandbox.collection.PluginSandboxCollections;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.FloatElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.ElementCase;
@ -282,7 +282,7 @@ public class ReportStylePane extends BasicPane {
editCellElement = report.getTemplateCellElement(column, row);
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(column, row);
editCellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
report.addCellElement(editCellElement);
}

6
designer-realize/src/main/java/com/fr/design/style/BorderUtils.java

@ -9,12 +9,12 @@ import java.util.List;
import com.fr.base.CellBorderStyle;
import com.fr.base.Style;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.general.ComparatorUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.FloatElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.ElementCase;
@ -433,7 +433,7 @@ public abstract class BorderUtils {
for (int j = row; j < row + rowSpan; j++) {
TemplateCellElement tmpCellElement = report.getTemplateCellElement(i, j);
if (tmpCellElement == null) {
tmpCellElement = new DefaultTemplateCellElement(i, j);
tmpCellElement = DefaultThemedTemplateCellElementCase.createInstance(i, j);
report.addCellElement(tmpCellElement);
}
Style style = tmpCellElement.getStyle();
@ -516,7 +516,7 @@ public abstract class BorderUtils {
for (int j = row; j < row + rowSpan; j++) {
TemplateCellElement tmpCellElement = report.getTemplateCellElement(i, j);
if (tmpCellElement == null) {
tmpCellElement = new DefaultTemplateCellElement(i, j);
tmpCellElement = DefaultThemedTemplateCellElementCase.createInstance(i, j);
report.addCellElement(tmpCellElement);
}
Style style = tmpCellElement.getStyle();

4
designer-realize/src/main/java/com/fr/design/style/StylePane.java

@ -16,6 +16,7 @@ import com.fr.design.fun.StyleUIConfigProvider;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.style.background.BackgroundPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.grid.selection.CellSelection;
@ -24,7 +25,6 @@ import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.solution.sandbox.collection.PluginSandboxCollections;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.FloatElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.ElementCase;
@ -322,7 +322,7 @@ public class StylePane extends BasicBeanPane<Style> implements ChangeListener {
editCellElement = report.getTemplateCellElement(column, row);
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(column, row);
editCellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
report.addCellElement(editCellElement);
}

84
designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java

@ -519,7 +519,10 @@ public class EditToolBar extends BasicPane {
if (javaScriptPane == null || ((CustomToolBarButton) widget).getJSImpl() == null) {
javaScriptPane = JavaScriptActionPane.createDefault();
}
javaScriptPane.setResourceInfo(new JavaScriptResourceInfo(JavaScriptResourceInfo.Type.WIDGET, ((Button) widget).getText()));
JavaScriptResourceInfo.PathNode pathNode = JavaScriptResourceInfo.PathNode.create(JavaScriptResourceInfo.Type.WIDGET, ((Button) widget).getText());
JavaScriptResourceInfo javaScriptResourceInfo = new JavaScriptResourceInfo().addFirstPathNode(pathNode);
javaScriptPane.setResourceInfo(javaScriptResourceInfo);
javaScriptPane.setPreferredSize(new Dimension(750, 500));
BasicDialog dialog = javaScriptPane.showWindow(SwingUtilities.getWindowAncestor(ButtonPane.this));
@ -539,27 +542,28 @@ public class EditToolBar extends BasicPane {
}
};
/**
* 更新
* @param widget 对应组件
*/
public void populate(Widget widget) {
this.widget = widget;
card.show(centerPane, "none");
if (widget instanceof Button) {
populateDefault();
}
if (widget instanceof Export) {
populateExport();
} else if (widget instanceof AppendColumnRow) {
populateAppendColumnRow();
} else if (widget instanceof Submit) {
populateSubmit();
} else if (widget instanceof CustomToolBarButton) {
populateCustomToolBarButton();
} else if (widget instanceof Email) {
populateEmail();
}
/**
* 更新
*
* @param widget 对应组件
*/
public void populate(Widget widget) {
this.widget = widget;
card.show(centerPane, "none");
if (widget instanceof Button) {
populateDefault();
}
if (widget instanceof Export) {
populateExport();
} else if (widget instanceof AppendColumnRow) {
populateAppendColumnRow();
} else if (widget instanceof Submit) {
populateSubmit();
} else if (widget instanceof CustomToolBarButton) {
populateCustomToolBarButton();
} else if (widget instanceof Email) {
populateEmail();
}
Set<ExtraButtonToolBarProvider> extraButtonSet = ExtraDesignClassManager.getInstance().getArray(ExtraButtonToolBarProvider.XML_TAG);
for (ExtraButtonToolBarProvider provider : extraButtonSet) {
@ -572,21 +576,22 @@ public class EditToolBar extends BasicPane {
count.setValue(((AppendColumnRow) widget).getCount());
}
private void populateExport(){
card.show(centerPane, "export");
Export export = (Export) widget;
this.pdf.setSelected(export.isPdfAvailable());
this.excelP.setSelected(export.isExcelPAvailable());
this.excelO.setSelected(export.isExcelOAvailable());
this.excelS.setSelected(export.isExcelSAvailable());
this.word.setSelected(export.isWordAvailable());
this.image.setSelected(export.isImageAvailable());
if(exportToolBarProviders != null){
for(int i=0; i<exportToolBarProviders.length; i++){
exportToolBarProviders[i].populate();;
}
}
}
private void populateExport() {
card.show(centerPane, "export");
Export export = (Export) widget;
this.pdf.setSelected(export.isPdfAvailable());
this.excelP.setSelected(export.isExcelPAvailable());
this.excelO.setSelected(export.isExcelOAvailable());
this.excelS.setSelected(export.isExcelSAvailable());
this.word.setSelected(export.isWordAvailable());
this.image.setSelected(export.isImageAvailable());
if (exportToolBarProviders != null) {
for (int i = 0; i < exportToolBarProviders.length; i++) {
exportToolBarProviders[i].populate();
;
}
}
}
private void populateEmail() {
card.show(centerPane, EMAIL);
@ -694,7 +699,10 @@ public class EditToolBar extends BasicPane {
if (customToolBarButton.getJSImpl() == null) {
this.javaScriptPane = JavaScriptActionPane.createDefault();
}
javaScriptPane.setResourceInfo(new JavaScriptResourceInfo(JavaScriptResourceInfo.Type.CUSTOM_BUTTON, ((Button) widget).getText()));
JavaScriptResourceInfo.PathNode pathNode = JavaScriptResourceInfo.PathNode.create(JavaScriptResourceInfo.Type.CUSTOM_BUTTON, ((Button) widget).getText());
JavaScriptResourceInfo javaScriptResourceInfo = new JavaScriptResourceInfo().addFirstPathNode(pathNode);
javaScriptPane.setResourceInfo(javaScriptResourceInfo);
customToolBarButton.setJSImpl(this.javaScriptPane.updateBean());
}

86
designer-realize/src/main/java/com/fr/design/widget/WidgetEventPane.java

@ -55,29 +55,31 @@ public class WidgetEventPane extends UIListGroupControlPane {
public NameableCreator[] createNameableCreators() {
return new NameableCreator[]{
new EventCreator(Widget.EVENT_STATECHANGE, WidgetEventListenerUpdatePane.class)
};
};
}
@Override
public void saveSettings() {
@Override
public void saveSettings() {
CellWidgetPropertyPane.getInstance().update(selection);
}
@Override
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event");
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event");
}
public static class WidgetEventListenerUpdatePane extends ListenerUpdatePane {
private ElementCasePane epane;
private ElementCasePane epane;
// 反射会用到
public WidgetEventListenerUpdatePane() {
this(null);
}
public WidgetEventListenerUpdatePane(ElementCasePane epane){
this.epane = epane;
super.initComponents();
}
public WidgetEventListenerUpdatePane(ElementCasePane epane) {
this.epane = epane;
super.initComponents();
}
/**
* 根据有无单元格创建 DBManipulationPane
@ -88,41 +90,41 @@ public class WidgetEventPane extends UIListGroupControlPane {
return jTemplate.createDBManipulationPaneInWidget();
}
@Override
protected JavaScriptActionPane createJavaScriptActionPane() {
return new JavaScriptActionPane() {
@Override
protected JavaScriptActionPane createJavaScriptActionPane() {
return new JavaScriptActionPane() {
@Override
protected DBManipulationPane createDBManipulationPane() {
if(epane == null && DesignerContext.getDesignerFrame().getSelectedJTemplate() != null) {
return autoCreateDBManipulationInWidgetEventPane();
}
@Override
protected DBManipulationPane createDBManipulationPane() {
if (epane == null && DesignerContext.getDesignerFrame().getSelectedJTemplate() != null) {
return autoCreateDBManipulationInWidgetEventPane();
}
return new SmartInsertDBManipulationInWidgetEventPane(epane);
}
return new SmartInsertDBManipulationInWidgetEventPane(epane);
}
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Callback_Function");
}
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Callback_Function");
}
@Override
protected boolean isForm() {
return false;
}
@Override
protected boolean isForm() {
return false;
}
protected String[] getDefaultArgs() {
return new String[0];
}
};
}
protected String[] getDefaultArgs() {
return new String[0];
}
};
}
@Override
protected boolean supportCellAction() {
return false;
}
@Override
protected boolean supportCellAction() {
return false;
}
}
}
public void populate(Widget widget) {
if (widget == null) {
@ -191,7 +193,13 @@ public class WidgetEventPane extends UIListGroupControlPane {
public void wrapperListener(Listener listener) {
if (listener.getAction() instanceof Commit2DBJavaScript) {
Commit2DBJavaScript commit2DBJavaScript = (Commit2DBJavaScript) listener.getAction();
commit2DBJavaScript.setJsResourceInfo(new JavaScriptResourceInfo(JavaScriptResourceInfo.Type.WIDGET, targetWidget.getWidgetName()));
JavaScriptResourceInfo.PathNode widgetNode = JavaScriptResourceInfo.PathNode.create(JavaScriptResourceInfo.Type.WIDGET, targetWidget.getWidgetName());
JavaScriptResourceInfo.PathNode EventNode = JavaScriptResourceInfo.PathNode.create(JavaScriptResourceInfo.Type.EVENT, listener.getName());
JavaScriptResourceInfo javaScriptResourceInfo = new JavaScriptResourceInfo()
.addFirstPathNode(EventNode)
.addFirstPathNode(widgetNode);
commit2DBJavaScript.setJsResourceInfo(javaScriptResourceInfo);
}
}

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

@ -18,6 +18,7 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.mainframe.DesignOperationEvent;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.event.EventDispatcher;
import com.fr.general.ComparatorUtils;
@ -30,7 +31,6 @@ import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.ReportHelper;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.FloatElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellGUIAttr;
@ -870,7 +870,7 @@ public class Grid extends BaseGridComponent {
}
// 必须保证editingCellElement不是null。
if (editingCellElement == null) {
editingCellElement = new DefaultTemplateCellElement(column, row);
editingCellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row);
}
editorComponent = getCellEditingComp();
if (editorComponent == null) {
@ -1034,7 +1034,7 @@ public class Grid extends BaseGridComponent {
}
// 必须保证editingCellElement不是null。
if (editingCellElement == null) {
editingCellElement = new DefaultTemplateCellElement(editingColumn, editingRow);
editingCellElement = DefaultThemedTemplateCellElementCase.createInstance(editingColumn, editingRow);
tplEC.addCellElement(editingCellElement);
}
if (setValue4EditingElement(newValue)) {

6
designer-realize/src/main/java/com/fr/grid/IntelliElements.java

@ -5,11 +5,11 @@ import com.fr.base.BaseUtils;
import com.fr.design.cell.clipboard.CellElementsClip;
import com.fr.design.cell.clipboard.ElementsTransferable;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.general.script.FunctionHelper;
import com.fr.grid.selection.CellSelection;
import com.fr.log.FineLoggerFactory;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.elementcase.TemplateElementCase;
@ -189,9 +189,9 @@ public class IntelliElements {
TemplateCellElement sourceCellElement = getSourceCellElementByColumnRow(colIndex, rowIndex);
if (sourceCellElement == null) {
sourceCellElement = new DefaultTemplateCellElement();
sourceCellElement = DefaultThemedTemplateCellElementCase.createInstance();
}
TemplateCellElement newCellElement = new DefaultTemplateCellElement(colIndex, rowIndex);
TemplateCellElement newCellElement = DefaultThemedTemplateCellElementCase.createInstance(colIndex, rowIndex);
applyStyle(newCellElement, sourceCellElement);//style
if (sourceCellElement.getValue() instanceof DSColumn) {
try{

7
designer-realize/src/main/java/com/fr/grid/dnd/ElementCasePaneDropTarget.java

@ -5,6 +5,7 @@ import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.data.TableDataColumn;
import com.fr.grid.Grid;
@ -13,7 +14,6 @@ import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.report.cell.cellattr.core.group.DSColumn;
@ -24,7 +24,6 @@ import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import java.awt.Point;
import java.awt.datatransfer.DataFlavor;
@ -223,7 +222,7 @@ public class ElementCasePaneDropTarget extends DropTargetAdapter {
private void paintDropCellElement(int i) {
TemplateElementCase report = ePane.getEditingElementCase();
TemplateCellElement curCellElement = new DefaultTemplateCellElement();
TemplateCellElement curCellElement = DefaultThemedTemplateCellElementCase.createInstance();
if (report instanceof WorkSheet || report instanceof PolyECBlock || report instanceof FormElementCase) {
String[] attribute = doubleArray[i];
if (ArrayUtils.isEmpty(attribute)) {
@ -250,7 +249,7 @@ public class ElementCasePaneDropTarget extends DropTargetAdapter {
CellExpandAttr cellExPandAttr = new CellExpandAttr();
cellExPandAttr.setDirection(Constants.TOP_TO_BOTTOM);
if (curCellElement == null) {
curCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow(), cs.getColumnSpan(), cs.getRowSpan(), newLinearDSColumn);
curCellElement = DefaultThemedTemplateCellElementCase.createInstance(cs.getColumn(), cs.getRow(), cs.getColumnSpan(), cs.getRowSpan(), newLinearDSColumn);
report.addCellElement(curCellElement);
} else {

11
designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

@ -1,13 +1,9 @@
package com.fr.grid.selection;
import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.NameStyle;
import com.fr.base.Utils;
import com.fr.base.vcs.DesignerMode;
import com.fr.cache.list.IntList;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.cell.CellAttributeAction;
import com.fr.design.actions.cell.CellExpandAttrAction;
import com.fr.design.actions.cell.CellStyleAttrAction;
@ -33,12 +29,11 @@ import com.fr.design.mainframe.CellWidgetPropertyPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.ElementCasePane.Clear;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.report.RowColumnPane;
import com.fr.design.selection.QuickEditor;
import com.fr.grid.GridUtils;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellGUIAttr;
import com.fr.report.elementcase.TemplateElementCase;
@ -347,7 +342,7 @@ public class CellSelection extends Selection {
TemplateCellElement cellElement = ec.getTemplateCellElement(column, row);
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row, ob);
cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row, ob);
ec.addCellElement(cellElement, false);
} else {
cellElement.setValue(ob);
@ -443,7 +438,7 @@ public class CellSelection extends Selection {
}
// 不覆盖以前的元素
ec.addCellElement(new DefaultTemplateCellElement(kc, kr), false);
ec.addCellElement(DefaultThemedTemplateCellElementCase.createInstance(kc, kr), false);
}
}
}

4
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java

@ -13,12 +13,12 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.general.IOUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.quickeditor.CellQuickEditor;
import com.fr.report.ReportHelper;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.stable.ColumnRow;
import com.fr.stable.StringUtils;
@ -158,7 +158,7 @@ public class CellFormulaQuickEditor extends CellQuickEditor {
if (cellElement == null) {
CellSelection cs = (CellSelection) tc.getSelection();
cellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
cellElement = DefaultThemedTemplateCellElementCase.createInstance(cs.getColumn(), cs.getRow());
tc.getEditingElementCase().addCellElement(cellElement, false);
}
if (tmpText != null && (tmpText.length() > 0 && tmpText.charAt(0) == '=')) {

4
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellStringQuickEditor.java

@ -4,11 +4,11 @@ import com.fr.base.BaseFormula;
import com.fr.base.Style;
import com.fr.base.TextFormat;
import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.grid.GridKeyListener;
import com.fr.grid.selection.CellSelection;
import com.fr.quickeditor.CellQuickEditor;
import com.fr.report.ReportHelper;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.stable.ColumnRow;
import com.fr.stable.StringUtils;
@ -107,7 +107,7 @@ public class CellStringQuickEditor extends CellQuickEditor {
if (cellElement == null) {
CellSelection cs = (CellSelection) tc.getSelection();
cellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
cellElement = DefaultThemedTemplateCellElementCase.createInstance(cs.getColumn(), cs.getRow());
tc.getEditingElementCase().addCellElement(cellElement, false);
}
if (tmpText != null && (tmpText.length() > 0 && tmpText.charAt(0) == '=')) {

7
designer-realize/src/test/java/com.fr/design/mainframe/JFileTest.java

@ -4,12 +4,12 @@ import com.fr.config.dao.DaoContext;
import com.fr.config.dao.impl.LocalClassHelperDao;
import com.fr.config.dao.impl.LocalEntityDao;
import com.fr.config.dao.impl.LocalXmlEntityDao;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.form.main.Form;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.general.ImageWithSuffix;
import com.fr.general.ModuleContext;
import com.fr.main.impl.WorkBook;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellImage;
import com.fr.report.restriction.CellCountRestriction;
@ -18,7 +18,6 @@ import com.fr.report.worksheet.FormElementCase;
import com.fr.report.worksheet.WorkSheet;
import com.fr.restriction.Restrictions;
import com.fr.stable.module.Module;
import com.fr.start.Designer;
import com.fr.start.MainDesigner;
import junit.framework.TestCase;
import org.junit.Assert;
@ -41,7 +40,7 @@ public class JFileTest extends TestCase {
WorkBook workBook = new WorkBook();
WorkSheet workSheet = new WorkSheet();
workBook.addReport("sheet1", workSheet);
TemplateCellElement cellElement = new DefaultTemplateCellElement();
TemplateCellElement cellElement = DefaultThemedTemplateCellElementCase.createInstance();
workSheet.addCellElement(cellElement);
ImageWithSuffix imageWithSuffix = ImageWithSuffix.build(new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB), "jpg");
CellImage cellImage = new CellImage();
@ -55,7 +54,7 @@ public class JFileTest extends TestCase {
Form form = new Form();
ElementCaseEditor editor = new ElementCaseEditor();
FormElementCase elementCase = new FormElementCase();
TemplateCellElement cellElement = new DefaultTemplateCellElement();
TemplateCellElement cellElement = DefaultThemedTemplateCellElementCase.createInstance();
elementCase.addCellElement(cellElement);
editor.setElementCase(elementCase);
form.getContainer().addWidget(editor);

Loading…
Cancel
Save