Browse Source

REPORT-60897 【固定布局-原布局推荐4.1】决策报表-自适应布局-布局推荐弹窗右上方的简约视图和真实视图,交互设计预期是一开始默认是简约视图,且记录用户的选择,下次打开时显示上次的选择;现在效果是默认真实,且没有记录

bugfix/11.0
方磊 3 years ago
parent
commit
c89baa08b8
  1. 12
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 8
      designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java
  3. 6
      designer-form/src/main/java/com/fr/design/widget/ui/designer/PredefinedLayoutPane.java

12
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -205,6 +205,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private boolean showTemplateMissingPlugin = true; private boolean showTemplateMissingPlugin = true;
private boolean useSimpleStyleLayout = false;
/** /**
* DesignerEnvManager. * DesignerEnvManager.
*/ */
@ -1691,6 +1693,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.openDebug = openDebug; this.openDebug = openDebug;
} }
public boolean isUseSimpleStyleLayout() {
return useSimpleStyleLayout;
}
public void setUseSimpleStyleLayout(boolean useSimpleStyleLayout) {
this.useSimpleStyleLayout = useSimpleStyleLayout;
}
/** /**
* Read XML.<br> * Read XML.<br>
* The method will be invoked when read data from XML file.<br> * The method will be invoked when read data from XML file.<br>
@ -1861,6 +1871,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.setEmbedServerLazyStartup(reader.getAttrAsBoolean("embedServerLazyStartup", false)); this.setEmbedServerLazyStartup(reader.getAttrAsBoolean("embedServerLazyStartup", false));
this.setShowTemplateMissingPlugin(reader.getAttrAsBoolean("showTemplateMissingPlugin", true)); this.setShowTemplateMissingPlugin(reader.getAttrAsBoolean("showTemplateMissingPlugin", true));
this.setShowServerDatasetAuthTip(reader.getAttrAsBoolean("showServerDatasetAuthTip", true)); this.setShowServerDatasetAuthTip(reader.getAttrAsBoolean("showServerDatasetAuthTip", true));
this.setUseSimpleStyleLayout(reader.getAttrAsBoolean("useSimpleStyleLayout", false));
} }
private void readReportPaneAttributions(XMLableReader reader) { private void readReportPaneAttributions(XMLableReader reader) {
@ -2134,6 +2145,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
if (!this.isShowTemplateMissingPlugin()) { if (!this.isShowTemplateMissingPlugin()) {
writer.attr("showTemplateMissingPlugin", this.isShowTemplateMissingPlugin()); writer.attr("showTemplateMissingPlugin", this.isShowTemplateMissingPlugin());
} }
writer.attr("useSimpleStyleLayout", this.isUseSimpleStyleLayout());
writer.attr("showServerDatasetAuthTip", this.isShowServerDatasetAuthTip()); writer.attr("showServerDatasetAuthTip", this.isShowServerDatasetAuthTip());
writer.end(); writer.end();
} }

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

@ -1,6 +1,7 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.base.iofile.attr.TemplateLayoutIdAttrMark; import com.fr.base.iofile.attr.TemplateLayoutIdAttrMark;
import com.fr.design.DesignerEnvManager;
import com.fr.design.border.UITitledMatteBorder; import com.fr.design.border.UITitledMatteBorder;
import com.fr.design.designer.beans.PredefinedLayout; import com.fr.design.designer.beans.PredefinedLayout;
import com.fr.design.designer.beans.models.NewFormModel; import com.fr.design.designer.beans.models.NewFormModel;
@ -50,6 +51,8 @@ import java.util.Map;
public class NewFormPane extends BasicPane { public class NewFormPane extends BasicPane {
private static final String EMPTY_FORM_LAYOUTID = "9ebf6aff-ad53-45a9-a175-9633f4162a3a"; private static final String EMPTY_FORM_LAYOUTID = "9ebf6aff-ad53-45a9-a175-9633f4162a3a";
private static final int SIMPLE_STYLE_LAYOUT_INDEX = 0;
private static final int REAL_STYLE_LAYOUT_INDEX = 1;
private NewFormModel newFormModel; private NewFormModel newFormModel;
private UIDialog dialog; private UIDialog dialog;
@ -187,13 +190,14 @@ public class NewFormPane extends BasicPane {
Toolkit.i18nText("Fine-Design_Real_Style_Template") Toolkit.i18nText("Fine-Design_Real_Style_Template")
}); });
buttonGroup.setPreferredSize(new Dimension(140, 20)); buttonGroup.setPreferredSize(new Dimension(140, 20));
buttonGroup.setSelectedIndex(1); buttonGroup.setSelectedIndex(DesignerEnvManager.getEnvManager().isUseSimpleStyleLayout()? SIMPLE_STYLE_LAYOUT_INDEX : REAL_STYLE_LAYOUT_INDEX);
buttonGroup.addChangeListener(new ChangeListener() { buttonGroup.addChangeListener(new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
int selectedIndex = buttonGroup.getSelectedIndex(); int selectedIndex = buttonGroup.getSelectedIndex();
for (PredefinedLayoutPane layoutCard : layoutCards) { for (PredefinedLayoutPane layoutCard : layoutCards) {
if (selectedIndex == 1) { DesignerEnvManager.getEnvManager().setUseSimpleStyleLayout(selectedIndex == SIMPLE_STYLE_LAYOUT_INDEX);
if (selectedIndex == REAL_STYLE_LAYOUT_INDEX) {
layoutCard.showRealStyle(); layoutCard.showRealStyle();
} else { } else {
layoutCard.showSimpleStyle(); layoutCard.showSimpleStyle();

6
designer-form/src/main/java/com/fr/design/widget/ui/designer/PredefinedLayoutPane.java

@ -2,6 +2,7 @@ package com.fr.design.widget.ui.designer;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.base.svg.IconUtils; import com.fr.base.svg.IconUtils;
import com.fr.design.DesignerEnvManager;
import com.fr.design.designer.beans.PredefinedLayout; import com.fr.design.designer.beans.PredefinedLayout;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.share.ui.base.MouseClickListener; import com.fr.design.mainframe.share.ui.base.MouseClickListener;
@ -39,6 +40,11 @@ public class PredefinedLayoutPane extends JPanel {
this.add(realStyle, 0); this.add(realStyle, 0);
this.add(simpleStyle, 1); this.add(simpleStyle, 1);
this.setPreferredSize(new Dimension(235, 134)); this.setPreferredSize(new Dimension(235, 134));
if (DesignerEnvManager.getEnvManager().isUseSimpleStyleLayout()) {
showSimpleStyle();
} else {
showRealStyle();
}
this.initListener(); this.initListener();
} }

Loading…
Cancel
Save