From 8afa1b4ae9fe4413445d3368745261e6319a3a51 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 16 Oct 2020 13:46:38 +0800 Subject: [PATCH 1/5] =?UTF-8?q?REPORT-35149=E3=80=9010.0.11=E3=80=91?= =?UTF-8?q?=E9=A2=84=E5=AE=9A=E4=B9=89=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=8F=8A=E4=B8=8E=E5=9B=BE=E8=A1=A8=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 5 +- .../ui/ServerPredefinedStylePane.java | 4 +- .../ui/detail/ComponentStyleSettingPane.java | 6 --- .../detail/background/GradientDetailPane.java | 2 +- .../detail/background/PatternDetailPane.java | 10 +--- .../ui/dialog/PredefinedStyleEditDialog.java | 2 +- .../dialog/ReportPredefinedStyleDialog.java | 10 ++-- .../java/com/fr/design/utils/DesignUtils.java | 24 ++++++++- .../design/designer/creator/XChartEditor.java | 7 +-- .../design/designer/creator/XElementCase.java | 10 ++-- .../creator/cardlayout/XWTabFitLayout.java | 9 +--- .../xpane/FormPredefinedBackgroundPane.java | 11 ++-- .../PredefinedComponentStyleSettingPane.java | 54 ++++++------------- .../AccessibleBodyBackgroundEditor.java | 6 +-- .../AccessibleBorderStyleEditor.java | 6 +-- .../layout/BorderStyleWidgetDefinePane.java | 9 ++-- .../ui/designer/layout/ComponentStyle.java | 35 ------------ .../layout/ElementEditorDefinePane.java | 10 ++++ .../FRAbsoluteBodyLayoutDefinePane.java | 11 ++-- .../layout/FRFitLayoutDefinePane.java | 9 ++-- .../layout/WTitleLayoutDefinePane.java | 10 ++-- .../actions/cell/GlobalStyleMenuDef.java | 22 ++++---- .../ServerPredefinedStyleAction.java | 2 + .../cell/settingpane/CellStylePane.java | 4 +- .../style/CellPredefinedStyleSettingPane.java | 6 +-- .../java/com/fr/design/style/BorderUtils.java | 9 +++- .../com/fr/grid/selection/CellSelection.java | 23 ++++---- 27 files changed, 143 insertions(+), 173 deletions(-) delete mode 100644 designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/ComponentStyle.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 6129f8746..14a86fe0a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -51,6 +51,7 @@ import com.fr.design.menu.MenuDef; import com.fr.design.menu.NameSeparator; import com.fr.design.menu.ShortCut; import com.fr.design.preview.PagePreview; +import com.fr.design.utils.DesignUtils; import com.fr.design.write.submit.DBManipulationInWidgetEventPane; import com.fr.design.write.submit.DBManipulationPane; import com.fr.file.FILE; @@ -77,7 +78,6 @@ import com.fr.stable.StringUtils; import com.fr.stable.core.UUID; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; - import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JComponent; @@ -1339,9 +1339,12 @@ public abstract class JTemplate> } }); + preferenceButton.setEnabled(DesignUtils.checkDesignerRemoteVersion()); return preferenceButton; } + + private void setPredefinedButtonSize(UIButton predefinedBtn) { String text = predefinedBtn.getText(); FontMetrics metrics = predefinedBtn.getFontMetrics(predefinedBtn.getFont()); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java index 90b013e0e..76b2a3b60 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java @@ -190,7 +190,9 @@ public class ServerPredefinedStylePane extends BasicPane { PredefinedStyleEditPane editPane = PredefinedStyleEditPane.createNewEditPane(selectPane); PredefinedStyleEditDialog editDialog = new PredefinedStyleEditDialog( SwingUtilities.getWindowAncestor(ServerPredefinedStylePane.this), editPane); - editPane.populate(style.getPredefinedStyle()); + PredefinedStyle predefinedStyle = style.getPredefinedStyle(); + predefinedStyle.setStyleName(StringUtils.EMPTY); + editPane.populate(predefinedStyle); editDialog.setVisible(true); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ComponentStyleSettingPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ComponentStyleSettingPane.java index 5a7ea8502..e2d306933 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ComponentStyleSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ComponentStyleSettingPane.java @@ -4,7 +4,6 @@ import com.fr.config.predefined.PredefinedComponentStyle; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.MultiTabPane; import com.fr.design.mainframe.predefined.ui.detail.component.ComponentFrameStylePane; -import com.fr.design.mainframe.predefined.ui.detail.component.ComponentMarginStylePane; import com.fr.design.mainframe.predefined.ui.detail.component.ComponentTitleStylePane; import java.util.ArrayList; @@ -16,7 +15,6 @@ import java.util.List; public class ComponentStyleSettingPane extends MultiTabPane { private ComponentFrameStylePane frameStylePane; private ComponentTitleStylePane titleStylePane; - private ComponentMarginStylePane marginStylePane; public ComponentStyleSettingPane() { } @@ -26,11 +24,9 @@ public class ComponentStyleSettingPane extends MultiTabPane initPaneList() { this.frameStylePane = new ComponentFrameStylePane(); this.titleStylePane = ComponentTitleStylePane.createPredefinedSettingPane(); - this.marginStylePane = new ComponentMarginStylePane(); paneList = new ArrayList(); paneList.add(this.frameStylePane); paneList.add(this.titleStylePane); - paneList.add(this.marginStylePane); return paneList; } @@ -38,7 +34,6 @@ public class ComponentStyleSettingPane extends MultiTabPane { +public class FormPredefinedBackgroundPane extends PredefinedStyleSettingPane { private BackgroundWithAlphaSettingPane backgroundPane; @Override @@ -42,7 +43,7 @@ public class FormPredefinedBackgroundPane extends PredefinedStyleSettingPane { +public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingPane { private StyleSettingPane styleSettingPane; private TinyFormulaPane formulaPane; @@ -52,11 +48,10 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP } @Override - public void populateBean(ComponentStyle ob) { + public void populateBean(NameLayoutBorderStyle ob) { this.setPopulating(true); - NameLayoutBorderStyle layoutBorderStyle = ob.getNameLayoutBorderStyle(); - super.populate(layoutBorderStyle); - this.formulaPane.populateBean(layoutBorderStyle.getTitleText().toString()); + super.populate(ob); + this.formulaPane.populateBean(ob.getTitleText().toString()); styleSettingPane.populateBean(ob); this.previewPane.refresh(); this.setPopulating(false); @@ -64,12 +59,11 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP @Override - public ComponentStyle updateBean() { + public NameLayoutBorderStyle updateBean() { if (predefinedRadioBtn.isSelected()) { NameLayoutBorderStyle layoutBorderStyle = NameLayoutBorderStyle.createPredefinedStyle(getPredefinedStyleName()); layoutBorderStyle.setTitleText(formulaPane.updateBean()); - return new ComponentStyle(layoutBorderStyle, - NamePaddingMargin.createPredefinedStyle(getPredefinedStyleName())); + return layoutBorderStyle; } return styleSettingPane.updateBean(); } @@ -79,10 +73,9 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Style"); } - class StyleSettingPane extends BasicBeanPane { + class StyleSettingPane extends BasicBeanPane { private ComponentFrameStylePane frameStylePane; private ComponentTitleStylePane titleStylePane; - private ComponentMarginStylePane marginStylePane; public StyleSettingPane() { initPane(); @@ -92,53 +85,37 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel frame = FRGUIPaneFactory.createTitledBorderNoGapPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Frame")); frameStylePane = new ComponentFrameStylePane(); - frameStylePane.setPreferredSize(new Dimension(233, 183)); + frameStylePane.setPreferredSize(new Dimension(233, 225)); frame.add(frameStylePane); JPanel title = FRGUIPaneFactory.createTitledBorderNoGapPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Title")); titleStylePane = ComponentTitleStylePane.createStyleSettingPane(); - titleStylePane.setPreferredSize(new Dimension(233, 140)); + titleStylePane.setPreferredSize(new Dimension(233, 220)); title.add(titleStylePane); - - JPanel margin = FRGUIPaneFactory.createTitledBorderNoGapPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Base_Margin")); - marginStylePane = new ComponentMarginStylePane(); - marginStylePane.setPreferredSize(new Dimension(233, 100)); - margin.add(marginStylePane); - this.add(frame, BorderLayout.NORTH); this.add(title, BorderLayout.CENTER); - this.add(margin, BorderLayout.SOUTH); } @Override - public void populateBean(ComponentStyle ob) { + public void populateBean(NameLayoutBorderStyle ob) { PredefinedComponentStyle componentStyle = new PredefinedComponentStyle(); - componentStyle.setBorderStyle(ob.getNameLayoutBorderStyle().createRealStyle()); - PaddingMargin margin = ob.getNamePaddingMargin().createRealStyle(); - componentStyle.setTop(margin.getTop()); - componentStyle.setBottom(margin.getBottom()); - componentStyle.setLeft(margin.getLeft()); - componentStyle.setRight(margin.getRight()); + componentStyle.setBorderStyle(ob.createRealStyle()); frameStylePane.populate(componentStyle); titleStylePane.populate(componentStyle); - marginStylePane.populate(componentStyle); } @Override - public ComponentStyle updateBean() { + public NameLayoutBorderStyle updateBean() { PredefinedComponentStyle componentStyle = update(); NameLayoutBorderStyle nameLayoutBorderStyle = NameLayoutBorderStyle.createCustomStyle(componentStyle.getBorderStyle()); - NamePaddingMargin namePaddingMargin = NamePaddingMargin.createCustomStyle( - new PaddingMargin(componentStyle.getTop(), componentStyle.getLeft(), componentStyle.getBottom(), componentStyle.getRight())); - return new ComponentStyle(nameLayoutBorderStyle, namePaddingMargin); + return nameLayoutBorderStyle; } public PredefinedComponentStyle update() { PredefinedComponentStyle componentStyle = new PredefinedComponentStyle(); frameStylePane.update(componentStyle); titleStylePane.update(componentStyle); - marginStylePane.update(componentStyle); return componentStyle; } @@ -159,9 +136,8 @@ public class PredefinedComponentStyleSettingPane extends PredefinedStyleSettingP } public void refresh() { - ComponentStyle componentStyle = PredefinedComponentStyleSettingPane.this.updateBean(); - NameLayoutBorderStyle borderStyle = componentStyle.getNameLayoutBorderStyle(); - this.layoutBorderPreviewPane.repaint((LayoutBorderStyle) borderStyle.createRealStyle()); + NameLayoutBorderStyle componentStyle = PredefinedComponentStyleSettingPane.this.updateBean(); + this.layoutBorderPreviewPane.repaint((LayoutBorderStyle) componentStyle.createRealStyle()); } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyBackgroundEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyBackgroundEditor.java index 2b3072182..fd3430a8c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyBackgroundEditor.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyBackgroundEditor.java @@ -8,7 +8,7 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.xpane.FormPredefinedBackgroundPane; import com.fr.design.mainframe.widget.editors.ITextComponent; import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer; -import com.fr.form.ui.NameFormBackground; +import com.fr.form.ui.NameComponentBackground; import javax.swing.SwingUtilities; import java.awt.Dimension; @@ -43,7 +43,7 @@ public class AccessibleBodyBackgroundEditor extends UneditableAccessibleEditor { fireStateChanged(); } }); - backgroundPane.populateBean((NameFormBackground) getValue()); + backgroundPane.populateBean((NameComponentBackground) getValue()); dlg.setVisible(true); } @@ -62,7 +62,7 @@ public class AccessibleBodyBackgroundEditor extends UneditableAccessibleEditor { if (v == null) { return null; } - NameFormBackground style = (NameFormBackground) v; + NameComponentBackground style = (NameComponentBackground) v; return style.usePredefinedStyle() ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Predefined") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom"); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBorderStyleEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBorderStyleEditor.java index d6e14d1b8..f723474f0 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBorderStyleEditor.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBorderStyleEditor.java @@ -8,7 +8,7 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.xpane.PredefinedComponentStyleSettingPane; import com.fr.design.mainframe.widget.editors.ITextComponent; import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer; -import com.fr.design.widget.ui.designer.layout.ComponentStyle; +import com.fr.form.ui.NameLayoutBorderStyle; import javax.swing.SwingUtilities; import java.awt.Dimension; @@ -43,7 +43,7 @@ public class AccessibleBorderStyleEditor extends UneditableAccessibleEditor { fireStateChanged(); } }); - borderPane.populateBean((ComponentStyle) getValue()); + borderPane.populateBean((NameLayoutBorderStyle) getValue()); dlg.setVisible(true); } @@ -63,7 +63,7 @@ public class AccessibleBorderStyleEditor extends UneditableAccessibleEditor { if (v == null) { return null; } - ComponentStyle style = (ComponentStyle) v; + NameLayoutBorderStyle style = (NameLayoutBorderStyle) v; return style.usePredefinedStyle() ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Predefined") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Custom"); } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/BorderStyleWidgetDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/BorderStyleWidgetDefinePane.java index 4a2ac45c2..451b0b3c4 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/BorderStyleWidgetDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/BorderStyleWidgetDefinePane.java @@ -10,6 +10,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.widget.accessibles.AccessibleBorderStyleEditor; import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.form.ui.AbstractBorderStyleWidget; +import com.fr.form.ui.NameLayoutBorderStyle; import javax.swing.*; @@ -49,17 +50,15 @@ public class BorderStyleWidgetDefinePane extends AbstractDataModify { + private PaddingBoundPane paddingBoundPane; private AccessibleElementCaseToolBarEditor elementCaseToolBarEditor; private PropertyGroupPane extraPropertyGroupPane; @@ -27,8 +31,10 @@ public class ElementEditorDefinePane extends WTitleLayoutDefinePane allStyle = config.getAllStyles(); this.applicationFormat.clearBoxItems(); for (String name : allStyle.keySet()) { diff --git a/designer-realize/src/main/java/com/fr/design/style/BorderUtils.java b/designer-realize/src/main/java/com/fr/design/style/BorderUtils.java index 48c3c05aa..3a7142b4e 100644 --- a/designer-realize/src/main/java/com/fr/design/style/BorderUtils.java +++ b/designer-realize/src/main/java/com/fr/design/style/BorderUtils.java @@ -7,6 +7,7 @@ import java.util.Hashtable; import java.util.List; import com.fr.base.CellBorderStyle; +import com.fr.base.NameStyle; import com.fr.base.Style; import com.fr.design.mainframe.ElementCasePane; import com.fr.general.ComparatorUtils; @@ -14,6 +15,7 @@ import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.report.cell.CellElement; +import com.fr.report.cell.DefaultPredefinedTemplateCellElement; import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.FloatElement; import com.fr.report.cell.TemplateCellElement; @@ -511,10 +513,13 @@ public abstract class BorderUtils { for (int j = row; j < row + rowSpan; j++) { TemplateCellElement tmpCellElement = report.getTemplateCellElement(i, j); if (tmpCellElement == null) { - tmpCellElement = new DefaultTemplateCellElement(i, j); + tmpCellElement = new DefaultPredefinedTemplateCellElement(i, j); report.addCellElement(tmpCellElement); } Style style = tmpCellElement.getStyle(); + if (style instanceof NameStyle && ((NameStyle) style).usePredefinedStyle()) { + continue; + } style = inspectStyle(row, column, rowSpan, columnSpan, cellBorderStyle, newCellBorderStyle, tmpCellElement, style); tmpCellElement.setStyle(style); } @@ -675,4 +680,4 @@ public abstract class BorderUtils { return false; } } -} \ No newline at end of file +} diff --git a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java index 393aa3668..cd89f3e4d 100644 --- a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java +++ b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java @@ -9,7 +9,6 @@ import com.fr.base.vcs.DesignerMode; import com.fr.cache.list.IntList; import com.fr.config.ServerPreferenceConfig; import com.fr.config.predefined.PredefinedStyle; -import com.fr.config.predefined.PredefinedStyleConfig; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.cell.CellAttributeAction; import com.fr.design.actions.cell.CellExpandAttrAction; @@ -45,6 +44,7 @@ import com.fr.design.report.RowColumnPane; import com.fr.design.selection.QuickEditor; import com.fr.grid.GridUtils; +import com.fr.predefined.PredefinedPatternStyleManager; import com.fr.report.cell.CellElement; import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; @@ -480,19 +480,16 @@ public class CellSelection extends Selection { if (!ServerPreferenceConfig.getInstance().hasStyle()) { UIMenu styleMenu = new UIMenu(KeySetUtils.GLOBAL_STYLE.getMenuName()); styleMenu.setIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cell.png")); - PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig(); String styleName = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle(); - PredefinedStyle currentStyle = config.getStyle(styleName); - if (currentStyle != null) { - Iterator iterator = config.getStyle(styleName).getCellStyleConfig().getStyleNameIterator(); - while (iterator.hasNext()) { - String name = (String) iterator.next(); - name = GlobalStyleMenuDef.judgeChina(name); - NameStyle nameStyle = NameStyle.createPredefinedStyle(styleName, name, Style.getInstance()); - UpdateAction.UseMenuItem useMenuItem = new GlobalStyleSelection(ePane, nameStyle).createUseMenuItem(); - useMenuItem.setNameStyle(nameStyle); - styleMenu.add(useMenuItem); - } + PredefinedStyle currentStyle = PredefinedPatternStyleManager.INSTANCE.getStyleFromName(styleName); + Iterator iterator = currentStyle.getCellStyleConfig().getStyleNameIterator(); + while (iterator.hasNext()) { + String name = (String) iterator.next(); + name = GlobalStyleMenuDef.judgeChina(name); + NameStyle nameStyle = NameStyle.createPredefinedStyle(styleName, name, Style.getInstance()); + UpdateAction.UseMenuItem useMenuItem = new GlobalStyleSelection(ePane, nameStyle).createUseMenuItem(); + useMenuItem.setNameStyle(nameStyle); + styleMenu.add(useMenuItem); } styleMenu.addSeparator(); styleMenu.add(new GlobalStyleMenuDef.CustomStyleAction(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom"))); From d0af9b014c5bf46132979ab6a76f58fd567f3655 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 16 Oct 2020 14:24:02 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/JTemplate.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 14a86fe0a..7943ee8ea 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -60,6 +60,7 @@ import com.fr.file.MemFILE; import com.fr.form.ui.NoneWidget; import com.fr.form.ui.Widget; import com.fr.general.ComparatorUtils; +import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginRuntime; @@ -154,13 +155,20 @@ public abstract class JTemplate> consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile)); initAndStartPlugin(); + setPredefinedInfo(isNewFile); + } + + private void setPredefinedInfo(boolean isNewFile){ if (this.template.getAttrMark(PredefinedStyleAttrMark.XML_TAG) == null) { - this.template.addAttrMark(new PredefinedStyleAttrMark()); + PredefinedStyleAttrMark attrMark= new PredefinedStyleAttrMark(); + if (!isNewFile){ + attrMark.setPreferenceStyleName(InterProviderFactory.getProvider().getLocText("Fine-Engine_Predefined_Style_Compatibility")); + } + this.template.addAttrMark(attrMark); } } - private void initAndStartPlugin() { initPluginPane(); startListenPlugin(); From 6ef2bb2717bbe19525084c1484c9bd84cd934d96 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 16 Oct 2020 14:38:38 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/predefined/ui/PredefinedStyleSelectPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSelectPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSelectPane.java index 565243424..227c9e30d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSelectPane.java @@ -51,7 +51,7 @@ public class PredefinedStyleSelectPane extends BasicPane { contentPane.removeAll(); Iterator iterator = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig().getPredefinedStyleIterator(); int rowCount = (ServerPreferenceConfig.getInstance().getPreferenceStyleConfig().getPredefinedSize() +2)/ 3; - contentPane.setPreferredSize(new Dimension(618, 210 * rowCount)); + contentPane.setPreferredSize(new Dimension(618, 220 * rowCount)); while (iterator.hasNext()) { PredefinedStyle tmpStyle = iterator.next(); From 46faea6b85b60a5e9feea43912d908e1b75066f8 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 16 Oct 2020 15:09:09 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BD=91=E5=9D=80key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/predefined/info/PredefinedStyleInfoCollector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java index 2827cbee0..6e6150c23 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java @@ -18,7 +18,7 @@ public class PredefinedStyleInfoCollector extends AbstractPointCollector { private static final String SIMPLE_DATE_PATTERN = "yyyy-MM-dd"; private static final String XML_TAG = "PredefinedStyleInfo"; private static final String XML_FILE_NAME = "predefinedStyle.info"; - private static final String CLOUD_URL = CloudCenter.getInstance().acquireUrlByKind("predefinedInfo.collector") + "/single"; + private static final String CLOUD_URL = CloudCenter.getInstance().acquireUrlByKind("design.collector") + "/single"; private static final String FUNCTION_NAME = "predefinedStyle"; private static final String FUNCTION_ID = "FR-F7003"; From 0bbb6a54f036836b0e45b88a857d102503e08343 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 16 Oct 2020 15:27:43 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/predefined/ui/PredefinedStyleEditPane.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java index 771da4613..8a611886c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java @@ -27,6 +27,7 @@ import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.Dimension; import java.util.Iterator; import java.util.LinkedHashMap; @@ -36,6 +37,8 @@ import java.util.Map; * Created by kerry on 2020-08-26 */ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane { + private static final Color TIP_COLOR = Color.decode("#8F8F92"); + private PredefinedStylePreviewPane previewPane; private UITextField styleNameField; private PredefinedBackgroundSettingPane backgroundSettingPane; @@ -189,9 +192,13 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane { private JPanel createComponentStyleSettingPane() { JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.setLayout(new BorderLayout(0, 5)); jPanel.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 5)); this.componentStyleSettingPane = new ComponentStyleSettingPane(); - jPanel.add(this.componentStyleSettingPane); + UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Predefined_ComponentStyle_Setting_Tip")); + label.setForeground(TIP_COLOR); + jPanel.add(label, BorderLayout.NORTH); + jPanel.add(this.componentStyleSettingPane, BorderLayout.CENTER); return jPanel; }