From ab4f4465686579f917794a628389495c2eed5dcd Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 15 Dec 2020 11:37:09 +0800 Subject: [PATCH 1/6] =?UTF-8?q?KERNEL-6224=20=E6=96=B0=E5=A2=9E=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=93=8D=E4=BD=9C=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 13 ++++++++++++- .../fr/design/mainframe/JTemplateEvent.java | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/JTemplateEvent.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 6c6de287e..316f48fc3 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 @@ -49,6 +49,7 @@ import com.fr.design.menu.ShortCut; import com.fr.design.preview.PagePreview; import com.fr.design.write.submit.DBManipulationInWidgetEventPane; import com.fr.design.write.submit.DBManipulationPane; +import com.fr.event.EventDispatcher; import com.fr.file.FILE; import com.fr.file.FILEChooserPane; import com.fr.file.MemFILE; @@ -107,7 +108,6 @@ public abstract class JTemplate> private DesignModelAdapter designModel; private PreviewProvider previewType; protected TimeConsumeTimer consumeTimer = new TimeConsumeTimer(); - public int resolution = ScreenResolution.getScreenResolution(); private PluginEventListener pluginListener; @@ -125,6 +125,7 @@ public abstract class JTemplate> public JTemplate(T t, FILE file, boolean isNewFile) { super(t); + beforeInit(); // 判断是否切换设计器状态到禁止拷贝剪切 if (t.getAttrMark(DesignBanCopyAttrMark.XML_TAG) != null) { DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.BAN_COPY_AND_CUT); @@ -301,6 +302,13 @@ public abstract class JTemplate> } + /** + * 模板初始化之前 + */ + private void beforeInit() { + EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_INIT, this); + } + /** * 模板关闭时 */ @@ -309,6 +317,7 @@ public abstract class JTemplate> PluginListenerRegistration.getInstance().stopListen(this.pluginListener); } + /** * 刷新内部资源 * @@ -1083,6 +1092,7 @@ public abstract class JTemplate> * 激活已存在的模板 */ public void activeOldJTemplate() { + EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_ACTIVE, this); DesignerContext.getDesignerFrame().activateJTemplate(this); } @@ -1090,6 +1100,7 @@ public abstract class JTemplate> * 激活新的模板 */ public void activeNewJTemplate() { + EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_ACTIVE, this); DesignerContext.getDesignerFrame().addAndActivateJTemplate(this); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateEvent.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateEvent.java new file mode 100644 index 000000000..d60d06474 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateEvent.java @@ -0,0 +1,19 @@ +package com.fr.design.mainframe; + +import com.fr.event.Event; + +/** + * Created by kerry on 2020-12-11 + */ +public enum JTemplateEvent implements Event { + /** + * 模板初始化之前 + */ + BEFORE_TEMPLATE_INIT, + + /** + * 模板激活之前 + */ + BEFORE_TEMPLATE_ACTIVE + +} From 0d92fd4e9d3bfe39f68696f0e30ca7064f527c99 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 15 Dec 2020 11:40:29 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormDesignerUI.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java index a21a2efad..cdec956ed 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java @@ -49,7 +49,6 @@ public class FormDesignerUI extends ComponentUI { private FormDesigner designer; private SelectionModel selectionModel; private Rectangle2D.Double back_or_selection_rect = new Rectangle2D.Double(0, 0, 0, 0); - private float time; public FormDesignerUI() { } @@ -71,7 +70,6 @@ public class FormDesignerUI extends ComponentUI { @Override public void paint(final Graphics g, JComponent c) { XCreator rootComponent = designer.getRootComponent(); - this.time = (float) designer.getResolution() / ScreenResolution.getScreenResolution(); AffineTransform at = new AffineTransform(); if (rootComponent.getParent() != null) { at.translate(designer.getPaintX(), designer.getPaintY()); From 454e69707bd76de4df30f9f813b74575d0123ba5 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 15 Dec 2020 11:43:33 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormDesignerUI.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java index cdec956ed..7c3e86a57 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe; import com.fr.base.GraphHelper; -import com.fr.base.ScreenResolution; import com.fr.base.Utils; import com.fr.base.iofile.attr.WatermarkAttr; import com.fr.base.vcs.DesignerMode; From 0bb145cb4122d202ce5e3fed895b393d870f5b1a Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 15 Dec 2020 16:06:16 +0800 Subject: [PATCH 4/6] =?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 ++++++++++-- .../com/fr/design/mainframe/JVirtualTemplate.java | 3 +++ 2 files changed, 13 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 316f48fc3..eb191383f 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 @@ -309,6 +309,13 @@ public abstract class JTemplate> EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_INIT, this); } + /** + * 模板激活之前之前 + */ + protected void beforeActive() { + EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_ACTIVE, this); + } + /** * 模板关闭时 */ @@ -1085,6 +1092,7 @@ public abstract class JTemplate> * 激活指定的template */ public void activeJTemplate(int index, JTemplate jt) { + beforeActive(); DesignerContext.getDesignerFrame().activateJTemplate(this); } @@ -1092,7 +1100,7 @@ public abstract class JTemplate> * 激活已存在的模板 */ public void activeOldJTemplate() { - EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_ACTIVE, this); + beforeActive(); DesignerContext.getDesignerFrame().activateJTemplate(this); } @@ -1100,7 +1108,7 @@ public abstract class JTemplate> * 激活新的模板 */ public void activeNewJTemplate() { - EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_ACTIVE, this); + beforeActive(); DesignerContext.getDesignerFrame().addAndActivateJTemplate(this); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java index 64a10c88f..911c0dc17 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java @@ -208,6 +208,7 @@ public class JVirtualTemplate extends JTemplate { @Override public void activeJTemplate(int index, JTemplate jt) { + beforeActive(); List> historyList = HistoryTemplateListPane.getInstance().getHistoryList(); historyList.set(index, jt); DesignerContext.getDesignerFrame().addAndActivateJTemplate(jt); @@ -217,11 +218,13 @@ public class JVirtualTemplate extends JTemplate { @Override public void activeOldJTemplate() { + beforeActive(); DesignerContext.getDesignerFrame().openTemplate(this.getEditingFILE()); } @Override public void activeNewJTemplate() { + beforeActive(); DesignerContext.getDesignerFrame().openTemplate(this.getEditingFILE()); } From 69f0ecdcbf5f04a812ee94427c5c250bd8e437dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 15 Dec 2020 16:55:27 +0800 Subject: [PATCH 5/6] =?UTF-8?q?CHART-17429=20=20=20=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E8=BD=B4=E9=87=8D=E7=BD=AE=E9=9D=A2=E6=9D=BF=E6=97=B6?= =?UTF-8?q?=E5=80=99=E9=87=8D=E7=BD=AEhtml=E9=A1=B5=E9=9D=A2=E7=9B=91?= =?UTF-8?q?=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java index 1a4fccf58..cd6c4fcf6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java @@ -176,6 +176,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { gaugeStyle = gaugePlot.getGaugeStyle(); reLayoutPane(false); parent.initAllListeners(); + setParentPane(parent); } populateBean(gaugePlot.getGaugeAxis()); } From 676980d1230f91d5e3ab0c2e304a37b03cc2168b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 15 Dec 2020 17:27:02 +0800 Subject: [PATCH 6/6] =?UTF-8?q?CHART-15835=20=20=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/style/label/VanChartPlotLabelDetailPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index 20ce7452b..624e6c879 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -158,14 +158,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return jPanel; } - private JPanel createLabelBorderPane() { + protected JPanel createLabelBorderPane() { borderPane = new VanChartBorderWithShapePane(); borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); return borderPaneWithTitle; } - private JPanel createLabelBackgroundPane() { + protected JPanel createLabelBackgroundPane() { backgroundPane = new VanChartBackgroundWithOutImagePane() { protected Component[][] getPaneComponents() {