From b558e64cb7c819c99c6c867abaa7729bedf1fab2 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 18 Aug 2017 12:03:03 +0800 Subject: [PATCH 1/4] =?UTF-8?q?REPORT-3813=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E5=8D=95=E5=85=83=E6=A0=BC=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E5=86=85=E5=AE=B9=E6=8F=90=E7=A4=BA=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/widget/CellWidgetCardPane.java | 26 ++++++++-- .../ui/BasicWidgetPropertySettingPane.java | 1 - .../fr/design/widget/ui/ButtonDefinePane.java | 2 - .../design/widget/ui/CheckBoxDefinePane.java | 6 +-- .../widget/ui/FieldEditorDefinePane.java | 12 ++--- .../widget/ui/IframeEditorDefinePane.java | 6 +-- .../design/widget/ui/WaterMarkDictPane.java | 8 ++-- .../fr/design/extra/PluginOperateUtils.java | 2 +- .../src/com/fr/design/extra/PluginUtils.java | 8 ++-- .../com/fr/design/extra/WebViewDlgHelper.java | 19 +------- .../gui/itextfield/UIPropertyTextField.java | 47 +++++++++++++++++++ .../fr/design/gui/itextfield/UITextField.java | 14 ++++-- .../design/mainframe/WidgetPropertyPane.java | 4 +- .../widget/ui/FormWidgetCardPane.java | 28 +++++++++-- .../widget/ui/designer/ButtonDefinePane.java | 10 ++-- .../ui/designer/CheckBoxDefinePane.java | 6 +-- .../ui/designer/ComboBoxDefinePane.java | 6 +-- .../ui/designer/ComboCheckBoxDefinePane.java | 7 ++- .../CustomWritableRepeatEditorPane.java | 1 - .../ui/designer/FieldEditorDefinePane.java | 34 +++++++++++--- .../ui/designer/IframeEditorDefinePane.java | 6 +-- .../designer/TextFieldEditorDefinePane.java | 6 +-- .../TreeComboBoxEditorDefinePane.java | 6 +-- .../widget/ui/designer/WaterMarkDictPane.java | 6 +-- .../designer/btn/ButtonGroupDefinePane.java | 2 +- .../designer/component/PaddingBoundPane.java | 1 - 26 files changed, 179 insertions(+), 95 deletions(-) create mode 100644 designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java diff --git a/designer/src/com/fr/design/widget/CellWidgetCardPane.java b/designer/src/com/fr/design/widget/CellWidgetCardPane.java index b6c4c5318..bfae04186 100644 --- a/designer/src/com/fr/design/widget/CellWidgetCardPane.java +++ b/designer/src/com/fr/design/widget/CellWidgetCardPane.java @@ -2,6 +2,7 @@ package com.fr.design.widget; import com.fr.design.data.DataCreatorUI; import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.BasicScrollPane; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.layout.FRGUIPaneFactory; @@ -48,10 +49,30 @@ public class CellWidgetCardPane extends BasicPane { this.removeAll(); this.setLayout(FRGUIPaneFactory.createBorderLayout()); + final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + + BasicScrollPane basicScrollPane = new BasicScrollPane() { + @Override + protected JPanel createContentPane() { + return jPanel; + } + + @Override + public void populateBean(Object ob) { + + } + + @Override + protected String title4PopupWindow() { + return null; + } + }; + this.add(basicScrollPane, BorderLayout.CENTER); + //k tabbedPane = new CardLayout(); center = new JPanel(tabbedPane); - this.add(center, BorderLayout.CENTER); + jPanel.add(center, BorderLayout.CENTER); attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); @@ -70,7 +91,7 @@ public class CellWidgetCardPane extends BasicPane { } }; tabsHeaderIconPane.setNeedLeftRightOutLine(false); - this.add(tabsHeaderIconPane, BorderLayout.NORTH); + jPanel.add(tabsHeaderIconPane, BorderLayout.NORTH); widgetPropertyPane = new BasicWidgetPropertySettingPane(); @@ -82,7 +103,6 @@ public class CellWidgetCardPane extends BasicPane { attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); attriTabPane.add(attriCardPane, BorderLayout.CENTER); attriCardLayout = (CardLayout) attriCardPane.getLayout(); - this.setPreferredSize(new Dimension(600, 450)); } private void initPaneList() { diff --git a/designer/src/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java b/designer/src/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java index 5e95a9d09..16876b6f0 100644 --- a/designer/src/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java +++ b/designer/src/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java @@ -3,7 +3,6 @@ package com.fr.design.widget.ui; import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.dialog.BasicPane; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; diff --git a/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java b/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java index fcb3f2dcc..3d2a703dd 100644 --- a/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java @@ -5,8 +5,6 @@ import com.fr.design.widget.ui.btn.ButtonDetailPaneFactory; import com.fr.form.ui.Button; import com.fr.form.ui.FreeButton; import com.fr.design.widget.btn.ButtonDetailPane; - -import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.*; diff --git a/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java b/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java index 98a1539ad..bde3332b4 100644 --- a/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java @@ -3,7 +3,7 @@ package com.fr.design.widget.ui; import com.fr.design.constants.LayoutConstants; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -14,7 +14,7 @@ import javax.swing.*; import java.awt.*; public class CheckBoxDefinePane extends AbstractDataModify { - private UITextField text; + private UIPropertyTextField text; public CheckBoxDefinePane() { this.iniComoponents(); @@ -22,7 +22,7 @@ public class CheckBoxDefinePane extends AbstractDataModify { private void iniComoponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - text = new UITextField(8); + text = new UIPropertyTextField(); JPanel panel = new JPanel(new BorderLayout()); panel.add(text, BorderLayout.CENTER); panel.setBorder(BorderFactory.createEmptyBorder(0, 35, 0, 0)); diff --git a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java index 6a646996f..ceb3d6476 100644 --- a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java @@ -5,7 +5,7 @@ import com.fr.design.constants.LayoutConstants; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -24,7 +24,7 @@ public abstract class FieldEditorDefinePane extends Abstr private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30; protected UICheckBox allowBlankCheckBox; // richer:错误信息,是所有控件共有的属性,所以放到这里来 - protected UITextField errorMsgTextField; + protected UIPropertyTextField errorMsgTextField; protected JPanel validatePane; public FieldEditorDefinePane() { @@ -33,7 +33,6 @@ public abstract class FieldEditorDefinePane extends Abstr protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - initErrorMsgPane(); JPanel contentPane = this.setFirstContentPane(); if (contentPane != null) { UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 24, contentPane); @@ -45,9 +44,8 @@ public abstract class FieldEditorDefinePane extends Abstr protected void initErrorMsgPane() { // 错误信息 - errorMsgTextField = new UITextField(10); - - // richer:主要为了方便查看比较长的错误信息 + errorMsgTextField = new UIPropertyTextField(); +// // richer:主要为了方便查看比较长的错误信息 errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { public void changedUpdate(DocumentEvent e) { @@ -98,7 +96,7 @@ public abstract class FieldEditorDefinePane extends Abstr protected void addValidatePane() { validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); final UILabel uiLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Error", "FR-Designer_Tooltips"})); - errorMsgTextField = new UITextField(10); + initErrorMsgPane(); allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null")); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT)); diff --git a/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java index 7416f314f..218743c49 100644 --- a/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java @@ -9,7 +9,7 @@ import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -28,7 +28,7 @@ public class IframeEditorDefinePane extends AbstractDataModify { private static final int P_W = 610; private static final int P_H = 580; - private UITextField srcTextField; + private UIPropertyTextField srcTextField; private ReportletParameterViewPane parameterViewPane; private UICheckBox horizontalCheck; private UICheckBox verticalCheck; @@ -61,7 +61,7 @@ public class IframeEditorDefinePane extends AbstractDataModify { java.awt.Component[][] coms = { {horizontalCheck, null}, {verticalCheck, null}, - {new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UITextField()}, + {new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UIPropertyTextField()}, {new UILabel(Inter.getLocText("FR-Designer_Parameters")), parameterViewPaneButton}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, 45, LayoutConstants.VGAP_LARGE); diff --git a/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java b/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java index ad9c21216..1f3812997 100644 --- a/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java +++ b/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java @@ -1,7 +1,7 @@ package com.fr.design.widget.ui; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.WaterMark; @@ -13,14 +13,12 @@ import java.awt.event.KeyListener; public class WaterMarkDictPane extends JPanel { - private UITextField waterMarkTextField; + private UIPropertyTextField waterMarkTextField; public WaterMarkDictPane() { this.setLayout(new BorderLayout()); -// this.setBorder(BorderFactory.createEmptyBorder(2,2,2,2)); -// this.add(new UILabel(Inter.getLocText("WaterMark") + ":")); - waterMarkTextField = new UITextField(13); + waterMarkTextField = new UIPropertyTextField(); UILabel emptyLabel = new UILabel(); emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); diff --git a/designer_base/src/com/fr/design/extra/PluginOperateUtils.java b/designer_base/src/com/fr/design/extra/PluginOperateUtils.java index 8ab6b3bbe..257c3ef34 100644 --- a/designer_base/src/com/fr/design/extra/PluginOperateUtils.java +++ b/designer_base/src/com/fr/design/extra/PluginOperateUtils.java @@ -292,7 +292,7 @@ public class PluginOperateUtils { pluginInfo.append(PluginUtils.getMessageByErrorCode(pluginTaskResult.errorCode())); continue; } - PluginMarker pluginMarker = pluginTask.getMarker(); + PluginMarker pluginMarker = pluginTask.getToMarker(); PluginContext pluginContext = PluginManager.getContext(pluginMarker); if (pluginContext != null) { pluginInfo.append(pluginContext.getName()).append(PluginUtils.getMessageByErrorCode(pluginTaskResult.errorCode())); diff --git a/designer_base/src/com/fr/design/extra/PluginUtils.java b/designer_base/src/com/fr/design/extra/PluginUtils.java index 049ab28f9..186b466dd 100644 --- a/designer_base/src/com/fr/design/extra/PluginUtils.java +++ b/designer_base/src/com/fr/design/extra/PluginUtils.java @@ -78,8 +78,8 @@ public class PluginUtils { return jsonArray.toString(); } - public static void downloadShopScripts(String id, String username, String password, Process p) throws Exception { - HttpClient httpClient = new HttpClient(getDownloadPath(id, username, password)); + public static void downloadShopScripts(String id, Process p) throws Exception { + HttpClient httpClient = new HttpClient(getDownloadPath(id)); if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { int totalSize = httpClient.getContentLength(); InputStream reader = httpClient.getResponseStream(); @@ -104,11 +104,9 @@ public class PluginUtils { } } - private static String getDownloadPath(String id, String username, String password) throws Exception { + private static String getDownloadPath(String id) throws Exception { HashMap map = new HashMap(); map.put("id", id); - map.put("username", username); - map.put("password", password); HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.scripts")); httpClient.asGet(); String resText = httpClient.getResponseText(); diff --git a/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java b/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java index 84ecb10c3..8f5821d8f 100644 --- a/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java @@ -1,7 +1,6 @@ package com.fr.design.extra; import com.fr.base.FRContext; -import com.fr.design.DesignerEnvManager; import com.fr.design.RestartHelper; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.UIDialog; @@ -171,10 +170,8 @@ public class WebViewDlgHelper { new SwingWorker() { @Override protected Boolean doInBackground() throws Exception { - String username = DesignerEnvManager.getEnvManager().getBBSName(); - String password = DesignerEnvManager.getEnvManager().getBBSPassword(); try { - PluginUtils.downloadShopScripts(scriptsId, username, password, new Process() { + PluginUtils.downloadShopScripts(scriptsId, new Process() { @Override public void process(Double integer) { } @@ -198,19 +195,7 @@ public class WebViewDlgHelper { IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome); copyMainFile(StableUtils.pathJoin(installHome, "index.html"), StableUtils.pathJoin(installHome, relativePath)); // TODO: 2017/4/17 删除之前存放在安装目录下的script - int rv = JOptionPane.showOptionDialog( - null, - Inter.getLocText("FR-Designer-Plugin_Shop_Installed"), - Inter.getLocText("FR-Designer-Plugin_Warning"), - JOptionPane.YES_NO_OPTION, - JOptionPane.INFORMATION_MESSAGE, - null, - new String[]{Inter.getLocText("FR-Designer-Basic_Restart_Designer"), Inter.getLocText("FR-Designer-Basic_Restart_Designer_Later")}, - null - ); - if (rv == JOptionPane.OK_OPTION) { - RestartHelper.restart(); - } + JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Shop_Installed"), Inter.getLocText("FR-Designer_Tooltips"), JOptionPane.INFORMATION_MESSAGE); } } catch (InterruptedException | ExecutionException e) { FRContext.getLogger().error(e.getMessage(), e); diff --git a/designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java b/designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java new file mode 100644 index 000000000..8a949d4a1 --- /dev/null +++ b/designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java @@ -0,0 +1,47 @@ +package com.fr.design.gui.itextfield; + +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import javax.swing.text.Document; + + +/** + * Created by ibm on 2017/8/16. + */ +public class UIPropertyTextField extends UITextField{ + + public UIPropertyTextField() { + super(); + } + + public UIPropertyTextField(int columns) { + super(columns); + } + + public UIPropertyTextField(String text, int columns) { + super(text, columns); + } + + public UIPropertyTextField(String text) { + super(text); + } + + public UIPropertyTextField(Document doc, String text, int columns) { + super(doc, text, columns); + } + + protected void initListener() { + if (shouldResponseChangeListener()) { + addFocusListener(new FocusListener() { + @Override + public void focusGained(FocusEvent e) { + } + + @Override + public void focusLost(FocusEvent e) { + attributeChange(); + } + }); + } + } +} diff --git a/designer_base/src/com/fr/design/gui/itextfield/UITextField.java b/designer_base/src/com/fr/design/gui/itextfield/UITextField.java index 71e6366ba..7df91335c 100644 --- a/designer_base/src/com/fr/design/gui/itextfield/UITextField.java +++ b/designer_base/src/com/fr/design/gui/itextfield/UITextField.java @@ -13,8 +13,6 @@ import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.text.Document; import java.awt.*; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; /** * @author Jerry @@ -61,13 +59,19 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs protected void initListener() { if (shouldResponseChangeListener()) { - addFocusListener(new FocusListener() { + getDocument().addDocumentListener(new DocumentListener() { @Override - public void focusGained(FocusEvent e) { + public void insertUpdate(DocumentEvent e) { + attributeChange(); + } + + @Override + public void removeUpdate(DocumentEvent e) { + attributeChange(); } @Override - public void focusLost(FocusEvent e) { + public void changedUpdate(DocumentEvent e) { attributeChange(); } }); diff --git a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java index 8d577d3fe..d24e79c5a 100644 --- a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java @@ -326,9 +326,11 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope public void fireCreatorModified(DesignerEvent evt) { if (evt.getCreatorEventID() == DesignerEvent.CREATOR_EDITED || evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED - || evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED || evt.getCreatorEventID() == DesignerEvent.CREATOR_RESIZED) { formWidgetCardPane.populate(); + }else if(evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED){ + formWidgetCardPane = new FormWidgetCardPane(designer); + formWidgetCardPane.populate(); } } diff --git a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java b/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java index 37593b88d..425d9e533 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java +++ b/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.widget.ui; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.creator.*; +import com.fr.design.dialog.BasicScrollPane; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AttributeChangeListener; @@ -46,7 +47,6 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { if (widgetBoundPane != null) { attriCardPane.add(widgetBoundPane, BorderLayout.CENTER); } - } public XLayoutContainer getParent(XCreator source) { @@ -102,9 +102,27 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { } private void initComponents() { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + BasicScrollPane basicScrollPane = new BasicScrollPane() { + @Override + protected JPanel createContentPane() { + return jPanel; + } + + @Override + public void populateBean(Object ob) { + + } + + @Override + protected String title4PopupWindow() { + return null; + } + }; + this.add(basicScrollPane, BorderLayout.CENTER); + if (xCreator.supportSetVisibleOrEnable()) { widgetPropertyPane = new FormBasicWidgetPropertyPane(); } else { @@ -113,11 +131,11 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { UIExpandablePane uiExpandablePane = new UIExpandablePane("基本", 280, 20, widgetPropertyPane); - this.add(uiExpandablePane, BorderLayout.NORTH); + jPanel.add(uiExpandablePane, BorderLayout.NORTH); attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - this.add(attriCardPane, BorderLayout.CENTER); + jPanel.add(attriCardPane, BorderLayout.CENTER); this.listener2 = new AttributeChangeListener() { @Override diff --git a/designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java index 4ecf07da5..588828255 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java @@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer; import com.fr.design.designer.creator.XCreator; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -17,8 +17,8 @@ import javax.swing.*; import java.awt.*; public abstract class ButtonDefinePane extends AbstractDataModify { - private UITextField hotkeysTextField; - private UITextField buttonNameTextField; + private UIPropertyTextField hotkeysTextField; + private UIPropertyTextField buttonNameTextField; private AccessibleIconEditor iconPane; @@ -35,8 +35,8 @@ public abstract class ButtonDefinePane extends AbstractDataMod double columnSize[] = {p, f}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; iconPane = new AccessibleIconEditor(); - hotkeysTextField = new UITextField(); - buttonNameTextField = new UITextField(); + hotkeysTextField = new UIPropertyTextField(); + buttonNameTextField = new UIPropertyTextField(); Component[] backgroundCompPane = createBackgroundComp(); Component[] frFont = createFontPane(); UILabel backgroundLabel = new UILabel(Inter.getLocText("FR-Designer_Background")); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java index 6f60be68a..18f0e0ced 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java @@ -4,7 +4,7 @@ import com.fr.design.designer.creator.XCreator; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -16,7 +16,7 @@ import javax.swing.*; import java.awt.*; public class CheckBoxDefinePane extends AbstractDataModify { - private UITextField text; + private UIPropertyTextField text; private UISpinner fontSizePane; private FormWidgetValuePane formWidgetValuePane; @@ -27,7 +27,7 @@ public class CheckBoxDefinePane extends AbstractDataModify { private void iniComoponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - text = new UITextField(); + text = new UIPropertyTextField(); fontSizePane = new UISpinner(0, 20, 1, 0); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); double f = TableLayout.FILL; diff --git a/designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java index 829736a65..08f73236a 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java @@ -4,7 +4,7 @@ import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.form.ui.ComboBox; import com.fr.general.Inter; @@ -13,7 +13,7 @@ import java.awt.*; public class ComboBoxDefinePane extends DictEditorDefinePane { private UICheckBox removeRepeatCheckBox; - private UITextField waterMarkField; + private UIPropertyTextField waterMarkField; public ComboBoxDefinePane(XCreator xCreator) { super(xCreator); @@ -26,7 +26,7 @@ public class ComboBoxDefinePane extends DictEditorDefinePane { } public Component[] createWaterMarkPane() { - waterMarkField = new UITextField(); + waterMarkField = new UIPropertyTextField(); return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkField}; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java index baa732557..7a3ed0f22 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java @@ -3,10 +3,9 @@ package com.fr.design.widget.ui.designer; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.ComboCheckBox; @@ -18,7 +17,7 @@ import java.awt.*; public class ComboCheckBoxDefinePane extends DictEditorDefinePane { private UICheckBox supportTagCheckBox; private UIButtonGroup returnType; - private UITextField waterMarkDictPane; + private UIPropertyTextField waterMarkDictPane; private UICheckBox removeRepeatCheckBox; public ComboCheckBoxDefinePane(XCreator xCreator) { @@ -32,7 +31,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane } public Component[] createWaterMarkPane() { - waterMarkDictPane = new UITextField(); + waterMarkDictPane = new UIPropertyTextField(); return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java b/designer_form/src/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java index 9328bc1b6..96b4cc46a 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java @@ -3,7 +3,6 @@ package com.fr.design.widget.ui.designer; import com.fr.base.GraphHelper; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; diff --git a/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java index 2bf1df46e..ffc45d266 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java @@ -1,12 +1,11 @@ package com.fr.design.widget.ui.designer; -import com.fr.base.GraphHelper; import com.fr.design.designer.creator.*; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -14,16 +13,16 @@ import com.fr.form.ui.FieldEditor; import com.fr.general.Inter; import javax.swing.*; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; public abstract class FieldEditorDefinePane extends AbstractDataModify { - private static final int ALLOW_BLANK_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("FR-Designer_Allow_Null") + 30; - private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30; protected UICheckBox allowBlankCheckBox; // richer:错误信息,是所有控件共有的属性,所以放到这里来 - protected UITextField errorMsgTextField; + protected UIPropertyTextField errorMsgTextField; protected JPanel validatePane; protected UISpinner fontSizePane; @@ -40,9 +39,8 @@ public abstract class FieldEditorDefinePane extends Abstr this.setLayout(FRGUIPaneFactory.createBorderLayout()); allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null")); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); -// allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT)); fontSizePane = new UISpinner(0, 20, 1, 0); - errorMsgTextField = new UITextField(); + errorMsgTextField = new UIPropertyTextField(); JPanel contentPane = this.setFirstContentPane(); if (contentPane != null) { UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane); @@ -71,6 +69,27 @@ public abstract class FieldEditorDefinePane extends Abstr return e; } + protected void initErrorMsgPane() { + // 错误信息 + errorMsgTextField = new UIPropertyTextField(); +// // richer:主要为了方便查看比较长的错误信息 + errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { + + public void changedUpdate(DocumentEvent e) { + errorMsgTextField.setToolTipText(errorMsgTextField.getText()); + } + + public void insertUpdate(DocumentEvent e) { + errorMsgTextField.setToolTipText(errorMsgTextField.getText()); + } + + public void removeUpdate(DocumentEvent e) { + errorMsgTextField.setToolTipText(errorMsgTextField.getText()); + } + }); + + } + protected abstract T updateSubFieldEditorBean(); @@ -83,6 +102,7 @@ public abstract class FieldEditorDefinePane extends Abstr } protected void addValidatePane() { + initErrorMsgPane(); validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); final UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java index fb7399ef8..cbda1a2e3 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java @@ -5,7 +5,7 @@ import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -18,7 +18,7 @@ import java.awt.*; import java.util.List; public class IframeEditorDefinePane extends AbstractDataModify { - private UITextField srcTextField; + private UIPropertyTextField srcTextField; private ReportletParameterViewPane parameterViewPane; private UICheckBox horizontalCheck; private UICheckBox verticalCheck; @@ -44,7 +44,7 @@ public class IframeEditorDefinePane extends AbstractDataModify { Component[][] coms = { { horizontalCheck, null }, { verticalCheck, null }, - { new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() }, + { new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UIPropertyTextField() }, { new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } }; int[][] rowCount = {{1, 1},{1, 1},{1, 1}, {1, 1}}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java index 395ded7d1..46f62dac1 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java @@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -18,7 +18,7 @@ import java.awt.event.KeyEvent; public class TextFieldEditorDefinePane extends FieldEditorDefinePane { protected RegPane regPane; - private UITextField waterMarkDictPane; + private UIPropertyTextField waterMarkDictPane; FormWidgetValuePane formWidgetValuePane; public TextFieldEditorDefinePane(XCreator xCreator) { @@ -47,7 +47,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane } }; regPane.addPhoneRegListener(pl); - waterMarkDictPane = new UITextField(13); + waterMarkDictPane = new UIPropertyTextField(); waterMarkDictPane.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { regPane.removePhoneRegListener(pl); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java index baabdac70..68cac1037 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java @@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.form.ui.TreeEditor; import com.fr.general.Inter; @@ -11,14 +11,14 @@ import java.awt.*; public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane { - protected UITextField waterMarkDictPane; + protected UIPropertyTextField waterMarkDictPane; public TreeComboBoxEditorDefinePane(XCreator xCreator) { super(xCreator); } public Component[] createWaterMarkPane(){ - waterMarkDictPane = new UITextField(); + waterMarkDictPane = new UIPropertyTextField(); return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java b/designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java index c0ec063af..75d6d7d17 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java @@ -1,6 +1,6 @@ package com.fr.design.widget.ui.designer; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.form.ui.WaterMark; @@ -8,12 +8,12 @@ import javax.swing.*; public class WaterMarkDictPane extends JPanel{ - private UITextField waterMarkTextField; + private UIPropertyTextField waterMarkTextField; public WaterMarkDictPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); - waterMarkTextField = new UITextField(); + waterMarkTextField = new UIPropertyTextField(); this.add(waterMarkTextField); } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java index 99cc2b143..e0df39eb1 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java @@ -39,7 +39,7 @@ public abstract class ButtonGroupDefinePane extends Field double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, - new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), new UITextField()}, + new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictionaryEditor}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_FRFont")), fontSizePane}, new Component[]{buttonGroupDictPane, null} }; diff --git a/designer_form/src/com/fr/design/widget/ui/designer/component/PaddingBoundPane.java b/designer_form/src/com/fr/design/widget/ui/designer/component/PaddingBoundPane.java index d7721e0b4..32d840f72 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/component/PaddingBoundPane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/component/PaddingBoundPane.java @@ -3,7 +3,6 @@ package com.fr.design.widget.ui.designer.component; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; -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; From fa21593fcc68723a6d941f4e901ba3d1b46242ee Mon Sep 17 00:00:00 2001 From: MoMeak Date: Fri, 18 Aug 2017 14:50:38 +0800 Subject: [PATCH 2/4] =?UTF-8?q?REPORT-3895=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E6=B8=90=E5=8F=98=E8=89=B2=E5=B7=A6?= =?UTF-8?q?=E8=BE=B9=E7=AE=AD=E5=A4=B4=E4=B8=8D=E6=98=93=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=EF=BC=8C=E5=8F=B3=E8=BE=B9=E7=AE=AD=E5=A4=B4=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=A6=82=E9=99=84=E4=BB=B6=E5=9B=BE=E7=89=87=20REPORT?= =?UTF-8?q?-3896=20[9.0=E4=B8=80=E8=BD=AE=E5=9B=9E=E5=BD=92]=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E5=8D=95=E5=85=83=E6=A0=BC=E8=83=8C=E6=99=AF=E5=9B=BE?= =?UTF-8?q?=E6=A1=88=E7=9A=84=E5=89=8D=E6=99=AF=E5=92=8C=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E6=8C=89=E9=92=AE=E5=8F=AA=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=80=E5=8D=8A=E5=A6=82=E9=99=84=E4=BB=B6=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cell/settingpane/CellOtherSetPane.java | 2 - .../GradientBackgroundQuickPane.java | 4 +- .../ImageBackgroundQuickPane.java | 7 +- .../PatternBackgroundQuickPane.java | 372 +++++++++--------- .../TextureBackgroundQuickPane.java | 1 - 5 files changed, 196 insertions(+), 190 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index 411ef87a9..751acbf46 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -248,8 +248,6 @@ public class CellOtherSetPane extends AbstractCellAttrPane { } } }); - tooltipTextField = new UITextField(); - tooltipTextField.getUI(); return fileNamePane; } diff --git a/designer_base/src/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java b/designer_base/src/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java index 08ef9e61c..97ba9cbe7 100644 --- a/designer_base/src/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java +++ b/designer_base/src/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java @@ -22,7 +22,7 @@ import java.awt.*; public class GradientBackgroundQuickPane extends BackgroundQuickPane { private static final long serialVersionUID = -6854603990673031897L; - private static final int DEFAULT_GRADIENT_WIDTH = 185; + private static final int DEFAULT_GRADIENT_WIDTH = 150 ; private int gradientBarWidth = DEFAULT_GRADIENT_WIDTH; @@ -52,7 +52,7 @@ public class GradientBackgroundQuickPane extends BackgroundQuickPane { Component[][] components = new Component[][]{ new Component[]{gradientBar, null}, - new Component[]{new UILabel(Inter.getLocText("Gradient-Direction") + ":"), directionPane} + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Gradient_Direction")), directionPane} }; JPanel Gradient = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); this.setLayout(new BorderLayout()); diff --git a/designer_base/src/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java b/designer_base/src/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java index 114b704c0..4dafe476a 100644 --- a/designer_base/src/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java +++ b/designer_base/src/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java @@ -61,17 +61,14 @@ public class ImageBackgroundQuickPane extends BackgroundQuickPane { contentPane.add(southPane, BorderLayout.NORTH); this.add(contentPane, BorderLayout.CENTER); - JPanel selectFilePane = new JPanel(new GridLayout(0, 2)); UIButton selectPictureButton = new UIButton(Inter.getLocText("Image-Select_Picture")); - selectFilePane.add(new JPanel()); - selectFilePane.add(selectPictureButton); selectPictureButton.addActionListener(selectPictureActionListener); if(hasImageLayout){ - southPane.add(imageLayoutPane, BorderLayout.CENTER); + southPane.add(imageLayoutPane, BorderLayout.SOUTH); } - southPane.add(selectFilePane, BorderLayout.SOUTH); + southPane.add(selectPictureButton, BorderLayout.CENTER); imageLayoutPane.addChangeListener(new ChangeListener() { diff --git a/designer_base/src/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java b/designer_base/src/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java index 16b294955..86a96a2cb 100644 --- a/designer_base/src/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java +++ b/designer_base/src/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java @@ -2,14 +2,17 @@ package com.fr.design.mainframe.backgroundpane; import com.fr.base.GraphHelper; import com.fr.base.background.PatternBackground; -import com.fr.design.constants.UIConstants; import com.fr.design.border.UIRoundedBorder; +import com.fr.design.constants.LayoutConstants; +import com.fr.design.constants.UIConstants; import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.style.color.ColorSelectBox; import com.fr.general.Background; import com.fr.general.Inter; -import com.fr.design.style.color.ColorSelectBox; import javax.swing.*; import javax.swing.event.ChangeEvent; @@ -25,182 +28,191 @@ import java.awt.geom.Rectangle2D; */ public class PatternBackgroundQuickPane extends BackgroundQuickPane { - private int patternIndex = 0; // pattern setIndex. - private final static int DEFAULT_DIM_HEIGHT = 190; - private ColorSelectBox foregroundColorPane; - private ColorSelectBox backgroundColorPane; - private PatternButton[] patternButtonArray; - - public PatternBackgroundQuickPane() { - this.setLayout(new BorderLayout(0, 4)); - JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); - this.add(contentPane, BorderLayout.NORTH); - contentPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5)); - JPanel typePane2 = new JPanel(); - contentPane.add(typePane2); - typePane2.setLayout(new GridLayout(0, 8, 1, 1)); - typePane2.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); - ButtonGroup patternButtonGroup = new ButtonGroup(); - patternButtonArray = new PatternButton[PatternBackground.PATTERN_COUNT]; - for (int i = 0; i < PatternBackground.PATTERN_COUNT; i++) { - patternButtonArray[i] = new PatternButton(i); - patternButtonGroup.add(patternButtonArray[i]); - typePane2.add(patternButtonArray[i]); - } - JPanel colorPane = new JPanel(new GridLayout(0, 2)); - foregroundColorPane = new ColorSelectBox(70); - backgroundColorPane = new ColorSelectBox(70); - colorPane.add(this.createLabelColorPane(Inter.getLocText("FR-Designer_Foreground") + ":", foregroundColorPane)); - colorPane.add(this.createLabelColorPane(Inter.getLocText("FR-Designer_Background") + ":", backgroundColorPane)); - this.add(colorPane, BorderLayout.CENTER); - foregroundColorPane.addSelectChangeListener(colorChangeListener); - backgroundColorPane.addSelectChangeListener(colorChangeListener); - } - - @Override - public Dimension getPreferredSize() { - Dimension dim = super.getPreferredSize(); - dim.height = DEFAULT_DIM_HEIGHT; - return dim; - } - - private JPanel createLabelColorPane(String text, JComponent colorPane) { - JPanel labelColorPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); - labelColorPane.add(new UILabel(text)); - labelColorPane.add(colorPane); - - return labelColorPane; - } - - public void populateBean(Background background) { - PatternBackground patternBackground = (PatternBackground) background; - int patternIndex = patternBackground.getPatternIndex(); - - if (patternIndex >= 0 && patternIndex < this.patternButtonArray.length) { - this.patternButtonArray[patternIndex].setSelected(true); - this.patternIndex = patternIndex; - } else { - this.patternIndex = 0; - } - - foregroundColorPane.setSelectObject(patternBackground.getForeground()); - backgroundColorPane.setSelectObject(patternBackground.getBackground()); - } - - public Background updateBean() { - return new PatternBackground(patternIndex, foregroundColorPane.getSelectObject(), backgroundColorPane.getSelectObject()); - } - - - /** - * 给组件登记一个观察者监听事件 - * - * @param listener 观察者监听事件 - */ - public void registerChangeListener(final UIObserverListener listener) { - foregroundColorPane.addSelectChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - listener.doChange(); - } - }); - backgroundColorPane.addSelectChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - listener.doChange(); - } - }); - for (int i = 0, count = patternButtonArray.length; i < count; i ++) { - patternButtonArray[i].addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - listener.doChange(); - } - }); - } - } - - - // Foreground or Background changed. - ChangeListener colorChangeListener = new ChangeListener() { - - public void stateChanged(ChangeEvent e) { - for (int i = 0; i < patternButtonArray.length; i++) { - patternButtonArray[i].setPatternForeground(foregroundColorPane.getSelectObject()); - patternButtonArray[i].setPatternBackground(backgroundColorPane.getSelectObject()); - } - - PatternBackgroundQuickPane.this.repaint();// repaint - } - }; - - /** - * Pattern type button. - */ - class PatternButton extends JToggleButton implements ActionListener { - - public PatternButton(int pIndex) { - this.pIndex = pIndex; - this.addActionListener(this); - - this.setCursor(new Cursor(Cursor.HAND_CURSOR)); - this.setBorder(null); - this.patternBackground = new PatternBackground(this.pIndex, Color.lightGray, Color.black); - } - - public void paintComponent(Graphics g) { - Graphics2D g2d = (Graphics2D) g; - - Dimension d = getSize(); - this.patternBackground.paint(g2d, new Rectangle2D.Double(0, 0, d.width - 1, d.height - 1)); - - if (this.pIndex == patternIndex) {// it's selected. - g2d.setPaint(UIConstants.LINE_COLOR); - GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1, d.height - 1)); - } - } - - public Dimension getPreferredSize() { - return new Dimension(super.getPreferredSize().width, 20); - } - - public void setPatternForeground(Color foreground) { - this.patternBackground.setForeground(foreground); - } - - public void setPatternBackground(Color background) { - this.patternBackground.setBackground(background); - } - - /** - * set Pattern setIndex. - */ - public void actionPerformed(ActionEvent evt) { - PatternBackgroundQuickPane.this.patternIndex = pIndex; - - fireChagneListener(); - PatternBackgroundQuickPane.this.repaint();// repaint - } - - public void addChangeListener(ChangeListener changeListener) { - this.changeListener = changeListener; - } - - private void fireChagneListener() { - if (this.changeListener != null) { - ChangeEvent evt = new ChangeEvent(this); - this.changeListener.stateChanged(evt); - } - } - - private int pIndex = 0; - private PatternBackground patternBackground; - } - - @Override - public boolean accept(Background background) { - return background instanceof PatternBackground; - } - - @Override - public String title4PopupWindow() { - return Inter.getLocText("FR-Designer_Background-Pattern"); - } + private int patternIndex = 0; // pattern setIndex. + private final static int DEFAULT_DIM_HEIGHT = 210; + private ColorSelectBox foregroundColorPane; + private ColorSelectBox backgroundColorPane; + private PatternButton[] patternButtonArray; + + public PatternBackgroundQuickPane() { + this.setLayout(new BorderLayout(0, 4)); + JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); + this.add(contentPane, BorderLayout.NORTH); + contentPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5)); + JPanel typePane2 = new JPanel(); + contentPane.add(typePane2); + typePane2.setLayout(new GridLayout(0, 8, 1, 1)); + typePane2.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); + ButtonGroup patternButtonGroup = new ButtonGroup(); + patternButtonArray = new PatternButton[PatternBackground.PATTERN_COUNT]; + for (int i = 0; i < PatternBackground.PATTERN_COUNT; i++) { + patternButtonArray[i] = new PatternButton(i); + patternButtonGroup.add(patternButtonArray[i]); + typePane2.add(patternButtonArray[i]); + } + foregroundColorPane = new ColorSelectBox(60); + backgroundColorPane = new ColorSelectBox(60); + + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + Component[][] components = new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Foreground"), UILabel.LEFT), foregroundColorPane}, + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background"), UILabel.LEFT), backgroundColorPane}, + }; + double[] rowSize = {p, p, p}; + double[] columnSize = {p, f}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; + JPanel colorPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE); + this.add(colorPane, BorderLayout.CENTER); + foregroundColorPane.addSelectChangeListener(colorChangeListener); + backgroundColorPane.addSelectChangeListener(colorChangeListener); + } + + @Override + public Dimension getPreferredSize() { + Dimension dim = super.getPreferredSize(); + dim.height = DEFAULT_DIM_HEIGHT; + return dim; + } + + private JPanel createLabelColorPane(String text, JComponent colorPane) { + JPanel labelColorPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); + labelColorPane.add(new UILabel(text)); + labelColorPane.add(colorPane); + + return labelColorPane; + } + + public void populateBean(Background background) { + PatternBackground patternBackground = (PatternBackground) background; + int patternIndex = patternBackground.getPatternIndex(); + + if (patternIndex >= 0 && patternIndex < this.patternButtonArray.length) { + this.patternButtonArray[patternIndex].setSelected(true); + this.patternIndex = patternIndex; + } else { + this.patternIndex = 0; + } + + foregroundColorPane.setSelectObject(patternBackground.getForeground()); + backgroundColorPane.setSelectObject(patternBackground.getBackground()); + } + + public Background updateBean() { + return new PatternBackground(patternIndex, foregroundColorPane.getSelectObject(), backgroundColorPane.getSelectObject()); + } + + + /** + * 给组件登记一个观察者监听事件 + * + * @param listener 观察者监听事件 + */ + public void registerChangeListener(final UIObserverListener listener) { + foregroundColorPane.addSelectChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + listener.doChange(); + } + }); + backgroundColorPane.addSelectChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + listener.doChange(); + } + }); + for (int i = 0, count = patternButtonArray.length; i < count; i++) { + patternButtonArray[i].addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + listener.doChange(); + } + }); + } + } + + + // Foreground or Background changed. + ChangeListener colorChangeListener = new ChangeListener() { + + public void stateChanged(ChangeEvent e) { + for (int i = 0; i < patternButtonArray.length; i++) { + patternButtonArray[i].setPatternForeground(foregroundColorPane.getSelectObject()); + patternButtonArray[i].setPatternBackground(backgroundColorPane.getSelectObject()); + } + + PatternBackgroundQuickPane.this.repaint();// repaint + } + }; + + /** + * Pattern type button. + */ + class PatternButton extends JToggleButton implements ActionListener { + + public PatternButton(int pIndex) { + this.pIndex = pIndex; + this.addActionListener(this); + + this.setCursor(new Cursor(Cursor.HAND_CURSOR)); + this.setBorder(null); + this.patternBackground = new PatternBackground(this.pIndex, Color.lightGray, Color.black); + } + + public void paintComponent(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + + Dimension d = getSize(); + this.patternBackground.paint(g2d, new Rectangle2D.Double(0, 0, d.width - 1, d.height - 1)); + + if (this.pIndex == patternIndex) {// it's selected. + g2d.setPaint(UIConstants.LINE_COLOR); + GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1, d.height - 1)); + } + } + + public Dimension getPreferredSize() { + return new Dimension(super.getPreferredSize().width, 20); + } + + public void setPatternForeground(Color foreground) { + this.patternBackground.setForeground(foreground); + } + + public void setPatternBackground(Color background) { + this.patternBackground.setBackground(background); + } + + /** + * set Pattern setIndex. + */ + public void actionPerformed(ActionEvent evt) { + PatternBackgroundQuickPane.this.patternIndex = pIndex; + + fireChagneListener(); + PatternBackgroundQuickPane.this.repaint();// repaint + } + + public void addChangeListener(ChangeListener changeListener) { + this.changeListener = changeListener; + } + + private void fireChagneListener() { + if (this.changeListener != null) { + ChangeEvent evt = new ChangeEvent(this); + this.changeListener.stateChanged(evt); + } + } + + private int pIndex = 0; + private PatternBackground patternBackground; + } + + @Override + public boolean accept(Background background) { + return background instanceof PatternBackground; + } + + @Override + public String title4PopupWindow() { + return Inter.getLocText("FR-Designer_Background-Pattern"); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/mainframe/backgroundpane/TextureBackgroundQuickPane.java b/designer_base/src/com/fr/design/mainframe/backgroundpane/TextureBackgroundQuickPane.java index dcd386343..33e09057b 100644 --- a/designer_base/src/com/fr/design/mainframe/backgroundpane/TextureBackgroundQuickPane.java +++ b/designer_base/src/com/fr/design/mainframe/backgroundpane/TextureBackgroundQuickPane.java @@ -33,7 +33,6 @@ public class TextureBackgroundQuickPane extends BackgroundQuickPane { this.add(borderPane, BorderLayout.NORTH); contentPane.setLayout(new GridLayout(0, 8, 1, 1)); contentPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); - borderPane.setPreferredSize(new Dimension(0, 145)); ButtonGroup patternButtonGroup = new ButtonGroup(); textureButtonArray = new TextureButton[EMBED_TEXTURE_PAINT_ARRAY.length]; for (int i = 0; i < EMBED_TEXTURE_PAINT_ARRAY.length; i++) { From 64f3b4d8c2fa9a706365d95fce1ec60679d25fd0 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Fri, 18 Aug 2017 15:14:02 +0800 Subject: [PATCH 3/4] =?UTF-8?q?rollback,=E8=BF=99=E4=B8=AAbug=E7=9A=84pr?= =?UTF-8?q?=E7=BB=99kerry=E9=82=A3=E8=BE=B9=E4=B8=80=E8=B5=B7=E6=8F=90?= 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, 2 insertions(+) diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index 751acbf46..411ef87a9 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -248,6 +248,8 @@ public class CellOtherSetPane extends AbstractCellAttrPane { } } }); + tooltipTextField = new UITextField(); + tooltipTextField.getUI(); return fileNamePane; } From 038d141b069769b37bcc899bd07dd73ac41a88dd Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 18 Aug 2017 15:18:51 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/cell/settingpane/CellOtherSetPane.java | 12 +++++------- .../mainframe/widget/ui/FormWidgetCardPane.java | 3 ++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index 411ef87a9..e8d82c510 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -10,7 +10,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itextfield.UIPropertyTextField; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.JTemplate; @@ -47,9 +47,9 @@ public class CellOtherSetPane extends AbstractCellAttrPane { private UIComboBox showContent; - private UITextField tooltipTextField; + private UIPropertyTextField tooltipTextField; - private UITextField fileNameTextField; + private UIPropertyTextField fileNameTextField; // 分页 private UICheckBox pageBeforeRowCheckBox; @@ -228,8 +228,8 @@ public class CellOtherSetPane extends AbstractCellAttrPane { final JPanel fileNamePane = new JPanel(fileNameLayout); JPanel fileNameCCPane = new JPanel(new BorderLayout(4, 0)); fileNameCCPane.add(new UILabel(Inter.getLocText("FR-Designer_File_Name_For_Download")), BorderLayout.WEST); - fileNameTextField = new UITextField(); - tooltipTextField = new UITextField(); + fileNameTextField = new UIPropertyTextField(); + tooltipTextField = new UIPropertyTextField(); tooltipTextField.getUI(); fileNamePane.add(new JPanel(), "none"); fileNamePane.add(fileNameCCPane, "content"); @@ -248,8 +248,6 @@ public class CellOtherSetPane extends AbstractCellAttrPane { } } }); - tooltipTextField = new UITextField(); - tooltipTextField.getUI(); return fileNamePane; } diff --git a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java b/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java index 425d9e533..2a8e1de2b 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java +++ b/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java @@ -18,6 +18,7 @@ import com.fr.form.ui.Widget; import com.fr.form.ui.container.WScaleLayout; import com.fr.form.ui.container.WTitleLayout; import com.fr.form.ui.widget.CRBoundsWidget; +import com.fr.general.Inter; import javax.swing.*; import java.awt.*; @@ -129,7 +130,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { widgetPropertyPane = new FormBasicPropertyPane(); } - UIExpandablePane uiExpandablePane = new UIExpandablePane("基本", 280, 20, widgetPropertyPane); + UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 280, 20, widgetPropertyPane); jPanel.add(uiExpandablePane, BorderLayout.NORTH);