From 5355d7dda4e6378403a8ab291600f370565e8ba7 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Wed, 14 Nov 2018 20:06:54 +0800 Subject: [PATCH 01/20] REPORT-12161 & REPORT-10599 --- .../java/com/fr/design/dialog/UIDialog.java | 23 +++++++++------ .../fr/design/javascript/JSContentPane.java | 27 ++++++++++++----- .../design/javascript/JavaScriptImplPane.java | 4 ++- .../fr/design/mainframe/DesignerFrame.java | 11 ++++++- .../com/fr/design/mainframe/JTemplate.java | 2 +- .../mainframe/toolbar/ToolBarMenuDock.java | 29 ++++++++++++++++--- .../design/mainframe/WidgetPropertyPane.java | 19 ++++++++---- .../fr/design/mainframe/ElementCasePane.java | 2 +- 8 files changed, 87 insertions(+), 30 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java b/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java index 7380bb58f..193a5ea07 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java +++ b/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java @@ -73,7 +73,7 @@ public abstract class UIDialog extends JDialog { } this.setName(pane.title4PopupWindow()); this.setModal(true); - this.pack(); + GUICoreUtils.centerWindow(this); } @@ -90,12 +90,10 @@ public abstract class UIDialog extends JDialog { //取消 addCancelButton(buttonsPane); - this.getRootPane().setDefaultButton(okButton); - return controlPane; } - protected void addCustomButton(JPanel buttonsPane){ + protected void addCustomButton(JPanel buttonsPane) { } @@ -110,6 +108,18 @@ public abstract class UIDialog extends JDialog { doCancel(); } }); + JPanel defaultPane = (JPanel) this.getContentPane(); + InputMap inputMapAncestor = defaultPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); + ActionMap actionMap = defaultPane.getActionMap(); + + // transfer focus to CurrentEditor + inputMapAncestor.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "dialogOK"); + actionMap.put("dialogOK", new AbstractAction() { + + public void actionPerformed(ActionEvent evt) { + doOK(); + } + }); } private void addOkButton(JPanel buttonsPane) { @@ -130,7 +140,6 @@ public abstract class UIDialog extends JDialog { * 添加监听器 * * @param l 监听器 - * */ public void addDialogActionListener(DialogActionListener l) { listeners.add(l); @@ -138,7 +147,6 @@ public abstract class UIDialog extends JDialog { /** * 清除所有监听器 - * */ public void clearDialogActionListeners() { listeners.clear(); @@ -146,7 +154,6 @@ public abstract class UIDialog extends JDialog { /** * 确定操作 - * */ public void doOK() { try { @@ -177,7 +184,6 @@ public abstract class UIDialog extends JDialog { /** * 取消操作 - * */ public void doCancel() { @@ -224,7 +230,6 @@ public abstract class UIDialog extends JDialog { /** * 检测结果是否合法 - * */ public abstract void checkValid() throws Exception; diff --git a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java index 77e16e312..cd6e01df3 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java @@ -28,6 +28,7 @@ import java.util.ArrayList; public class JSContentPane extends BasicPane { private RSyntaxTextArea contentTextArea; private UILabel funNameLabel; + private AutoCompletion ac; private int titleWidth = 180; @@ -78,14 +79,6 @@ public class JSContentPane extends BasicPane { contentTextArea.setCodeFoldingEnabled(true); contentTextArea.setAntiAliasingEnabled(true); - CompletionProvider provider = createCompletionProvider(); - - AutoCompletion ac = new AutoCompletion(provider); - String shortCuts = DesignerEnvManager.getEnvManager().getAutoCompleteShortcuts(); - - ac.setTriggerKey(convert2KeyStroke(shortCuts)); - ac.install(contentTextArea); - UIScrollPane sp = new UIScrollPane(contentTextArea); this.add(sp, BorderLayout.CENTER); @@ -104,13 +97,31 @@ public class JSContentPane extends BasicPane { } public void populate(String js) { + if (ac == null) { + CompletionProvider provider = createCompletionProvider(); + ac = new AutoCompletion(provider); + String shortCuts = DesignerEnvManager.getEnvManager().getAutoCompleteShortcuts(); + + ac.setTriggerKey(convert2KeyStroke(shortCuts)); + ac.install(contentTextArea); + } + this.contentTextArea.setText(js); } public String update() { + if (ac != null) { + this.ac.uninstall(); + ac = null; + } + return this.contentTextArea.getText(); } + public void reset() { + this.contentTextArea.setText(null); + } + public void setFunctionTitle(String[] args) { funNameLabel.setText(createFunctionTitle(args)); } diff --git a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java index 23a33976b..8806d6853 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java @@ -138,6 +138,9 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { public void populateBean(JavaScriptImpl javaScriptImpl) { if (javaScriptImpl == null) { javaScriptImpl = new JavaScriptImpl(); + jsPane.reset(); + }else{ + jsPane.populate(javaScriptImpl.getContent()); } int rowCount = javaScriptImpl.getJSImportSize(); @@ -147,7 +150,6 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { } importedJsPane.populate(value); parameterPane.populate(javaScriptImpl.getParameters()); - jsPane.populate(javaScriptImpl.getContent()); if (itemNameTextField != null) { itemNameTextField.setText(javaScriptImpl.getItemName()); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index be2695815..7d9a3d749 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -155,6 +155,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta // 右边的虚线 private DottedLine rightDottedLine; + //用于判断设计器是否打开了 + private boolean designerOpened = false; + private int contentWidth = (int) (Toolkit.getDefaultToolkit().getScreenSize().getWidth()); private int contentHeight = (int) (Toolkit.getDefaultToolkit().getScreenSize().getHeight()); @@ -351,7 +354,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ public void addDesignerOpenedListener(DesignerOpenedListener listener) { - designerOpenedListenerList.add(listener); + if (!designerOpened) { + designerOpenedListenerList.add(listener); + } } /** @@ -362,6 +367,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta for (DesignerOpenedListener listener : designerOpenedListenerList) { listener.designerOpened(); } + + designerOpened = true; + //使用完清除监听 + designerOpenedListenerList.clear(); } protected DesktopCardPane getCenterTemplateCardPane() { 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 737b5ba16..d14a066e5 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 @@ -780,7 +780,7 @@ public abstract class JTemplate> ((JTemplateActionListener) listeners[i + 1]).templateClosed(this); } } - + this.undoState = null; this.repaint(30); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 8f20583ab..b46719efe 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -148,6 +148,9 @@ public abstract class ToolBarMenuDock { }; private static final String FINEREPORT = "FineReport"; private static final int MENUBAR_HEIGHT = 22; + + private static final List PLUGIN_LISTENERS = new ArrayList<>(); + private MenuDef[] menus; private ToolBarDef toolBarDef; private List shortCutsList; @@ -218,6 +221,8 @@ public abstract class ToolBarMenuDock { } public MenuDef[] menus(final ToolBarMenuDockPlus plus) { + //删除之前创建的插件菜单监听 + clearPluginListeners(); java.util.List menuList = new java.util.ArrayList(); // 添加文件菜单 menuList.add(createFileMenuDef(plus)); @@ -248,6 +253,15 @@ public abstract class ToolBarMenuDock { return menuList.toArray(new MenuDef[menuList.size()]); } + //清空监听 + private static synchronized void clearPluginListeners() { + + for (PluginEventListener listener : PLUGIN_LISTENERS) { + GeneralContext.stopListenPlugin(listener); + } + PLUGIN_LISTENERS.clear(); + } + /** * 获取所有actionmodel * @@ -644,7 +658,7 @@ public abstract class ToolBarMenuDock { } }; - GeneralContext.listenPlugin(PluginEventType.BeforeStop, new PluginEventListener() { + PluginEventListener beforeStop = new PluginEventListener() { @Override public void on(PluginEvent event) { @@ -652,8 +666,9 @@ public abstract class ToolBarMenuDock { Set menuHandlers = runtime.get(MenuHandler.MARK_STRING); removeExtraMenus(menuDef, anchor, action, menuHandlers); } - }, filter); - GeneralContext.listenPlugin(PluginEventType.AfterRun, new PluginEventListener() { + }; + + PluginEventListener afterRun = new PluginEventListener() { @Override public void on(PluginEvent event) { @@ -662,7 +677,13 @@ public abstract class ToolBarMenuDock { Set menuHandlers = runtime.get(MenuHandler.MARK_STRING); addExtraMenus(menuDef, anchor, action, menuHandlers); } - }, filter); + }; + + GeneralContext.listenPlugin(PluginEventType.BeforeStop, beforeStop, filter); + GeneralContext.listenPlugin(PluginEventType.AfterRun, afterRun, filter); + + PLUGIN_LISTENERS.add(afterRun); + PLUGIN_LISTENERS.add(beforeStop); } private void removeExtraMenus(MenuDef menuDef, String anchor, ShortCutMethodAction action, Set set) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java index d6ee25342..0cf740dbe 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java @@ -28,7 +28,7 @@ import java.util.Set; * 控件属性表绘制 * Modified by fanglei */ -public class WidgetPropertyPane extends FormDockView implements BaseWidgetPropertyPane { +public class WidgetPropertyPane extends FormDockView implements BaseWidgetPropertyPane { private static final int PADDING = 10; private static final int PADDING_M = 12; @@ -108,11 +108,10 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope */ private void initTables() { formWidgetCardPane.populate(); - eventTable.refresh(); + if (mobileExtraPropertyPanes != null) { for (MobileWidgetDefinePane extraPane : mobileExtraPropertyPanes) { extraPane.initPropertyGroups(designer); - extraPane.populate(designer); } } if (widgetPropertyTables != null) { @@ -222,7 +221,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Mobile_Terminal") }; - final CardLayout tabbedPane = new CardLayout(); + final CardLayout tabbedPane = new CardLayout(); final JPanel center = new JPanel(tabbedPane); center.add(formWidgetCardPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Properties")); center.add(eventTable, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event")); @@ -232,6 +231,16 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope tabsHeaderIconPane = new UIHeadGroup(tabTitles) { @Override public void tabChanged(int index) { + //切换的时候再populate + if (index == 1) { + eventTable.refresh(); + } else if (index == 2) { + if (mobileExtraPropertyPanes != null) { + for (MobileWidgetDefinePane extraPane : mobileExtraPropertyPanes) { + extraPane.populate(designer); + } + } + } tabbedPane.show(center, tabTitles[index]); } }; @@ -292,7 +301,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope if (evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED || evt.getCreatorEventID() == DesignerEvent.CREATOR_RESIZED) { formWidgetCardPane.populate(); - } else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED){ + } else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) { // 防止多次触发 if (lastAffectedCreator != null && lastAffectedCreator == evt.getAffectedCreator()) { return; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java index 8832ec4c3..df9476c71 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java @@ -596,7 +596,7 @@ public abstract class ElementCasePane extends Tar * @return 是则返回true */ public boolean isSelectedOneCell() { - return selection.isSelectedOneCell(this); + return (selection == null) ? false : selection.isSelectedOneCell(this); } /** From 916fcba1a67db2773edf3cf8469b9edcaacd7a9f Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 15 Nov 2018 11:13:30 +0800 Subject: [PATCH 02/20] =?UTF-8?q?REPORT-12697=20mac=E5=9C=A8jni=E5=9C=A8?= =?UTF-8?q?=E9=83=A8=E5=88=86=E7=B3=BB=E7=BB=9F=E4=B8=8B=E6=8A=A5=E7=AD=BE?= =?UTF-8?q?=E5=90=8D=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/com/fr/start/jni/splash.dylib | Bin 41248 -> 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 5d096b2b37d34197e377f7b1ed115c3768bd0d08..2b59ee3eb04f6377b0a8f06d9f60096a1216ee32 100755 GIT binary patch literal 57200 zcmeHwd3;nw_V4X164rzz4x(sKP*9e1NFV{DX_8>KbRZBwT$rXwIwX?KULZlyU=pRh zM58|!bX;)9ZDd@LaS4kMT#<1c1Vv_s!44?k28c+%@2NVs`}R#(e!us}`@HwM;ohpV z)Tyddr?yk~-h6uW`{P{{#T2V3${D!&;%e!kC{0QdVv2GWt}+lEj_LWcrVCW$tuPW) z7=}zG9#=OeI~-nDtvAeTl$X&@(sm4&p$3Oi#3}WmI3f;*$LpKx389Sgk}Q&xX_6tq z92JNJmPd7_pOoh)b5+#1+yaiQuXTc8Q~JlqkYJ8VM2GSfS66w$6*iV{PM%D*Tm}lk zaUAa~a5$>xUSI5}ba~6FoRzK)?Qw+V{ey*QuqG>_tU$87;tHq7LjsNE`_v{=Uc~}5 z_!RP}eBQd6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8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListPane.java | 143 +++++++++++++++++- 1 file changed, 140 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java index 073c4fd1d..73d305333 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java @@ -1,16 +1,153 @@ package com.fr.design.file; +import com.fr.base.chart.chartdata.CallbackEvent; +import com.fr.design.mainframe.JTemplate; +import com.fr.file.FILE; +import com.fr.file.FileNodeFILE; + +import java.util.List; + /** * 历史模板缓存 - * + *

* 为可能存在的插件做兼容处理 * * @see HistoryTemplateListCache * @deprecated use HistoryTemplateListCache instead */ @Deprecated -public class HistoryTemplateListPane { - public static HistoryTemplateListCache getInstance() { +public class HistoryTemplateListPane implements CallbackEvent { + + + private static volatile HistoryTemplateListPane THIS; + + public static HistoryTemplateListPane getInstance() { + if (THIS == null) { + synchronized (HistoryTemplateListPane.class) { + if (THIS == null) { + THIS = new HistoryTemplateListPane(); + } + } + } + return THIS; + } + + private static HistoryTemplateListCache instead() { return HistoryTemplateListCache.getInstance(); } + + + /** + * 关闭选择的文件 + * + * @param selected 选择的 + */ + public void closeSelectedReport(JTemplate selected) { + instead().closeSelectedReport(selected); + } + + /** + * 临时关闭选择的文件 + * + * @param selected 选择的 + */ + public void closeVirtualSelectedReport(JTemplate selected) { + instead().closeVirtualSelectedReport(selected); + } + + + public JTemplate getCurrentEditingTemplate() { + return instead().getCurrentEditingTemplate(); + } + + public void setCurrentEditingTemplate(JTemplate jt) { + instead().setCurrentEditingTemplate(jt); + + } + + /** + * 添加历史记录 + */ + public void addHistory() { + instead().addHistory(); + } + + + public List> getHistoryList() { + return instead().getHistoryList(); + } + + + /** + * 清空历史记录 + */ + public void removeAllHistory() { + instead().removeAllHistory(); + } + + public int getHistoryCount() { + return instead().getHistoryCount(); + } + + + public JTemplate get(int index) { + return instead().get(index); + } + + + public JTemplate getTemplate(int index) { + return instead().getTemplate(index); + } + + /** + * 获取模板的index + * + * @param jt 模板 + * @return 位置 + */ + public int contains(JTemplate jt) { + return instead().contains(jt); + } + + + /** + * 判断是否打开过该模板 + * + * @param filename 文件名 + * @return 文件位置 + */ + public int contains(String filename) { + return instead().contains(filename); + } + + /** + * 是否是当前编辑的文件 + * + * @param filename 文件名 + * @return 是则返回TRUE + */ + public boolean isCurrentEditingFile(String filename) { + return instead().isCurrentEditingFile(filename); + } + + + public void callback() { + getCurrentEditingTemplate().repaint(); + } + + /** + * 打开new模板的同时关闭old模板,优先关已保存的、先打开的 + */ + public void closeOverLineTemplate() { + instead().closeOverLineTemplate(); + } + + + public void deleteFile(FileNodeFILE file) { + instead().deleteFile(file); + } + + public boolean rename(FILE tplFile, String from, String to) { + return instead().rename(tplFile, from, to); + } } From 8a9923d02a7e9d30111531b0b47027b706039536 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Thu, 15 Nov 2018 20:24:24 +0800 Subject: [PATCH 04/20] =?UTF-8?q?REPORT-12721=20HistoryTemplateListPane?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/file/HistoryTemplateListPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java index 73d305333..a51735f64 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java @@ -131,8 +131,9 @@ public class HistoryTemplateListPane implements CallbackEvent { } + @Override public void callback() { - getCurrentEditingTemplate().repaint(); + instead().callback(); } /** From 3c40011366f54e8e4844cab5e3f409fc90abc43a Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 16 Nov 2018 16:37:19 +0800 Subject: [PATCH 05/20] =?UTF-8?q?=20=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=80=A6=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/fun/ConnectionProvider.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/ConnectionProvider.java b/designer-base/src/main/java/com/fr/design/fun/ConnectionProvider.java index 766f7d414..8e5aed5b8 100644 --- a/designer-base/src/main/java/com/fr/design/fun/ConnectionProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/ConnectionProvider.java @@ -10,32 +10,36 @@ import com.fr.stable.fun.mark.Mutable; */ public interface ConnectionProvider extends Mutable { - public static final String XML_TAG = "ConnectionProvider"; + String XML_TAG = "ConnectionProvider"; // 2016-12-14 1 -> 2 , 增加connection.feature方法导致不兼容. int CURRENT_LEVEL = 2; /** * 数据连接弹出菜单的名字 + * * @return 名字 */ - public String nameForConnection(); + String nameForConnection(); /** * 数据连接弹出菜单的图标 + * * @return 图标路径 */ - public String iconPathForConnection(); + String iconPathForConnection(); /** * 数据连接的类型 + * * @return 连接类型 */ - public Class classForConnection(); + Class classForConnection(); /** * 数据连接的设计界面 + * * @return 设计界面 */ - public Class> appearanceForConnection(); + Class> appearanceForConnection(); } \ No newline at end of file From f38df1c8b616588887ff9d29d1f288a2addde015 Mon Sep 17 00:00:00 2001 From: qinghuiliu Date: Sun, 18 Nov 2018 12:55:25 +0800 Subject: [PATCH 06/20] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=89=80=E6=9C=89?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=9A=84=E5=9D=90=E6=A0=87=E8=BD=B4=E5=88=BB?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/style/axis/ChartValuePane.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java index 32e656479..82b5dd326 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.chart.gui.style.axis; import com.fr.base.BaseFormula; import com.fr.base.Utils; +import com.fr.chart.base.AxisUnitType; import com.fr.chart.base.ChartBaseUtils; import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.Axis; @@ -257,10 +258,10 @@ public class ChartValuePane extends ChartAxisUsePane{ axisLineStylePane.update(axis); axis.setAxisReversed(this.axisReversed.isSelected()); String unitValue = Utils.objectToString(unitCombox.getSelectedItem()); - if(ComparatorUtils.equals(unitValue, ChartConstants.UNIT_I18N_VALUES[0])) { + if(ComparatorUtils.equals(unitValue, AxisUnitType.UNIT_NONE.toLocaleString())) { unitValue = null; } - numberAxis.setShowUnit(ChartConstants.getUnitValueFromKey(unitValue)); + numberAxis.setShowUnit(AxisUnitType.parse(unitValue)); if(numberAxis.isSurpportAxisTitle()) { updateAxisTitle(numberAxis); } @@ -378,11 +379,13 @@ public class ChartValuePane extends ChartAxisUsePane{ axisLineStylePane.populate(axis); axisReversed.setSelected(axis.hasAxisReversed()); - String unitKey = numberAxis.getShowUnit(); - if(StringUtils.isBlank(unitKey)) { - unitKey = ChartConstants.UNIT_I18N_KEYS[0]; + String unitKey; + if(numberAxis.getShowUnit() != null) { + unitKey = numberAxis.getShowUnit().getStringType(); + }else{ + unitKey = AxisUnitType.UNIT_NONE.getStringType(); } - unitCombox.setSelectedItem(ChartConstants.getUnitKey2Value(unitKey)); + unitCombox.setSelectedItem(AxisUnitType.parse(unitKey).toLocaleString()); if(numberAxis.isSurpportAxisTitle()) { populateAxisTitle(axis); From 081d76d68dbc676c180858426c0b71a3d602e0d3 Mon Sep 17 00:00:00 2001 From: qinghuiliu Date: Sun, 18 Nov 2018 13:30:30 +0800 Subject: [PATCH 07/20] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/chart/gui/style/axis/ChartValuePane.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java index 82b5dd326..02080857d 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java @@ -4,7 +4,6 @@ import com.fr.base.BaseFormula; import com.fr.base.Utils; import com.fr.chart.base.AxisUnitType; import com.fr.chart.base.ChartBaseUtils; -import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.Axis; import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.NumberAxis; @@ -79,7 +78,7 @@ public class ChartValuePane extends ChartAxisUsePane{ axisLineStylePane = new ChartAxisLineStylePane(); zeroPane = aliagnZero4Second(); axisReversed = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_AxisReversed")); - unitCombox = new UIComboBox(ChartConstants.UNIT_I18N_VALUES); + unitCombox = new UIComboBox(AxisUnitType.UNIT_I18N_VALUES); formatPane = new FormatPaneWithOutFont(); axisLabelPane = new ChartAxisLabelPane(); dataPane = createDataDefinePane(); From d6670650e54cbee6e6b2b3f523d20340b506037f Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Sun, 18 Nov 2018 20:02:21 +0800 Subject: [PATCH 08/20] CHART-3206 & CHART-3374 9to10 --- .../java/com/fr/design/style/color/ColorSelectDetailPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java index 73dfe5ca9..758c673fa 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java @@ -95,7 +95,7 @@ public class ColorSelectDetailPane extends BasicPane { public void stateChanged(ChangeEvent e) { ColorSelectionModel model = (ColorSelectionModel) e.getSource(); colorChooserPreview.setMyColor(model.getSelectedColor()); - colorChooserPreview.paint(colorChooserPreview.getGraphics()); + colorChooserPreview.repaint(); } }); previewPanel.add(colorChooserPreview); From 8058d1142a429f593a8fd803b02c3ecc4983db7f Mon Sep 17 00:00:00 2001 From: qinghuiliu Date: Mon, 19 Nov 2018 09:52:20 +0800 Subject: [PATCH 09/20] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/chart/gui/style/axis/ChartValuePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java index 02080857d..8f55156df 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java @@ -78,7 +78,7 @@ public class ChartValuePane extends ChartAxisUsePane{ axisLineStylePane = new ChartAxisLineStylePane(); zeroPane = aliagnZero4Second(); axisReversed = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_AxisReversed")); - unitCombox = new UIComboBox(AxisUnitType.UNIT_I18N_VALUES); + unitCombox = new UIComboBox(AxisUnitType.getUNIT_I18N_VALUES()); formatPane = new FormatPaneWithOutFont(); axisLabelPane = new ChartAxisLabelPane(); dataPane = createDataDefinePane(); From 2dba45028720e3ad57fc42b9e4900370134cd45a Mon Sep 17 00:00:00 2001 From: qinghuiliu Date: Mon, 19 Nov 2018 10:12:51 +0800 Subject: [PATCH 10/20] =?UTF-8?q?=E6=94=B9=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/chart/gui/style/axis/ChartValuePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java index 8f55156df..35b57d09d 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java @@ -78,7 +78,7 @@ public class ChartValuePane extends ChartAxisUsePane{ axisLineStylePane = new ChartAxisLineStylePane(); zeroPane = aliagnZero4Second(); axisReversed = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_AxisReversed")); - unitCombox = new UIComboBox(AxisUnitType.getUNIT_I18N_VALUES()); + unitCombox = new UIComboBox(AxisUnitType.getI18NValues()); formatPane = new FormatPaneWithOutFont(); axisLabelPane = new ChartAxisLabelPane(); dataPane = createDataDefinePane(); From c396d3469f57b0bd217847c7cd25ee0050b3e604 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 19 Nov 2018 15:02:39 +0800 Subject: [PATCH 11/20] =?UTF-8?q?REPORT-10535=09=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=80=82=E9=85=8D=E5=8A=9F=E8=83=BD=E2=80=94=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AFTAB=E7=BB=84=E4=BB=B6=E5=A4=9A=E6=A0=B7?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/layout/FRGUIPaneFactory.java | 11 + .../ui/DefaultMobileStyleDefinePane.java | 97 ++++++++ .../mobile/ui/DownMenuStyleDefinePane.java | 174 ++++++++++++++ .../design/mainframe/mobile/ui/LinePane.java | 108 +++++++++ .../ui/MobileTemplateStyleDefinePane.java | 219 ++++++++++++++++++ .../mobile/ui/SliderStyleDefinePane.java | 150 ++++++++++++ .../ui/StyleDefinePaneWithSelectConf.java | 113 +++++++++ .../mobile/ui/TabIconConfigPane.java | 172 ++++++++++++++ .../ui/TemplateStyleDefinePaneFactory.java | 55 +++++ .../mobile/ui/UpMenuStyleDefinePane.java | 211 +++++++++++++++++ .../widget/MobileTabFontConfPane.java | 143 ++++++++++++ .../mainframe/widget/UITitleSplitLine.java | 69 ++++++ .../AbstractTemplateStylePane.java | 10 + .../AccessibleTemplateStyleEditor.java | 13 +- .../accessibles/MobileTemplateStylePane.java | 113 +++++++++ .../widget/accessibles/TemplateStylePane.java | 5 +- .../accessibles/TemplateStylePreviewPane.java | 14 +- .../preview/MobileTemplatePreviewPane.java | 53 +++++ .../creator/cardlayout/XWCardTagLayout.java | 6 + .../mobile/TabMobilePropertyUI.java | 30 +++ .../layout/WCardTagLayoutDefinePane.java | 3 +- .../mobile/TabMobileWidgetDefinePane.java | 69 ++++++ 22 files changed, 1818 insertions(+), 20 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DownMenuStyleDefinePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/LinePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SliderStyleDefinePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/StyleDefinePaneWithSelectConf.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TabIconConfigPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TemplateStyleDefinePaneFactory.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/widget/MobileTabFontConfPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/widget/UITitleSplitLine.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AbstractTemplateStylePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/widget/preview/MobileTemplatePreviewPane.java create mode 100644 designer-form/src/main/java/com/fr/design/designer/properties/mobile/TabMobilePropertyUI.java create mode 100644 designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java diff --git a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java index db48cf995..09eaad466 100644 --- a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java @@ -251,6 +251,17 @@ public class FRGUIPaneFactory { return jp; } + + /** + * 创建一个靠左流式布局,流式内嵌 + * + * @return JPanel对象 + */ + public static JPanel createBoxFlowInnerContainerPane(int hgap, int vgap) { + JPanel jp = new JPanel(); + jp.setLayout(new FlowLayout(FlowLayout.LEFT, hgap, vgap)); + return jp; + } /** * 创建一个靠左流式布局,流式内嵌,首元素距离左边0 * diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java new file mode 100644 index 000000000..b42f1a6ce --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java @@ -0,0 +1,97 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.base.GraphHelper; +import com.fr.design.mainframe.widget.preview.MobileTemplatePreviewPane; +import com.fr.form.ui.CardSwitchButton; +import com.fr.form.ui.container.cardlayout.WCardTagLayout; +import com.fr.general.FRFont; +import com.fr.general.cardtag.mobile.DefaultMobileTemplateStyle; +import com.fr.general.cardtag.mobile.MobileTemplateStyle; + +import java.awt.BasicStroke; +import java.awt.Dimension; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; + +public class DefaultMobileStyleDefinePane extends MobileTemplateStyleDefinePane { + + public DefaultMobileStyleDefinePane(WCardTagLayout tagLayout) { + super(tagLayout); + } + + @Override + public void populateBean(MobileTemplateStyle ob) { + updatePreviewPane(); + } + + protected void createConfigPane() { + + } + + @Override + protected void initDefaultConfig() { + + } + + @Override + public MobileTemplateStyle updateSubStyle() { + return null; + } + + @Override + public MobileTemplateStyle updateBean() { + return new DefaultMobileTemplateStyle(); + } + + @Override + protected MobileTemplateStyle getDefaultTemplateStyle() { + return new DefaultMobileTemplateStyle(); + } + + @Override + protected String title4PopupWindow() { + return null; + } + + protected MobileTemplatePreviewPane createPreviewPane() { + return new DefaultStylePreviewPane(); + } + + public class DefaultStylePreviewPane extends MobileTemplatePreviewPane { + + public DefaultStylePreviewPane() { + this.setBackground(DefaultMobileTemplateStyle.DEFAULT_INITIAL_COLOR); + } + + public void repaint() { + super.repaint(); + } + + @Override + public void paint(Graphics g) { + super.paint(g); + Dimension dimension = this.getSize(); + int panelWidth = dimension.width; + int panelHeight = dimension.height; + Graphics2D g2d = (Graphics2D) g.create(); + FRFont frFont = DefaultMobileTemplateStyle.DEFAULT_TAB_FONT.getFont(); + FontMetrics fm = GraphHelper.getFontMetrics(frFont); + WCardTagLayout cardTagLayout = DefaultMobileStyleDefinePane.this.getTagLayout(); + int eachWidth = panelWidth / cardTagLayout.getWidgetCount(); + g2d.setFont(frFont); + for (int i = 0; i < cardTagLayout.getWidgetCount(); i++) { + CardSwitchButton cardSwitchButton = cardTagLayout.getSwitchButton(i); + String widgetName = cardSwitchButton.getText(); + int width = fm.stringWidth(widgetName); + g2d.drawString(widgetName, (eachWidth - width) / 2, (panelHeight) / 2); + if (i == 0) { + g2d.setStroke(new BasicStroke(2.0f)); + g2d.drawLine(0, panelHeight - 1, eachWidth, panelHeight - 1); + } + g2d.translate(eachWidth, 0); + } + } + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DownMenuStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DownMenuStyleDefinePane.java new file mode 100644 index 000000000..b8f267e98 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DownMenuStyleDefinePane.java @@ -0,0 +1,174 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.base.GraphHelper; +import com.fr.base.IconManager; +import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.widget.UITitleSplitLine; +import com.fr.design.mainframe.widget.preview.MobileTemplatePreviewPane; +import com.fr.form.ui.CardSwitchButton; +import com.fr.form.ui.container.cardlayout.WCardTagLayout; +import com.fr.general.FRFont; +import com.fr.general.cardtag.mobile.DownMenuStyle; +import com.fr.general.cardtag.mobile.LineDescription; +import com.fr.general.cardtag.mobile.MobileTemplateStyle; + +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.util.ArrayList; + +public class DownMenuStyleDefinePane extends StyleDefinePaneWithSelectConf { + private LinePane splitLinePane; + private TabIconConfigPane initIconConfigPane; + private TabIconConfigPane selectIconConfigPane; + + public DownMenuStyleDefinePane(WCardTagLayout tagLayout) { + super(tagLayout); + } + + protected void createExtraConfPane(JPanel centerPane) { + UITitleSplitLine iconSplitLine = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon"), 520); + iconSplitLine.setPreferredSize(new Dimension(520, 20)); + centerPane.add(iconSplitLine); + + initIconConfigPane = new TabIconConfigPane(getTagLayout().getWidgetCount()); + selectIconConfigPane = new TabIconConfigPane(getTagLayout().getWidgetCount()); + + UILabel initIconLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Initial_Icon")); + UILabel selectIconLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Select_Icon")); + initIconLabel.setPreferredSize(new Dimension(55, 20)); + selectIconLabel.setPreferredSize(new Dimension(55, 20)); + JPanel initIconContainPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{initIconLabel, initIconConfigPane}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + JPanel selectIconContainePane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{selectIconLabel, selectIconConfigPane}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + initIconContainPane.setPreferredSize(new Dimension(240, 50)); + selectIconContainePane.setPreferredSize(new Dimension(240, 50)); + centerPane.add(initIconContainPane); + centerPane.add(selectIconContainePane); + UITitleSplitLine splitLine = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Spit_Line"), 520); + splitLine.setPreferredSize(new Dimension(520, 20)); + splitLinePane = new LinePane(); + splitLinePane.addLineChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + updatePreviewPane(); + } + }); + centerPane.add(splitLine); + centerPane.add(splitLinePane); + } + + @Override + protected void initDefaultConfig() { + this.initialColorBox.setSelectObject(DownMenuStyle.DEFAULT_INITIAL_COLOR); + this.fontConfPane.populate(DownMenuStyle.DEFAULT_TAB_FONT.getFont()); + this.selectColorBox.setSelectObject(DownMenuStyle.DEFAULT_SELECT_COLOR); + this.selectFontColor.setColor(DownMenuStyle.DEFAULT_SELECT_FONT_COLOR); + this.splitLinePane.populate(DownMenuStyle.DEFAULT_SPLIT_LINE); + } + + @Override + protected MobileTemplatePreviewPane createPreviewPane() { + return new DownMenuStylePreviewPane(); + } + + + @Override + public void populateBean(MobileTemplateStyle ob) { + super.populateBean(ob); + DownMenuStyle downMenuStyle = (DownMenuStyle) ob; + splitLinePane.populate(downMenuStyle.getSplitLine()); + ArrayList initialIconNames = new ArrayList(); + ArrayList selectIconNames = new ArrayList(); + for (int i = 0; i < getTagLayout().getWidgetCount(); i++) { + CardSwitchButton cardSwitchButton = (CardSwitchButton) getTagLayout().getWidget(i); + initialIconNames.add(cardSwitchButton.getInitIconName()); + selectIconNames.add(cardSwitchButton.getSelectIconName()); + } + initIconConfigPane.populate(initialIconNames); + selectIconConfigPane.populate(selectIconNames); + } + + @Override + protected MobileTemplateStyle getDefaultTemplateStyle() { + return new DownMenuStyle(); + } + + @Override + public MobileTemplateStyle updateStyleWithSelectConf() { + DownMenuStyle downMenuStyle = new DownMenuStyle(); + downMenuStyle.setSplitLine(splitLinePane.update()); + ArrayList initialIconNames = initIconConfigPane.update(); + ArrayList selectIconNames = selectIconConfigPane.update(); + for (int i = 0; i < getTagLayout().getWidgetCount(); i++) { + CardSwitchButton cardSwitchButton = (CardSwitchButton) getTagLayout().getWidget(i); + cardSwitchButton.setInitIconName(initialIconNames.get(i)); + cardSwitchButton.setSelectIconName(selectIconNames.get(i)); + } + return downMenuStyle; + } + + @Override + protected String title4PopupWindow() { + return null; + } + + public class DownMenuStylePreviewPane extends MobileTemplatePreviewPane { + private LineDescription splitLine; + private static final String PAINT_ICON = "fund_white"; + + public DownMenuStylePreviewPane() { + this.setBackground(Color.decode("#3888EE")); + } + + public void repaint() { + super.repaint(); + } + + @Override + public void paint(Graphics g) { + super.paint(g); + Color selectFontColor = this.getTabFontConfig().getSelectColor(); + Dimension dimension = this.getSize(); + int panelWidth = dimension.width; + int panelHeight = dimension.height; + Graphics2D g2d = (Graphics2D) g.create(); + FRFont frFont = this.getTabFontConfig().getFont(); + FontMetrics fm = GraphHelper.getFontMetrics(frFont); + WCardTagLayout cardTagLayout = DownMenuStyleDefinePane.this.getTagLayout(); + int eachWidth = panelWidth / cardTagLayout.getWidgetCount(); + for (int i = 0; i < cardTagLayout.getWidgetCount(); i++) { + g2d.setFont(frFont); + g2d.setColor(i == 0 ? selectFontColor : frFont.getForeground()); + CardSwitchButton cardSwitchButton = cardTagLayout.getSwitchButton(i); + String widgetName = cardSwitchButton.getText(); + int width = fm.stringWidth(widgetName); + String iconName = PAINT_ICON; + g2d.drawImage(IconManager.getIconManager().getIconImage(iconName), (eachWidth - 18) / 2, 6, null); + g2d.drawString(widgetName, (eachWidth - width) / 2, panelHeight / 2 + 9); + if (splitLine.getLineStyle() != 0) { + g2d.setColor(splitLine.getColor()); + + g2d.drawLine(eachWidth, 0, eachWidth, panelHeight); + } + + g2d.translate(eachWidth, 0); + + } + + } + + public void populateConfig(MobileTemplateStyle templateStyle) { + super.populateConfig(templateStyle); + this.splitLine = ((DownMenuStyle) templateStyle).getSplitLine(); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/LinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/LinePane.java new file mode 100644 index 000000000..fabc7ca5b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/LinePane.java @@ -0,0 +1,108 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.gui.icombobox.LineComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.layout.VerticalFlowLayout; +import com.fr.design.style.color.NewColorSelectBox; +import com.fr.general.cardtag.mobile.LineDescription; +import com.fr.stable.CoreConstants; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.EventListenerList; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; + +public class LinePane extends JPanel { + private LineComboBox lineStyle; + private NewColorSelectBox lineColor; + private EventListenerList lineChangeListener = new EventListenerList(); + + public LinePane() { + init(); + } + + private void init() { + this.setLayout(new VerticalFlowLayout(FlowLayout.CENTER, 0, 10)); + this.setBorder(BorderFactory.createEmptyBorder(0, 20, 5, 20)); + UILabel lineLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_FRFont_Line_Style")); + UILabel colorLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Colors")); + lineLabel.setPreferredSize(new Dimension(55, 20)); + colorLabel.setPreferredSize(new Dimension(55, 20)); + + lineStyle = new LineComboBox(CoreConstants.UNDERLINE_STYLE_ARRAY); + lineStyle.setPreferredSize(new Dimension(152, 20)); + lineColor = new NewColorSelectBox(137); + lineStyle.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + fireLineStateChanged(); + } + }); + lineColor.addSelectChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + fireLineStateChanged(); + } + }); + this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{lineLabel, lineStyle}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM)); + this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{colorLabel, lineColor}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM)); + } + + public LineDescription update() { + LineDescription lineDescription = new LineDescription(); + lineDescription.setColor(lineColor.getSelectObject()); + lineDescription.setLineStyle(lineStyle.getSelectedLineStyle()); + return lineDescription; + } + + public void populate(LineDescription lineDescription) { + lineStyle.setSelectedLineStyle(lineDescription.getLineStyle()); + lineColor.setSelectObject(lineDescription.getColor()); + } + + + /** + * 添加监听 + * + * @param changeListener 监听列表 + */ + public void addLineChangeListener(ChangeListener changeListener) { + lineChangeListener.add(ChangeListener.class, changeListener); + } + + /** + * 移除监听 + * Removes an old ColorChangeListener. + * + * @param changeListener 监听列表 + */ + public void removeLineChangeListener(ChangeListener changeListener) { + lineChangeListener.remove(ChangeListener.class, changeListener); + } + + /** + * 颜色状态改变 + */ + public void fireLineStateChanged() { + Object[] listeners = lineChangeListener.getListenerList(); + ChangeEvent e = null; + + for (int i = listeners.length - 2; i >= 0; i -= 2) { + if (listeners[i] == ChangeListener.class) { + if (e == null) { + e = new ChangeEvent(this); + } + ((ChangeListener) listeners[i + 1]).stateChanged(e); + } + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java new file mode 100644 index 000000000..a1d487ab7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java @@ -0,0 +1,219 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.dialog.AttrScrollPane; +import com.fr.design.dialog.BasicScrollPane; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.widget.MobileTabFontConfPane; +import com.fr.design.mainframe.widget.UITitleSplitLine; +import com.fr.design.mainframe.widget.preview.MobileTemplatePreviewPane; +import com.fr.design.style.color.NewColorSelectBox; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.form.ui.container.cardlayout.WCardTagLayout; +import com.fr.general.FRFont; +import com.fr.general.cardtag.mobile.MobileTemplateStyle; +import com.fr.general.cardtag.mobile.TabFontConfig; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.border.TitledBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; + +public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane { + private UIComboBox custom; + protected NewColorSelectBox initialColorBox; + protected MobileTabFontConfPane fontConfPane; + private JPanel centerPane; + protected MobileTemplatePreviewPane previewPane; + private static final String[] TAB_STYLES = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Custom")}; + private WCardTagLayout tagLayout; + + + public MobileTemplatePreviewPane getPreviewPane() { + return previewPane; + } + + public MobileTemplateStyleDefinePane(WCardTagLayout tagLayout) { + this.tagLayout = tagLayout; + init(); + } + + + public WCardTagLayout getTagLayout() { + return tagLayout; + } + + protected void init() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + previewPane = createPreviewPane(); + previewPane.setPreferredSize(new Dimension(500, 60)); + JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + TitledBorder titledBorder = GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"), null); + titledBorder.setTitleFont(FRFont.getInstance("PingFangSC-Regular", Font.PLAIN, 9, Color.BLUE)); + northPane.setBorder(titledBorder); + northPane.setPreferredSize(new Dimension(500, 83)); + northPane.add(previewPane, BorderLayout.CENTER); + this.add(northPane, BorderLayout.NORTH); + createConfigPane(); + + } + + protected void createConfigPane() { + JPanel configPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + TitledBorder titledBorder = GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set"), null); + titledBorder.setTitleFont(FRFont.getInstance("PingFangSC-Regular", Font.PLAIN, 9, Color.BLUE)); + configPane.setBorder(titledBorder); + centerPane = createCenterPane(); + custom = new UIComboBox(TAB_STYLES); + custom.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + boolean isCustom = custom.getSelectedIndex() == 1; + centerPane.setVisible(isCustom); + updatePreviewPane(); + } + }); + centerPane.setVisible(false); + custom.setPreferredSize(new Dimension(157, 20)); + final JPanel scrollPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + BasicScrollPane basicScrollPane = new AttrScrollPane() { + @Override + protected JPanel createContentPane() { + return scrollPanel; + } + }; + configPane.add(basicScrollPane, BorderLayout.CENTER); + this.add(configPane, BorderLayout.CENTER); + + JPanel outPanel = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); + outPanel.setBorder(BorderFactory.createEmptyBorder(10, 20, 5, 20)); + UILabel tabStyleLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Style")); + tabStyleLabel.setPreferredSize(new Dimension(55, 20)); + JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{tabStyleLabel, custom}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + jPanel.setPreferredSize(new Dimension(200, 20)); + outPanel.add(jPanel); + scrollPanel.add(outPanel, BorderLayout.NORTH); + + UITitleSplitLine backgroundSplit = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"), 520); + backgroundSplit.setPreferredSize(new Dimension(520, 20)); + centerPane.add(backgroundSplit); + + centerPane.add(createBackgroundConfPane()); + + UITitleSplitLine fontSplit = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Char"), 520); + fontSplit.setPreferredSize(new Dimension(520, 20)); + centerPane.add(fontSplit); + + centerPane.add(createFontConfPane()); + + createExtraConfPane(centerPane); + + scrollPanel.add(centerPane, BorderLayout.CENTER); + initDefaultConfig(); + } + + protected JPanel createCenterPane() { + JPanel panel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 10); + return panel; + } + + protected JPanel createBackgroundConfPane() { + initialColorBox = new NewColorSelectBox(137); + initialColorBox.addSelectChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + updatePreviewPane(); + } + }); + UILabel fillLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fill")); + fillLabel.setPreferredSize(new Dimension(55, 20)); + JPanel boxFlowPane = FRGUIPaneFactory.createBoxFlowInnerContainerPane(10, 0); + boxFlowPane.add(fillLabel); + boxFlowPane.add(initialColorBox); + initialColorBox.setPreferredSize(new Dimension(157, 20)); + boxFlowPane.setPreferredSize(new Dimension(500, 20)); + boxFlowPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20)); + return boxFlowPane; + } + + protected JPanel createFontConfPane() { + fontConfPane = new MobileTabFontConfPane(); + fontConfPane.addFontChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + updatePreviewPane(); + } + }); + UILabel initCharLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Init_Char")); + initCharLabel.setPreferredSize(new Dimension(55, 20)); + JPanel jPanel3 = FRGUIPaneFactory.createBoxFlowInnerContainerPane(5, 0); + jPanel3.add(initCharLabel); + jPanel3.add(fontConfPane); + jPanel3.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20)); + return jPanel3; + } + + + protected void createExtraConfPane(JPanel centerPane) { + + } + + protected abstract void initDefaultConfig(); + + protected abstract MobileTemplatePreviewPane createPreviewPane(); + + @Override + public void populateBean(MobileTemplateStyle ob) { + centerPane.setVisible(ob.isCustom()); + custom.setSelectedItem(ob.isCustom() ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default") : + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Custom")); + initialColorBox.setSelectObject(ob.getInitialColor()); + fontConfPane.populate(ob.getTabFontConfig().getFont()); + updatePreviewPane(); + } + + + @Override + public MobileTemplateStyle updateBean() { + if (custom.getSelectedIndex() == 0) { + return getDefaultTemplateStyle(); + } + MobileTemplateStyle ob = updateSubStyle(); + ob.setCustom(custom.getSelectedIndex() == 1); + ob.setInitialColor(initialColorBox.getSelectObject()); + TabFontConfig config = ob.getTabFontConfig(); + config.setFont(fontConfPane.update()); + return ob; + } + + protected abstract MobileTemplateStyle getDefaultTemplateStyle(); + + public void updatePreviewPane() { + previewPane.populateConfig(updateBean()); + previewPane.setBackground(previewPane.getInitialColor()); + previewPane.repaint(); + } + + public abstract MobileTemplateStyle updateSubStyle(); + + + @Override + protected String title4PopupWindow() { + return null; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SliderStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SliderStyleDefinePane.java new file mode 100644 index 000000000..4765edc52 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SliderStyleDefinePane.java @@ -0,0 +1,150 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.widget.UITitleSplitLine; +import com.fr.design.mainframe.widget.preview.MobileTemplatePreviewPane; +import com.fr.design.style.color.NewColorSelectBox; +import com.fr.form.ui.container.cardlayout.WCardTagLayout; +import com.fr.general.FRFont; +import com.fr.general.cardtag.mobile.MobileTemplateStyle; +import com.fr.general.cardtag.mobile.SliderStyle; + +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; + +public class SliderStyleDefinePane extends MobileTemplateStyleDefinePane { + private NewColorSelectBox initDotColor; + private NewColorSelectBox selectDotColor; + + + public SliderStyleDefinePane(WCardTagLayout tagLayout) { + super(tagLayout); + } + + @Override + public void populateBean(MobileTemplateStyle ob) { + super.populateBean(ob); + SliderStyle sliderStyle = (SliderStyle) ob; + initDotColor.setSelectObject(sliderStyle.getInitDotColor()); + selectDotColor.setSelectObject(sliderStyle.getSelectDotColor()); + } + + @Override + protected MobileTemplateStyle getDefaultTemplateStyle() { + return new SliderStyle(); + } + + @Override + public MobileTemplateStyle updateSubStyle() { + SliderStyle sliderStyle = new SliderStyle(); + sliderStyle.setInitDotColor(initDotColor.getSelectObject()); + sliderStyle.setSelectDotColor(selectDotColor.getSelectObject()); + return sliderStyle; + } + + + protected void createExtraConfPane(JPanel centerPane) { + UITitleSplitLine dotIndicator = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Slider_Dot_Indicator"), 520); + dotIndicator.setPreferredSize(new Dimension(520, 20)); + centerPane.add(dotIndicator); + initDotColor = new NewColorSelectBox(137); + initDotColor.addSelectChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + updatePreviewPane(); + } + }); + selectDotColor = new NewColorSelectBox(137); + selectDotColor.addSelectChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + updatePreviewPane(); + } + }); + UILabel initColor = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Init_Fill")); + + UILabel selectColor = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Select_Fill")); + initColor.setPreferredSize(new Dimension(55, 20)); + selectColor.setPreferredSize(new Dimension(55, 20)); + JPanel initDotColorPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{initColor, initDotColor}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + JPanel selectDotColorPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{selectColor, selectDotColor}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + initDotColorPane.setPreferredSize(new Dimension(240, 20)); + selectDotColorPane.setPreferredSize(new Dimension(240, 20)); + centerPane.add(initDotColorPane); + centerPane.add(selectDotColorPane); + + } + + @Override + protected void initDefaultConfig() { + this.initialColorBox.setSelectObject(SliderStyle.DEFAULT_INITIAL_COLOR); + this.fontConfPane.populate(SliderStyle.DEFAULT_TAB_FONT.getFont()); + initDotColor.setSelectObject(SliderStyle.DEFAULT_INITIAL_DOT_COLOR); + selectDotColor.setSelectObject(SliderStyle.DEFAULT_SELECT_DOT_COLOR); + } + + @Override + protected MobileTemplatePreviewPane createPreviewPane() { + return new SliderStylePreviewPane(); + } + + + @Override + protected String title4PopupWindow() { + return null; + } + + + public class SliderStylePreviewPane extends MobileTemplatePreviewPane { + private Color initDotColor; + private Color selectDotColor; + + public SliderStylePreviewPane() { + + } + + public void repaint() { + super.repaint(); + } + + @Override + public void paint(Graphics g) { + super.paint(g); + Graphics2D g2d = (Graphics2D) g.create(); + FRFont frFont = this.getTabFontConfig().getFont(); + g2d.setFont(frFont); + g2d.setColor(frFont.getForeground()); + g2d.drawString(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Slider_Title"), 10, 18); + WCardTagLayout cardTagLayout = SliderStyleDefinePane.this.getTagLayout(); + g2d.translate(10, 25); + for (int i = 0; i < cardTagLayout.getWidgetCount(); i++) { + if (i == 0) { + g2d.setColor(selectDotColor); + g2d.fillOval(0, 0, 6, 6); + g2d.translate(9, 0); + continue; + } + g2d.setColor(initDotColor); + g2d.fillOval(0, 0, 6, 6); + g2d.translate(9, 0); + } + + } + + public void populateConfig(MobileTemplateStyle templateStyle) { + super.populateConfig(templateStyle); + this.initDotColor = ((SliderStyle) templateStyle).getInitDotColor(); + this.selectDotColor = ((SliderStyle) templateStyle).getSelectDotColor(); + } + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/StyleDefinePaneWithSelectConf.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/StyleDefinePaneWithSelectConf.java new file mode 100644 index 000000000..9096fc957 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/StyleDefinePaneWithSelectConf.java @@ -0,0 +1,113 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.gui.ibutton.UIColorButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.widget.MobileTabFontConfPane; +import com.fr.design.style.color.NewColorSelectBox; +import com.fr.form.ui.container.cardlayout.WCardTagLayout; +import com.fr.general.cardtag.mobile.MobileTemplateStyle; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; + +public abstract class StyleDefinePaneWithSelectConf extends MobileTemplateStyleDefinePane { + + protected NewColorSelectBox selectColorBox; + protected UIColorButton selectFontColor; + + public StyleDefinePaneWithSelectConf(WCardTagLayout tagLayout) { + super(tagLayout); + } + + protected JPanel createBackgroundConfPane() { + JPanel panel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 10); + panel.setBorder(BorderFactory.createEmptyBorder(0, 20, 5, 20)); + initialColorBox = new NewColorSelectBox(137); + initialColorBox.addSelectChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + updatePreviewPane(); + } + }); + + selectColorBox = new NewColorSelectBox(137); + selectColorBox.addSelectChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + updatePreviewPane(); + } + }); + UILabel initFillLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Init_Fill")); + UILabel selectFillLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Select_Fill")); + initFillLabel.setPreferredSize(new Dimension(55, 20)); + selectFillLabel.setPreferredSize(new Dimension(55, 20)); + JPanel jPanel2 = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{initFillLabel, initialColorBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + JPanel jPanel3 = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{selectFillLabel, selectColorBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + jPanel2.setPreferredSize(new Dimension(240, 20)); + jPanel3.setPreferredSize(new Dimension(240, 20)); + panel.add(jPanel2); + panel.add(jPanel3); + return panel; + } + + protected JPanel createFontConfPane() { + JPanel panel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 10); + panel.setBorder(BorderFactory.createEmptyBorder(0, 20, 5, 20)); + fontConfPane = new MobileTabFontConfPane(); + fontConfPane.addFontChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + updatePreviewPane(); + } + }); + selectFontColor = new UIColorButton(); + selectFontColor.addColorChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + + updatePreviewPane(); + } + }); + UILabel initCharLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Init_Char")); + initCharLabel.setPreferredSize(new Dimension(55, 20)); + JPanel jPanel3 = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{initCharLabel, fontConfPane}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + jPanel3.setPreferredSize(new Dimension(500, 20)); + + UILabel selectCharLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Select_Char")); + selectCharLabel.setPreferredSize(new Dimension(55, 20)); + selectFontColor.setPreferredSize(new Dimension(20, 20)); + JPanel jPanel4 = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{selectCharLabel, selectFontColor}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + JPanel jPanel5 = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + jPanel5.setPreferredSize(new Dimension(500, 20)); + jPanel5.add(jPanel4); + panel.add(jPanel3); + panel.add(jPanel5); + return panel; + } + + @Override + public MobileTemplateStyle updateSubStyle() { + MobileTemplateStyle mobileTemplateStyle = updateStyleWithSelectConf(); + mobileTemplateStyle.setSelectColor(selectColorBox.getSelectObject()); + mobileTemplateStyle.getTabFontConfig().setSelectColor(selectFontColor.getColor()); + return mobileTemplateStyle; + } + + protected abstract MobileTemplateStyle updateStyleWithSelectConf(); + + @Override + public void populateBean(MobileTemplateStyle mobileTemplateStyle) { + super.populateBean(mobileTemplateStyle); + selectColorBox.setSelectObject(mobileTemplateStyle.getSelectColor()); + selectFontColor.setColor(mobileTemplateStyle.getTabFontConfig().getSelectColor()); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TabIconConfigPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TabIconConfigPane.java new file mode 100644 index 000000000..6f424e19e --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TabIconConfigPane.java @@ -0,0 +1,172 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.base.GraphHelper; +import com.fr.base.IconManager; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.web.CustomIconPane; +import com.fr.form.ui.WidgetInfoConfig; +import com.fr.general.ComparatorUtils; +import com.fr.stable.Constants; + +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.JToggleButton; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.plaf.basic.BasicButtonUI; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.geom.Rectangle2D; +import java.util.ArrayList; + +public class TabIconConfigPane extends JPanel { + private UIButton editIconButton; + private String curIconName; + private IconButton selectIconButton; + private ArrayList iconButtons = new ArrayList(); + + public TabIconConfigPane(int count) { + initComp(count); + } + + public void initComp(int count) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel panel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0)); + editIconButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); + editIconButton.setPreferredSize(new Dimension(62, 20)); + panel.add(editIconButton); + editIconButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + final CustomIconPane cip = new CustomIconPane(); + BasicDialog editDialog = cip.showWindow(DesignerContext.getDesignerFrame()); + editDialog.addDialogActionListener(new DialogActionAdapter() { + @Override + public void doOk() { + curIconName = cip.update(); + setShowIconImage(); + TabIconConfigPane.this.repaint(); + } + }); + editDialog.setVisible(true); + } + }); + editIconButton.setEnabled(false); + this.add(panel, BorderLayout.CENTER); + + JPanel northPane = new JPanel(); + northPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0)); + for (int i = 0; i < count; i++) { + IconButton iconButton = new IconButton(""); + northPane.add(iconButton); + iconButtons.add(iconButton); + } + this.add(northPane, BorderLayout.NORTH); + } + + public void setShowIconImage() { + selectIconButton.setIconName(curIconName); + } + + public void populate(ArrayList iconArr) { + for (int i = 0; i < iconButtons.size(); i++) { + iconButtons.get(i).setIconName(iconArr.get(i)); + } + } + + public ArrayList update() { + ArrayList iconNames = new ArrayList(); + for (int i = 0; i < iconButtons.size(); i++) { + iconNames.add(iconButtons.get(i).getIconName()); + } + return iconNames; + } + + + private class IconButton extends JToggleButton implements ActionListener { + private String iconName; + private Image iconImage = null; + private static final int ICON_BUTTON_SIZE = 20; + private static final int ICON_X = 2; + private static final int ICON_Y = 2; + + public IconButton(String name) { + this.iconName = name; + this.addActionListener(this); + this.setBackground(Color.WHITE); + this.setCursor(new Cursor(Cursor.HAND_CURSOR)); + this.iconImage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(name); + } + + @Override + public void updateUI() { + setUI(new BasicButtonUI() { + public void paint(Graphics g, JComponent c) { + super.paint(g, c); + } + }); + } + + public String getIconName() { + return iconName; + } + + public void setIconName(String iconName) { + this.iconName = iconName; + this.iconImage = WidgetInfoConfig.getInstance().getIconManager().getIconImage(iconName); + } + + @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); + } + if (this.iconName != null && ComparatorUtils.equals(this, selectIconButton)) { + g2d.setPaint(Color.decode("#419BF9")); + } else { + g2d.setPaint(Color.decode("#D9DADD")); + } + GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, 20, 20), Constants.LINE_MEDIUM); + } + + @Override + public Dimension getPreferredSize() { + return new Dimension(ICON_BUTTON_SIZE, ICON_BUTTON_SIZE); + } + + public void actionPerformed(ActionEvent evt) { + selectIconButton = this; + editIconButton.setEnabled(true); + TabIconConfigPane.this.repaint();// repaint + } + + @Override + public void addChangeListener(ChangeListener changeListener) { + this.changeListener = changeListener; + } + + private void fireChagneListener() { + if (this.changeListener != null) { + ChangeEvent evt = new ChangeEvent(this); + this.changeListener.stateChanged(evt); + } + } + + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TemplateStyleDefinePaneFactory.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TemplateStyleDefinePaneFactory.java new file mode 100644 index 000000000..3f923707d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TemplateStyleDefinePaneFactory.java @@ -0,0 +1,55 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.form.ui.container.cardlayout.WCardTagLayout; +import com.fr.general.cardtag.mobile.DefaultMobileTemplateStyle; +import com.fr.general.cardtag.mobile.DownMenuStyle; +import com.fr.general.cardtag.mobile.MobileTemplateStyle; +import com.fr.general.cardtag.mobile.SliderStyle; +import com.fr.general.cardtag.mobile.UpMenuStyle; +import com.fr.invoke.Reflect; +import com.fr.log.FineLoggerFactory; + +import java.util.HashMap; +import java.util.Map; + +public class TemplateStyleDefinePaneFactory { + private static Map defineMap = new HashMap(); + + static { + defineMap.put(DefaultMobileTemplateStyle.STYLE_NAME, new StyleDefinePaneUI(DefaultMobileStyleDefinePane.class)); + defineMap.put(UpMenuStyle.STYLE_NAME, new StyleDefinePaneUI(UpMenuStyleDefinePane.class)); + defineMap.put(DownMenuStyle.STYLE_NAME, new StyleDefinePaneUI(DownMenuStyleDefinePane.class)); + defineMap.put(SliderStyle.STYLE_NAME, new StyleDefinePaneUI(SliderStyleDefinePane.class)); + } + + public static BasicBeanPane createDefinePane(String style, WCardTagLayout tagLayout) { + StyleDefinePaneUI styleDefinePaneUI = defineMap.get(style); + Class> clazz = styleDefinePaneUI.getaClass(); + if (clazz == null) { + } + BasicBeanPane quickPane = null; + try { + quickPane = Reflect.on(clazz).create(tagLayout).get(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return quickPane; + } + + private static class StyleDefinePaneUI { + private Class> aClass; + + public StyleDefinePaneUI(Class> aClass) { + this.aClass = aClass; + } + + public Class> getaClass() { + return aClass; + } + + public void setaClass(Class> aClass) { + this.aClass = aClass; + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java new file mode 100644 index 000000000..41265faef --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java @@ -0,0 +1,211 @@ +package com.fr.design.mainframe.mobile.ui; + +import com.fr.base.GraphHelper; +import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.widget.UITitleSplitLine; +import com.fr.design.mainframe.widget.preview.MobileTemplatePreviewPane; +import com.fr.form.ui.CardSwitchButton; +import com.fr.form.ui.container.cardlayout.WCardTagLayout; +import com.fr.general.FRFont; +import com.fr.general.cardtag.mobile.LineDescription; +import com.fr.general.cardtag.mobile.MobileTemplateStyle; +import com.fr.general.cardtag.mobile.UpMenuStyle; + +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BasicStroke; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; + +public class UpMenuStyleDefinePane extends StyleDefinePaneWithSelectConf { + private UIRadioButton gapFix; + private UIRadioButton titleWidthFix; + private LinePane bottomBorderPane; + private LinePane underLinePane; + + public UpMenuStyleDefinePane(WCardTagLayout tagLayout) { + super(tagLayout); + } + + protected JPanel createCenterPane() { + JPanel panel = super.createCenterPane(); + UILabel displayGap = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Display_Gap")); + displayGap.setPreferredSize(new Dimension(55, 20)); + gapFix = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Gap_Fix")); + titleWidthFix = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Title_Width_Fix")); + ButtonGroup buttonGroup = new ButtonGroup(); + titleWidthFix.setSelected(true); + buttonGroup.add(gapFix); + gapFix.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + titleWidthFix.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + buttonGroup.add(titleWidthFix); + gapFix.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + updatePreviewPane(); + } + }); + titleWidthFix.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + updatePreviewPane(); + } + }); + + + JPanel flowLeft = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); + flowLeft.add(gapFix); + flowLeft.add(titleWidthFix); + JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{displayGap, flowLeft}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + centerPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 15, 20)); + centerPane.setPreferredSize(new Dimension(500, 20)); + JPanel outerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + outerPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 15, 0)); + outerPane.add(centerPane, BorderLayout.CENTER); + panel.add(outerPane); + return panel; + } + + protected void createExtraConfPane(JPanel centerPane) { + bottomBorderPane = new LinePane(); + underLinePane = new LinePane(); + bottomBorderPane.addLineChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + updatePreviewPane(); + } + }); + underLinePane.addLineChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + updatePreviewPane(); + } + }); + UITitleSplitLine titleSplitLine = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Spit_Line"), 520); + titleSplitLine.setPreferredSize(new Dimension(520, 20)); + centerPane.add(titleSplitLine); + centerPane.add(bottomBorderPane); + UITitleSplitLine titleUnderLine = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Under_Line"), 520); + titleUnderLine.setPreferredSize(new Dimension(520, 20)); + centerPane.add(titleUnderLine); + centerPane.add(underLinePane); + } + + @Override + protected void initDefaultConfig() { + this.initialColorBox.setSelectObject(UpMenuStyle.DEFAULT_INITIAL_COLOR); + this.fontConfPane.populate(UpMenuStyle.DEFAULT_TAB_FONT.getFont()); + this.selectColorBox.setSelectObject(UpMenuStyle.DEFAULT_SELECT_COLOR); + this.selectFontColor.setColor(UpMenuStyle.DEFAULT_SELECT_FONT_COLOR); + this.bottomBorderPane.populate(UpMenuStyle.DEFAULT_BOTTOM_BORDER); + this.underLinePane.populate(UpMenuStyle.DEFAULT_UNDER_LINE); + } + + @Override + protected MobileTemplatePreviewPane createPreviewPane() { + return new UpMenuStylePreviewPane(); + } + + @Override + public void populateBean(MobileTemplateStyle ob) { + super.populateBean(ob); + UpMenuStyle style = (UpMenuStyle) ob; + gapFix.setSelected(style.isGapFix()); + titleWidthFix.setSelected(style.isTitleWidthFix()); + bottomBorderPane.populate(style.getBottomBorder()); + underLinePane.populate(style.getUnderline()); + } + + @Override + protected MobileTemplateStyle getDefaultTemplateStyle() { + return new UpMenuStyle(); + } + + + @Override + public MobileTemplateStyle updateStyleWithSelectConf() { + UpMenuStyle style = new UpMenuStyle(); + style.setGapFix(gapFix.isSelected()); + style.setTitleWidthFix(titleWidthFix.isSelected()); + style.setBottomBorder(bottomBorderPane.update()); + style.setUnderline(underLinePane.update()); + return style; + } + + @Override + protected String title4PopupWindow() { + return null; + } + + + public class UpMenuStylePreviewPane extends MobileTemplatePreviewPane { + private LineDescription bottomBorder; + private LineDescription underLine; + private boolean isGapFix; + + public UpMenuStylePreviewPane() { + this.setBackground(Color.WHITE); + } + + public void repaint() { + super.repaint(); + } + + @Override + public void paint(Graphics g) { + super.paint(g); + Color selectFontColor = this.getTabFontConfig().getSelectColor(); + Dimension dimension = this.getSize(); + int panelWidth = dimension.width; + int panelHeight = dimension.height; + Graphics2D g2d = (Graphics2D) g.create(); + FRFont frFont = UpMenuStyleDefinePane.this.fontConfPane.update(); + FontMetrics fm = GraphHelper.getFontMetrics(frFont); + WCardTagLayout cardTagLayout = UpMenuStyleDefinePane.this.getTagLayout(); + int eachWidth = panelWidth / cardTagLayout.getWidgetCount(); + g2d.setFont(frFont); + for (int i = 0; i < cardTagLayout.getWidgetCount(); i++) { + g2d.setColor(i == 0 ? selectFontColor : frFont.getForeground()); + CardSwitchButton cardSwitchButton = cardTagLayout.getSwitchButton(i); + String widgetName = cardSwitchButton.getText(); + int width = fm.stringWidth(widgetName); + g2d.drawString(widgetName, (eachWidth - width) / 2, (panelHeight) / 2); + if (i == 0) { + g2d.setColor(this.underLine.getColor()); + g2d.setStroke(new BasicStroke(2.0f)); + int underLineX = this.isGapFix ? (eachWidth - width) / 2 : 0; + int underLineWidth = this.isGapFix ? width : eachWidth; + g2d.drawLine(underLineX, panelHeight - 1, underLineX + underLineWidth, panelHeight - 1); + } + if (bottomBorder.getLineStyle() != 0) { + g2d.setColor(bottomBorder.getColor()); + g2d.drawLine(eachWidth, 0, eachWidth, panelHeight); + } + g2d.translate(eachWidth, 0); + } + + + } + + public void populateConfig(MobileTemplateStyle templateStyle) { + super.populateConfig(templateStyle); + this.bottomBorder = ((UpMenuStyle) templateStyle).getBottomBorder(); + this.underLine = ((UpMenuStyle) templateStyle).getUnderline(); + this.isGapFix = ((UpMenuStyle) templateStyle).isGapFix(); + } + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/MobileTabFontConfPane.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/MobileTabFontConfPane.java new file mode 100644 index 000000000..3c17d3b9b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/MobileTabFontConfPane.java @@ -0,0 +1,143 @@ +package com.fr.design.mainframe.widget; + +import com.fr.base.BaseUtils; +import com.fr.base.Utils; +import com.fr.design.gui.ibutton.UIColorButton; +import com.fr.design.gui.ibutton.UIToggleButton; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.general.FRFont; + +import javax.swing.Icon; +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.EventListenerList; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.util.Vector; + +public class MobileTabFontConfPane extends JPanel { + private EventListenerList fontChangeListener = new EventListenerList(); + private UIComboBox fontFamily; + private UIComboBox fontSize; + private UIToggleButton bold; + private UIColorButton color; + private UIToggleButton italic; + private final static Icon[] ITALIC_ICONS = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic_white.png")}; + private final static Icon[] BOLD_ICONS = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold_white.png")}; + + + public MobileTabFontConfPane() { + super(); + init(); + } + + private void init() { + this.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0)); + fontFamily = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + Vector integerList = new Vector(); + for (int i = 1; i < 100; i++) { + integerList.add(i); + } + fontFamily.setPreferredSize(new Dimension(152, 20)); + fontSize = new UIComboBox(integerList); + color = new UIColorButton(); + bold = new UIToggleButton(BOLD_ICONS, true); + italic = new UIToggleButton(ITALIC_ICONS, true); + fontFamily.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + fireFontStateChanged(); + } + }); + fontSize.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + fireFontStateChanged(); + } + }); + bold.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + fireFontStateChanged(); + } + }); + italic.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + fireFontStateChanged(); + } + }); + color.addColorChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + fireFontStateChanged(); + } + }); + this.add(fontFamily); + this.add(fontSize); + this.add(color); + this.add(bold); + this.add(italic); + + } + + public FRFont update() { + String family = (String) fontFamily.getSelectedItem(); + int size = (int) fontSize.getSelectedItem(); + int style = Font.PLAIN; + style += this.bold.isSelected() ? Font.BOLD : Font.PLAIN; + style += this.italic.isSelected() ? Font.ITALIC : Font.PLAIN; + FRFont frFont = FRFont.getInstance(family, style, size, color.getColor()); + return frFont; + } + + public void populate(FRFont frFont) { + fontFamily.setSelectedItem(frFont.getFamily()); + fontSize.setSelectedItem(frFont.getSize()); + color.setColor(frFont.getForeground()); + bold.setSelected(frFont.isBold()); + italic.setSelected(frFont.isItalic()); + + } + + + /** + * 添加监听 + * + * @param changeListener 监听列表 + */ + public void addFontChangeListener(ChangeListener changeListener) { + fontChangeListener.add(ChangeListener.class, changeListener); + } + + /** + * 移除监听 + * Removes an old ColorChangeListener. + * + * @param changeListener 监听列表 + */ + public void removeFontChangeListener(ChangeListener changeListener) { + fontChangeListener.remove(ChangeListener.class, changeListener); + } + + /** + * 颜色状态改变 + */ + public void fireFontStateChanged() { + Object[] listeners = fontChangeListener.getListenerList(); + ChangeEvent e = null; + + for (int i = listeners.length - 2; i >= 0; i -= 2) { + if (listeners[i] == ChangeListener.class) { + if (e == null) { + e = new ChangeEvent(this); + } + ((ChangeListener) listeners[i + 1]).stateChanged(e); + } + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/UITitleSplitLine.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/UITitleSplitLine.java new file mode 100644 index 000000000..afd1a2c96 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/UITitleSplitLine.java @@ -0,0 +1,69 @@ +package com.fr.design.mainframe.widget; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.FRFont; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; + +public class UITitleSplitLine extends JPanel { + private static final Color LINE_COLOR = Color.decode("#E0E0E1"); + private static final Color TITLE_COLOR = Color.decode("#333334"); + private static final FRFont TITLE_FONT = FRFont.getInstance("PingFangSC-Regular", 0, 12.0F); + + private Color color; + private UILabel label; + private int width; + private static final int OFFSETX = 10; + private static final int OFFSET = 3; + + + public UITitleSplitLine(String title, int width) { + this(title, LINE_COLOR, width); + } + + public UITitleSplitLine(String title, Color color, int width) { + super(); + this.color = color; + this.width = width; + this.label = new UILabel(title); + } + + public void paint(Graphics g) { + super.paint(g); + Dimension size = label.getPreferredSize(); + int labelH = size.height; + g.setColor(color); + g.drawLine(0, labelH / 2, OFFSETX, labelH / 2); + g.drawLine(OFFSETX + size.width + OFFSET * 2, labelH / 2, width, labelH / 2); + g.translate(OFFSETX + OFFSET, 0); + label.setFont(TITLE_FONT); + label.setForeground(TITLE_COLOR); + label.setSize(size.width, size.height); + label.paint(g); + g.translate(-OFFSETX - OFFSET, 0); + } + + + public static void main(String[] args) { +// JFrame jf = new JFrame("test"); +// jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); +// JPanel content = (JPanel) jf.getContentPane(); +// content.setLayout(new BorderLayout()); +// JPanel myPanel = new JPanel(); +// myPanel.setLayout(new BorderLayout()); +// JPanel Panel = new JPanel(); +// Panel.setBackground(Color.blue); +// myPanel.add(new UITitleSplitLine("基本", 223), BorderLayout.CENTER); +// content.add(myPanel, BorderLayout.CENTER); +// GUICoreUtils.centerWindow(jf); +// jf.setSize(439, 400); +// jf.setVisible(true); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AbstractTemplateStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AbstractTemplateStylePane.java new file mode 100644 index 000000000..482b2cebc --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AbstractTemplateStylePane.java @@ -0,0 +1,10 @@ +package com.fr.design.mainframe.widget.accessibles; + +import com.fr.design.dialog.BasicPane; + +public abstract class AbstractTemplateStylePane extends BasicPane { + + public abstract void populate(T ob); + + public abstract T update(); +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleTemplateStyleEditor.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleTemplateStyleEditor.java index 9e32a4d46..195a92e8a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleTemplateStyleEditor.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleTemplateStyleEditor.java @@ -2,7 +2,6 @@ package com.fr.design.mainframe.widget.accessibles; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; -import com.fr.general.cardtag.TemplateStyle; import com.fr.design.mainframe.widget.wrappers.TemplateStyleWrapper; import javax.swing.SwingUtilities; @@ -15,18 +14,16 @@ public class AccessibleTemplateStyleEditor extends UneditableAccessibleEditor { private static final Dimension DEFAULT_DIMENSION = new Dimension(600, 400); - private TemplateStylePane stylePane; + private AbstractTemplateStylePane stylePane; - public AccessibleTemplateStyleEditor() { + public AccessibleTemplateStyleEditor(AbstractTemplateStylePane stylePane) { super(new TemplateStyleWrapper()); + this.stylePane = stylePane; } @Override protected void showEditorPane() { - if (stylePane == null) { - stylePane = new TemplateStylePane(); - stylePane.setPreferredSize(DEFAULT_DIMENSION); - } + stylePane.setPreferredSize(DEFAULT_DIMENSION); BasicDialog dlg = stylePane.showWindow(SwingUtilities.getWindowAncestor(this)); dlg.addDialogActionListener(new DialogActionAdapter() { @@ -36,7 +33,7 @@ public class AccessibleTemplateStyleEditor extends UneditableAccessibleEditor { fireStateChanged(); } }); - stylePane.populate((TemplateStyle) getValue()); + stylePane.populate(getValue()); dlg.setVisible(true); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java new file mode 100644 index 000000000..f88221a42 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java @@ -0,0 +1,113 @@ +package com.fr.design.mainframe.widget.accessibles; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.mobile.ui.TemplateStyleDefinePaneFactory; +import com.fr.form.ui.container.cardlayout.WCardTagLayout; +import com.fr.general.cardtag.mobile.DefaultMobileTemplateStyle; +import com.fr.general.cardtag.mobile.DownMenuStyle; +import com.fr.general.cardtag.mobile.MobileTemplateStyle; +import com.fr.general.cardtag.mobile.SliderStyle; +import com.fr.general.cardtag.mobile.UpMenuStyle; +import javax.swing.DefaultListCellRenderer; +import javax.swing.DefaultListModel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.ListCellRenderer; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MobileTemplateStylePane extends AbstractTemplateStylePane { + private static final List STYLE_LIST = new ArrayList(); + static { + STYLE_LIST.add(DefaultMobileTemplateStyle.STYLE_NAME); + STYLE_LIST.add(UpMenuStyle.STYLE_NAME); + STYLE_LIST.add(DownMenuStyle.STYLE_NAME); + STYLE_LIST.add(SliderStyle.STYLE_NAME); + } + + private DefaultListModel listModel; + private JList styleList; + private Map> map = new HashMap<>(); + private JPanel right; + private CardLayout card; + public MobileTemplateStylePane(WCardTagLayout tagLayout){ + init(tagLayout); + } + + public void init(WCardTagLayout tagLayout){ + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + listModel = new DefaultListModel(); + card = new CardLayout(); + right = FRGUIPaneFactory.createCardLayout_S_Pane(); + right.setLayout(card); + for(String style : STYLE_LIST){ + listModel.addElement(style); + BasicBeanPane styleBasicBeanPane = TemplateStyleDefinePaneFactory.createDefinePane(style, tagLayout); + map.put(style, styleBasicBeanPane); + right.add(style, styleBasicBeanPane); + } + styleList = new JList(listModel); + styleList.setCellRenderer(render); + + JPanel westPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + westPane.add(styleList, BorderLayout.CENTER); + westPane.setPreferredSize(new Dimension(100, 500)); + + + JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + JPanel attrConfPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + centerPane.setPreferredSize(new Dimension(500, 500)); + attrConfPane.add(right, BorderLayout.CENTER); + centerPane.add(attrConfPane, BorderLayout.CENTER); + styleList.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + String selectedValue = (String)styleList.getSelectedValue(); + card.show(right, selectedValue); + } + }); + this.add(westPane, BorderLayout.WEST); + this.add(centerPane, BorderLayout.CENTER); + } + public static ListCellRenderer render = new DefaultListCellRenderer() { + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + + if (value instanceof MobileTemplateStyle) { + MobileTemplateStyle l = (MobileTemplateStyle) value; + this.setText(l.toString()); + } + return this; + } + }; + + @Override + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Tab_Style_Template"); + } + + public void populate(MobileTemplateStyle templateStyle) { + for(int i = 0; i< listModel.getSize(); i++){ + if((listModel.getElementAt(i)).equals(templateStyle.getStyle())){ + styleList.setSelectedIndex(i); + map.get(templateStyle.getStyle()).populateBean(templateStyle); + card.show(right, templateStyle.getStyle()); + return; + } + } + styleList.setSelectedIndex(0); + } + + public MobileTemplateStyle update() { + return map.get(styleList.getSelectedValue()).updateBean(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/TemplateStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/TemplateStylePane.java index fdd6cbb32..6374a19c5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/TemplateStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/TemplateStylePane.java @@ -21,16 +21,17 @@ import javax.swing.ListCellRenderer; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; +import java.awt.Rectangle; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; /** * Created by kerry on 2017/11/23. */ -public class TemplateStylePane extends BasicPane { +public class TemplateStylePane extends AbstractTemplateStylePane { private DefaultListModel listModel; private JList styleList; - private TemplateStylePreviewPane previewPane = new TemplateStylePreviewPane(new DefaultTemplateStyle()); + private TemplateStylePreviewPane previewPane = new TemplateStylePreviewPane(new DefaultTemplateStyle(), new Rectangle(0, 50, 540, 400)); public TemplateStylePane(){ init(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/TemplateStylePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/TemplateStylePreviewPane.java index 0f684006a..1e47d3089 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/TemplateStylePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/TemplateStylePreviewPane.java @@ -1,26 +1,23 @@ package com.fr.design.mainframe.widget.accessibles; -import com.fr.base.BaseUtils; import com.fr.general.cardtag.TemplateStyle; import javax.swing.JPanel; import java.awt.Graphics; import java.awt.Graphics2D; -import java.awt.Image; +import java.awt.Rectangle; /** * Created by kerry on 2017/12/11. */ public class TemplateStylePreviewPane extends JPanel { - private static final int WIDTH = 540; - private static final int HEIGHT = 400; - private static final int OFFSETY = 50; - + private Rectangle rectangle; private TemplateStyle templateStyle; - public TemplateStylePreviewPane(TemplateStyle templateStyle){ + public TemplateStylePreviewPane(TemplateStyle templateStyle, Rectangle rectangle){ this.templateStyle = templateStyle; + this.rectangle = rectangle; } public void repaint (TemplateStyle templateStyle){ @@ -32,7 +29,6 @@ public class TemplateStylePreviewPane extends JPanel { public void paint(Graphics g) { super.paint(g); Graphics2D g2d = (Graphics2D) g.create(); - Image image = BaseUtils.readImage(templateStyle.getPreview()); - g2d.drawImage(image, 0, OFFSETY, WIDTH, HEIGHT, null); + templateStyle.paintPreview(g2d, rectangle); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/preview/MobileTemplatePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/preview/MobileTemplatePreviewPane.java new file mode 100644 index 000000000..d5ddbb6b9 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/preview/MobileTemplatePreviewPane.java @@ -0,0 +1,53 @@ +package com.fr.design.mainframe.widget.preview; + +import com.fr.general.cardtag.mobile.MobileTemplateStyle; +import com.fr.general.cardtag.mobile.TabFontConfig; + +import javax.swing.JPanel; +import java.awt.Color; + +public abstract class MobileTemplatePreviewPane extends JPanel { + private Color initialColor; + private Color selectColor; + private TabFontConfig tabFontConfig = new TabFontConfig(); + + public Color getInitialColor() { + return initialColor; + } + + public void setInitialColor(Color initialColor) { + this.initialColor = initialColor; + } + + public Color getSelectColor() { + return selectColor; + } + + public void setSelectColor(Color selectColor) { + this.selectColor = selectColor; + } + + public TabFontConfig getTabFontConfig() { + return tabFontConfig; + } + + public void setTabFontConfig(TabFontConfig tabFontConfig) { + this.tabFontConfig = tabFontConfig; + } + + public MobileTemplatePreviewPane(){ + + } + + public void populateConfig(MobileTemplateStyle templateStyle){ + this.setInitialColor(templateStyle.getInitialColor()); + this.setBackground(templateStyle.getInitialColor()); + this.setSelectColor(templateStyle.getSelectColor()); + this.setTabFontConfig(templateStyle.getTabFontConfig()); + } + + public void repaint (){ + super.repaint(); + } + +} diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java index f0d155f7a..1b9d2690e 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java @@ -16,9 +16,11 @@ import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWHorizontalBoxLayout; import com.fr.design.designer.creator.XWidgetCreator; +import com.fr.design.designer.properties.mobile.TabMobilePropertyUI; import com.fr.design.form.layout.FRFlowLayout; import com.fr.design.form.layout.FRHorizontalLayout; import com.fr.design.form.layout.FRVerticalLayout; +import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.mainframe.EditingMouseListener; @@ -328,6 +330,10 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout { return ComparatorUtils.equals(displayPosition, WTabDisplayPosition.TOP_POSITION) || ComparatorUtils.equals(displayPosition, WTabDisplayPosition.BOTTOM_POSITION); } + @Override + public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { + return new WidgetPropertyUIProvider[]{ new TabMobilePropertyUI(this)}; + } /** * data属性改变触发其他操作 diff --git a/designer-form/src/main/java/com/fr/design/designer/properties/mobile/TabMobilePropertyUI.java b/designer-form/src/main/java/com/fr/design/designer/properties/mobile/TabMobilePropertyUI.java new file mode 100644 index 000000000..8ebdbd769 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/properties/mobile/TabMobilePropertyUI.java @@ -0,0 +1,30 @@ +package com.fr.design.designer.properties.mobile; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.dialog.BasicPane; +import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider; +import com.fr.design.gui.itable.AbstractPropertyTable; +import com.fr.design.widget.ui.designer.mobile.TabMobileWidgetDefinePane; + +public class TabMobilePropertyUI extends AbstractWidgetPropertyUIProvider { + private XCreator xCreator; + + public TabMobilePropertyUI(XCreator xCreator){ + this.xCreator = xCreator; + } + + @Override + public AbstractPropertyTable createWidgetAttrTable() { + return null; + } + + @Override + public BasicPane createWidgetAttrPane() { + return new TabMobileWidgetDefinePane(xCreator); + } + + @Override + public String tableTitle() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr"); + } +} diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WCardTagLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WCardTagLayoutDefinePane.java index ee021d260..d1e68baf3 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WCardTagLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WCardTagLayoutDefinePane.java @@ -15,6 +15,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.widget.accessibles.AccessibleTabPaneBackgroundEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleTemplateStyleEditor; +import com.fr.design.mainframe.widget.accessibles.TemplateStylePane; import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.container.WTabDisplayPosition; @@ -51,7 +52,7 @@ public class WCardTagLayoutDefinePane extends AbstractDataModify this.setLayout(FRGUIPaneFactory.createBorderLayout()); backgroundEditor = new AccessibleTabPaneBackgroundEditor(); - templateStyleEditor = new AccessibleTemplateStyleEditor(); + templateStyleEditor = new AccessibleTemplateStyleEditor(new TemplateStylePane()); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; double[] rowSize = {p, p, p, p, p}; diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java new file mode 100644 index 000000000..f6d94da06 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java @@ -0,0 +1,69 @@ +package com.fr.design.widget.ui.designer.mobile; + +import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.widget.accessibles.AccessibleTemplateStyleEditor; +import com.fr.design.mainframe.widget.accessibles.MobileTemplateStylePane; +import com.fr.form.ui.container.cardlayout.WCardTagLayout; +import com.fr.general.cardtag.mobile.MobileTemplateStyle; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; + +public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { + private XCreator xCreator; + private AccessibleTemplateStyleEditor templateStyleEditor; + private AttributeChangeListener changeListener; + + public TabMobileWidgetDefinePane(XCreator xCreator) { + this.xCreator = xCreator; + } + + private void bindListeners2Widgets() { + reInitAllListeners(); + this.changeListener = new AttributeChangeListener() { + @Override + public void attributeChange() { + update(); + } + }; + } + /** + * 后台初始化所有事件. + */ + private void reInitAllListeners() { + initListener(this); + } + + @Override + public void initPropertyGroups(Object source) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Tab_Style_Template")); + templateStyleEditor = new AccessibleTemplateStyleEditor(new MobileTemplateStylePane((WCardTagLayout) xCreator.toData())); + JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{label, templateStyleEditor}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + this.add(jPanel, BorderLayout.CENTER); + } + + @Override + public void populate(FormDesigner designer) { + templateStyleEditor.setValue(((WCardTagLayout)xCreator.toData()).getMobileTemplateStyle()); + // 数据 populate 完成后,再设置监听 + this.bindListeners2Widgets(); + this.addAttributeChangeListener(changeListener); + } + + @Override + public void update() { + ((WCardTagLayout)xCreator.toData()).setMobileTemplateStyle((MobileTemplateStyle) templateStyleEditor.getValue()); + DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来 + + } +} From 8722af6cbf9995a779b5a84c5ff06e5785fc5340 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 19 Nov 2018 16:34:22 +0800 Subject: [PATCH 12/20] =?UTF-8?q?REPORT-12391=20=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E7=AB=AF=E5=8F=A3=E5=8F=B7=E5=8F=AF=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=3D>=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GlobalNativePrintSettingPane.java | 49 ++++++++++++++----- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/GlobalNativePrintSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/GlobalNativePrintSettingPane.java index 82a4ff3f2..4b30458e6 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/GlobalNativePrintSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/GlobalNativePrintSettingPane.java @@ -3,35 +3,39 @@ package com.fr.design.webattr.printsettings; import com.fr.base.print.NativePrintAttr; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UIIntNumberField; +import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.gui.GUICoreUtils; +import com.sun.jna.Native; import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.Component; +import java.awt.FlowLayout; /** * 本地打印设置面板——全局 * Created by plough on 2018/10/31. */ public class GlobalNativePrintSettingPane extends AbstractNativePrintSettingPane { + private static final int PRINT_PORT_FIELD_COLUMNS = 8; + // 服务器配置面板特有的组件 private UICheckBox defaultDownloadUrlCheck; // 采用默认的软件下载地址 private UITextField customUrlFieldWin; private UITextField customUrlFieldMac; + private UINumberField printPortField; // 打印软件端口号 @Override JPanel createHeaderPane(Component... comps) { - - Component[] newComps = { - getDownloadUrlSettingPane() - }; - Component[] allComps = new Component[comps.length + newComps.length]; + Component[] allComps = new Component[comps.length + 1]; System.arraycopy(comps, 0, allComps, 0, comps.length); - System.arraycopy(newComps, 0, allComps, comps.length, newComps.length); + allComps[comps.length] = getExtraSettingPane(); JPanel headerPane = GUICoreUtils.createHeaderLayoutPane(allComps); headerPane.setBorder(BorderFactory.createEmptyBorder(2, 12, 5, 0)); @@ -48,6 +52,7 @@ public class GlobalNativePrintSettingPane extends AbstractNativePrintSettingPane nativePrintAttr.setCustomDownloadUrlMac(customUrlFieldMac.getText()); nativePrintAttr.setCustomDownloadUrlWin(customUrlFieldWin.getText()); } + nativePrintAttr.setPrintPort((int) printPortField.getValue()); } @Override @@ -55,21 +60,43 @@ public class GlobalNativePrintSettingPane extends AbstractNativePrintSettingPane defaultDownloadUrlCheck.setSelected(nativePrintAttr.isUseDefaultDownloadUrl()); customUrlFieldMac.setText(nativePrintAttr.getCustomDownloadUrlMac()); customUrlFieldWin.setText(nativePrintAttr.getCustomDownloadUrlWin()); + printPortField.setValue(nativePrintAttr.getPrintPort()); } - private JPanel getDownloadUrlSettingPane() { + // 服务器配置中,特有的设置面板 + private JPanel getExtraSettingPane() { + // 软件下载地址 defaultDownloadUrlCheck = GUICoreUtils.createNoBorderCheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default")); JPanel downloadUrlSettingCheckPane = GUICoreUtils.createCheckboxAndDynamicPane(defaultDownloadUrlCheck, getCustomUrlSettingPane(), true); downloadUrlSettingCheckPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); + JPanel downloadTipPane = getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Software_Download_Url") + ": "); + downloadTipPane.setBorder(BorderFactory.createEmptyBorder(0, 0, -6, 0)); + + // 打印软件端口号 + UILabel printPortTip = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Native_Print_Port") + ": "); + JPanel printPortFiledPane = getPrintPortFieldPane(); // TableLayout double p = TableLayout.PREFERRED; - double[] rowSize = {p}; + double[] rowSize = {p, p}; double[] columnSize = {p, p}; Component[][] components = { - {getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Software_Download_Url") + ": "), downloadUrlSettingCheckPane} + { + downloadTipPane, downloadUrlSettingCheckPane + }, { + printPortTip, printPortFiledPane + } }; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 15); + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 0); + } + + private JPanel getPrintPortFieldPane() { + printPortField = new UIIntNumberField(); + printPortField.setMaxValue(NativePrintAttr.MAX_PRINT_PORT_VALUE); + printPortField.setColumns(PRINT_PORT_FIELD_COLUMNS); + JPanel panel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + panel.add(printPortField); + return panel; } private JPanel getCustomUrlSettingPane() { @@ -85,7 +112,7 @@ public class GlobalNativePrintSettingPane extends AbstractNativePrintSettingPane {new UILabel("macOS: "), customUrlFieldMac} }; JPanel urlSettingPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 10); - urlSettingPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); + urlSettingPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0)); return urlSettingPane; } } From 9306bb26b13add61188c936e18630c6340fba444 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 19 Nov 2018 16:35:53 +0800 Subject: [PATCH 13/20] =?UTF-8?q?REPORT-12391=20=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E7=AB=AF=E5=8F=A3=E5=8F=B7=E5=8F=AF=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=3D>=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webattr/printsettings/GlobalNativePrintSettingPane.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/GlobalNativePrintSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/GlobalNativePrintSettingPane.java index 4b30458e6..7b3643899 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/GlobalNativePrintSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/GlobalNativePrintSettingPane.java @@ -10,12 +10,10 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.gui.GUICoreUtils; -import com.sun.jna.Native; import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.Component; -import java.awt.FlowLayout; /** * 本地打印设置面板——全局 From 1516847f4958eab30cecedc30f77c6c3fd46d613 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 19 Nov 2018 16:41:29 +0800 Subject: [PATCH 14/20] =?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 --- .../fr/design/layout/FRGUIPaneFactory.java | 11 -------- .../ui/MobileTemplateStyleDefinePane.java | 8 +++--- .../widget/MobileTabFontConfPane.java | 5 ++-- .../mainframe/widget/UITitleSplitLine.java | 25 +++---------------- .../com/fr/design/utils/gui/GUICoreUtils.java | 12 +++++++++ 5 files changed, 22 insertions(+), 39 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java index 09eaad466..db48cf995 100644 --- a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java @@ -251,17 +251,6 @@ public class FRGUIPaneFactory { return jp; } - - /** - * 创建一个靠左流式布局,流式内嵌 - * - * @return JPanel对象 - */ - public static JPanel createBoxFlowInnerContainerPane(int hgap, int vgap) { - JPanel jp = new JPanel(); - jp.setLayout(new FlowLayout(FlowLayout.LEFT, hgap, vgap)); - return jp; - } /** * 创建一个靠左流式布局,流式内嵌,首元素距离左边0 * diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java index a1d487ab7..ae55b7971 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java @@ -34,13 +34,13 @@ import java.awt.event.ItemEvent; import java.awt.event.ItemListener; public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane { + private static final String[] TAB_STYLES = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Custom")}; private UIComboBox custom; protected NewColorSelectBox initialColorBox; protected MobileTabFontConfPane fontConfPane; private JPanel centerPane; protected MobileTemplatePreviewPane previewPane; - private static final String[] TAB_STYLES = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Custom")}; private WCardTagLayout tagLayout; @@ -142,7 +142,7 @@ public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane Date: Mon, 19 Nov 2018 19:46:04 +0800 Subject: [PATCH 15/20] =?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 --- .../ui/DefaultMobileStyleDefinePane.java | 4 ++- .../mobile/ui/DownMenuStyleDefinePane.java | 35 ++++++++++++++----- .../ui/MobileTemplateStyleDefinePane.java | 13 ++++--- .../mobile/ui/SliderStyleDefinePane.java | 33 ++++++++++++----- .../mobile/ui/UpMenuStyleDefinePane.java | 17 +++++++-- 5 files changed, 74 insertions(+), 28 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java index b42f1a6ce..d397c8d52 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java @@ -80,11 +80,13 @@ public class DefaultMobileStyleDefinePane extends MobileTemplateStyleDefinePane WCardTagLayout cardTagLayout = DefaultMobileStyleDefinePane.this.getTagLayout(); int eachWidth = panelWidth / cardTagLayout.getWidgetCount(); g2d.setFont(frFont); + int fontHeight = fm.getHeight(); + int ascentHeight = fm.getAscent(); for (int i = 0; i < cardTagLayout.getWidgetCount(); i++) { CardSwitchButton cardSwitchButton = cardTagLayout.getSwitchButton(i); String widgetName = cardSwitchButton.getText(); int width = fm.stringWidth(widgetName); - g2d.drawString(widgetName, (eachWidth - width) / 2, (panelHeight) / 2); + g2d.drawString(widgetName, (eachWidth - width) / 2, (panelHeight - fontHeight) / 2 + ascentHeight); if (i == 0) { g2d.setStroke(new BasicStroke(2.0f)); g2d.drawLine(0, panelHeight - 1, eachWidth, panelHeight - 1); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DownMenuStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DownMenuStyleDefinePane.java index b8f267e98..a0184c9a8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DownMenuStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DownMenuStyleDefinePane.java @@ -5,6 +5,7 @@ import com.fr.base.IconManager; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.widget.UITitleSplitLine; import com.fr.design.mainframe.widget.preview.MobileTemplatePreviewPane; @@ -15,15 +16,18 @@ import com.fr.general.cardtag.mobile.DownMenuStyle; import com.fr.general.cardtag.mobile.LineDescription; import com.fr.general.cardtag.mobile.MobileTemplateStyle; +import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; +import java.awt.FlowLayout; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; +import java.awt.Stroke; import java.util.ArrayList; public class DownMenuStyleDefinePane extends StyleDefinePaneWithSelectConf { @@ -36,6 +40,8 @@ public class DownMenuStyleDefinePane extends StyleDefinePaneWithSelectConf { } protected void createExtraConfPane(JPanel centerPane) { + JPanel panel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 0); + panel.setBorder(BorderFactory.createEmptyBorder(0, 20, 5, 20)); UITitleSplitLine iconSplitLine = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon"), 520); iconSplitLine.setPreferredSize(new Dimension(520, 20)); centerPane.add(iconSplitLine); @@ -51,8 +57,8 @@ public class DownMenuStyleDefinePane extends StyleDefinePaneWithSelectConf { JPanel selectIconContainePane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{selectIconLabel, selectIconConfigPane}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); initIconContainPane.setPreferredSize(new Dimension(240, 50)); selectIconContainePane.setPreferredSize(new Dimension(240, 50)); - centerPane.add(initIconContainPane); - centerPane.add(selectIconContainePane); + panel.add(initIconContainPane); + panel.add(selectIconContainePane); UITitleSplitLine splitLine = new UITitleSplitLine(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Spit_Line"), 520); splitLine.setPreferredSize(new Dimension(520, 20)); splitLinePane = new LinePane(); @@ -62,6 +68,7 @@ public class DownMenuStyleDefinePane extends StyleDefinePaneWithSelectConf { updatePreviewPane(); } }); + centerPane.add(panel); centerPane.add(splitLine); centerPane.add(splitLinePane); } @@ -122,8 +129,10 @@ public class DownMenuStyleDefinePane extends StyleDefinePaneWithSelectConf { } public class DownMenuStylePreviewPane extends MobileTemplatePreviewPane { - private LineDescription splitLine; + private static final int ICON_OFFSET = 16; + private static final int GAP = 6; private static final String PAINT_ICON = "fund_white"; + private LineDescription splitLine; public DownMenuStylePreviewPane() { this.setBackground(Color.decode("#3888EE")); @@ -145,21 +154,31 @@ public class DownMenuStyleDefinePane extends StyleDefinePaneWithSelectConf { FontMetrics fm = GraphHelper.getFontMetrics(frFont); WCardTagLayout cardTagLayout = DownMenuStyleDefinePane.this.getTagLayout(); int eachWidth = panelWidth / cardTagLayout.getWidgetCount(); + g2d.setFont(frFont); + int fontHeight = fm.getHeight(); + int ascent = fm.getAscent(); for (int i = 0; i < cardTagLayout.getWidgetCount(); i++) { - g2d.setFont(frFont); + g2d.setColor(i == 0 ? selectFontColor : frFont.getForeground()); CardSwitchButton cardSwitchButton = cardTagLayout.getSwitchButton(i); String widgetName = cardSwitchButton.getText(); int width = fm.stringWidth(widgetName); + if(i == 0){ + Color oldColor = g2d.getColor(); + g2d.setColor(this.getSelectColor()); + g2d.fillRect(0, 0 ,eachWidth, panelHeight); + g2d.setColor(oldColor); + } String iconName = PAINT_ICON; - g2d.drawImage(IconManager.getIconManager().getIconImage(iconName), (eachWidth - 18) / 2, 6, null); - g2d.drawString(widgetName, (eachWidth - width) / 2, panelHeight / 2 + 9); + g2d.drawImage(IconManager.getIconManager().getIconImage(iconName), (eachWidth - ICON_OFFSET) / 2, (panelHeight - ICON_OFFSET - GAP - fontHeight) / 2, null); + g2d.drawString(widgetName, (eachWidth - width) / 2, (panelHeight + ICON_OFFSET + GAP - fontHeight) / 2 + ascent); + Stroke oldStroke = g2d.getStroke(); if (splitLine.getLineStyle() != 0) { g2d.setColor(splitLine.getColor()); - + g2d.setStroke(GraphHelper.getStroke(splitLine.getLineStyle())); g2d.drawLine(eachWidth, 0, eachWidth, panelHeight); } - + g2d.setStroke(oldStroke); g2d.translate(eachWidth, 0); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java index ae55b7971..9f5809f92 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java @@ -142,13 +142,12 @@ public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane Date: Mon, 19 Nov 2018 20:07:29 +0800 Subject: [PATCH 16/20] =?UTF-8?q?REPORT-12593=2010.0=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E5=86=85=E5=AE=B9=E5=A4=8D=E9=80=89?= =?UTF-8?q?=E6=A1=86=E5=A4=B1=E6=95=88=20=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=9D=A2=E6=9D=BF=E7=9A=84=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E9=82=A3=E4=B8=AAcheckbox=E7=9A=84?= =?UTF-8?q?=E5=80=BC=E6=B2=A1=E6=9C=89=E6=AD=A3=E7=A1=AE=E7=9A=84=E8=A2=AB?= =?UTF-8?q?set=E5=88=B0CellGUIAttr=EF=BC=8C=E5=AF=BC=E8=87=B4=E5=80=BC?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=A2=ABwrite=E5=88=B0=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/cell/settingpane/CellOtherSetPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index 814a4ebec..4ac2aab9b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -427,7 +427,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane { } } - if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Preview"))) { + if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))) { cellGUIAttr.setPreviewContent(previewCellContent.isSelected()); } From 795c9d1e0a04a574ab8eb7ec809f44ae236afccb Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Mon, 19 Nov 2018 20:11:58 +0800 Subject: [PATCH 17/20] =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=9D=A2=E6=9D=BF=E7=9A=84=E9=A2=84=E8=A7=88=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E9=82=A3=E4=B8=AAcheckbox=E7=9A=84=E5=80=BC?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=AD=A3=E7=A1=AE=E7=9A=84=E8=A2=ABset?= =?UTF-8?q?=E5=88=B0CellGUIAttr=EF=BC=8C=E5=AF=BC=E8=87=B4=E5=80=BC?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=A2=ABwrite=E5=88=B0=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/cell/settingpane/CellOtherSetPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index 814a4ebec..4ac2aab9b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -427,7 +427,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane { } } - if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Preview"))) { + if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))) { cellGUIAttr.setPreviewContent(previewCellContent.isSelected()); } From 595910ef7a693ec3383721cfba06a801d9f9be63 Mon Sep 17 00:00:00 2001 From: Hades Date: Tue, 20 Nov 2018 11:31:36 +0800 Subject: [PATCH 18/20] =?UTF-8?q?REPORT-12622=20=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E6=94=AF=E6=8C=81=E6=89=AB=E7=A0=81=20ui?= =?UTF-8?q?=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/WidgetMobilePaneFactory.java | 3 + .../widget/ui/mobile/ScanCodeMobilePane.java | 64 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 designer-realize/src/main/java/com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetMobilePaneFactory.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetMobilePaneFactory.java index 8b9afc3f2..5d995ddad 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetMobilePaneFactory.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetMobilePaneFactory.java @@ -4,7 +4,9 @@ import com.fr.base.FRContext; import com.fr.design.ExtraDesignClassManager; import com.fr.design.widget.mobile.WidgetMobilePane; import com.fr.design.widget.ui.mobile.MultiFileEditorMobilePane; +import com.fr.design.widget.ui.mobile.ScanCodeMobilePane; import com.fr.form.ui.MultiFileEditor; +import com.fr.form.ui.TextEditor; import com.fr.form.ui.Widget; import java.util.HashMap; @@ -18,6 +20,7 @@ public class WidgetMobilePaneFactory { static { mobilePaneMap.put(MultiFileEditor.class, MultiFileEditorMobilePane.class); + mobilePaneMap.put(TextEditor.class, ScanCodeMobilePane.class); mobilePaneMap.putAll(ExtraDesignClassManager.getInstance().getCellWidgetMobileOptionsMap()); } diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java new file mode 100644 index 000000000..8fd0fc88c --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java @@ -0,0 +1,64 @@ +package com.fr.design.widget.ui.mobile; + +import com.fr.base.mobile.MobileScanCodeAttr; +import com.fr.base.mobile.ScanCodeState; +import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.widget.mobile.WidgetMobilePane; +import com.fr.form.ui.TextEditor; +import com.fr.form.ui.Widget; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; + +public class ScanCodeMobilePane extends WidgetMobilePane { + + private UICheckBox appScanCodeCheck; + + protected void init() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.add(getMobileSettingPane(), BorderLayout.NORTH); + } + + private UIExpandablePane getMobileSettingPane() { + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + appScanCodeCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Support_Scan_Code"), true); + appScanCodeCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); + panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + panel.add(appScanCodeCheck); + final JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); + panelWrapper.add(panel, BorderLayout.NORTH); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, panelWrapper); + } + + @Override + public void populate(Widget widget) { + MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) widget).getMobileScanCodeAttr(); + ScanCodeState scanCodeState = mobileScanCodeAttr.getScanCodeState(); + appScanCodeCheck.setSelected(scanCodeState2boolean(scanCodeState)); + } + + @Override + public void update(Widget widget) { + MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) widget).getMobileScanCodeAttr(); + mobileScanCodeAttr.setScanCodeState(boolean2ScanCodeState(appScanCodeCheck.isSelected())); + } + + private ScanCodeState boolean2ScanCodeState(boolean scanCodeCheck) { + if (scanCodeCheck) { + return ScanCodeState.SUPPORT_SCAN_CODE; + } else { + return ScanCodeState.NOT_SUPPORT_SCAN_CODE; + } + } + + private boolean scanCodeState2boolean(ScanCodeState scanCodeState) { + if (scanCodeState == ScanCodeState.SUPPORT_SCAN_CODE) { + return true; + } else { + return false; + } + } +} From 90fbfa525daa762e063a4332da9b5b8ce782e1e0 Mon Sep 17 00:00:00 2001 From: Hades Date: Tue, 20 Nov 2018 12:34:58 +0800 Subject: [PATCH 19/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=B8=AASB?= =?UTF-8?q?=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java index 8fd0fc88c..586501e7b 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java @@ -55,10 +55,6 @@ public class ScanCodeMobilePane extends WidgetMobilePane { } private boolean scanCodeState2boolean(ScanCodeState scanCodeState) { - if (scanCodeState == ScanCodeState.SUPPORT_SCAN_CODE) { - return true; - } else { - return false; - } + return scanCodeState == ScanCodeState.SUPPORT_SCAN_CODE; } } From 695aea46b367e73e9c355e61d86fc5ee7a61602d Mon Sep 17 00:00:00 2001 From: Hades Date: Tue, 20 Nov 2018 13:55:00 +0800 Subject: [PATCH 20/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9enum=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/ui/mobile/ScanCodeMobilePane.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java index 586501e7b..e9c798ec9 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java @@ -37,24 +37,14 @@ public class ScanCodeMobilePane extends WidgetMobilePane { public void populate(Widget widget) { MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) widget).getMobileScanCodeAttr(); ScanCodeState scanCodeState = mobileScanCodeAttr.getScanCodeState(); - appScanCodeCheck.setSelected(scanCodeState2boolean(scanCodeState)); + appScanCodeCheck.setSelected(scanCodeState.getState()); } @Override public void update(Widget widget) { MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) widget).getMobileScanCodeAttr(); - mobileScanCodeAttr.setScanCodeState(boolean2ScanCodeState(appScanCodeCheck.isSelected())); + mobileScanCodeAttr.setScanCodeState(ScanCodeState.parse(appScanCodeCheck.isSelected())); } - private ScanCodeState boolean2ScanCodeState(boolean scanCodeCheck) { - if (scanCodeCheck) { - return ScanCodeState.SUPPORT_SCAN_CODE; - } else { - return ScanCodeState.NOT_SUPPORT_SCAN_CODE; - } - } - private boolean scanCodeState2boolean(ScanCodeState scanCodeState) { - return scanCodeState == ScanCodeState.SUPPORT_SCAN_CODE; - } }