Browse Source

Merge pull request #5872 in DESIGN/design from feature/10.0 to feature/big-screen

* commit '50a2b66ea89af2cd7448e45e7f42ff86cd022026':
  REPORT-59189 导出-导出事件-导出模板选cptx会出问题
  REPORT-57551 设计器显示,自适应布局下body背景设置以后,画布中没有实时显示背景
  REPORT-57551 设计器显示,自适应布局下body背景设置以后,画布中没有实时显示背景
  REPORT-57551 设计器显示,自适应布局下body背景设置以后,画布中没有实时显示背景
  REPORT-58301 【决策报表】布局切换以后,body背景样式不保留
  add executeJavaScriptAndReturnValue function
  CHART-20662 fix:数据集字段拖入单元格 白色文字
  CHART-19792 大屏模板屏蔽全局参数菜单项
feature/big-screen
superman 3 years ago
parent
commit
a34a6fc4de
  1. 4
      designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java
  2. 11
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  3. 9
      designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java
  4. 42
      designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java
  5. 6
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  6. 6
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  7. 6
      designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java
  8. 8
      designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java
  9. 2
      designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java
  10. 2
      designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java
  11. 10
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java
  12. 2
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java
  13. 8
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java
  14. 14
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  15. 2
      designer-realize/src/main/java/com/fr/design/present/ConditionAttributesGroupPane.java
  16. 3
      designer-realize/src/main/java/com/fr/grid/dnd/ElementCasePaneDropTarget.java

4
designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java

@ -2,6 +2,7 @@ package com.fr.design.javascript;
import com.fr.base.BaseFormula;
import com.fr.base.Parameter;
import com.fr.base.extension.FileExtension;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
@ -417,6 +418,9 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript
if (path == null) {
throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Function_The_Selected_File_Cannot_Be_Null"));
}
if (path.endsWith(FileExtension.CPTX.getExtension())) {
throw new Exception(Toolkit.i18nText("Fine-Design_Basic_Function_Cptx_Unsupported"));
}
}
/**

11
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -40,6 +40,7 @@ import com.fr.design.actions.server.GlobalParameterAction;
import com.fr.design.actions.server.GlobalTableDataAction;
import com.fr.design.actions.server.PlatformManagerAction;
import com.fr.design.actions.server.PluginManagerAction;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.file.NewTemplatePane;
import com.fr.design.fun.MenuHandler;
import com.fr.design.fun.OemProcessor;
@ -491,10 +492,12 @@ public abstract class ToolBarMenuDock {
if (!DesignerMode.isAuthorityEditing()) {
addPluginManagerAction(menuDef);
menuDef.addShortCut(
new FunctionManagerAction(),
new GlobalParameterAction()
);
menuDef.addShortCut(new FunctionManagerAction());
if (!DesignModeContext.isDuchampMode()) {
menuDef.addShortCut(new GlobalParameterAction());
}
}

9
designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java

@ -11,7 +11,6 @@ import com.fr.web.struct.AssembleComponent;
import com.teamdev.jxbrowser.browser.callback.InjectJsCallback;
import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.BrowserType;
import com.teamdev.jxbrowser.chromium.JSObject;
import com.teamdev.jxbrowser.chromium.JSValue;
import com.teamdev.jxbrowser.chromium.events.LoadListener;
import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter;
@ -23,11 +22,11 @@ import com.teamdev.jxbrowser.event.Observer;
import javax.swing.JDialog;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import java.util.Map;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Map;
/**
* @author richie
@ -180,12 +179,10 @@ public class ModernUIPane<T> extends BasicPane {
}
}
public JSObject getEmptyJSObjectV6() {
public JSValue executeJavaScriptAndReturnValue(String javaScript) {
if (browser != null) {
return browser.executeJavaScriptAndReturnValue("var __empty_props__ = {};__empty_props__").asObject();
return browser.executeJavaScriptAndReturnValue(javaScript);
}
return null;
}

42
designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java

@ -21,6 +21,8 @@ import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import javax.swing.plaf.PanelUI;
import javax.swing.plaf.basic.BasicPanelUI;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.awt.geom.RoundRectangle2D;
@ -42,12 +44,23 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{
public XBorderStyleWidgetCreator(Widget widget, Dimension initSize) {
super(widget, initSize);
setUI(new NoBackgroundPaneUI());
setOpaque(false);
setBackupBound(null);
ExtendSharableAttrMark sharableAttrMark = this.toData().getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG);
if (sharableAttrMark != null) {
this.setShareId(sharableAttrMark.getShareId());
}
}
@Override
public void setUI(PanelUI ui) {
if (ui instanceof NoBackgroundPaneUI) {
super.setUI(ui);
}
}
public Background getBackground4Painting() {
return this.background4Painting;
}
@ -88,12 +101,12 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{
super.addToWrapper(parentPanel, width, minHeight);
// REPORT-53175: 新创建的图表组件默认显示标题 since 10.0.18
// 将当前对象添加到父容器后,初始化默认样式的效果
initStyle();
refreshStylePreviewEffect();
}
protected void initStyle() {
public void refreshStylePreviewEffect() {
BorderPacker style = toData().getBorderStyle();
initBorderAndBackgroundStyle();
refreshBorderAndBackgroundStylePreviewEffect();
if (ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)) {
initTitleStyle(style);
} else {
@ -104,7 +117,7 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{
reshuffleBorderAndBackgroundPaintingEffectIfTitleExists();
}
protected void initBorderAndBackgroundStyle() {
public void refreshBorderAndBackgroundStylePreviewEffect() {
BorderPacker style = toData().getBorderStyle();
LineBorder DEFAULT_LINE_BORDER = (LineBorder) DEFALUTBORDER;
@ -263,6 +276,11 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{
}
@Override
public void setBackground(Color bg) {
super.setBackground(bg);
}
// 根据当前组件边框裁剪内容,如果当前组件存在圆角,则应当按圆角裁剪内容
private void clipByRoundedBorder(Graphics2D g2d) {
Border currentBorder = getBorder();
@ -280,6 +298,11 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{
// 设计器预览界面中绘制组件背景效果
public void paintBackground(Graphics2D g2d) {
if (isOpaque()) {
g2d.setColor(getBackground());
g2d.fillRect(0, 0, getWidth(), getHeight());
}
Background background4Painting = getBackground4Painting();
if (background4Painting != null) {
Composite oldComposite = g2d.getComposite();
@ -303,12 +326,12 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{
}
public void paintForeground(Graphics2D g2d) {
super.paint(g2d);
super.paintComponent(g2d);
super.paintBorder(g2d);
}
@Override
public void paint(Graphics g) {
public void paintComponent(Graphics g) {
this.clipByRoundedBorder((Graphics2D) g);
this.paintBackground((Graphics2D) g);
this.paintBorderImage((Graphics2D) g);
@ -370,4 +393,11 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
}
}
public static class NoBackgroundPaneUI extends BasicPanelUI {
@Override
public void update(Graphics g, JComponent c) {
paint(g, c);
}
}
}

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

@ -122,7 +122,7 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
@Override
public void propertyChange() {
initStyle();
refreshStylePreviewEffect();
}
}),
};
@ -165,7 +165,7 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
@Override
protected void initXCreatorProperties() {
super.initXCreatorProperties();
initBorderAndBackgroundStyle();
refreshBorderAndBackgroundStylePreviewEffect();
BaseChartCollection collection = ((BaseChartEditor) data).getChartCollection();
isRefreshing = true;
((MiddleChartComponent) designerEditor.getEditorTarget()).populate(collection);
@ -341,7 +341,7 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
* data属性改变触发其他操作
*/
public void firePropertyChange() {
initStyle();
refreshStylePreviewEffect();
}
@Override

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

@ -58,7 +58,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
super.initXCreatorProperties();
// 报表块初始化时要加载对应的borderStyle
initBorderAndBackgroundStyle();
refreshBorderAndBackgroundStylePreviewEffect();
}
/**
@ -94,7 +94,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
@Override
public void propertyChange() {
initStyle();
refreshStylePreviewEffect();
}
}),
new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class)
@ -342,7 +342,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
*
*/
public void firePropertyChange() {
initStyle();
refreshStylePreviewEffect();
}
/**

6
designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java

@ -75,7 +75,7 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme
@Override
public void propertyChange() {
initStyle();
refreshStylePreviewEffect();
}
}),
new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class)
@ -118,7 +118,7 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme
@Override
protected void initXCreatorProperties() {
super.initXCreatorProperties();
initBorderAndBackgroundStyle();
refreshBorderAndBackgroundStylePreviewEffect();
this.initLayoutManager();
this.convert();
}
@ -547,7 +547,7 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme
*
*/
public void firePropertyChange(){
initStyle();
refreshStylePreviewEffect();
}
/**

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

@ -78,7 +78,7 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout {
@Override
public void propertyChange() {
initStyle();
XWAbsoluteBodyLayout.this.refreshStylePreviewEffect();
}
})
};
@ -105,8 +105,8 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout {
}
@Override
protected void initStyle() {
initBorderAndBackgroundStyle();
public void refreshStylePreviewEffect() {
refreshBorderAndBackgroundStylePreviewEffect();
}
/**
@ -114,7 +114,7 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout {
*
*/
public void firePropertyChange(){
initStyle();
this.refreshStylePreviewEffect();
}
@Override

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

@ -305,7 +305,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
}
@Override
protected void initStyle() {
public void refreshStylePreviewEffect() {
// do nothing
}

2
designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java

@ -63,7 +63,7 @@ public class XWTitleLayout extends DedicateLayoutContainer {
}
@Override
protected void initBorderAndBackgroundStyle() {
public void refreshBorderAndBackgroundStylePreviewEffect() {
setBorder(null);
setBorderImage4Painting(null, 0.0);
setBackground4Painting(null, 0.0);

10
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java

@ -160,7 +160,7 @@ public class XWCardLayout extends XLayoutContainer {
*/
@Override
protected XLayoutContainer getCreatorWrapper(String widgetName) {
initStyle();
refreshStylePreviewEffect();
Dimension dimension = new Dimension();
//主结构是一个borderlayout, 标签部分是north, card部分为center
WCardMainBorderLayout border = new WCardMainBorderLayout();
@ -389,7 +389,7 @@ public class XWCardLayout extends XLayoutContainer {
@Override
public void propertyChange() {
initStyle();
refreshStylePreviewEffect();
}
})
};
@ -397,10 +397,10 @@ public class XWCardLayout extends XLayoutContainer {
//初始化样式
@Override
protected void initStyle() {
public void refreshStylePreviewEffect() {
BorderPacker style = toData().getBorderStyle();
initBorderTitleStyle(style);
initBorderAndBackgroundStyle();
refreshBorderAndBackgroundStylePreviewEffect();
clearOrShowTitleLayout(ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE));
}
@ -484,7 +484,7 @@ public class XWCardLayout extends XLayoutContainer {
*/
@Override
public void firePropertyChange() {
initStyle();
refreshStylePreviewEffect();
}
public void resetTabBackground(TemplateStyle templateStyle) {

2
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java

@ -417,7 +417,7 @@ public class XWCardMainBorderLayout extends XWBorderLayout {
public void firePropertyChange(){
XWCardLayout cardLayout = this.getCardPart();
if (cardLayout != null && cardLayout.toData() != null) {
cardLayout.initStyle();
cardLayout.refreshStylePreviewEffect();
}
}

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

@ -24,6 +24,8 @@ import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout;
import com.fr.general.act.BorderPacker;
import com.fr.report.core.ReportUtils;
import javax.swing.BorderFactory;
@ -150,7 +152,13 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
if (state == WBodyLayoutType.FIT.getTypeValue()) {
XWFitLayout xwFitLayout = ((XWFitLayout)creator.getBackupParent());
xwFitLayout.switch2FitBodyLayout(creator);
WFitLayout wFitLayout = xwFitLayout.toData();
// 切换布局类型时,保留body背景样式
if (wFitLayout != null) {
wFitLayout.setBorderStyle(layout.getBorderStyle());
}
copyLayoutAttr(layout, xwFitLayout.toData());
xwFitLayout.refreshStylePreviewEffect();
}
}
layout.setBorderStyle(stylePane.updateBean());

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

@ -34,10 +34,12 @@ import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout;
import com.fr.general.ComparatorUtils;
import com.fr.general.act.BorderPacker;
import com.fr.log.FineLoggerFactory;
import com.fr.report.core.ReportUtils;
import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;
/**
@ -191,9 +193,12 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
layout.setLayoutType(WBodyLayoutType.parse(state));
layout.setCompState(adaptComboBox.getSelectedIndex());
try {
// 自适应布局切换到绝对布局
if (state == WBodyLayoutType.ABSOLUTE.getTypeValue()) {
WAbsoluteBodyLayout wAbsoluteBodyLayout = new WAbsoluteBodyLayout("body");
wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED);
// 切换布局类型时,保留body背景样式
wAbsoluteBodyLayout.setBorderStyle((BorderPacker) (layout.getBorderStyle().clone()));
Component[] components = xWFitLayout.getComponents();
xWFitLayout.removeAll();
layout.resetStyle();
@ -215,6 +220,15 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreators(
FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{wAbsoluteBodyLayout}));
if (xwAbsoluteBodyLayout.toData() != null) {
xwAbsoluteBodyLayout.toData().setBorderStyle(wAbsoluteBodyLayout.getBorderStyle());
}
xwAbsoluteBodyLayout.refreshStylePreviewEffect();
if (xWFitLayout.toData() != null) {
xWFitLayout.toData().resetStyle();
}
xWFitLayout.refreshStylePreviewEffect();
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);

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

@ -7,6 +7,7 @@ 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.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.general.NameObject;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
@ -83,6 +84,7 @@ public class ConditionAttributesGroupPane extends UIListControlPane {
editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
AdjustWorkBookDefaultStyleUtils.adjustCellElement(editCellElement);
}
SheetUtils.calculateDefaultParent(tplEC); // 不知道这行代码的作用,怕去掉之后会出问题,先放在这里

3
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.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.data.TableDataColumn;
import com.fr.grid.Grid;
@ -251,7 +252,7 @@ public class ElementCasePaneDropTarget extends DropTargetAdapter {
cellExPandAttr.setDirection(Constants.TOP_TO_BOTTOM);
if (curCellElement == null) {
curCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow(), cs.getColumnSpan(), cs.getRowSpan(), newLinearDSColumn);
AdjustWorkBookDefaultStyleUtils.adjustCellElement(curCellElement);
report.addCellElement(curCellElement);
} else {
// marks:直接覆盖值

Loading…
Cancel
Save