From 13dabcebc726cdbfad3ac5eb34b1d0e85918454b Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Wed, 28 Nov 2018 10:51:36 +0800 Subject: [PATCH 01/13] REPORT-12635 --- .../src/main/java/com/fr/design/web/CustomIconPane.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java b/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java index 90d5874ecb..edce02c7af 100644 --- a/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java +++ b/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java @@ -24,6 +24,8 @@ import com.fr.stable.Constants; import com.fr.stable.CoreGraphHelper; import com.fr.stable.ListMap; import com.fr.stable.StringUtils; +import com.fr.transaction.Configurations; +import com.fr.transaction.WorkerFacade; import javax.swing.*; import javax.swing.event.ChangeEvent; @@ -283,6 +285,13 @@ public class CustomIconPane extends BasicPane { } public String update() { + //把图标信息入库 + Configurations.update(new WorkerFacade(WidgetInfoConfig.class) { + @Override + public void run() { + WidgetInfoConfig.getInstance().setIconManager(IconManager.getIconManager()); + } + }); return selectedIconName; } From 0a54a24cf43363fd85bc009b75860a2c67ddb770 Mon Sep 17 00:00:00 2001 From: zheng Date: Wed, 28 Nov 2018 14:38:59 +0800 Subject: [PATCH 02/13] =?UTF-8?q?CHART-3215=20=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/van/chart/designer/TableLayout4VanChartHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/TableLayout4VanChartHelper.java b/designer-chart/src/main/java/com/fr/van/chart/designer/TableLayout4VanChartHelper.java index ed94fd15c9..da918bb792 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/TableLayout4VanChartHelper.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/TableLayout4VanChartHelper.java @@ -37,7 +37,7 @@ public class TableLayout4VanChartHelper { public static JPanel createExpandablePaneWithTitle(String title, Component[][] components) { JPanel panel = createGapTableLayoutPane(components); - return createExpandablePaneWithTitle(title, panel); + return createExpandablePaneWithTitleTopGap(title, panel); } public static JPanel createExpandablePaneWithTitle(String title, JPanel panel) { From 01f5d14d523ca1fd8e6c14d564dceab52b6e3b00 Mon Sep 17 00:00:00 2001 From: zheng Date: Wed, 28 Nov 2018 15:48:29 +0800 Subject: [PATCH 03/13] =?UTF-8?q?CHART-3223=20&&=20CHART-3246=20&&=20CHART?= =?UTF-8?q?-3248=20=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/AbstractExtendedChartReportDataPane.java | 14 ++++++++------ .../chart/AbstractExtendedChartTableDataPane.java | 7 ++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java index 950d71e8c0..e42707a62a 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java @@ -6,6 +6,7 @@ import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; import javax.swing.BorderFactory; @@ -49,16 +50,17 @@ public abstract class AbstractExtendedChartReportDataPane Date: Thu, 29 Nov 2018 17:36:22 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E6=95=B4=E7=90=86=E5=BC=80=E6=94=BE=E6=8E=A5=E5=8F=A3=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/fun/JavaScriptActionProvider.java | 16 ++++++++++++++-- .../impl/AbstractJavaScriptActionProvider.java | 16 ++++++++++++---- .../design/javascript/JavaScriptActionPane.java | 3 ++- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/JavaScriptActionProvider.java b/designer-base/src/main/java/com/fr/design/fun/JavaScriptActionProvider.java index 754bdaeb4a..5f1f1aa5aa 100644 --- a/designer-base/src/main/java/com/fr/design/fun/JavaScriptActionProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/JavaScriptActionProvider.java @@ -2,11 +2,12 @@ package com.fr.design.fun; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.javascript.JavaScriptActionPane; +import com.fr.design.mainframe.JTemplate; import com.fr.js.JavaScript; import com.fr.stable.fun.mark.Mutable; /** - * Created by zack on 2015/8/14. + * 控件的事件扩展接口 */ public interface JavaScriptActionProvider extends Mutable{ @@ -14,10 +15,21 @@ public interface JavaScriptActionProvider extends Mutable{ int CURRENT_LEVEL = 1; + /** + * 事件的界面 + */ FurtherBasicBeanPane getJavaScriptActionPane(); + /** + * 这个界面在哪些类型模板设计的时候会出现 + * @see com.fr.design.mainframe.JWorkBook + * @see com.fr.design.mainframe.JForm + */ + boolean accept(JTemplate template); + + @Deprecated FurtherBasicBeanPane getJavaScriptActionPane(JavaScriptActionPane pane); + @Deprecated boolean isSupportType(); - } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java index 4640eaf4fa..7f57f35a5d 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java @@ -3,6 +3,8 @@ package com.fr.design.fun.impl; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.fun.JavaScriptActionProvider; import com.fr.design.javascript.JavaScriptActionPane; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.JTemplate; import com.fr.js.JavaScript; import com.fr.stable.fun.impl.AbstractProvider; import com.fr.stable.fun.mark.API; @@ -27,10 +29,16 @@ public abstract class AbstractJavaScriptActionProvider extends AbstractProvider return getJavaScriptActionPane(); } - /** - * 判断是否是支持的类型(cpt,frm),默认是 - * @return - */ + @Override + public boolean accept(JTemplate template) { + // 这里只是为了兼容原来的isSupportType方法 + boolean result = isSupportType(); + if (result) { + return true; + } + return true; + } + @Override public boolean isSupportType(){ return true; diff --git a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java index 05208762e3..3b025ae1fa 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java @@ -7,6 +7,7 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.fun.JavaScriptActionProvider; import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.write.submit.DBManipulationPane; import com.fr.form.ui.WebContentUtils; import com.fr.js.JavaScript; @@ -45,7 +46,7 @@ public abstract class JavaScriptActionPane extends UIComboBoxPane { Set javaScriptActionProviders = ExtraDesignClassManager.getInstance().getArray(JavaScriptActionProvider.XML_TAG); if (javaScriptActionProviders != null) { for (JavaScriptActionProvider jsp : javaScriptActionProviders) { - if(jsp.isSupportType()){ + if(jsp.accept(DesignerContext.getDesignerFrame().getSelectedJTemplate())){ paneList.add(jsp.getJavaScriptActionPane(this)); } } From 34d8785d70fb6beb930d9f5c552eaebc292bc5e9 Mon Sep 17 00:00:00 2001 From: richie Date: Thu, 29 Nov 2018 17:55:22 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E6=95=B4=E7=90=86=E5=BC=80=E6=94=BE=E6=8E=A5=E5=8F=A3=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/fun/HyperlinkProvider.java | 31 ++++++++++++++++--- .../fun/impl/AbstractHyperlinkProvider.java | 24 ++++++++++++++ 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/HyperlinkProvider.java b/designer-base/src/main/java/com/fr/design/fun/HyperlinkProvider.java index 448a120fea..9b58b96898 100644 --- a/designer-base/src/main/java/com/fr/design/fun/HyperlinkProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/HyperlinkProvider.java @@ -1,21 +1,44 @@ package com.fr.design.fun; +import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.controlpane.NameableCreator; -import com.fr.stable.fun.Level; +import com.fr.js.Hyperlink; import com.fr.stable.fun.mark.Mutable; /** * Created by zack on 2016/1/20. */ -public interface HyperlinkProvider extends Mutable { +public interface HyperlinkProvider extends Mutable { String XML_TAG = "HyperlinkProvider"; int CURRENT_LEVEL = 2; /** - * 创建一个超级连接类型 - * @return NameableCreator + * 超级链接的描述信息,如果是实现类中重载了这个方法,就不需要再实现下面的三个方法: + * @see HyperlinkProvider#text() + * @see HyperlinkProvider#target() + * @see HyperlinkProvider#appearance() + * 如果并不重载,就需要分别实现上面的三个方法,不推荐重载这个方法 + * @return 描述信息 */ NameableCreator createHyperlinkCreator(); + + /** + * 超级链接的名字 + * @return 名字 + */ + String text(); + + /** + * 超级链接的实现类 + * @return 实现类 + */ + Class target(); + + /** + * 超级链接的界面配置类 + * @return 配置类 + */ + Class> appearance(); } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractHyperlinkProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractHyperlinkProvider.java index bc5d5115a8..9c74795d8e 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractHyperlinkProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractHyperlinkProvider.java @@ -1,6 +1,10 @@ package com.fr.design.fun.impl; +import com.fr.design.beans.BasicBeanPane; import com.fr.design.fun.HyperlinkProvider; +import com.fr.design.gui.controlpane.NameObjectCreator; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.stable.StringUtils; import com.fr.stable.fun.impl.AbstractProvider; import com.fr.stable.fun.mark.API; @@ -18,4 +22,24 @@ public abstract class AbstractHyperlinkProvider extends AbstractProvider impleme public String mark4Provider() { return getClass().getName(); } + + @Override + public NameableCreator createHyperlinkCreator() { + return new NameObjectCreator(text(), target(), appearance()); + } + + @Override + public String text() { + return StringUtils.EMPTY; + } + + @Override + public Class target() { + return null; + } + + @Override + public Class appearance() { + return null; + } } \ No newline at end of file From 20a39e41ed7d2fad167ce6a6e0d8993d42ea57fd Mon Sep 17 00:00:00 2001 From: zack Date: Mon, 3 Dec 2018 20:17:54 +0800 Subject: [PATCH 06/13] =?UTF-8?q?REPORT-13215=2010.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=90=AF=E5=8A=A8=E8=BF=87=E7=A8=8B=E4=B8=AD=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E7=94=B1=E4=BA=8E=E6=8A=A5=E9=94=99=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=99=BD=E8=89=B2=E8=92=99=E5=B1=82=E4=B8=8D=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/BaseDesigner.java | 2 ++ .../src/main/java/com/fr/start/ServerStarter.java | 13 +++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/start/BaseDesigner.java b/designer-base/src/main/java/com/fr/start/BaseDesigner.java index 3e466ed1f3..b1931f284f 100644 --- a/designer-base/src/main/java/com/fr/start/BaseDesigner.java +++ b/designer-base/src/main/java/com/fr/start/BaseDesigner.java @@ -64,6 +64,8 @@ public abstract class BaseDesigner extends ToolBarMenuDock { TemplateTreePane.getInstance().getTemplateFileTree().refresh(); } DesignerContext.getDesignerFrame().updateProgress(PERCENT_COMPLETE); + throw new NullPointerException(); + } diff --git a/designer-base/src/main/java/com/fr/start/ServerStarter.java b/designer-base/src/main/java/com/fr/start/ServerStarter.java index 3115730d17..6d20cf12a5 100644 --- a/designer-base/src/main/java/com/fr/start/ServerStarter.java +++ b/designer-base/src/main/java/com/fr/start/ServerStarter.java @@ -5,18 +5,11 @@ import com.fr.design.DesignerEnvManager; import com.fr.design.utils.BrowseUtils; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.OperatingSystem; import com.fr.stable.StableUtils; import com.fr.start.server.FineEmbedServer; import com.fr.start.server.FineEmbedServerMonitor; import com.fr.workspace.WorkContext; -import javax.swing.JOptionPane; -import java.awt.Desktop; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -66,7 +59,11 @@ public class ServerStarter { @Override public void run() { - FineEmbedServer.start(); + try { + FineEmbedServer.start(); + } finally { + FineEmbedServerMonitor.getInstance().setComplete(); + } BrowseUtils.browser(url); } }); From 03806dcb611ba4776dd22076d5a52cd239368091 Mon Sep 17 00:00:00 2001 From: zack Date: Mon, 3 Dec 2018 20:19:23 +0800 Subject: [PATCH 07/13] rt --- designer-base/src/main/java/com/fr/start/BaseDesigner.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/start/BaseDesigner.java b/designer-base/src/main/java/com/fr/start/BaseDesigner.java index b1931f284f..6b513657bb 100644 --- a/designer-base/src/main/java/com/fr/start/BaseDesigner.java +++ b/designer-base/src/main/java/com/fr/start/BaseDesigner.java @@ -64,7 +64,6 @@ public abstract class BaseDesigner extends ToolBarMenuDock { TemplateTreePane.getInstance().getTemplateFileTree().refresh(); } DesignerContext.getDesignerFrame().updateProgress(PERCENT_COMPLETE); - throw new NullPointerException(); } From 819da17ad5d0d94e044f875a62483079ed95598e Mon Sep 17 00:00:00 2001 From: zack Date: Mon, 3 Dec 2018 20:19:44 +0800 Subject: [PATCH 08/13] rt --- designer-base/src/main/java/com/fr/start/BaseDesigner.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/start/BaseDesigner.java b/designer-base/src/main/java/com/fr/start/BaseDesigner.java index 6b513657bb..3e466ed1f3 100644 --- a/designer-base/src/main/java/com/fr/start/BaseDesigner.java +++ b/designer-base/src/main/java/com/fr/start/BaseDesigner.java @@ -64,7 +64,6 @@ public abstract class BaseDesigner extends ToolBarMenuDock { TemplateTreePane.getInstance().getTemplateFileTree().refresh(); } DesignerContext.getDesignerFrame().updateProgress(PERCENT_COMPLETE); - } From ef07745d35dede2b4b34111828f9abbe263e563a Mon Sep 17 00:00:00 2001 From: zack Date: Mon, 3 Dec 2018 20:20:11 +0800 Subject: [PATCH 09/13] =?UTF-8?q?REPORT-13215=2010.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=90=AF=E5=8A=A8=E8=BF=87=E7=A8=8B=E4=B8=AD=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E7=94=B1=E4=BA=8E=E6=8A=A5=E9=94=99=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=99=BD=E8=89=B2=E8=92=99=E5=B1=82=E4=B8=8D=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/start/module/DesignerStartup.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java index 71f197ea6e..701a6936c1 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java @@ -52,9 +52,11 @@ public class DesignerStartup extends Activator { @Override public void run() { - - designer.show(args); - DesignerContext.getDesignerFrame().getProgressDialog().dispose(); + try { + designer.show(args); + } finally { + DesignerContext.getDesignerFrame().getProgressDialog().dispose(); + } } }); service.shutdown(); From cb8ad88b188be54d989c63577f0f57d5cedd00ca Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 4 Dec 2018 18:55:44 +0800 Subject: [PATCH 10/13] =?UTF-8?q?REPORT-13254=2010.0=E7=9A=84=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8mac=E4=B8=8D=E8=83=BD=E7=82=B9=E6=9C=80?= =?UTF-8?q?=E5=A4=A7=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/com/fr/start/jni/splash.dylib | Bin 57200 -> 57200 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/designer-realize/src/main/resources/com/fr/start/jni/splash.dylib b/designer-realize/src/main/resources/com/fr/start/jni/splash.dylib index 2b59ee3eb04f6377b0a8f06d9f60096a1216ee32..6ae677da37199ce7ebe825dbb5590452bdb081dd 100755 GIT binary patch delta 7366 zcmai23s_Ufww|4^F^EWlglB;81{FxaNKj({A4J811q-MMsP*`23l@%8^~4HTW2EIc zRk8M})mCk5Es9#D>OoY%YJFg>uU4#D4Qdt9`ao;Wnmx0%`rZ58{e8*W|62d7S+mxx z**j_9CvD#+ty-i=c1OZ>tT&a(TUW+&+$nsLOHmvdMs-oO-?-^~T<+*QV* z0}wJ}9el^T24T+$*=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r!*}*<%0WNxP~d{#?A`+au)kwv97LREes{G=0aY xZ?&msrY%{XbubFZs^&U^WTF6HjVo=bk8J8a8tS@#I*jMA6A{s#px24(;N From d457793b7fa34677cc0cadea265751d49a79f1d9 Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 4 Dec 2018 20:38:24 +0800 Subject: [PATCH 11/13] =?UTF-8?q?DEC-5669=20=E8=BF=9C=E7=A8=8B=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=88=B0=E6=9C=AC=E5=9C=B0=E6=97=B6=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/start/server/FineEmbedServerActivator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java index 982b3633dc..2d08b286d5 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java @@ -49,7 +49,7 @@ public class FineEmbedServerActivator extends Activator { stopSpring(); stopServerActivator(); stopTomcat(); - } catch (LifecycleException e) { + } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } From 04cbb4e93226441185e187711744857b6bf1eee8 Mon Sep 17 00:00:00 2001 From: zheng Date: Tue, 4 Dec 2018 21:30:46 +0800 Subject: [PATCH 12/13] =?UTF-8?q?CHART-3460=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=85=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/ChartTypeInterfaceManager.java | 44 ++++++------------- .../design/chart/ChartDesignerActivator.java | 2 + .../com/fr/design/chart/ChartTypePane.java | 21 ++++++--- .../design/chart/gui/ChartWidgetOption.java | 10 +++-- .../impl/ChartHyperPoplinkPane.java | 6 +-- .../mainframe/chart/gui/ChartTypePane.java | 4 +- 6 files changed, 41 insertions(+), 46 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java index 154f4c0976..3a8abb56e5 100644 --- a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java @@ -121,12 +121,17 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr return classManager; } - + static { readDefault(); readVanChart(); PluginModule.registerAgent(PluginModule.ExtraChartDesign, classManager); + } + + //安装插件,图表类型热更新。 + //不在static原因:放在static,启动过程中图表插件init也会触发(不需要) + public static void addPluginChangedListener() { GeneralContext.listenPluginRunningChanged(new PluginEventListener() { @Override @@ -151,42 +156,21 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; - final Chart[][] allCharts = new Chart[typeName.length][]; - for (int i = 0; i < typeName.length; i++) { - String plotID = typeName[i].getPlotID(); + int index = 0; + for (ChartInternationalNameContentBean bean : typeName) { + String plotID = bean.getPlotID(); Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); - if (ArrayUtils.isEmpty(rowChart)) { + if (ArrayUtils.isEmpty(rowChart) && !ChartTypeManager.innerChart(plotID)) { continue; } String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); Icon icon = IOUtils.readIcon(iconPath); - child[i] = new ChartWidgetOption(com.fr.design.i18n.Toolkit.i18nText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); - - allCharts[i] = rowChart; + child[index] = new ChartWidgetOption(com.fr.design.i18n.Toolkit.i18nText(bean.getName()), icon, ChartEditor.class, plotID); + index++; } return child; } - - //加载所有图表图片 - private static void initAllChartsDemoImage(Chart[][] allCharts) { - - for (Chart[] rowChart : allCharts) { - if (rowChart == null) { - continue; - } - //加载初始化图表模型图片 - initChartsDemoImage(rowChart); - } - } - - private static void initChartsDemoImage(Chart[] rowChart) { - - for (Chart aRowChart : rowChart) { - //此时,为图片生成模型数据 - aRowChart.createSlotImage(); - } - } private static void readVanChart() { @@ -252,7 +236,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr } } - private static IndependentChartUIProvider getChartTypeInterface(String plotID) { + private IndependentChartUIProvider getChartTypeInterface(String plotID) { if (idAndPriorityMap.containsKey(plotID)) { String priority = idAndPriorityMap.get(plotID); if (chartTypeInterfaces.containsKey(priority)) { @@ -303,7 +287,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr } } - private static String getChartName(String plotID, IndependentChartUIProvider provider) { + private String getChartName(String plotID, IndependentChartUIProvider provider) { String name = provider.getPlotTypeTitle4PopupWindow(); if (StringUtils.isEmpty(name)) { name = ChartTypeManager.getInstance().getChartName(plotID); diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java index de7e5ec8a4..c3213c10ba 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java @@ -52,6 +52,8 @@ public class ChartDesignerActivator extends Activator implements Prepare { DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance()); DesignImageEvent.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); + + ChartTypeInterfaceManager.addPluginChangedListener(); } @Override diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java index b4efa05a4f..5cc3c8d50c 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java @@ -15,25 +15,32 @@ import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; - import com.fr.license.exception.RegistEditionException; import com.fr.license.function.VT4FR; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.DefaultListCellRenderer; +import javax.swing.DefaultListModel; +import javax.swing.JList; +import javax.swing.JOptionPane; +import javax.swing.JScrollPane; +import javax.swing.JSplitPane; +import javax.swing.ListCellRenderer; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import java.awt.*; +import java.awt.Color; +import java.awt.Component; public class ChartTypePane extends ChartCommonWizardPane { private static final long serialVersionUID = -1175602484968520546L; - private ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); + private ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstanceWithCheck().getAllChartBaseNames(); private Chart[][] charts4Icon = null; { charts4Icon = new Chart[this.typeName.length][]; for (int i = 0; i < this.typeName.length; i++) { - Chart[] rowCharts = ChartTypeManager.getInstance().getChartTypes(this.typeName[i].getPlotID()); + Chart[] rowCharts = ChartTypeManager.getInstanceWithCheck().getChartTypes(this.typeName[i].getPlotID()); int rowChartsCount = rowCharts.length; charts4Icon[i] = new Chart[rowChartsCount]; for (int j = 0; j < rowChartsCount; j++) { @@ -137,7 +144,7 @@ public class ChartTypePane extends ChartCommonWizardPane { int subIndex = 0; for (int i = 0; i < typeName.length; i++) { - Chart [] charts = ChartTypeManager.getInstance().getChartTypes(typeName[i].getPlotID()); + Chart[] charts = ChartTypeManager.getInstanceWithCheck().getChartTypes(typeName[i].getPlotID()); for (int j = 0; j < charts.length; j++) { if (charts[j].getPlot().match4GUI(plot)) { mainIndex = i; @@ -154,7 +161,7 @@ public class ChartTypePane extends ChartCommonWizardPane { public void update(Chart oldChart) { String plotID = typeName[mainTypeList.getSelectedIndex()].getPlotID(); - Chart chart = ChartTypeManager.getInstance().getChartTypes(plotID)[iconViewList.getSelectedIndex()]; + Chart chart = ChartTypeManager.getInstanceWithCheck().getChartTypes(plotID)[iconViewList.getSelectedIndex()]; if(chart.getPlot() != null){ if(chart.getPlot() instanceof MapPlot && !supportMap()){ JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Map_Not_Supported")); diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartWidgetOption.java b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartWidgetOption.java index c87a7a8ed4..783bfdd6a6 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartWidgetOption.java +++ b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartWidgetOption.java @@ -2,11 +2,12 @@ package com.fr.design.chart.gui; import com.fr.base.FRContext; import com.fr.chart.chartattr.Chart; +import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.gui.core.WidgetOption; import com.fr.form.ui.ChartEditor; import com.fr.form.ui.Widget; -import javax.swing.*; +import javax.swing.Icon; /** * 表单中 图表控件信息, 名称, class, form中通过XcreatorUtils反射类 实现XChartEditor的初始化. @@ -19,13 +20,13 @@ public class ChartWidgetOption extends WidgetOption { private String optionName; private Icon optionIcon; private Class widgetClass; - private Chart chart; + private String chartID; - public ChartWidgetOption(String optionName, Icon optionIcon, Class widgetClass, Chart chart) { + public ChartWidgetOption(String optionName, Icon optionIcon, Class widgetClass, String chartID) { this.optionName = optionName; this.optionIcon = optionIcon; this.widgetClass = widgetClass; - this.chart = chart; + this.chartID = chartID; } /** @@ -37,6 +38,7 @@ public class ChartWidgetOption extends WidgetOption { Class clz = widgetClass(); try { ChartEditor widget = clz.newInstance(); + Chart chart = ChartTypeManager.getInstanceWithCheck().getChartTypes(this.chartID)[0]; widget.addChart((Chart) chart.clone()); return widget; } catch (InstantiationException e) { diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java index f66bc11617..c3db9b7ef3 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java @@ -15,8 +15,8 @@ import com.fr.design.module.DesignModuleFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; - -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Dimension; import java.util.HashMap; /** @@ -66,7 +66,7 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane Date: Wed, 5 Dec 2018 11:33:32 +0800 Subject: [PATCH 13/13] 1 --- .../com/fr/design/web/CustomIconPane.java | 629 +++++++++--------- 1 file changed, 317 insertions(+), 312 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java b/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java index edce02c7af..b85ac113d5 100644 --- a/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java +++ b/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java @@ -41,333 +41,337 @@ import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; /** - * * carl:自定义Icon编辑 - * */ public class CustomIconPane extends BasicPane { - private String selectedIconName = null; - private ListMap iconButtonMap = null; - private JPanel iconPane = null; - private ButtonGroup bg; - private UIScrollPane jsPane; - // 老一次次去拿真麻烦 - private IconManager iconManager = null; - private UIButton removeButton; - private UIButton editButton; - - - - private static final int THE_WIDTH = 180; - private static final int HORIZONTAL_COUNT = 6; - private static final int HEIGHT_PER = 29; - private static final int GAP = 10; - - public CustomIconPane() { - this.initComponents(); - } - - private void initComponents() { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - centerPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon"))); - JPanel noNamePane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); - centerPane.add(noNamePane, BorderLayout.CENTER); - - iconPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - - // 开始加图标选择按钮 - initIcons(); - - jsPane = new UIScrollPane(iconPane); - refreshIconPane(false); - jsPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); - - jsPane.setPreferredSize(new Dimension(200,180)); - noNamePane.add(jsPane); - - DescriptionTextArea des = new DescriptionTextArea(2); - des.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_Message1")); - centerPane.add(des, BorderLayout.SOUTH); - - this.add(centerPane, BorderLayout.CENTER); - - JPanel eastPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); - JPanel buttonPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); - - // 增加、删除、编辑按钮 - initAddButton(buttonPane); - initRemoveButton(buttonPane); - initEditButton(buttonPane); - - eastPane.add(buttonPane); - this.add(eastPane, BorderLayout.EAST); - - } - - private void initIcons() { - iconButtonMap = new ListMap(); - iconManager = WidgetInfoConfig.getInstance().getIconManager(); - bg = new ButtonGroup(); - Object[] names = iconManager.getIconNames(); - Object name = null; - for (int i = 0; i < names.length; i++) { - name = names[i]; - if (name == null || !(name instanceof String)) { - continue; - } - // carl:默认选第一个 - if (this.selectedIconName == null) { - this.selectedIconName = (String)name; - } - IconButton iconButton = new IconButton((String)name); - iconButtonMap.put(name, iconButton); - iconPane.add(iconButton); - bg.add(iconButton); - } - } - - private void initAddButton(JPanel buttonPane) { - UIButton addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add")); - addButton.setPreferredSize(new Dimension(80, 25)); - addButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - final EditIconDialog add = new EditIconDialog(); - add.populate(null); - add.showWindow(SwingUtilities.getWindowAncestor(CustomIconPane.this), new DialogActionAdapter() { - @Override - public void doOk() { - Icon icon = add.update(); - if (iconManager.addIcon(icon, false)) { - IconButton iconButton = null;//初始化 - - addIcon(icon, iconButton); - - }else { - // add failed - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_Message2"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.WARNING_MESSAGE); - } - } + private String selectedIconName = null; + private ListMap iconButtonMap = null; + private JPanel iconPane = null; + private ButtonGroup bg; + private UIScrollPane jsPane; + // 老一次次去拿真麻烦 + private IconManager iconManager = null; + private UIButton removeButton; + private UIButton editButton; + + + private static final int THE_WIDTH = 180; + private static final int HORIZONTAL_COUNT = 6; + private static final int HEIGHT_PER = 29; + private static final int GAP = 10; + + public CustomIconPane() { + this.initComponents(); + } + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + centerPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon"))); + JPanel noNamePane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); + centerPane.add(noNamePane, BorderLayout.CENTER); + + iconPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + + // 开始加图标选择按钮 + initIcons(); + + jsPane = new UIScrollPane(iconPane); + refreshIconPane(false); + jsPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); + + jsPane.setPreferredSize(new Dimension(200, 180)); + noNamePane.add(jsPane); + + DescriptionTextArea des = new DescriptionTextArea(2); + des.setText(createDescriptionText()); + centerPane.add(des, BorderLayout.SOUTH); + + this.add(centerPane, BorderLayout.CENTER); + + JPanel eastPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); + JPanel buttonPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); + + // 增加、删除、编辑按钮 + initAddButton(buttonPane); + initRemoveButton(buttonPane); + initEditButton(buttonPane); + + eastPane.add(buttonPane); + this.add(eastPane, BorderLayout.EAST); + + } + + + protected String createDescriptionText(){ + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_Message1"); + } + + private void initIcons() { + iconButtonMap = new ListMap(); + iconManager = WidgetInfoConfig.getInstance().getIconManager(); + bg = new ButtonGroup(); + Object[] names = iconManager.getIconNames(); + Object name = null; + for (int i = 0; i < names.length; i++) { + name = names[i]; + if (name == null || !(name instanceof String)) { + continue; + } + // carl:默认选第一个 + if (this.selectedIconName == null) { + this.selectedIconName = (String) name; + } + IconButton iconButton = new IconButton((String) name); + iconButtonMap.put(name, iconButton); + iconPane.add(iconButton); + bg.add(iconButton); + } + } + + private void initAddButton(JPanel buttonPane) { + UIButton addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add")); + addButton.setPreferredSize(new Dimension(80, 25)); + addButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + final EditIconDialog add = new EditIconDialog(); + add.populate(null); + add.showWindow(SwingUtilities.getWindowAncestor(CustomIconPane.this), new DialogActionAdapter() { + @Override + public void doOk() { + Icon icon = add.update(); + if (iconManager.addIcon(icon, false)) { + IconButton iconButton = null;//初始化 + + addIcon(icon, iconButton); + + } else { + // add failed + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_Message2"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.WARNING_MESSAGE); + } + } }).setVisible(true); - } - }); - buttonPane.add(addButton); - } - - private void initRemoveButton(JPanel buttonPane) { - removeButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); - removeButton.setPreferredSize(new Dimension(80, 25)); - removeButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (iconManager.isSystemIcon(selectedIconName)) { - return; - } - if (iconManager.removeIcon(selectedIconName)) { - IconButton iconButton = (IconButton)iconButtonMap.get(selectedIconName); - iconPane.remove(iconButton); - iconButtonMap.remove(selectedIconName); - bg.remove(iconButton); - selectedIconName = ((IconButton)iconButtonMap.getByIndex(0)).iconName; - refreshIconPane(false); - CustomIconPane.this.validate(); - CustomIconPane.this.repaint(); - } else { - // remove failed - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_Message2"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), - JOptionPane.WARNING_MESSAGE); - } - } - }); - buttonPane.add(removeButton); - } - - private void initEditButton(JPanel buttonPane) { - editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); - editButton.setPreferredSize(new Dimension(80, 25)); - editButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (iconManager.isSystemIcon(selectedIconName)) { - return; - } - Icon oldIcon = null; - try { - oldIcon= iconManager.getIcon(selectedIconName); - } catch (CloneNotSupportedException e1) { + } + }); + buttonPane.add(addButton); + } + + private void initRemoveButton(JPanel buttonPane) { + removeButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); + removeButton.setPreferredSize(new Dimension(80, 25)); + removeButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + if (iconManager.isSystemIcon(selectedIconName)) { + return; + } + if (iconManager.removeIcon(selectedIconName)) { + IconButton iconButton = (IconButton) iconButtonMap.get(selectedIconName); + iconPane.remove(iconButton); + iconButtonMap.remove(selectedIconName); + bg.remove(iconButton); + selectedIconName = ((IconButton) iconButtonMap.getByIndex(0)).iconName; + refreshIconPane(false); + CustomIconPane.this.validate(); + CustomIconPane.this.repaint(); + } else { + // remove failed + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_Message2"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + JOptionPane.WARNING_MESSAGE); + } + } + }); + buttonPane.add(removeButton); + } + + private void initEditButton(JPanel buttonPane) { + editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); + editButton.setPreferredSize(new Dimension(80, 25)); + editButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + if (iconManager.isSystemIcon(selectedIconName)) { + return; + } + Icon oldIcon = null; + try { + oldIcon = iconManager.getIcon(selectedIconName); + } catch (CloneNotSupportedException e1) { // do nothing - } - if (oldIcon == null) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), - "Error", - "Error", - JOptionPane.ERROR_MESSAGE); - } - - final EditIconDialog edit = new EditIconDialog(); - edit.populate(oldIcon); - edit.showWindow(DesignerContext.getDesignerFrame(), new IconDialogActionListener(oldIcon) { - @Override - public void doOk() { - iconManager.removeIcon(oldIcon.getName()); - Icon icon = edit.update(); - if (iconManager.addIcon(icon, false)) { - IconButton iconButton = (IconButton)iconButtonMap.get(oldIcon.getName()); - iconPane.remove(iconButton); - bg.remove(iconButton); - - addIcon(icon, iconButton); - - } else { - // 失败了再弄回去 - iconManager.addIcon(oldIcon, true); - // edit failed - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_Message2"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.WARNING_MESSAGE); - } - } + } + if (oldIcon == null) { + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), + "Error", + "Error", + JOptionPane.ERROR_MESSAGE); + } + + final EditIconDialog edit = new EditIconDialog(); + edit.populate(oldIcon); + edit.showWindow(DesignerContext.getDesignerFrame(), new IconDialogActionListener(oldIcon) { + @Override + public void doOk() { + iconManager.removeIcon(oldIcon.getName()); + Icon icon = edit.update(); + if (iconManager.addIcon(icon, false)) { + IconButton iconButton = (IconButton) iconButtonMap.get(oldIcon.getName()); + iconPane.remove(iconButton); + bg.remove(iconButton); + + addIcon(icon, iconButton); + + } else { + // 失败了再弄回去 + iconManager.addIcon(oldIcon, true); + // edit failed + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_Message2"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.WARNING_MESSAGE); + } + } }).setVisible(true); - } - }); - buttonPane.add(editButton); - } - - private void updateButtonPane() { - if (editButton == null || removeButton == null){ - return; - } - if (iconManager.isSystemIcon(selectedIconName)) { - editButton.setEnabled(false); + } + }); + buttonPane.add(editButton); + } + + private void updateButtonPane() { + if (editButton == null || removeButton == null) { + return; + } + if (iconManager.isSystemIcon(selectedIconName)) { + editButton.setEnabled(false); removeButton.setEnabled(false); - } else { + } else { editButton.setEnabled(true); removeButton.setEnabled(true); } - } - - @Override - protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_SelectIcon"); - } + } + + @Override + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_SelectIcon"); + } /** * 添加按钮 * - * @param icon 图标 + * @param icon 图标 * @param iconButton 按钮 */ - public void addIcon(Icon icon,IconButton iconButton){ - selectedIconName = icon.getName(); - iconButton = new IconButton(icon.getName()); - iconButtonMap.put(icon.getName(), iconButton); - iconPane.add(iconButton); - bg.add(iconButton); - refreshIconPane(true); - CustomIconPane.this.validate(); - CustomIconPane.this.repaint(); - } - - public static class IconDialogActionListener extends DialogActionAdapter { - protected Icon oldIcon; - - public IconDialogActionListener(Icon oldIcon) { - this.oldIcon = oldIcon; - } - } - - public void populate(String iconName) { - if (iconName == null) { - return; - } - this.selectedIconName = iconName; + public void addIcon(Icon icon, IconButton iconButton) { + selectedIconName = icon.getName(); + iconButton = new IconButton(icon.getName()); + iconButtonMap.put(icon.getName(), iconButton); + iconPane.add(iconButton); + bg.add(iconButton); + refreshIconPane(true); + CustomIconPane.this.validate(); + CustomIconPane.this.repaint(); + } + + public static class IconDialogActionListener extends DialogActionAdapter { + protected Icon oldIcon; + + public IconDialogActionListener(Icon oldIcon) { + this.oldIcon = oldIcon; + } + } + + public void populate(String iconName) { + if (iconName == null) { + return; + } + this.selectedIconName = iconName; updateButtonPane(); - this.repaint(); - } - - public String update() { - //把图标信息入库 - Configurations.update(new WorkerFacade(WidgetInfoConfig.class) { - @Override - public void run() { - WidgetInfoConfig.getInstance().setIconManager(IconManager.getIconManager()); - } - }); - return selectedIconName; - } - - // 不知道怎么动态布局,就这么傻傻的调一下大小 - private void refreshIconPane(boolean down) { - iconPane.setPreferredSize(new Dimension(THE_WIDTH, (iconButtonMap.size() / HORIZONTAL_COUNT + 1) * HEIGHT_PER + GAP)); - UIScrollBar jsBar = jsPane.createVerticalScrollBar(); - try { - if (down) { - // 将滚动条滚到最后 - jsBar.setValue(jsBar.getMaximum() - jsBar.getVisibleAmount()); - } else { - jsBar.setValue(0); - } - } catch (RuntimeException re) { + this.repaint(); + } + + public String update() { + //把图标信息入库 + Configurations.update(new WorkerFacade(WidgetInfoConfig.class) { + @Override + public void run() { + WidgetInfoConfig.getInstance().setIconManager(IconManager.getIconManager()); + } + }); + + return selectedIconName; + } + + // 不知道怎么动态布局,就这么傻傻的调一下大小 + private void refreshIconPane(boolean down) { + iconPane.setPreferredSize(new Dimension(THE_WIDTH, (iconButtonMap.size() / HORIZONTAL_COUNT + 1) * HEIGHT_PER + GAP)); + UIScrollBar jsBar = jsPane.createVerticalScrollBar(); + try { + if (down) { + // 将滚动条滚到最后 + jsBar.setValue(jsBar.getMaximum() - jsBar.getVisibleAmount()); + } else { + jsBar.setValue(0); + } + } catch (RuntimeException re) { return; - } - updateButtonPane(); - } - - private class IconButton extends JToggleButton implements ActionListener{ - private String iconName; - private Image iconImage = null; + } + updateButtonPane(); + } + + private class IconButton extends JToggleButton implements ActionListener { + private String iconName; + private Image iconImage = null; private static final int ICON_BUTTON_SIZE = 24; private static final int ICON_X = 4; private static final int ICON_Y = 4; - public IconButton(String name) { - this.iconName = name; - this.addActionListener(this); + + public IconButton(String name) { + this.iconName = name; + this.addActionListener(this); this.setCursor(new Cursor(Cursor.HAND_CURSOR)); this.setBorder(null); this.iconImage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(name); this.setToolTipText(iconName); - } + } @Override public void updateUI() { - setUI(new BasicButtonUI(){ + setUI(new BasicButtonUI() { public void paint(Graphics g, JComponent c) { super.paint(g, c); } }); } - - @Override - public void paintComponent(Graphics g) { + + @Override + public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D) g; // carl:这里缩放显示 16 × 16 if (iconImage != null) { - g2d.drawImage(iconImage, ICON_X, ICON_Y, IconManager.DEFAULT_ICONWIDTH, IconManager.DEFAULT_ICONHEIGHT, null); + g2d.drawImage(iconImage, ICON_X, ICON_Y, IconManager.DEFAULT_ICONWIDTH, IconManager.DEFAULT_ICONHEIGHT, null); } if (this.iconName != null && ComparatorUtils.equals(this.iconName, selectedIconName)) { - g2d.setPaint(Color.RED); + g2d.setPaint(Color.RED); } else { g2d.setPaint(Color.LIGHT_GRAY); } GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, IconManager.DEFAULT_ICONWIDTH + 7, - IconManager.DEFAULT_ICONHEIGHT + 7), Constants.LINE_THICK); + IconManager.DEFAULT_ICONHEIGHT + 7), Constants.LINE_THICK); } - + @Override - public Dimension getPreferredSize() { + public Dimension getPreferredSize() { return new Dimension(ICON_BUTTON_SIZE, ICON_BUTTON_SIZE); } - + public void actionPerformed(ActionEvent evt) { CustomIconPane.this.selectedIconName = iconName; fireChagneListener(); - updateButtonPane(); + updateButtonPane(); CustomIconPane.this.repaint();// repaint } @Override - public void addChangeListener(ChangeListener changeListener) { + public void addChangeListener(ChangeListener changeListener) { this.changeListener = changeListener; } @@ -377,18 +381,18 @@ public class CustomIconPane extends BasicPane { this.changeListener.stateChanged(evt); } } - - } - - private static class EditIconDialog extends BasicPane { - private UITextField nameTextField; - private UILabel showImageLabel; - private Image iconImage = null; - private String oldName = null; - - protected EditIconDialog() { + + } + + private static class EditIconDialog extends BasicPane { + private UITextField nameTextField; + private UILabel showImageLabel; + private Image iconImage = null; + private String oldName = null; + + protected EditIconDialog() { init(); - } + } private void init() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); @@ -402,16 +406,17 @@ public class CustomIconPane extends BasicPane { nameTextField = new UITextField(20); browseButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { + public void actionPerformed(ActionEvent e) { onBrowseButtonClicked(); - } - }); + } + }); // 焦点丢失时看看名称是否已经存在 nameTextField.addFocusListener(new FocusListener() { public void focusGained(FocusEvent e) { // do nothing } + public void focusLost(FocusEvent e) { if (oldName != null && ComparatorUtils.equals(oldName, nameTextField.getText())) { return; @@ -428,7 +433,7 @@ public class CustomIconPane extends BasicPane { JPanel imagePane = new JPanel(); imagePane.setLayout(new FlowLayout(FlowLayout.LEFT, 30, 0)); showImageLabel = new UILabel(); - showImageLabel.setPreferredSize(new Dimension(20,20)); + showImageLabel.setPreferredSize(new Dimension(20, 20)); imagePane.add(showImageLabel); imagePane.add(browseButton); Component[][] components = {{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"), nameTextField}, {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon") + ":"), imagePane}}; @@ -448,7 +453,7 @@ public class CustomIconPane extends BasicPane { // 将图片转化到16 × 16大小 Image image = BaseUtils.readImage(path); BufferedImage bufferedImage = CoreGraphHelper.createBufferedImage(IconManager.DEFAULT_ICONWIDTH, -IconManager.DEFAULT_ICONHEIGHT, BufferedImage.TYPE_INT_ARGB); + IconManager.DEFAULT_ICONHEIGHT, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = bufferedImage.createGraphics(); g2d.drawImage(image, 0, 0, IconManager.DEFAULT_ICONWIDTH, IconManager.DEFAULT_ICONHEIGHT, null); bufferedImage.flush(); @@ -461,29 +466,29 @@ IconManager.DEFAULT_ICONHEIGHT, BufferedImage.TYPE_INT_ARGB); } @Override - protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Add_Icon"); - } - - // 用户自定义的只有name 和 imgae两属性, path不要去管 - public void populate(Icon icon) { - if (icon == null) { - return; - } - oldName = icon.getName(); - nameTextField.setText(icon.getName()); - if (icon.getImage() != null) { - showImageLabel.setIcon(new ImageIcon(icon.getImage())); - } - iconImage = icon.getImage(); - } - - public Icon update() { - // 有一个是空,都返回null,反正不会添加的 - if (StringUtils.isBlank(nameTextField.getText()) || iconImage == null) { - return null; - } - return new Icon(nameTextField.getText(), iconImage); - } - } + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Add_Icon"); + } + + // 用户自定义的只有name 和 imgae两属性, path不要去管 + public void populate(Icon icon) { + if (icon == null) { + return; + } + oldName = icon.getName(); + nameTextField.setText(icon.getName()); + if (icon.getImage() != null) { + showImageLabel.setIcon(new ImageIcon(icon.getImage())); + } + iconImage = icon.getImage(); + } + + public Icon update() { + // 有一个是空,都返回null,反正不会添加的 + if (StringUtils.isBlank(nameTextField.getText()) || iconImage == null) { + return null; + } + return new Icon(nameTextField.getText(), iconImage); + } + } }