diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
index f00e1a8558..d2d768ea16 100644
--- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
+++ b/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 useSimpleStyleLayout = false;
+
/**
* DesignerEnvManager.
*/
@@ -1691,6 +1693,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.openDebug = openDebug;
}
+ public boolean isUseSimpleStyleLayout() {
+ return useSimpleStyleLayout;
+ }
+
+ public void setUseSimpleStyleLayout(boolean useSimpleStyleLayout) {
+ this.useSimpleStyleLayout = useSimpleStyleLayout;
+ }
+
/**
* Read XML.
* The method will be invoked when read data from XML file.
@@ -1861,6 +1871,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.setEmbedServerLazyStartup(reader.getAttrAsBoolean("embedServerLazyStartup", false));
this.setShowTemplateMissingPlugin(reader.getAttrAsBoolean("showTemplateMissingPlugin", true));
this.setShowServerDatasetAuthTip(reader.getAttrAsBoolean("showServerDatasetAuthTip", true));
+ this.setUseSimpleStyleLayout(reader.getAttrAsBoolean("useSimpleStyleLayout", false));
}
private void readReportPaneAttributions(XMLableReader reader) {
@@ -2134,6 +2145,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
if (!this.isShowTemplateMissingPlugin()) {
writer.attr("showTemplateMissingPlugin", this.isShowTemplateMissingPlugin());
}
+ writer.attr("useSimpleStyleLayout", this.isUseSimpleStyleLayout());
writer.attr("showServerDatasetAuthTip", this.isShowServerDatasetAuthTip());
writer.end();
}
diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java
index dfa156d5e1..5a518f73bb 100644
--- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java
+++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java
@@ -1,6 +1,7 @@
package com.fr.design.widget.ui.designer;
import com.fr.base.iofile.attr.TemplateLayoutIdAttrMark;
+import com.fr.design.DesignerEnvManager;
import com.fr.design.border.UITitledMatteBorder;
import com.fr.design.designer.beans.PredefinedLayout;
import com.fr.design.designer.beans.models.NewFormModel;
@@ -50,6 +51,8 @@ import java.util.Map;
public class NewFormPane extends BasicPane {
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 UIDialog dialog;
@@ -187,13 +190,14 @@ public class NewFormPane extends BasicPane {
Toolkit.i18nText("Fine-Design_Real_Style_Template")
});
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() {
@Override
public void stateChanged(ChangeEvent e) {
int selectedIndex = buttonGroup.getSelectedIndex();
for (PredefinedLayoutPane layoutCard : layoutCards) {
- if (selectedIndex == 1) {
+ DesignerEnvManager.getEnvManager().setUseSimpleStyleLayout(selectedIndex == SIMPLE_STYLE_LAYOUT_INDEX);
+ if (selectedIndex == REAL_STYLE_LAYOUT_INDEX) {
layoutCard.showRealStyle();
} else {
layoutCard.showSimpleStyle();
diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/PredefinedLayoutPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/PredefinedLayoutPane.java
index bde9b07eed..5094faa4d4 100644
--- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/PredefinedLayoutPane.java
+++ b/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.svg.IconUtils;
+import com.fr.design.DesignerEnvManager;
import com.fr.design.designer.beans.PredefinedLayout;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.share.ui.base.MouseClickListener;
@@ -39,6 +40,11 @@ public class PredefinedLayoutPane extends JPanel {
this.add(realStyle, 0);
this.add(simpleStyle, 1);
this.setPreferredSize(new Dimension(235, 134));
+ if (DesignerEnvManager.getEnvManager().isUseSimpleStyleLayout()) {
+ showSimpleStyle();
+ } else {
+ showRealStyle();
+ }
this.initListener();
}