diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java index 408b730b2..622d2a0ee 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java @@ -38,6 +38,7 @@ public class VanChartRichEditorPane { .prepare(new ScriptContextAdapter() { public void onScriptContextCreated(ScriptContextEvent event) { browser = event.getBrowser(); + browser.getCacheStorage().clearCache(); JSValue ns = browser.executeJavaScriptAndReturnValue("window." + namespace); ns.asObject().setProperty(variable, model); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java index 69e438401..7e3795fb5 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java @@ -228,10 +228,13 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { mobileAttr.setAllowFullScreen(allowFullCheckBox.isSelected()); mobileAttr.setFunctionalWhenUnactivated(!functionalWhenUnactivatedCheckBox.isSelected()); } - MobileCollapsedStyle style = this.mobileCollapsedStyleEditor.getStyle(); - if (style != null) { - ((ChartEditor) xCreator.toData()).setMobileCollapsedStyle(style); - style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom() && !FormDesignerUtils.isInAbsoluteLayout(xCreator)); + // 在不勾选body移动端属性-手机重布局时,如果修改body内的图表块的移动端属性,会造成这边的npe,因此加个判断 + if (this.mobileCollapsedStyleEditor != null) { + MobileCollapsedStyle style = this.mobileCollapsedStyleEditor.getStyle(); + if (style != null) { + ((ChartEditor) xCreator.toData()).setMobileCollapsedStyle(style); + style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom() && !FormDesignerUtils.isInAbsoluteLayout(xCreator)); + } } DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来 } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java index ee7a28c29..af591abdd 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java @@ -4,6 +4,8 @@ import com.fr.base.iofile.attr.FormTabPaddingAttrMark; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.creator.XCreator; +import com.fr.design.dialog.AttrScrollPane; +import com.fr.design.dialog.BasicScrollPane; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.gui.frpane.AttributeChangeListener; @@ -15,7 +17,6 @@ import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.widget.accessibles.AccessibleTemplateStyleEditor; import com.fr.design.mainframe.widget.accessibles.MobileTemplateStylePane; -import com.fr.design.widget.ui.designer.mobile.component.MobileAdvanceInnerPane; import com.fr.design.widget.ui.designer.mobile.component.MobileBookMarkUsePane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentMarginPane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentLayoutIntervalPane; @@ -23,7 +24,9 @@ import com.fr.design.widget.ui.designer.mobile.component.MobileTabCommonSettingP import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.general.cardtag.mobile.MobileTemplateStyle; +import java.awt.Dimension; import javax.swing.JPanel; +import javax.swing.BorderFactory; import java.awt.BorderLayout; import java.awt.Component; @@ -36,9 +39,22 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { private MobileComponentLayoutIntervalPane intervalPane; private MobileBookMarkUsePane mobileBookMarkUsePane; private MobileTabCommonSettingPane mobileTabCommonSettingPane; + private JPanel contentJPanel; + private BasicScrollPane scrollPane; + private JPanel holder; + private Dimension dimension; public TabMobileWidgetDefinePane(XCreator xCreator) { this.xCreator = xCreator; + contentJPanel = FRGUIPaneFactory.createCenterFlowZeroGapBorderPane(); + scrollPane = new AttrScrollPane() { + @Override + protected JPanel createContentPane() { + return contentJPanel; + } + }; + scrollPane.setBorder(null); + } private void bindListeners2Widgets() { @@ -61,11 +77,23 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { @Override public void initPropertyGroups(Object source) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Tab_Style_Template")); templateStyleEditor = new AccessibleTemplateStyleEditor(new MobileTemplateStylePane((WCardTagLayout) xCreator.toData())); JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{label, templateStyleEditor}, {new UILabel()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_LARGE); - JPanel holder = FRGUIPaneFactory.createBorderLayout_S_Pane(); + holder = new JPanel(new BorderLayout()) { + @Override + public Dimension getPreferredSize() { + if (dimension == null) { + return super.getPreferredSize(); + } else { + Dimension defaultDimension = super.getPreferredSize(); + defaultDimension.width = dimension.width; + return defaultDimension; + } + } + }; holder.add(jPanel, BorderLayout.NORTH); JPanel innerAdvancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); if (!shouldHidePadding(designer)) { @@ -89,13 +117,17 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { //高级 holder.add(advancePane, BorderLayout.CENTER); - this.add(holder, BorderLayout.NORTH); + contentJPanel.add(holder, BorderLayout.CENTER); + this.add(scrollPane, BorderLayout.CENTER); } @Override public void populate(FormDesigner designer) { WCardTagLayout wCardTagLayout = (WCardTagLayout) xCreator.toData(); MobileTemplateStyle mobileTemplateStyle = wCardTagLayout.getMobileTemplateStyle(); + if (dimension == null) { + dimension = holder.getPreferredSize(); + } templateStyleEditor.setValue(mobileTemplateStyle); // 数据 populate 完成后,再设置监听 this.bindListeners2Widgets(); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java index 4670456ae..def9cf795 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java @@ -35,6 +35,7 @@ public class MobileTabCommonSettingPane extends BasicPane { private ModeButtonGroup buttonGroup; private NewColorSelectBox initDotColorBox; private NewColorSelectBox selectDotColorBox; + private boolean isPopulate; public MobileTabCommonSettingPane(boolean isTopComponent) { initComponent(isTopComponent); @@ -89,23 +90,27 @@ public class MobileTabCommonSettingPane extends BasicPane { initDotColorBox = new NewColorSelectBox(0){ @Override protected void iniListener() { - } - - @Override - public void mouseClicked(MouseEvent e) { - super.mouseClicked(e); - this.attributeChange(); + this.addSelectChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + if (!isPopulate) { + attributeChange(); + } + } + }); } }; selectDotColorBox = new NewColorSelectBox(0){ @Override protected void iniListener() { - } - - @Override - public void mouseClicked(MouseEvent e) { - super.mouseClicked(e); - this.attributeChange(); + this.addSelectChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + if (!isPopulate) { + attributeChange(); + } + } + }); } }; JPanel initDotColorPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{initColorLabel, initDotColorBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); @@ -189,7 +194,9 @@ public class MobileTabCommonSettingPane extends BasicPane { color = defaultColor; } if (color != colorBox.getSelectObject()) { + isPopulate = true; colorBox.setSelectObject(color); + isPopulate = false; } }