diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/NewFormModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/NewFormModel.java index df1d928c7..4e4b688b9 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/NewFormModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/NewFormModel.java @@ -6,12 +6,7 @@ import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.third.fasterxml.jackson.databind.ObjectMapper; -import java.io.BufferedReader; -import java.io.Closeable; -import java.io.IOException; import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; import java.io.Serializable; import java.util.HashMap; import java.util.List; @@ -19,7 +14,6 @@ import java.util.Map; public class NewFormModel implements Serializable { private static final String CONFIG_FILE_PATH = "/com/fr/design/form/layouts/config.json"; - private static final String CHARSET_DEFAULT = "utf-8"; private static NewFormModel holder = null; private Map> config = new HashMap<>(); @@ -39,49 +33,20 @@ public class NewFormModel implements Serializable { } - private static String readConfigFile() { + private synchronized static String readConfigFile() { String result = StringUtils.EMPTY; - InputStreamReader isReader = null; InputStream is = null; try { is = IOUtils.readResource(CONFIG_FILE_PATH); - isReader = new InputStreamReader(is, CHARSET_DEFAULT); - result = readString(isReader); + result = IOUtils.inputStream2String(is); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } finally { - close(is); - close(isReader); + IOUtils.close(is); } return result; } - private static String readString(Reader reader) throws Exception { - StringBuilder builder = new StringBuilder(); - final BufferedReader bufferedReader = new BufferedReader(reader); - - String line; - while ((line = bufferedReader.readLine()) != null) { - builder.append(line); - } - - bufferedReader.close(); - line = builder.toString(); - builder = null; - return line; - } - - private static void close(Closeable closeable) { - if (closeable == null) { - return; - } - try { - closeable.close(); - } catch (IOException ignore) { - - } - } - public Map> getConfig() { return config; } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 89164154c..ecb57eeb2 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -6,12 +6,13 @@ import com.fr.base.Parameter; import com.fr.base.Releasable; import com.fr.base.extension.FileExtension; import com.fr.base.iofile.attr.ExtendSharableAttrMark; -import com.fr.base.theme.TemplateThemeCompatible; -import com.fr.base.vcs.DesignerMode; +import com.fr.base.iofile.attr.TemplateLayoutIdAttrMark; import com.fr.base.theme.FormTheme; import com.fr.base.theme.FormThemeConfig; import com.fr.base.theme.TemplateTheme; +import com.fr.base.theme.TemplateThemeCompatible; import com.fr.base.theme.TemplateThemeConfig; +import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; import com.fr.design.ExtraDesignClassManager; @@ -23,10 +24,6 @@ import com.fr.design.base.mode.DesignModeContext; import com.fr.design.cell.FloatElementsProvider; import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.designer.TargetComponent; -import com.fr.design.designer.beans.actions.CopyAction; -import com.fr.design.designer.beans.actions.CutAction; -import com.fr.design.designer.beans.actions.FormDeleteAction; -import com.fr.design.designer.beans.actions.PasteAction; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XComponent; @@ -120,6 +117,7 @@ import java.util.List; public class JForm extends JTemplate implements BaseJForm
, Releasable { private static final String FORM_CARD = "FORM"; private static final String ELEMENTCASE_CARD = "ELEMENTCASE"; + private static final String EMPTY_FORM_LAYOUTID = "9ebf6aff-ad53-45a9-a175-9633f4162a3a"; private static final String[] CARDNAME = new String[]{FORM_CARD, ELEMENTCASE_CARD}; private static final int TOOLBARPANEDIMHEIGHT_FORM = 60; @@ -141,6 +139,7 @@ public class JForm extends JTemplate implements BaseJForm implements BaseJForm) jform); + } + private void setSelectedLayoutPane(PredefinedLayoutPane layoutPane) { if (selectedLayoutPane != layoutPane) { if (selectedLayoutPane != null) { diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/config.json b/designer-form/src/main/resources/com/fr/design/form/layouts/config.json index 04cc3e38c..5237356d5 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/config.json +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/config.json @@ -66,32 +66,32 @@ ], "多模块":[ { - "template":"多模块/1.frm", + "template":"multi/1.frm", "realStyle":"real_style_13", "simpleStyle":"simple_style_13" }, { - "template":"多模块/2.frm", + "template":"multi/2.frm", "realStyle":"real_style_14", "simpleStyle":"simple_style_14" }, { - "template":"多模块/3.frm", + "template":"multi/3.frm", "realStyle":"real_style_15", "simpleStyle":"simple_style_15" }, { - "template":"多模块/4.frm", + "template":"multi/4.frm", "realStyle":"real_style_16", "simpleStyle":"simple_style_16" }, { - "template":"多模块/5.frm", + "template":"multi/5.frm", "realStyle":"real_style_17", "simpleStyle":"simple_style_17" }, { - "template":"多模块/6.frm", + "template":"multi/6.frm", "realStyle":"real_style_18", "simpleStyle":"simple_style_18" } diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/empty.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/empty.frm deleted file mode 100644 index 4a1010290..000000000 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/empty.frm +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/多模块/1.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/1.frm similarity index 100% rename from designer-form/src/main/resources/com/fr/design/form/layouts/templates/多模块/1.frm rename to designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/1.frm diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/多模块/2.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/2.frm similarity index 100% rename from designer-form/src/main/resources/com/fr/design/form/layouts/templates/多模块/2.frm rename to designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/2.frm diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/多模块/3.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/3.frm similarity index 100% rename from designer-form/src/main/resources/com/fr/design/form/layouts/templates/多模块/3.frm rename to designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/3.frm diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/多模块/4.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/4.frm similarity index 100% rename from designer-form/src/main/resources/com/fr/design/form/layouts/templates/多模块/4.frm rename to designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/4.frm diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/多模块/5.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/5.frm similarity index 100% rename from designer-form/src/main/resources/com/fr/design/form/layouts/templates/多模块/5.frm rename to designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/5.frm diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/多模块/6.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/6.frm similarity index 100% rename from designer-form/src/main/resources/com/fr/design/form/layouts/templates/多模块/6.frm rename to designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/6.frm