From 81db8a7da5c357cabb25f7c1344d470395938272 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Mon, 16 Jan 2017 19:40:39 +0800 Subject: [PATCH 01/16] rt --- .../tabledatapane/DBTableDataPane.java | 53 ++++++------------- .../fr/design/fun/DBTableDataMenuHandler.java | 24 +++++++++ .../impl/AbstractDBTableDataMenuHandler.java | 34 ++++++++++++ 3 files changed, 75 insertions(+), 36 deletions(-) create mode 100644 designer_base/src/com/fr/design/fun/DBTableDataMenuHandler.java create mode 100644 designer_base/src/com/fr/design/fun/impl/AbstractDBTableDataMenuHandler.java diff --git a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java index 553e6814c0..94e6b44b69 100644 --- a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java +++ b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java @@ -7,6 +7,7 @@ import com.fr.base.ParameterHelper; import com.fr.data.core.db.TableProcedure; import com.fr.data.impl.DBTableData; import com.fr.data.impl.NameDatabaseConnection; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; import com.fr.design.border.UIRoundedBorder; import com.fr.design.constants.UIConstants; @@ -17,6 +18,7 @@ import com.fr.design.data.datapane.sqlpane.SQLEditPane; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.fun.DBTableDataMenuHandler; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itableeditorpane.ParameterTableModel; @@ -34,7 +36,6 @@ import com.fr.general.Inter; import com.fr.script.Calculator; import com.fr.stable.ArrayUtils; import com.fr.stable.ParameterProvider; -import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import javax.swing.*; @@ -53,11 +54,11 @@ public class DBTableDataPane extends AbstractTableDataPane { private ConnectionTableProcedurePane connectionTableProcedurePane; private UITableEditorPane editorPane; + private DBTableDataMenuHandler dbTableDataMenuHandler; private SQLEditPane sqlTextPane; private UICheckBox isShareCheckBox; private MaxMemRowCountPanel maxPanel; private String pageQuery = null; - private String customCountQuery = null; public DBTableDataPane() { @@ -149,11 +150,10 @@ public class DBTableDataPane extends AbstractTableDataPane { } private void refresh() { - String[] paramTexts = new String[3]; + String[] paramTexts = new String[2]; paramTexts[0] = sqlTextPane.getText(); paramTexts[1] = pageQuery; - paramTexts[2] = customCountQuery; - + String queryText = null; List existParameterList = editorPane.update(); Parameter[] ps = existParameterList == null ? new Parameter[0] : existParameterList.toArray(new Parameter[existParameterList.size()]); @@ -166,8 +166,11 @@ public class DBTableDataPane extends AbstractTableDataPane { toolBarDef.addShortCut(new PreviewAction()); toolBarDef.addShortCut(SeparatorDef.DEFAULT); toolBarDef.addShortCut(new EditPageQueryAction()); - toolBarDef.addShortCut(SeparatorDef.DEFAULT); - toolBarDef.addShortCut(new EditCustomCountQueryAction()); + dbTableDataMenuHandler = ExtraDesignClassManager.getInstance().getSingle(DBTableDataMenuHandler.MARK_STRING); + if (dbTableDataMenuHandler != null) { + toolBarDef.addShortCut(SeparatorDef.DEFAULT); + toolBarDef.addShortCut(dbTableDataMenuHandler.createQueryAction()); + } isShareCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Is_Share_DBTableData")); maxPanel = new MaxMemRowCountPanel(); maxPanel.setBorder(null); @@ -179,11 +182,9 @@ public class DBTableDataPane extends AbstractTableDataPane { } private void checkParameter() { - String[] paramTexts = new String[3]; + String[] paramTexts = new String[2]; paramTexts[0] = sqlTextPane.getText(); paramTexts[1] = pageQuery; - paramTexts[2] = customCountQuery; - Parameter[] parameters = ParameterHelper.analyze4Parameters(paramTexts, false); if (parameters.length < 1 && editorPane.update().size() < 1) { @@ -210,6 +211,9 @@ public class DBTableDataPane extends AbstractTableDataPane { @Override public void populateBean(DBTableData dbtabledata) { + if (dbTableDataMenuHandler != null) { + dbTableDataMenuHandler.setDBTableData(dbtabledata); + } ParameterProvider[] parameters = null; Calculator c = Calculator.createCalculator(); @@ -227,8 +231,6 @@ public class DBTableDataPane extends AbstractTableDataPane { isShare = dbtabledata.isShare(); maxMemeryRow = dbtabledata.getMaxMemRowCount(); this.pageQuery = dbtabledata.getPageQuerySql(); - this.customCountQuery = dbtabledata.getCustomCountQuery(); - this.connectionTableProcedurePane.setSelectedDatabaseConnection(db); this.sqlTextPane.setText(query); this.sqlTextPane.requestFocus(); @@ -264,8 +266,9 @@ public class DBTableDataPane extends AbstractTableDataPane { dbTableData.setShare(isShareCheckBox.isSelected()); dbTableData.setMaxMemRowCount(maxPanel.getValue()); dbTableData.setPageQuerySql(this.pageQuery); - dbTableData.setCustomCountQuery(this.customCountQuery); - + if (dbTableDataMenuHandler != null) { + dbTableData.setCustomCountQuery(dbTableDataMenuHandler.getDbTableData().getCustomCountQuery()); + } return dbTableData; } @@ -318,28 +321,6 @@ public class DBTableDataPane extends AbstractTableDataPane { } } - private class EditCustomCountQueryAction extends UpdateAction { - public EditCustomCountQueryAction() { - this.setName(Inter.getLocText("FR-Designer-LayerPageReport_CustomCountQuery")); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/text.png")); - } - - @Override - public void actionPerformed(ActionEvent e) { - final QueryPane editPane = new QueryPane(Inter.getLocText("FR-Designer-LayerPageReport_Define_CustomCountQuery")); - editPane.populate(customCountQuery); - BasicDialog dialog = editPane.showWindow(DesignerContext.getDesignerFrame()); - dialog.addDialogActionListener(new DialogActionAdapter() { - public void doOk() { - customCountQuery = editPane.update(); - checkParameter(); - } - }); - dialog.setVisible(true); - - } - } - private class QueryPane extends BasicPane { private SQLEditPane pageQueryPane; private String title; diff --git a/designer_base/src/com/fr/design/fun/DBTableDataMenuHandler.java b/designer_base/src/com/fr/design/fun/DBTableDataMenuHandler.java new file mode 100644 index 0000000000..c32bf7e86a --- /dev/null +++ b/designer_base/src/com/fr/design/fun/DBTableDataMenuHandler.java @@ -0,0 +1,24 @@ +package com.fr.design.fun; + +import com.fr.data.impl.DBTableData; +import com.fr.design.actions.UpdateAction; +import com.fr.stable.fun.mark.Immutable; + +/** + * Created by xiaxiang on 2017/1/15. + */ +public interface DBTableDataMenuHandler extends Immutable { + String MARK_STRING = "DBTableDataMenuHandler"; + + int CURRENT_LEVEL = 1; + + UpdateAction createQueryAction(); + + DBTableData getDbTableData(); + + void setDBTableData(DBTableData dbTableData); + + + + +} diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractDBTableDataMenuHandler.java b/designer_base/src/com/fr/design/fun/impl/AbstractDBTableDataMenuHandler.java new file mode 100644 index 0000000000..f0a8207f13 --- /dev/null +++ b/designer_base/src/com/fr/design/fun/impl/AbstractDBTableDataMenuHandler.java @@ -0,0 +1,34 @@ +package com.fr.design.fun.impl; + +import com.fr.data.impl.DBTableData; +import com.fr.design.actions.UpdateAction; +import com.fr.design.fun.DBTableDataMenuHandler; +import com.fr.stable.fun.mark.API; + +/** + * Created by xiaxiang on 2017/1/15. + */ +@API(level = DBTableDataMenuHandler.CURRENT_LEVEL) +public abstract class AbstractDBTableDataMenuHandler implements DBTableDataMenuHandler { + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + + public UpdateAction createQueryAction() { + return null; + } + + @Override + public DBTableData getDbTableData() { + return null; + } + + @Override + public void setDBTableData(DBTableData dbTableData) { + + } +} From 768035300aa9ed5887d003aa3f8ce89cb2b6f23c Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Tue, 17 Jan 2017 10:53:06 +0800 Subject: [PATCH 02/16] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E5=8F=8C?= =?UTF-8?q?=E5=90=91=E8=87=AA=E9=80=82=E5=BA=94=E5=92=8C=E4=B8=8D=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E6=8C=89=E9=92=AE=E7=9A=84=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/mobile/MobileRadioGroupPane.java | 78 ++++++++++++++----- 1 file changed, 59 insertions(+), 19 deletions(-) diff --git a/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java b/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java index f03b726260..7878451cf6 100644 --- a/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java +++ b/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java @@ -19,7 +19,7 @@ import java.util.List; */ public class MobileRadioGroupPane extends BasicBeanPane{ - private List radioButtons = new ArrayList(); + private List radioButtons = new ArrayList(); public MobileRadioGroupPane(String title) { initComponents(title); @@ -30,28 +30,35 @@ public class MobileRadioGroupPane extends BasicBeanPane{ double[] rowSize = {p}; double[] columnSize = {p, p, p, p, p, p}; - UIRadioButton defaultRadio = new UIRadioButton(MobileFitAttrState.DEFAULT.description()); - defaultRadio.setSelected(true); - UIRadioButton horizonRadio = new UIRadioButton(MobileFitAttrState.HORIZONTAL.description()); - UIRadioButton verticalRadio = new UIRadioButton(MobileFitAttrState.VERTICAL.description()); - UIRadioButton bidirectionalRadio = new UIRadioButton(MobileFitAttrState.BIDIRECTIONAL.description()); - UIRadioButton notFitRadio = new UIRadioButton(MobileFitAttrState.NONE.description()); + RadioButton defaultRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.DEFAULT.description()), MobileFitAttrState.DEFAULT.getState()); + defaultRadio.getRadioButton().setSelected(true); + RadioButton horizonRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.HORIZONTAL.description()), MobileFitAttrState.HORIZONTAL.getState()); + RadioButton verticalRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.VERTICAL.description()), MobileFitAttrState.VERTICAL.getState()); + RadioButton bidirectionalRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.BIDIRECTIONAL.description()), MobileFitAttrState.BIDIRECTIONAL.getState()); + RadioButton notFitRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.NONE.description()), MobileFitAttrState.NONE.getState()); addToButtonGroup(defaultRadio, horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio); Component[][] components = new Component[][]{ - new Component[]{new UILabel(title), defaultRadio, horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio} + new Component[] { + new UILabel(title), + defaultRadio.getRadioButton(), + horizonRadio.getRadioButton(), + verticalRadio.getRadioButton(), + bidirectionalRadio.getRadioButton(), + notFitRadio.getRadioButton() + } }; JPanel fitOpsPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); fitOpsPane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10)); this.add(fitOpsPane); } - private void addToButtonGroup(UIRadioButton... radios) { + private void addToButtonGroup(RadioButton... radios) { ButtonGroup buttonGroup = new ButtonGroup(); - for (UIRadioButton radio : radios) { + for (RadioButton radio : radios) { radioButtons.add(radio); - buttonGroup.add(radio); + buttonGroup.add(radio.getRadioButton()); } } @@ -59,8 +66,8 @@ public class MobileRadioGroupPane extends BasicBeanPane{ * 设置按钮状态 */ public void setEnabled(boolean enabled) { - for (UIRadioButton radioButton : radioButtons) { - radioButton.setEnabled(enabled); + for (RadioButton radioButton : radioButtons) { + radioButton.getRadioButton().setEnabled(enabled); } } @@ -71,8 +78,8 @@ public class MobileRadioGroupPane extends BasicBeanPane{ */ public int getSelectRadioIndex() { for (int i = 0, len = radioButtons.size(); i < len; i++) { - if (radioButtons.get(i).isSelected()) { - return i; + if (radioButtons.get(i).getRadioButton().isSelected()) { + return radioButtons.get(i).getRadioButtonIndex(); } } @@ -87,16 +94,19 @@ public class MobileRadioGroupPane extends BasicBeanPane{ return; } - UIRadioButton button = radioButtons.get(index); - button.setSelected(true); + for (RadioButton radioButton : this.radioButtons) { + if (radioButton.getRadioButtonIndex() == index) { + radioButton.getRadioButton().setSelected(true); + } + } } /** * 给所有的按钮加上监听 */ public void addActionListener(ActionListener actionListener) { - for (UIRadioButton radioButton : radioButtons) { - radioButton.addActionListener(actionListener); + for (RadioButton radioButton : radioButtons) { + radioButton.getRadioButton().addActionListener(actionListener); } } @@ -116,3 +126,33 @@ public class MobileRadioGroupPane extends BasicBeanPane{ return StringUtils.EMPTY; } } + +/** + * created by fanglei on 2017/1/16 + * 不再用radioButtonGroup的数组下标作为index,而是给每个按钮传入MobileFitAttrState的枚举值 + */ +class RadioButton { + private UIRadioButton radioButton; + private int index; + + RadioButton(UIRadioButton radioButton, int index) { + this.radioButton = radioButton; + this.index = index; + } + + public UIRadioButton getRadioButton() { + return this.radioButton; + } + + public void setUIReadioButton(UIRadioButton radioButton) { + this.radioButton = radioButton; + } + + public int getRadioButtonIndex() { + return this.index; + } + + public void setRadioButtonIndex(int index) { + this.index = index; + } +} From e539908dcbc0e7964ad7a00effb9f3b3549b5aeb Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Tue, 17 Jan 2017 14:57:27 +0800 Subject: [PATCH 03/16] rt --- .../fr/design/data/tabledata/tabledatapane/DBTableDataPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java index 94e6b44b69..fed22c080d 100644 --- a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java +++ b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java @@ -267,7 +267,7 @@ public class DBTableDataPane extends AbstractTableDataPane { dbTableData.setMaxMemRowCount(maxPanel.getValue()); dbTableData.setPageQuerySql(this.pageQuery); if (dbTableDataMenuHandler != null) { - dbTableData.setCustomCountQuery(dbTableDataMenuHandler.getDbTableData().getCustomCountQuery()); + dbTableData.setDataQueryProcessor(dbTableDataMenuHandler.getDbTableData().getDataQueryProcessor()); } return dbTableData; } From 47a758f0b1c12d3dd9d0d1c715db2ac210d24668 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Tue, 17 Jan 2017 17:13:15 +0800 Subject: [PATCH 04/16] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E7=9A=84=E5=8F=8C?= =?UTF-8?q?=E5=90=91=E8=87=AA=E9=80=82=E5=BA=94=E5=92=8C=E4=B8=8D=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E9=A1=BA=E5=BA=8F=E5=BF=98=E8=AE=B0=E6=94=B9?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../properties/mobile/MobileFitAlignmentItems.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/properties/mobile/MobileFitAlignmentItems.java b/designer_form/src/com/fr/design/designer/properties/mobile/MobileFitAlignmentItems.java index 552589b71a..8926befde4 100644 --- a/designer_form/src/com/fr/design/designer/properties/mobile/MobileFitAlignmentItems.java +++ b/designer_form/src/com/fr/design/designer/properties/mobile/MobileFitAlignmentItems.java @@ -9,12 +9,14 @@ public class MobileFitAlignmentItems implements ItemProvider { private static Item[] VALUE_ITEMS; static { - MobileFitAttrState[] allStates = MobileFitAttrState.values(); - int len = allStates.length; - VALUE_ITEMS = new Item[len]; - for (int i = 0; i < len ; i++) { - VALUE_ITEMS[i] = new Item(allStates[i].description(), allStates[i]); - } +// 此处不能循环根据MobileFitAttrState的枚举顺序创建items,否则不自适应选项就会跑到双向自适应选项前面。 + VALUE_ITEMS = new Item[]{ + new Item(MobileFitAttrState.DEFAULT.description(), MobileFitAttrState.DEFAULT), + new Item(MobileFitAttrState.HORIZONTAL.description(), MobileFitAttrState.HORIZONTAL), + new Item(MobileFitAttrState.VERTICAL.description(), MobileFitAttrState.VERTICAL), + new Item(MobileFitAttrState.BIDIRECTIONAL.description(), MobileFitAttrState.BIDIRECTIONAL), + new Item(MobileFitAttrState.NONE.description(), MobileFitAttrState.NONE) + }; } @Override From c32b292e35eedeacc11a53659bd2a34e962b20d3 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Tue, 17 Jan 2017 17:21:50 +0800 Subject: [PATCH 05/16] =?UTF-8?q?RadioButton=E7=9A=84=E6=9E=84=E9=80=A0?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E7=9A=84=E7=AC=AC=E4=BA=8C=E4=B8=AA=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=BF=AE=E6=94=B9=E4=B8=BAMobileFitAttrState?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/report/mobile/MobileRadioGroupPane.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java b/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java index 7878451cf6..638abc768c 100644 --- a/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java +++ b/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java @@ -30,12 +30,12 @@ public class MobileRadioGroupPane extends BasicBeanPane{ double[] rowSize = {p}; double[] columnSize = {p, p, p, p, p, p}; - RadioButton defaultRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.DEFAULT.description()), MobileFitAttrState.DEFAULT.getState()); + RadioButton defaultRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.DEFAULT.description()), MobileFitAttrState.DEFAULT); defaultRadio.getRadioButton().setSelected(true); - RadioButton horizonRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.HORIZONTAL.description()), MobileFitAttrState.HORIZONTAL.getState()); - RadioButton verticalRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.VERTICAL.description()), MobileFitAttrState.VERTICAL.getState()); - RadioButton bidirectionalRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.BIDIRECTIONAL.description()), MobileFitAttrState.BIDIRECTIONAL.getState()); - RadioButton notFitRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.NONE.description()), MobileFitAttrState.NONE.getState()); + RadioButton horizonRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.HORIZONTAL.description()), MobileFitAttrState.HORIZONTAL); + RadioButton verticalRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.VERTICAL.description()), MobileFitAttrState.VERTICAL); + RadioButton bidirectionalRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.BIDIRECTIONAL.description()), MobileFitAttrState.BIDIRECTIONAL); + RadioButton notFitRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.NONE.description()), MobileFitAttrState.NONE); addToButtonGroup(defaultRadio, horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio); @@ -135,9 +135,9 @@ class RadioButton { private UIRadioButton radioButton; private int index; - RadioButton(UIRadioButton radioButton, int index) { + RadioButton(UIRadioButton radioButton, MobileFitAttrState mobileFitAttrState) { this.radioButton = radioButton; - this.index = index; + this.index = mobileFitAttrState.getState(); } public UIRadioButton getRadioButton() { From a42bd2793829a8e84e8507d802b23c86a5977617 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Tue, 17 Jan 2017 18:53:12 +0800 Subject: [PATCH 06/16] rt --- .../fr/design/data/tabledata/tabledatapane/DBTableDataPane.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java index fed22c080d..94f88df8cc 100644 --- a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java +++ b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java @@ -153,7 +153,6 @@ public class DBTableDataPane extends AbstractTableDataPane { String[] paramTexts = new String[2]; paramTexts[0] = sqlTextPane.getText(); paramTexts[1] = pageQuery; - String queryText = null; List existParameterList = editorPane.update(); Parameter[] ps = existParameterList == null ? new Parameter[0] : existParameterList.toArray(new Parameter[existParameterList.size()]); From 74f529695de80d2fec5a0fa3993ceb1b41485e39 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 18 Jan 2017 10:19:00 +0800 Subject: [PATCH 07/16] rt --- .../data/tabledata/tabledatapane/DBTableDataPane.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java index 94f88df8cc..75b3219ebd 100644 --- a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java +++ b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java @@ -59,6 +59,8 @@ public class DBTableDataPane extends AbstractTableDataPane { private UICheckBox isShareCheckBox; private MaxMemRowCountPanel maxPanel; private String pageQuery = null; + private DBTableData dbTableData; + public DBTableDataPane() { @@ -210,8 +212,9 @@ public class DBTableDataPane extends AbstractTableDataPane { @Override public void populateBean(DBTableData dbtabledata) { + this.dbTableData = dbtabledata; if (dbTableDataMenuHandler != null) { - dbTableDataMenuHandler.setDBTableData(dbtabledata); + dbTableDataMenuHandler.populate(dbtabledata); } ParameterProvider[] parameters = null; @@ -254,7 +257,6 @@ public class DBTableDataPane extends AbstractTableDataPane { List parameterList = editorPane.update(); Parameter[] parameters = parameterList.toArray(new Parameter[parameterList.size()]); - DBTableData dbTableData = new DBTableData(); dbTableData.setDatabase(new NameDatabaseConnection(dbName)); // p:必须先设置Parameters数组,因为setQuery里面会自动设置的 @@ -266,7 +268,7 @@ public class DBTableDataPane extends AbstractTableDataPane { dbTableData.setMaxMemRowCount(maxPanel.getValue()); dbTableData.setPageQuerySql(this.pageQuery); if (dbTableDataMenuHandler != null) { - dbTableData.setDataQueryProcessor(dbTableDataMenuHandler.getDbTableData().getDataQueryProcessor()); + dbTableDataMenuHandler.update(); } return dbTableData; } From 5a16de43fa8ede11ce2e05662b0781cf96b992c2 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 18 Jan 2017 10:19:27 +0800 Subject: [PATCH 08/16] rt --- .../src/com/fr/design/fun/DBTableDataMenuHandler.java | 6 ++---- .../fr/design/fun/impl/AbstractDBTableDataMenuHandler.java | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/designer_base/src/com/fr/design/fun/DBTableDataMenuHandler.java b/designer_base/src/com/fr/design/fun/DBTableDataMenuHandler.java index c32bf7e86a..f06b63b712 100644 --- a/designer_base/src/com/fr/design/fun/DBTableDataMenuHandler.java +++ b/designer_base/src/com/fr/design/fun/DBTableDataMenuHandler.java @@ -14,11 +14,9 @@ public interface DBTableDataMenuHandler extends Immutable { UpdateAction createQueryAction(); - DBTableData getDbTableData(); - - void setDBTableData(DBTableData dbTableData); - + void populate(DBTableData dbTableData); + DBTableData update(); } diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractDBTableDataMenuHandler.java b/designer_base/src/com/fr/design/fun/impl/AbstractDBTableDataMenuHandler.java index f0a8207f13..dd11712505 100644 --- a/designer_base/src/com/fr/design/fun/impl/AbstractDBTableDataMenuHandler.java +++ b/designer_base/src/com/fr/design/fun/impl/AbstractDBTableDataMenuHandler.java @@ -23,12 +23,12 @@ public abstract class AbstractDBTableDataMenuHandler implements DBTableDataMenuH } @Override - public DBTableData getDbTableData() { + public DBTableData update() { return null; } @Override - public void setDBTableData(DBTableData dbTableData) { + public void populate(DBTableData dbTableData) { } } From ecdb72d4f4aa276443b18bb52e63d206ad0dbb2f Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Wed, 18 Jan 2017 10:31:06 +0800 Subject: [PATCH 09/16] =?UTF-8?q?=E4=B8=8D=E5=86=8D=E7=8B=AC=E8=87=AA?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=B8=A6index=E7=9A=84=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E6=8C=89=E9=92=AE=EF=BC=8C=E8=80=8C=E6=98=AF=E7=BB=A7=E6=89=BF?= =?UTF-8?q?=E8=87=AAUIRadioButton?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/mobile/MobileRadioGroupPane.java | 60 ++++++++----------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java b/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java index 638abc768c..68446abc97 100644 --- a/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java +++ b/designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java @@ -6,6 +6,7 @@ import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.general.data.index.Index; import com.fr.stable.StringUtils; import javax.swing.*; @@ -19,7 +20,7 @@ import java.util.List; */ public class MobileRadioGroupPane extends BasicBeanPane{ - private List radioButtons = new ArrayList(); + private List radioButtons = new ArrayList(); public MobileRadioGroupPane(String title) { initComponents(title); @@ -30,23 +31,23 @@ public class MobileRadioGroupPane extends BasicBeanPane{ double[] rowSize = {p}; double[] columnSize = {p, p, p, p, p, p}; - RadioButton defaultRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.DEFAULT.description()), MobileFitAttrState.DEFAULT); - defaultRadio.getRadioButton().setSelected(true); - RadioButton horizonRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.HORIZONTAL.description()), MobileFitAttrState.HORIZONTAL); - RadioButton verticalRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.VERTICAL.description()), MobileFitAttrState.VERTICAL); - RadioButton bidirectionalRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.BIDIRECTIONAL.description()), MobileFitAttrState.BIDIRECTIONAL); - RadioButton notFitRadio = new RadioButton(new UIRadioButton(MobileFitAttrState.NONE.description()), MobileFitAttrState.NONE); + IndexRadioButton defaultRadio = new IndexRadioButton(MobileFitAttrState.DEFAULT.description(), MobileFitAttrState.DEFAULT); + defaultRadio.setSelected(true); + IndexRadioButton horizonRadio = new IndexRadioButton(MobileFitAttrState.HORIZONTAL.description(), MobileFitAttrState.HORIZONTAL); + IndexRadioButton verticalRadio = new IndexRadioButton(MobileFitAttrState.VERTICAL.description(), MobileFitAttrState.VERTICAL); + IndexRadioButton bidirectionalRadio = new IndexRadioButton(MobileFitAttrState.BIDIRECTIONAL.description(), MobileFitAttrState.BIDIRECTIONAL); + IndexRadioButton notFitRadio = new IndexRadioButton(MobileFitAttrState.NONE.description(), MobileFitAttrState.NONE); addToButtonGroup(defaultRadio, horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio); Component[][] components = new Component[][]{ new Component[] { new UILabel(title), - defaultRadio.getRadioButton(), - horizonRadio.getRadioButton(), - verticalRadio.getRadioButton(), - bidirectionalRadio.getRadioButton(), - notFitRadio.getRadioButton() + defaultRadio, + horizonRadio, + verticalRadio, + bidirectionalRadio, + notFitRadio } }; JPanel fitOpsPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); @@ -54,11 +55,11 @@ public class MobileRadioGroupPane extends BasicBeanPane{ this.add(fitOpsPane); } - private void addToButtonGroup(RadioButton... radios) { + private void addToButtonGroup(IndexRadioButton... radios) { ButtonGroup buttonGroup = new ButtonGroup(); - for (RadioButton radio : radios) { + for (IndexRadioButton radio : radios) { radioButtons.add(radio); - buttonGroup.add(radio.getRadioButton()); + buttonGroup.add(radio); } } @@ -66,8 +67,8 @@ public class MobileRadioGroupPane extends BasicBeanPane{ * 设置按钮状态 */ public void setEnabled(boolean enabled) { - for (RadioButton radioButton : radioButtons) { - radioButton.getRadioButton().setEnabled(enabled); + for (IndexRadioButton radioButton : radioButtons) { + radioButton.setEnabled(enabled); } } @@ -78,7 +79,7 @@ public class MobileRadioGroupPane extends BasicBeanPane{ */ public int getSelectRadioIndex() { for (int i = 0, len = radioButtons.size(); i < len; i++) { - if (radioButtons.get(i).getRadioButton().isSelected()) { + if (radioButtons.get(i).isSelected()) { return radioButtons.get(i).getRadioButtonIndex(); } } @@ -94,9 +95,9 @@ public class MobileRadioGroupPane extends BasicBeanPane{ return; } - for (RadioButton radioButton : this.radioButtons) { + for (IndexRadioButton radioButton : this.radioButtons) { if (radioButton.getRadioButtonIndex() == index) { - radioButton.getRadioButton().setSelected(true); + radioButton.setSelected(true); } } } @@ -105,8 +106,8 @@ public class MobileRadioGroupPane extends BasicBeanPane{ * 给所有的按钮加上监听 */ public void addActionListener(ActionListener actionListener) { - for (RadioButton radioButton : radioButtons) { - radioButton.getRadioButton().addActionListener(actionListener); + for (IndexRadioButton radioButton : radioButtons) { + radioButton.addActionListener(actionListener); } } @@ -131,23 +132,14 @@ public class MobileRadioGroupPane extends BasicBeanPane{ * created by fanglei on 2017/1/16 * 不再用radioButtonGroup的数组下标作为index,而是给每个按钮传入MobileFitAttrState的枚举值 */ -class RadioButton { - private UIRadioButton radioButton; +class IndexRadioButton extends UIRadioButton { private int index; - RadioButton(UIRadioButton radioButton, MobileFitAttrState mobileFitAttrState) { - this.radioButton = radioButton; + IndexRadioButton(String text, MobileFitAttrState mobileFitAttrState) { + super(text); this.index = mobileFitAttrState.getState(); } - public UIRadioButton getRadioButton() { - return this.radioButton; - } - - public void setUIReadioButton(UIRadioButton radioButton) { - this.radioButton = radioButton; - } - public int getRadioButtonIndex() { return this.index; } From e21a7e997d3b2fc1ba9cf28281316591452a4c1e Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 18 Jan 2017 10:47:44 +0800 Subject: [PATCH 10/16] =?UTF-8?q?REPORT-1384=20=E5=A2=9E=E5=8A=A0=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E7=AE=A1=E7=90=86=E4=B8=AD=E7=9A=84=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/ui/btn/ButtonSytleDefinedPane.java | 29 +++++++++++++------ .../background/BackgroundButtonPane.java | 6 ++++ .../btn/ButtonWithHotkeysDetailPane.java | 1 + 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java b/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java index 124b72c796..40c6087b2b 100644 --- a/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java +++ b/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java @@ -1,12 +1,13 @@ package com.fr.design.widget.ui.btn; -import java.awt.BorderLayout; -import java.awt.Dimension; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.BorderFactory; import javax.swing.ImageIcon; + +import com.fr.base.background.ColorBackground; import com.fr.design.gui.ilable.UILabel; import javax.swing.JPanel; import javax.swing.SwingUtilities; @@ -18,7 +19,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.gui.frpane.ImgChoosePane; +import com.fr.design.style.background.BackgroundButtonPane; import com.fr.form.ui.FreeButton; import com.fr.general.Background; import com.fr.general.Inter; @@ -84,7 +85,7 @@ public class ButtonSytleDefinedPane extends BasicPane { class BackgroundPane extends JPanel { private UIButton editButton; - private ImgChoosePane choosePane; + private BackgroundButtonPane choosePane; private Background background; private UILabel ImagePreviewPane; @@ -106,7 +107,7 @@ public class ButtonSytleDefinedPane extends BasicPane { public void actionPerformed(ActionEvent e) { if (choosePane == null) { - choosePane = new ImgChoosePane(); + choosePane = new BackgroundButtonPane(); } BasicDialog dlg = choosePane.showWindow(SwingUtilities .getWindowAncestor(ButtonSytleDefinedPane.this)); @@ -116,7 +117,10 @@ public class ButtonSytleDefinedPane extends BasicPane { populate(choosePane.update()); } }); - choosePane.populate((ImageBackground) BackgroundPane.this.background); + if(BackgroundPane.this.background == null){ + BackgroundPane.this.background = new ColorBackground(); + } + choosePane.populate((Background) BackgroundPane.this.background); dlg.setVisible(true); } }); @@ -125,15 +129,22 @@ public class ButtonSytleDefinedPane extends BasicPane { public void populate(Background background) { this.background = background; + if (background instanceof ImageBackground && ((ImageBackground) background).getImage() != null) { ImagePreviewPane.setIcon(new ImageIcon(((ImageBackground) background).getImage())); - } else { + } else if(background instanceof ColorBackground && ((ColorBackground) background).getColor() != null){ + ImagePreviewPane.setIcon(null); + ImagePreviewPane.setOpaque(true); + ImagePreviewPane.setBackground(((ColorBackground) background).getColor()); + }else{ ImagePreviewPane.setIcon(null); + ImagePreviewPane.setOpaque(false); + ImagePreviewPane.setBackground(null); } } - public ImageBackground update() { - return (ImageBackground) background; + public Background update() { + return background; } } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/style/background/BackgroundButtonPane.java b/designer_base/src/com/fr/design/style/background/BackgroundButtonPane.java index 296ee746e3..084e0865aa 100644 --- a/designer_base/src/com/fr/design/style/background/BackgroundButtonPane.java +++ b/designer_base/src/com/fr/design/style/background/BackgroundButtonPane.java @@ -4,6 +4,8 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.Background; import com.fr.general.Inter; +import java.util.HashMap; + /** * Created by ibm on 2017/1/5. */ @@ -50,4 +52,8 @@ public class BackgroundButtonPane extends BackgroundPane { return quickPane; } + public void populate(Background background) { + cacheMap = new HashMap<>(); + super.populate(background); + } } diff --git a/designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java b/designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java index 9d278d0482..9efdb92622 100644 --- a/designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java +++ b/designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java @@ -31,6 +31,7 @@ public abstract class ButtonWithHotkeysDetailPane extends Butt } private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); advancedPane.setPreferredSize(new Dimension(600, 341)); JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); From 54678080a68297ddc4dfa06ceb88d00558c8a642 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 18 Jan 2017 11:08:26 +0800 Subject: [PATCH 11/16] =?UTF-8?q?=E4=BF=AE=E6=94=B9PMD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/widget/ui/btn/ButtonSytleDefinedPane.java | 8 ++++---- .../src/com/fr/design/locale/designer.properties | 5 ++++- .../src/com/fr/design/locale/designer_en_US.properties | 5 ++++- .../src/com/fr/design/locale/designer_ja_JP.properties | 5 ++++- .../src/com/fr/design/locale/designer_ko_KR.properties | 5 ++++- .../src/com/fr/design/locale/designer_zh_CN.properties | 5 ++++- .../src/com/fr/design/locale/designer_zh_TW.properties | 5 ++++- 7 files changed, 28 insertions(+), 10 deletions(-) diff --git a/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java b/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java index 40c6087b2b..fee61e5f3a 100644 --- a/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java +++ b/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java @@ -45,9 +45,9 @@ public class ButtonSytleDefinedPane extends BasicPane { JPanel buttonStylePane = new JPanel(); buttonStylePane.setLayout(new BorderLayout()); - initBackgroundPane = new BackgroundPane(Inter.getLocText("Background-Initial") + ":", Inter.getLocText("The_initial_background_of_the_button")); - overBackgroundPane = new BackgroundPane(Inter.getLocText("Background-Over") + ":", Inter.getLocText("Mouse_move-background")); - clickBackgroundPane = new BackgroundPane(Inter.getLocText("Background-Click") + ":", Inter.getLocText("Mouse_move-background")); + initBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Initial") + ":", Inter.getLocText("FR-Designer_Initial_Background_Tips")); + overBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Over") + ":", Inter.getLocText("FR-Designer_Mouse_Move_Tips")); + clickBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Click") + ":", Inter.getLocText("FR-Designer_Mouse_Click_Tips")); JPanel table = FRGUIPaneFactory.createYBoxEmptyBorderPane(); table.setBorder(new TitledBorder(Inter.getLocText(new String[]{"Custom", "Form-Button", "Style"}))); @@ -102,7 +102,7 @@ public class ButtonSytleDefinedPane extends BasicPane { ImagePreviewPane.setPreferredSize(new Dimension(100, 20)); this.add(ImagePreviewPane); - editButton = new UIButton(Inter.getLocText("Edit")); + editButton = new UIButton(Inter.getLocText("FR-Designer_Edit")); editButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 41f3c8cdd8..5caabf6222 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -520,4 +520,7 @@ FR-Designer_Background_Clear= FR-Designer_Background_Image_Select= FR-Designer_Tab_carousel= FR-Designer_setCarousel= -FR-Designer_carouselInterval= \ No newline at end of file +FR-Designer_carouselInterval= +FR-Designer_Initial_Background_Tips= +FR-Designer_Mouse_Move_Tips= +FR-Designer_Mouse_Click_Tips= \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index 334e01ca8c..91668466a6 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -520,4 +520,7 @@ FR-Designer_Background_Clear=Clear FR-Designer_Background_Image_Select=Select Picture FR-Designer_Tab_carousel= FR-Designer_setCarousel= -FR-Designer_carouselInterval= \ No newline at end of file +FR-Designer_carouselInterval= +FR-Designer_Initial_Background_Tips=Initial background of the button +FR-Designer_Mouse_Move_Tips=Move the mouse to the button on the background, in the absence of not changing the background +FR-Designer_Mouse_Click_Tips=The background of the mouse to click the button, in the absence of not changing the background \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index 6312538cf7..2e0ca9c92a 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -499,4 +499,7 @@ FR-Designer_Background_Clear= FR-Designer_Background_Image_Select= FR-Designer_Tab_carousel= FR-Designer_setCarousel= -FR-Designer_carouselInterval= \ No newline at end of file +FR-Designer_carouselInterval= +FR-Designer_Initial_Background_Tips= +FR-Designer_Mouse_Move_Tips= +FR-Designer_Mouse_Click_Tips= \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index 87a1b893c8..b86f0d900e 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -494,4 +494,7 @@ FR-Designer_Background_Clear= FR-Designer_Background_Image_Select= FR-Designer_Tab_carousel= FR-Designer_setCarousel= -FR-Designer_carouselInterval= \ No newline at end of file +FR-Designer_carouselInterval= +FR-Designer_Initial_Background_Tips= +FR-Designer_Mouse_Move_Tips= +FR-Designer_Mouse_Click_Tips= \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index 10c53380d0..659fe3737d 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -524,4 +524,7 @@ FR-Designer_Background_Clear=\u6E05\u9664 FR-Designer_Background_Image_Select=\u9009\u62E9\u56FE\u7247 FR-Designer_Tab_carousel=tab\u8F6E\u64AD FR-Designer_setCarousel=\u5F00\u542F\u8F6E\u64AD -FR-Designer_carouselInterval=\u8F6E\u64AD\u95F4\u9694 \ No newline at end of file +FR-Designer_carouselInterval=\u8F6E\u64AD\u95F4\u9694 +FR-Designer_Initial_Background_Tips=\u6309\u94AE\u7684\u521D\u59CB\u80CC\u666F +FR-Designer_Mouse_Move_Tips=\u9F20\u6807\u79FB\u52A8\u5230\u6309\u94AE\u4E0A\u7684\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F +FR-Designer_Mouse_Click_Tips=\u9F20\u6807\u70B9\u51FB\u6309\u94AE\u65F6\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index 96cb4260a9..5cff5b570c 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -512,4 +512,7 @@ FR-Designer_Background_Clear= FR-Designer_Background_Image_Select= FR-Designer_Tab_carousel= FR-Designer_setCarousel= -FR-Designer_carouselInterval= \ No newline at end of file +FR-Designer_carouselInterval= +FR-Designer_Initial_Background_Tips= +FR-Designer_Mouse_Move_Tips= +FR-Designer_Mouse_Click_Tips= \ No newline at end of file From f6ef244651a7a71f6915c9c9e4a4a92a929efb19 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 18 Jan 2017 16:40:01 +0800 Subject: [PATCH 12/16] =?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 --- .../com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java | 4 +--- .../fr/design/style/background/BackgroundButtonPane.java | 6 ------ .../widget/accessibles/AccessibleImgBackgroundEditor.java | 6 ++---- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java b/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java index fee61e5f3a..719ecea4e5 100644 --- a/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java +++ b/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java @@ -106,9 +106,7 @@ public class ButtonSytleDefinedPane extends BasicPane { editButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - if (choosePane == null) { - choosePane = new BackgroundButtonPane(); - } + choosePane = new BackgroundButtonPane(); BasicDialog dlg = choosePane.showWindow(SwingUtilities .getWindowAncestor(ButtonSytleDefinedPane.this)); dlg.addDialogActionListener(new DialogActionAdapter() { diff --git a/designer_base/src/com/fr/design/style/background/BackgroundButtonPane.java b/designer_base/src/com/fr/design/style/background/BackgroundButtonPane.java index 084e0865aa..296ee746e3 100644 --- a/designer_base/src/com/fr/design/style/background/BackgroundButtonPane.java +++ b/designer_base/src/com/fr/design/style/background/BackgroundButtonPane.java @@ -4,8 +4,6 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.Background; import com.fr.general.Inter; -import java.util.HashMap; - /** * Created by ibm on 2017/1/5. */ @@ -52,8 +50,4 @@ public class BackgroundButtonPane extends BackgroundPane { return quickPane; } - public void populate(Background background) { - cacheMap = new HashMap<>(); - super.populate(background); - } } diff --git a/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java b/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java index 8def747683..cbead62045 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java +++ b/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java @@ -18,10 +18,8 @@ public class AccessibleImgBackgroundEditor extends UneditableAccessibleEditor { @Override protected void showEditorPane() { - if (choosePane == null) { - choosePane = new BackgroundButtonPane(); - choosePane.setPreferredSize(new Dimension(600, 400)); - } + choosePane = new BackgroundButtonPane(); + choosePane.setPreferredSize(new Dimension(600, 400)); BasicDialog dlg = choosePane.showWindow(SwingUtilities.getWindowAncestor(this)); dlg.addDialogActionListener(new DialogActionAdapter() { From db5a84339098316d9d188182f8f436e203dc9001 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Thu, 19 Jan 2017 15:49:26 +0800 Subject: [PATCH 13/16] rt --- .../gui/icontainer/UIResizableContainer.java | 3 ++- .../parameter/ParameterPropertyPane.java | 27 ++++++++++++++----- .../parameter/ParameterToolBarPane.java | 6 ++--- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java index d16622184f..98fab75f0f 100644 --- a/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -14,6 +14,7 @@ import java.awt.event.MouseMotionListener; public class UIResizableContainer extends JPanel { private static final long serialVersionUID = 1854340560790476907L; + private static final int MAX_PARA_HEIGHT = 240; private int containerWidth = 240; private int preferredWidth = 240; private int toolPaneY = 300; @@ -139,7 +140,7 @@ public class UIResizableContainer extends JPanel { * @param height */ public void setParameterHeight(int height) { - paraHeight = hasParameterPane? height : 0; + paraHeight = hasParameterPane? Math.min(height, MAX_PARA_HEIGHT) : 0; refreshContainer(); } diff --git a/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java b/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java index f093a14327..9fbe3e6197 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java @@ -1,5 +1,6 @@ package com.fr.design.parameter; +import com.fr.design.dialog.BasicScrollPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormHierarchyTreePane; @@ -13,13 +14,12 @@ import java.awt.event.MouseEvent; public class ParameterPropertyPane extends JPanel{ private ParameterToolBarPane toolbarPane; - -// private JWorkBook workbook; + private BasicScrollPane basicScrollPane; private ParaDefinitePane paraPane; public static ParameterPropertyPane THIS; private boolean isEditing = false; - + public static final ParameterPropertyPane getInstance() { if(THIS == null) { THIS = new ParameterPropertyPane(); @@ -43,12 +43,26 @@ public class ParameterPropertyPane extends JPanel{ public ParameterPropertyPane() { toolbarPane = new ParameterToolBarPane(); + basicScrollPane = new BasicScrollPane() { + @Override + protected JPanel createContentPane() { + return toolbarPane; + } - initParameterListener(); + @Override + public void populateBean(Object ob) { + } + + @Override + protected String title4PopupWindow() { + return null; + } + }; + initParameterListener(); this.setLayout(new BorderLayout(0, 6)); this.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); - this.add(toolbarPane, BorderLayout.CENTER); + this.add(basicScrollPane, BorderLayout.CENTER); } private void setEditor(FormDesigner editor) { @@ -68,8 +82,9 @@ public class ParameterPropertyPane extends JPanel{ SwingUtilities.invokeLater(new Runnable() { @Override public void run() { - if (paraPane.isWithQueryButton()) + if (paraPane.isWithQueryButton()) { paraPane.addingParameter2Editor(toolbarPane.getTargetParameter(parameterSelectedLabel)); + } else { paraPane.addingParameter2EditorWithQueryButton(toolbarPane.getTargetParameter(parameterSelectedLabel)); } diff --git a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java index aa7c11660a..b2e4762faa 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java @@ -11,7 +11,6 @@ import java.util.ArrayList; import javax.swing.BorderFactory; import com.fr.design.gui.ilable.UILabel; import javax.swing.SwingConstants; -import javax.swing.event.ChangeListener; import com.fr.base.Parameter; import com.fr.design.beans.BasicBeanPane; @@ -23,7 +22,7 @@ import com.fr.general.Inter; * @author: august * */ public class ParameterToolBarPane extends BasicBeanPane { - private Parameter[] parameterList; + public Parameter[] parameterList; private ArrayList parameterSelectedLabellist = new ArrayList(); private MouseListener paraMouseListner; private UIButton addAll; @@ -35,7 +34,6 @@ public class ParameterToolBarPane extends BasicBeanPane { private static final int GAP_BV = 4; private static final int BUTTON_HEIGHT = 20; private static final int WIDTH = 225; - private static final int L_H = 18; public ParameterToolBarPane() { @@ -133,7 +131,7 @@ public class ParameterToolBarPane extends BasicBeanPane { layoutContainer(parent); - int h= ((parameterSelectedLabellist.size() == 0) ? L_H : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); + int h= ((parameterSelectedLabellist.size() == 0) ? 0 : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); return new Dimension(w, h); } From 91d9eecc6e59d8a43fa2700dd448a113c011e6b9 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Thu, 19 Jan 2017 15:52:16 +0800 Subject: [PATCH 14/16] rt --- .../src/com/fr/design/parameter/ParameterPropertyPane.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java b/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java index 9fbe3e6197..01302299ea 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java @@ -84,8 +84,7 @@ public class ParameterPropertyPane extends JPanel{ public void run() { if (paraPane.isWithQueryButton()) { paraPane.addingParameter2Editor(toolbarPane.getTargetParameter(parameterSelectedLabel)); - } - else { + } else { paraPane.addingParameter2EditorWithQueryButton(toolbarPane.getTargetParameter(parameterSelectedLabel)); } } From 288464b55fa8b4f1ebb82e302aa03de8b3609087 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Thu, 19 Jan 2017 15:53:04 +0800 Subject: [PATCH 15/16] rt --- .../src/com/fr/design/parameter/ParameterToolBarPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java index b2e4762faa..cfae55b853 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java @@ -22,7 +22,7 @@ import com.fr.general.Inter; * @author: august * */ public class ParameterToolBarPane extends BasicBeanPane { - public Parameter[] parameterList; + private Parameter[] parameterList; private ArrayList parameterSelectedLabellist = new ArrayList(); private MouseListener paraMouseListner; private UIButton addAll; From a8716db31ac9eb4adde59c6c2bde94845e59d150 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Thu, 19 Jan 2017 16:00:48 +0800 Subject: [PATCH 16/16] rt --- .../com/fr/design/gui/icontainer/UIResizableContainer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java index 98fab75f0f..96eccfc595 100644 --- a/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -5,6 +5,7 @@ import com.fr.design.constants.UIConstants; import com.fr.design.mainframe.DesignerContext; import com.fr.stable.Constants; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.stable.collections.utils.MathUtils; import javax.swing.*; import java.awt.*; @@ -19,6 +20,7 @@ public class UIResizableContainer extends JPanel { private int preferredWidth = 240; private int toolPaneY = 300; private int toolPaneHeight = 10; + private int bottomHeight = 30; private JComponent upPane; private JComponent downPane; @@ -209,7 +211,7 @@ public class UIResizableContainer extends JPanel { if(isDownPaneVisible){ upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY); horizontToolPane.setBounds(0, toolPaneY, containerWidth - toolPaneHeight, toolPaneHeight); - downPane.setBounds(0, toolPaneY + toolPaneHeight, containerWidth - toolPaneHeight, parent.getHeight() - toolPaneY - toolPaneHeight-30); + downPane.setBounds(0, toolPaneY + toolPaneHeight, containerWidth - toolPaneHeight, parent.getHeight() - toolPaneY - toolPaneHeight - bottomHeight); verticalToolPane.setBounds(containerWidth - toolPaneHeight, 0, toolPaneHeight, getHeight()); }else{ upPane.setBounds(0, 0, containerWidth - toolPaneHeight, getHeight());