From 95532609161c441ef57685609c527b73fda782cf Mon Sep 17 00:00:00 2001 From: zhouping Date: Thu, 16 Feb 2017 16:19:41 +0800 Subject: [PATCH 1/8] =?UTF-8?q?REPORT-1814=20=E8=A1=A8=E5=8D=95tab?= =?UTF-8?q?=E5=9D=97=E7=9A=84=E6=94=B9=E8=89=AFbug=20=E8=BD=AE=E6=92=ADbug?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E9=A1=B5=E7=AD=BE=E6=8B=96=E5=8A=A8=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/locale/designer_en_US.properties | 6 +++--- .../creator/cardlayout/TabMoveEndAction.java | 2 ++ .../cardlayout/TabMoveFirstAction.java | 2 ++ .../creator/cardlayout/TabMoveNextAction.java | 2 ++ .../creator/cardlayout/TabMovePrevAction.java | 2 ++ .../creator/cardlayout/XWCardLayout.java | 4 ++-- ...bsoluteBodyLayoutPropertiesGroupModel.java | 20 ++++++++++--------- .../mainframe/EditingMouseListener.java | 5 +++++ 8 files changed, 29 insertions(+), 14 deletions(-) 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 24c7a87c7..a871d47aa 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 @@ -525,9 +525,9 @@ FR-Designer_Background_Gradient_Color=Gradient Color FR-Designer_Background_Image=Image FR-Designer_Background_Clear=Clear FR-Designer_Background_Image_Select=Select Picture -FR-Designer_Tab_carousel= -FR-Designer_setCarousel= -FR-Designer_carouselInterval= +FR-Designer_Tab_carousel=tab carousel +FR-Designer_setCarousel=set carousel +FR-Designer_carouselInterval=interval 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 diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java index ae101dbe4..b2a5214c4 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java @@ -47,6 +47,8 @@ public class TabMoveEndAction extends FormUndoableAction { currentButton.setIndex(maxIndex - 1); currentTab.setIndex(maxIndex - 1); currentTab.setTabNameIndex(maxIndex - 1); + xwCardLayout.toData().setShowIndex(maxIndex - 1); + xwCardLayout.showCard(); xwCardTagLayout.setSwitchingTab(false); }catch (Exception e){ xwCardTagLayout.setSwitchingTab(false); diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java index 0d6047636..c9034d04b 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java @@ -46,6 +46,8 @@ public class TabMoveFirstAction extends FormUndoableAction { currentButton.setIndex(0); currentTab.setIndex(0); currentTab.setTabNameIndex(0); + xwCardLayout.toData().setShowIndex(0); + xwCardLayout.showCard(); xwCardTagLayout.setSwitchingTab(false); }catch (Exception e){ xwCardTagLayout.setSwitchingTab(false); diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java index 15bfa7337..e7806a7ae 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java @@ -45,6 +45,8 @@ public class TabMoveNextAction extends FormUndoableAction { currentButton.setIndex(currentIndex + 1); currentTab.setIndex(currentIndex + 1); currentTab.setTabNameIndex(currentIndex + 1); + xwCardLayout.toData().setShowIndex(currentIndex + 1); + xwCardLayout.showCard(); xwCardTagLayout.setSwitchingTab(false); }catch (Exception e){ xwCardTagLayout.setSwitchingTab(false); diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java index cac70db82..e92852c6c 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java @@ -45,6 +45,8 @@ public class TabMovePrevAction extends FormUndoableAction { currentButton.setIndex(currentIndex - 1); currentTab.setIndex(currentIndex - 1); currentTab.setTabNameIndex(currentIndex - 1); + xwCardLayout.toData().setShowIndex(currentIndex - 1); + xwCardLayout.showCard(); xwCardTagLayout.setSwitchingTab(false); }catch (Exception e){ xwCardTagLayout.setSwitchingTab(false); diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java index 32a7134ad..7597a4579 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java @@ -295,9 +295,9 @@ public class XWCardLayout extends XLayoutContainer { * 判断当前tab组件是不是嵌套的 * @return 嵌套与否 */ - private boolean isNested(){ + private boolean isNested() { XLayoutContainer xLayoutContainer = this.getBackupParent().getBackupParent(); - return xLayoutContainer != null && xLayoutContainer.acceptType(XWTabFitLayout.class); + return xLayoutContainer == null || xLayoutContainer.acceptType(XWTabFitLayout.class); } public CRPropertyDescriptor[] getisCarousel() throws IntrospectionException { diff --git a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java index b290bcccf..eb4b31154 100644 --- a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java +++ b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java @@ -26,8 +26,11 @@ import java.util.Comparator; public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPropertiesGroupModel { private LayoutTypeEditor layoutTypeEditor; private LayoutTypeRenderer layoutTypeRenderer; + //默认body是0,自适应布局;1,绝对布局. private WBodyLayoutType layoutType = WBodyLayoutType.ABSOLUTE; + private static final int EACH_ROW_COUNT = 4; + public FRAbsoluteBodyLayoutPropertiesGroupModel(XWAbsoluteBodyLayout xwAbsoluteBodyLayout) { super(xwAbsoluteBodyLayout); } @@ -180,9 +183,8 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr // 把绝对布局中的元素按规则移动到自适应布局中 // 规则:各元素按顺序放置,其中每行最多4个元素,超出则换行,各元素均分body的高度和宽度 private void moveComponents2FitLayout(XWFitLayout xwFitLayout) { - int eachRowCount = 4; Component[] components = xwFitLayout.getComponents(); - if (components.length <= 1){ + if (components.length == 0){ xwFitLayout.updateBoundsWidget(); return; } @@ -191,17 +193,17 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr int leftMargin = xwFitLayout.toData().getMargin().getLeft(); int topMargin = xwFitLayout.toData().getMargin().getTop(); xwFitLayout.toData().setCompInterval(0); - int row = (components.length / eachRowCount) + (components.length % eachRowCount == 0 ? 0 : 1); + int row = (components.length / EACH_ROW_COUNT) + (components.length % EACH_ROW_COUNT == 0 ? 0 : 1); //最后一行的列数不定 - int column = components.length % eachRowCount == 0 ? eachRowCount : components.length % eachRowCount; - int componentWidth = layoutWidth / eachRowCount; + int column = components.length % EACH_ROW_COUNT == 0 ? EACH_ROW_COUNT : components.length % EACH_ROW_COUNT; + int componentWidth = layoutWidth / EACH_ROW_COUNT; int componentHeight = layoutHeight / row; for(int i = 0;i < row - 1;i++){ - for(int j = 0;j < eachRowCount;j++){ - components[eachRowCount * i + j].setBounds( + for(int j = 0;j < EACH_ROW_COUNT;j++){ + components[EACH_ROW_COUNT * i + j].setBounds( leftMargin + componentWidth * j, topMargin + componentHeight * i, - j == eachRowCount - 1 ? layoutWidth - componentWidth * (eachRowCount - 1) : componentWidth, + j == EACH_ROW_COUNT - 1 ? layoutWidth - componentWidth * (EACH_ROW_COUNT - 1) : componentWidth, componentHeight ); } @@ -210,7 +212,7 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr int lastRowWidth = layoutWidth / column; int lastRowHeight = layoutHeight - componentHeight * (row - 1); for (int i = 0;i < column;i++) { - components[eachRowCount * (row - 1) + i].setBounds( + components[EACH_ROW_COUNT * (row - 1) + i].setBounds( leftMargin + lastRowWidth * i, topMargin + componentHeight * (row - 1), i == column - 1 ? layoutWidth - lastRowWidth * (column - 1) : lastRowWidth, diff --git a/designer_form/src/com/fr/design/mainframe/EditingMouseListener.java b/designer_form/src/com/fr/design/mainframe/EditingMouseListener.java index f1f61b2b2..88dc9268f 100644 --- a/designer_form/src/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer_form/src/com/fr/design/mainframe/EditingMouseListener.java @@ -11,6 +11,7 @@ import com.fr.design.designer.beans.location.Location; import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.beans.models.StateModel; import com.fr.design.designer.creator.*; +import com.fr.design.designer.creator.cardlayout.XCardSwitchButton; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.xpane.ToolTipEditor; @@ -519,6 +520,10 @@ public class EditingMouseListener extends MouseInputAdapter { public void mouseClicked(MouseEvent e) { XCreator creator = designer.getComponentAt(e); + if (e.getButton() != MouseEvent.BUTTON1 && !creator.acceptType(XCardSwitchButton.class)) { + return; + } + creator = processTopLayoutMouseClick(creator); if(creator != null){ From 4abace6d53aa2a50138f44b20351cc4cb68b33bc Mon Sep 17 00:00:00 2001 From: zhouping Date: Fri, 17 Feb 2017 14:17:25 +0800 Subject: [PATCH 2/8] =?UTF-8?q?REPORT-1814=20=E8=A1=A8=E5=8D=95tab?= =?UTF-8?q?=E5=9D=97=E7=9A=84=E6=94=B9=E8=89=AFbug=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B4=A8=E9=87=8F=EF=BC=8C=E6=8A=BD=E5=87=BA=E7=88=B6=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../creator/cardlayout/TabMoveAction.java | 80 +++++++++++++++++++ .../cardlayout/TabMoveCustomAction.java | 23 +----- .../creator/cardlayout/TabMoveEndAction.java | 64 ++++----------- .../cardlayout/TabMoveFirstAction.java | 61 ++++---------- .../creator/cardlayout/TabMoveNextAction.java | 60 ++++---------- .../creator/cardlayout/TabMovePrevAction.java | 60 ++++---------- 6 files changed, 143 insertions(+), 205 deletions(-) create mode 100644 designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveAction.java diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveAction.java new file mode 100644 index 000000000..354846d91 --- /dev/null +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveAction.java @@ -0,0 +1,80 @@ +package com.fr.design.designer.creator.cardlayout; + +import com.fr.design.designer.beans.actions.FormUndoableAction; +import com.fr.design.mainframe.FormDesigner; +import com.fr.form.ui.CardSwitchButton; +import com.fr.form.ui.container.cardlayout.WTabFitLayout; +import com.fr.general.FRLogger; + +/** + * Created by zhouping on 2017/2/17. + */ +public class TabMoveAction extends FormUndoableAction { + private XCardSwitchButton xCardSwitchButton; + + public TabMoveAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) { + super(t); + this.xCardSwitchButton = xCardSwitchButton; + } + + @Override + public boolean executeActionReturnUndoRecordNeeded() { + XCardSwitchButton xCardSwitchButton = getxCardSwitchButton(); + XWCardTagLayout xwCardTagLayout = xCardSwitchButton.getTagLayout(); + XWCardLayout xwCardLayout = xCardSwitchButton.getCardLayout(); + CardSwitchButton currentButton = (CardSwitchButton) xCardSwitchButton.toData(); + try { + int currentIndex = currentButton.getIndex(); + int maxIndex = xwCardTagLayout.getComponentCount(); + XWTabFitLayout xCurrentTab = (XWTabFitLayout) xwCardLayout.getXCreator(currentIndex); + WTabFitLayout currentTab = (WTabFitLayout) xCurrentTab.toData(); + xwCardTagLayout.setSwitchingTab(true); + + changeTabIndex(xwCardTagLayout, xwCardLayout, currentIndex, maxIndex); + + moveTabAction(xwCardTagLayout, currentButton, xCurrentTab, currentTab); + + xwCardTagLayout.setSwitchingTab(false); + }catch (Exception e){ + xwCardTagLayout.setSwitchingTab(false); + FRLogger.getLogger().error(e.getMessage()); + return false; + } + return true; + } + + private void moveTabAction(XWCardTagLayout xwCardTagLayout, CardSwitchButton currentButton, XWTabFitLayout xCurrentTab, WTabFitLayout currentTab) { + int move2Index = getTabMoveIndex(currentButton); + XWCardLayout xwCardLayout = xCardSwitchButton.getCardLayout(); + xwCardTagLayout.remove(xCardSwitchButton); + xwCardTagLayout.add(xCardSwitchButton, move2Index); + xwCardLayout.remove(xCurrentTab); + xwCardLayout.add(xCurrentTab, move2Index); + currentButton.setIndex(move2Index); + currentTab.setIndex(move2Index); + currentTab.setTabNameIndex(move2Index); + xwCardLayout.toData().setShowIndex(move2Index); + xwCardLayout.showCard(); + } + + //改变Tab的索引号 + protected void changeTabIndex(XWCardTagLayout xwCardTagLayout, XWCardLayout xwCardLayout, int currentIndex, int maxIndex) { + } + + /** + * 获取tab移动的目的索引:首位,末尾,下一个,上一个 + * @param currentButton 当前按钮 + * @return 索引 + */ + protected int getTabMoveIndex(CardSwitchButton currentButton) { + return currentButton.getIndex(); + } + + public XCardSwitchButton getxCardSwitchButton() { + return xCardSwitchButton; + } + + public void setxCardSwitchButton(XCardSwitchButton xCardSwitchButton) { + this.xCardSwitchButton = xCardSwitchButton; + } +} diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveCustomAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveCustomAction.java index 93a62287e..8930c686c 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveCustomAction.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveCustomAction.java @@ -1,32 +1,17 @@ package com.fr.design.designer.creator.cardlayout; -import com.fr.base.BaseUtils; -import com.fr.design.designer.beans.actions.FormUndoableAction; import com.fr.design.mainframe.FormDesigner; +import com.fr.general.IOUtils; /** * Created by zhouping on 2017/2/9. */ -public class TabMoveCustomAction extends FormUndoableAction { - private XCardSwitchButton xCardSwitchButton; +public class TabMoveCustomAction extends TabMoveAction { public TabMoveCustomAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) { - super(t); + super(t, xCardSwitchButton); this.setName(""); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png")); - this.xCardSwitchButton = xCardSwitchButton; + this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/control/refresh.png")); } - @Override - public boolean executeActionReturnUndoRecordNeeded() { - return false; - } - - public XCardSwitchButton getxCardSwitchButton() { - return xCardSwitchButton; - } - - public void setxCardSwitchButton(XCardSwitchButton xCardSwitchButton) { - this.xCardSwitchButton = xCardSwitchButton; - } } diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java index b2a5214c4..5da5dd1c7 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java @@ -1,68 +1,36 @@ package com.fr.design.designer.creator.cardlayout; -import com.fr.base.BaseUtils; -import com.fr.design.designer.beans.actions.FormUndoableAction; import com.fr.design.mainframe.FormDesigner; import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.container.cardlayout.WTabFitLayout; -import com.fr.general.FRLogger; +import com.fr.general.IOUtils; import com.fr.general.Inter; /** * Created by zhouping on 2017/2/9. */ -public class TabMoveEndAction extends FormUndoableAction { - private XCardSwitchButton xCardSwitchButton; +public class TabMoveEndAction extends TabMoveAction { public TabMoveEndAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) { - super(t); + super(t, xCardSwitchButton); this.setName(Inter.getLocText("FR-Designer-Move_Tab_End")); - this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/control/rightright.png")); - this.xCardSwitchButton = xCardSwitchButton; + this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/rightright.png")); } - @Override - public boolean executeActionReturnUndoRecordNeeded() { - XWCardTagLayout xwCardTagLayout = xCardSwitchButton.getTagLayout(); - XWCardLayout xwCardLayout = xCardSwitchButton.getCardLayout(); - CardSwitchButton currentButton = (CardSwitchButton) xCardSwitchButton.toData(); - try { - int currentIndex = currentButton.getIndex(); - int maxIndex = xwCardTagLayout.getComponentCount(); - XWTabFitLayout xCurrentTab = (XWTabFitLayout) xwCardLayout.getXCreator(currentIndex); - WTabFitLayout currentTab = (WTabFitLayout) xCurrentTab.toData(); - xwCardTagLayout.setSwitchingTab(true); - //修改当前tab往后所有tab的索引号 - for (int i = currentIndex + 1; i < maxIndex; i++) { - CardSwitchButton tempBtn = (CardSwitchButton) xwCardTagLayout.getXCreator(i).toData(); - tempBtn.setIndex(i - 1); - WTabFitLayout tempTab = (WTabFitLayout) xwCardLayout.getXCreator(i).toData(); - tempTab.setIndex(i - 1); - tempTab.setTabNameIndex(i - 1); - } - xwCardTagLayout.remove(xCardSwitchButton); - xwCardTagLayout.add(xCardSwitchButton); - xwCardLayout.remove(xCurrentTab); - xwCardLayout.add(xCurrentTab); - currentButton.setIndex(maxIndex - 1); - currentTab.setIndex(maxIndex - 1); - currentTab.setTabNameIndex(maxIndex - 1); - xwCardLayout.toData().setShowIndex(maxIndex - 1); - xwCardLayout.showCard(); - xwCardTagLayout.setSwitchingTab(false); - }catch (Exception e){ - xwCardTagLayout.setSwitchingTab(false); - FRLogger.getLogger().error(e.getMessage()); - return false; + //改变Tab的索引号 + protected void changeTabIndex(XWCardTagLayout xwCardTagLayout, XWCardLayout xwCardLayout, int currentIndex, int maxIndex) { + //修改当前tab往后所有tab的索引号 + for (int i = currentIndex + 1; i < maxIndex; i++) { + CardSwitchButton tempBtn = (CardSwitchButton) xwCardTagLayout.getXCreator(i).toData(); + tempBtn.setIndex(i - 1); + WTabFitLayout tempTab = (WTabFitLayout) xwCardLayout.getXCreator(i).toData(); + tempTab.setIndex(i - 1); + tempTab.setTabNameIndex(i - 1); } - return true; - } - - public XCardSwitchButton getxCardSwitchButton() { - return xCardSwitchButton; } - public void setxCardSwitchButton(XCardSwitchButton xCardSwitchButton) { - this.xCardSwitchButton = xCardSwitchButton; + @Override + protected int getTabMoveIndex(CardSwitchButton btn) { + return getxCardSwitchButton().getTagLayout().getComponentCount() - 1; } } diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java index c9034d04b..26195b946 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java @@ -1,67 +1,36 @@ package com.fr.design.designer.creator.cardlayout; -import com.fr.base.BaseUtils; -import com.fr.design.designer.beans.actions.FormUndoableAction; import com.fr.design.mainframe.FormDesigner; import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.container.cardlayout.WTabFitLayout; -import com.fr.general.FRLogger; +import com.fr.general.IOUtils; import com.fr.general.Inter; /** * Created by zhouping on 2017/2/9. */ -public class TabMoveFirstAction extends FormUndoableAction { - private XCardSwitchButton xCardSwitchButton; +public class TabMoveFirstAction extends TabMoveAction { public TabMoveFirstAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) { - super(t); + super(t, xCardSwitchButton); this.setName(Inter.getLocText("FR-Designer-Move_Tab_First")); - this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/control/leftleft.png")); - this.xCardSwitchButton = xCardSwitchButton; + this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/leftleft.png")); } @Override - public boolean executeActionReturnUndoRecordNeeded() { - XWCardTagLayout xwCardTagLayout = xCardSwitchButton.getTagLayout(); - XWCardLayout xwCardLayout = xCardSwitchButton.getCardLayout(); - CardSwitchButton currentButton = (CardSwitchButton) xCardSwitchButton.toData(); - try { - int currentIndex = currentButton.getIndex(); - XWTabFitLayout xCurrentTab = (XWTabFitLayout) xwCardLayout.getXCreator(currentIndex); - WTabFitLayout currentTab = (WTabFitLayout) xCurrentTab.toData(); - xwCardTagLayout.setSwitchingTab(true); - //修改当前tab往前所有tab的索引号 - for (int i = currentIndex - 1; i >= 0; i--) { - CardSwitchButton tempBtn = (CardSwitchButton) xwCardTagLayout.getXCreator(i).toData(); - tempBtn.setIndex(i + 1); - WTabFitLayout tempTab = (WTabFitLayout) xwCardLayout.getXCreator(i).toData(); - tempTab.setIndex(i + 1); - tempTab.setTabNameIndex(i + 1); - } - xwCardTagLayout.remove(xCardSwitchButton); - xwCardTagLayout.add(xCardSwitchButton, 0); - xwCardLayout.remove(xCurrentTab); - xwCardLayout.add(xCurrentTab, 0); - currentButton.setIndex(0); - currentTab.setIndex(0); - currentTab.setTabNameIndex(0); - xwCardLayout.toData().setShowIndex(0); - xwCardLayout.showCard(); - xwCardTagLayout.setSwitchingTab(false); - }catch (Exception e){ - xwCardTagLayout.setSwitchingTab(false); - FRLogger.getLogger().error(e.getMessage()); - return false; + protected void changeTabIndex(XWCardTagLayout xwCardTagLayout, XWCardLayout xwCardLayout, int currentIndex, int maxIndex) { + //修改当前tab往前所有tab的索引号 + for (int i = currentIndex - 1; i >= 0; i--) { + CardSwitchButton tempBtn = (CardSwitchButton) xwCardTagLayout.getXCreator(i).toData(); + tempBtn.setIndex(i + 1); + WTabFitLayout tempTab = (WTabFitLayout) xwCardLayout.getXCreator(i).toData(); + tempTab.setIndex(i + 1); + tempTab.setTabNameIndex(i + 1); } - return true; } - public XCardSwitchButton getxCardSwitchButton() { - return xCardSwitchButton; - } - - public void setxCardSwitchButton(XCardSwitchButton xCardSwitchButton) { - this.xCardSwitchButton = xCardSwitchButton; + @Override + protected int getTabMoveIndex(CardSwitchButton btn) { + return 0; } } diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java index e7806a7ae..10e796abc 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java @@ -1,66 +1,34 @@ package com.fr.design.designer.creator.cardlayout; -import com.fr.base.BaseUtils; -import com.fr.design.designer.beans.actions.FormUndoableAction; import com.fr.design.mainframe.FormDesigner; import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.container.cardlayout.WTabFitLayout; -import com.fr.general.FRLogger; +import com.fr.general.IOUtils; import com.fr.general.Inter; /** * Created by zhouping on 2017/2/9. */ -public class TabMoveNextAction extends FormUndoableAction { - private XCardSwitchButton xCardSwitchButton; +public class TabMoveNextAction extends TabMoveAction { public TabMoveNextAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) { - super(t); + super(t, xCardSwitchButton); this.setName(Inter.getLocText("FR-Designer-Move_Tab_Next")); - this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/control/right.png")); - this.xCardSwitchButton = xCardSwitchButton; + this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/right.png")); } @Override - public boolean executeActionReturnUndoRecordNeeded() { - XWCardTagLayout xwCardTagLayout = xCardSwitchButton.getTagLayout(); - XWCardLayout xwCardLayout = xCardSwitchButton.getCardLayout(); - CardSwitchButton currentButton = (CardSwitchButton) xCardSwitchButton.toData(); - try { - int currentIndex = currentButton.getIndex(); - XWTabFitLayout xCurrentTab = (XWTabFitLayout) xwCardLayout.getXCreator(currentIndex); - WTabFitLayout currentTab = (WTabFitLayout) xCurrentTab.toData(); - xwCardTagLayout.setSwitchingTab(true); - //修改下一个tab的索引号 - CardSwitchButton nextBtn = (CardSwitchButton) xwCardTagLayout.getXCreator(currentIndex + 1).toData(); - nextBtn.setIndex(currentIndex); - WTabFitLayout nextTab = (WTabFitLayout) xwCardLayout.getXCreator(currentIndex + 1).toData(); - nextTab.setIndex(currentIndex); - nextTab.setTabNameIndex(currentIndex); - - xwCardTagLayout.remove(xCardSwitchButton); - xwCardTagLayout.add(xCardSwitchButton, currentIndex + 1); - xwCardLayout.remove(xCurrentTab); - xwCardLayout.add(xCurrentTab, currentIndex + 1); - currentButton.setIndex(currentIndex + 1); - currentTab.setIndex(currentIndex + 1); - currentTab.setTabNameIndex(currentIndex + 1); - xwCardLayout.toData().setShowIndex(currentIndex + 1); - xwCardLayout.showCard(); - xwCardTagLayout.setSwitchingTab(false); - }catch (Exception e){ - xwCardTagLayout.setSwitchingTab(false); - FRLogger.getLogger().error(e.getMessage()); - return false; - } - return true; - } - - public XCardSwitchButton getxCardSwitchButton() { - return xCardSwitchButton; + protected void changeTabIndex(XWCardTagLayout xwCardTagLayout, XWCardLayout xwCardLayout, int currentIndex, int maxIndex) { + //修改下一个tab的索引号 + CardSwitchButton nextBtn = (CardSwitchButton) xwCardTagLayout.getXCreator(currentIndex + 1).toData(); + nextBtn.setIndex(currentIndex); + WTabFitLayout nextTab = (WTabFitLayout) xwCardLayout.getXCreator(currentIndex + 1).toData(); + nextTab.setIndex(currentIndex); + nextTab.setTabNameIndex(currentIndex); } - public void setxCardSwitchButton(XCardSwitchButton xCardSwitchButton) { - this.xCardSwitchButton = xCardSwitchButton; + @Override + protected int getTabMoveIndex(CardSwitchButton currentButton) { + return currentButton.getIndex() + 1; } } diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java index e92852c6c..859a27eea 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java @@ -1,66 +1,34 @@ package com.fr.design.designer.creator.cardlayout; -import com.fr.base.BaseUtils; -import com.fr.design.designer.beans.actions.FormUndoableAction; import com.fr.design.mainframe.FormDesigner; import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.container.cardlayout.WTabFitLayout; -import com.fr.general.FRLogger; +import com.fr.general.IOUtils; import com.fr.general.Inter; /** * Created by zhouping on 2017/2/9. */ -public class TabMovePrevAction extends FormUndoableAction { - private XCardSwitchButton xCardSwitchButton; +public class TabMovePrevAction extends TabMoveAction { public TabMovePrevAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) { - super(t); + super(t, xCardSwitchButton); this.setName(Inter.getLocText("FR-Designer-Move_Tab_Prev")); - this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/control/left.png")); - this.xCardSwitchButton = xCardSwitchButton; + this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/left.png")); } @Override - public boolean executeActionReturnUndoRecordNeeded() { - XWCardTagLayout xwCardTagLayout = xCardSwitchButton.getTagLayout(); - XWCardLayout xwCardLayout = xCardSwitchButton.getCardLayout(); - CardSwitchButton currentButton = (CardSwitchButton) xCardSwitchButton.toData(); - try { - int currentIndex = currentButton.getIndex(); - XWTabFitLayout xCurrentTab = (XWTabFitLayout) xwCardLayout.getXCreator(currentIndex); - WTabFitLayout currentTab = (WTabFitLayout) xCurrentTab.toData(); - xwCardTagLayout.setSwitchingTab(true); - //修改上一个tab的索引号 - CardSwitchButton prevBtn = (CardSwitchButton) xwCardTagLayout.getXCreator(currentIndex - 1).toData(); - prevBtn.setIndex(currentIndex); - WTabFitLayout prevTab = (WTabFitLayout) xwCardLayout.getXCreator(currentIndex - 1).toData(); - prevTab.setIndex(currentIndex); - prevTab.setTabNameIndex(currentIndex); - - xwCardTagLayout.remove(xCardSwitchButton); - xwCardTagLayout.add(xCardSwitchButton, currentIndex - 1); - xwCardLayout.remove(xCurrentTab); - xwCardLayout.add(xCurrentTab, currentIndex - 1); - currentButton.setIndex(currentIndex - 1); - currentTab.setIndex(currentIndex - 1); - currentTab.setTabNameIndex(currentIndex - 1); - xwCardLayout.toData().setShowIndex(currentIndex - 1); - xwCardLayout.showCard(); - xwCardTagLayout.setSwitchingTab(false); - }catch (Exception e){ - xwCardTagLayout.setSwitchingTab(false); - FRLogger.getLogger().error(e.getMessage()); - return false; - } - return true; - } - - public XCardSwitchButton getxCardSwitchButton() { - return xCardSwitchButton; + protected void changeTabIndex(XWCardTagLayout xwCardTagLayout, XWCardLayout xwCardLayout, int currentIndex, int maxIndex) { + //修改上一个tab的索引号 + CardSwitchButton prevBtn = (CardSwitchButton) xwCardTagLayout.getXCreator(currentIndex - 1).toData(); + prevBtn.setIndex(currentIndex); + WTabFitLayout prevTab = (WTabFitLayout) xwCardLayout.getXCreator(currentIndex - 1).toData(); + prevTab.setIndex(currentIndex); + prevTab.setTabNameIndex(currentIndex); } - public void setxCardSwitchButton(XCardSwitchButton xCardSwitchButton) { - this.xCardSwitchButton = xCardSwitchButton; + @Override + protected int getTabMoveIndex(CardSwitchButton currentButton) { + return currentButton.getIndex() - 1; } } From 5aeaf116985970713264c1c8528632a7dd919606 Mon Sep 17 00:00:00 2001 From: zhouping Date: Fri, 17 Feb 2017 18:01:28 +0800 Subject: [PATCH 3/8] =?UTF-8?q?REPORT-1838=20frm=E9=87=8C=E5=A4=9A?= =?UTF-8?q?=E5=B1=82tab=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=8A=A5=E8=A1=A8=E5=9D=97=E5=A4=A7=E5=B0=8F=E6=9C=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beans/adapters/layout/FRFitLayoutAdapter.java | 6 +++++- .../beans/adapters/layout/FRTabFitLayoutAdapter.java | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java index 25b079caf..d8243a24b 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java @@ -277,6 +277,10 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { super.clearCompsList(); } + protected Rectangle getLayoutBound(XWCardMainBorderLayout mainLayout){ + return mainLayout.getBounds(); + } + private Rectangle adjustBackupBound(Rectangle backupBound, XWCardMainBorderLayout mainLayout) { // 参数界面高度对纵坐标产生的影响 JForm jform = (JForm) (HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); @@ -284,7 +288,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter { backupBound.y -= jform.getFormDesign().getParaHeight(); } - Rectangle rec = mainLayout.getBounds(); + Rectangle rec = getLayoutBound(mainLayout); // XWTabLayout里面的横纵坐标收到外层XWCardMainBorderLayout的横纵坐标影响 // 减掉之后可以按照它原来的逻辑执行 backupBound.x -= rec.x; diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java index 8c67a44ab..bd85fc83b 100644 --- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java +++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRTabFitLayoutAdapter.java @@ -4,13 +4,12 @@ package com.fr.design.designer.beans.adapters.layout; -import java.awt.Rectangle; - import com.fr.design.beans.GroupModel; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWidgetCreator; import com.fr.design.designer.creator.cardlayout.XWCardLayout; +import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.properties.FRTabFitLayoutPropertiesGroupModel; import com.fr.design.utils.ComponentUtils; @@ -18,6 +17,8 @@ import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.general.ComparatorUtils; +import java.awt.*; + /** * tab布局tabFit适配器 * @@ -91,4 +92,8 @@ public class FRTabFitLayoutAdapter extends FRFitLayoutAdapter { } return y; } + + protected Rectangle getLayoutBound(XWCardMainBorderLayout mainLayout){ + return ComponentUtils.getRelativeBounds(mainLayout); + } } \ No newline at end of file From 3b3481f7685cf32f84681902559ae16cbd47c251 Mon Sep 17 00:00:00 2001 From: zhouping Date: Mon, 20 Feb 2017 11:20:01 +0800 Subject: [PATCH 4/8] =?UTF-8?q?REPORT-1814=20=E8=A1=A8=E5=8D=95tab?= =?UTF-8?q?=E5=9D=97=E7=9A=84=E6=94=B9=E8=89=AFbug=20=E5=B5=8C=E5=A5=97?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/cardlayout/XWCardLayout.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java index 7597a4579..8a7db6059 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java @@ -296,8 +296,14 @@ public class XWCardLayout extends XLayoutContainer { * @return 嵌套与否 */ private boolean isNested() { - XLayoutContainer xLayoutContainer = this.getBackupParent().getBackupParent(); - return xLayoutContainer == null || xLayoutContainer.acceptType(XWTabFitLayout.class); + XCreator xCreator = (XCreator)this.getBackupParent().getParent(); + while (xCreator != null) { + if (xCreator.acceptType(XWCardMainBorderLayout.class)) { + return true; + } + xCreator = (XCreator) xCreator.getParent(); + } + return false; } public CRPropertyDescriptor[] getisCarousel() throws IntrospectionException { From 1b93011d988b18c6878a3373e56f4582b83ae2d6 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 20 Feb 2017 14:44:50 +0800 Subject: [PATCH 5/8] =?UTF-8?q?REPORT-1178=20=E8=8B=B1=E6=96=87=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E2=80=94=E2=80=9411/23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/widget/ui/FieldEditorDefinePane.java | 4 ++-- designer_base/src/com/fr/design/locale/designer.properties | 2 +- .../src/com/fr/design/locale/designer_en_US.properties | 2 +- .../src/com/fr/design/locale/designer_ja_JP.properties | 2 +- .../src/com/fr/design/locale/designer_ko_KR.properties | 2 +- .../src/com/fr/design/locale/designer_zh_CN.properties | 2 +- .../src/com/fr/design/locale/designer_zh_TW.properties | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java index 34c355f51..bb3565c82 100644 --- a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java @@ -20,7 +20,7 @@ import com.fr.form.ui.FieldEditor; import com.fr.general.Inter; public abstract class FieldEditorDefinePane extends AbstractDataModify { - private static final int ALLOW_BLANK_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("FR-Designer_Allow_Blank") + 30; + 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; private UICheckBox allowBlankCheckBox; // richer:错误信息,是所有控件共有的属性,所以放到这里来 @@ -39,7 +39,7 @@ public abstract class FieldEditorDefinePane extends Abstr initRegErrorMsgTextField(); //JPanel firstPanel = FRGUIPaneFactory.createBorderLayout_M_Pane(); - allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Blank")); + allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null")); allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT)); allowBlankCheckBox.addItemListener(new ItemListener() { diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index ab71e8be8..4077af520 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -534,7 +534,7 @@ FR-Designer_Mouse_Click_Tips= FR-Designer_About_Version=Version FR-Designer_About_CopyRight=Copy Right FR-Designer_Service_Phone=Service Phone -FR-Designer_Allow_Blank=Allow Blank +FR-Designer_Allow_Null=Allow null FR-Designer_PageSetup_Page=Page FR-Designer_Custom_Job_Description=Description FR-Designer_Property=Property 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 24c7a87c7..ff68a3afc 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 @@ -534,7 +534,7 @@ FR-Designer_Mouse_Click_Tips=The background of the mouse to click the button, in FR-Designer_About_Version=Version FR-Designer_About_CopyRight=Copy Right FR-Designer_Service_Phone=Service Phone -FR-Designer_Allow_Blank=Allow Null +FR-Designer_Allow_Null=Allow null FR-Designer_PageSetup_Page=Page FR-Designer_Custom_Job_Description=Description FR-Designer_Property=Property 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 84559cf36..a780c302c 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 @@ -513,7 +513,7 @@ FR-Designer_Mouse_Click_Tips= FR-Designer_About_Version=\u30D0\u30FC\u30B8\u30E7\u30F3 FR-Designer_About_CopyRight=\u8457\u4F5C\u6A29\u6240\u6709 FR-Designer_Service_Phone=\u30B5\u30FC\u30D3\u30B9\u96FB\u8A71\uFF1A -FR-Designer_Allow_Blank=\u7A7A\u6B04\u3042\u308A +FR-Designer_Allow_Null=\u7A7A\u6B04\u3042\u308A FR-Designer_PageSetup_Page=\u30DA\u30FC\u30B8 FR-Designer_Custom_Job_Description=\u8A18\u8FF0 FR-Designer_Property=\u5C5E\u6027 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 f80d8ab0b..0f18d5ba4 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 @@ -508,7 +508,7 @@ FR-Designer_Mouse_Click_Tips= FR-Designer_About_Version=\uBC84\uC804 FR-Designer_About_CopyRight=\uD310\uAD8C\uC18C\uC720 FR-Designer_Service_Phone=\uC11C\uBE44\uC2A4\uC804\uD654\uFF1A -FR-Designer_Allow_Blank=\uBE48\uCE78\uD5C8\uC6A9 +FR-Designer_Allow_Null=\uBE48\uCE78\uD5C8\uC6A9 FR-Designer_PageSetup_Page=\uC6F9\uD398\uC774\uC9C0 FR-Designer_Custom_Job_Description=\uC124\uBA85 FR-Designer_Property=\uC18D\uC131 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 f448c6f62..2d28fd796 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 @@ -538,7 +538,7 @@ FR-Designer_Mouse_Click_Tips=\u9F20\u6807\u70B9\u51FB\u6309\u94AE\u65F6\u80CC\u6 FR-Designer_About_Version=\u7248\u672C FR-Designer_About_CopyRight=\u7248\u6743\u6240\u6709 FR-Designer_Service_Phone=\u670D\u52A1\u7535\u8BDD\uFF1A -FR-Designer_Allow_Blank=\u5141\u8BB8\u4E3A\u7A7A +FR-Designer_Allow_Null=\u5141\u8BB8\u4E3A\u7A7A FR-Designer_PageSetup_Page=\u9875\u9762 FR-Designer_Custom_Job_Description=\u63CF\u8FF0 FR-Designer_Property=\u5C5E\u6027 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 0b150c205..9312cbadf 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 @@ -526,7 +526,7 @@ FR-Designer_Mouse_Click_Tips= FR-Designer_About_Version=\u7248\u672C FR-Designer_About_CopyRight=\u7248\u6B0A\u6240\u6709 FR-Designer_Service_Phone=\u670D\u52D9\u96FB\u8A71\uFF1A -FR-Designer_Allow_Blank=\u5141\u8A31\u70BA\u7A7A\u767D +FR-Designer_Allow_Null=\u5141\u8A31\u70BA\u7A7A\u767D FR-Designer_PageSetup_Page=\u9801\u9762 FR-Designer_Custom_Job_Description=\u63CF\u8FF0 FR-Designer_Property=\u5C6C\u6027 From 5cd24d91f81d1b6984382605c318d71de3ca3177 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 20 Feb 2017 16:32:52 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=E3=80=82?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DWindows=E4=B8=8B=E5=87=BD=E6=95=B0=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=99=A8=E6=97=A0=E6=B3=95=E6=89=93=E5=BC=80=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/formula/FunctionManagerPane.java | 10 +++++++++- .../src/com/fr/design/locale/designer.properties | 2 +- .../src/com/fr/design/locale/designer_en_US.properties | 2 +- .../src/com/fr/design/locale/designer_ja_JP.properties | 2 +- .../src/com/fr/design/locale/designer_ko_KR.properties | 2 +- .../src/com/fr/design/locale/designer_zh_CN.properties | 2 +- .../src/com/fr/design/locale/designer_zh_TW.properties | 2 +- 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/designer_base/src/com/fr/design/formula/FunctionManagerPane.java b/designer_base/src/com/fr/design/formula/FunctionManagerPane.java index eb75dabe1..844deb959 100644 --- a/designer_base/src/com/fr/design/formula/FunctionManagerPane.java +++ b/designer_base/src/com/fr/design/formula/FunctionManagerPane.java @@ -159,7 +159,11 @@ public class FunctionManagerPane extends BasicPane { descriptionArea.setWrapStyleWord(true); descriptionArea.setLineWrap(true); northPane.add(descriptionArea); - descriptionArea.setText(Inter.getLocText("FR-Designer_Function_Description_Area_Text", File.separator, File.separator, FRContext.getCurrentEnv().getPath() + File.separator)); + + String path1 = getEscapePath(File.separator + "WEB-INF" + File.separator + "classes"); + String path2 = getEscapePath(FRContext.getCurrentEnv().getPath() + File.separator + "classes"); + descriptionArea.setText(Inter.getLocText("FR-Designer_Function_Description_Area_Text", path1, path2)); + JPanel descriptionPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); //Description Pane this.add(descriptionPane, BorderLayout.SOUTH); descriptionPane.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); @@ -167,6 +171,10 @@ public class FunctionManagerPane extends BasicPane { this.descriptionTextArea = new UITextArea(6, 24); descriptionPane.add(new JScrollPane(this.descriptionTextArea), BorderLayout.CENTER); } + + private String getEscapePath(String path) { + return path.replace("\\", "\\\\"); + } private ActionListener createEditorButtonActionListener() { return new ActionListener() { diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 4077af520..feea088a8 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -540,7 +540,7 @@ FR-Designer_Custom_Job_Description=Description FR-Designer_Property=Property FR-Designer_ClassName=Class Name FR-Designer_Polyblock_Edit=Polyblock Edit -FR-Designer_Function_Description_Area_Text=The class must inherit 'com.fr.script.AbstractFunction'. The compiled class should be copied to\nJ2EE server '{R1}WEB-INF{R2}classes' directory.\nAdd the source code(.java file) into the same folder if need.\nExample: {R3}classes} +FR-Designer_Function_Description_Area_Text=The class must inherit 'com.fr.script.AbstractFunction'. The compiled class should be copied to\nJ2EE server '{R1}' directory.\nAdd the source code(.java file) into the same folder if need.\nExample: {R2}} FR-Designer_PageSetup_Horizontal=Horizontal FR-Designer_PageSetup_Vertical=Vertical FR-Designer_Gradient_Direction=Gradient Direction 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 8f5c3549e..c0204008d 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 @@ -540,7 +540,7 @@ FR-Designer_Custom_Job_Description=Description FR-Designer_Property=Property FR-Designer_ClassName=Class Name FR-Designer_Polyblock_Edit=Aggregation block edition -FR-Designer_Function_Description_Area_Text=The class must inherit 'com.fr.script.AbstractFunction'. The compiled class files should be copied to\nJ2EE server '{R1}WEB-INF{R2}classes' directory.\nAdd the source code(.java file) into the same folder if need.\nExample: {R3}classes +FR-Designer_Function_Description_Area_Text=The class must inherit 'com.fr.script.AbstractFunction'. The compiled class files should be copied to\nJ2EE server '{R1}' directory.\nAdd the source code(.java file) into the same folder if need.\nExample: {R2} FR-Designer_PageSetup_Horizontal=Horizontal FR-Designer_PageSetup_Vertical=Vertical FR-Designer_Gradient_Direction=Gradient Direction 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 a780c302c..0ef9ce10c 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 @@ -519,7 +519,7 @@ FR-Designer_Custom_Job_Description=\u8A18\u8FF0 FR-Designer_Property=\u5C5E\u6027 FR-Designer_ClassName=\u985E\u540D FR-Designer_Polyblock_Edit=\u30A2\u30B0\u30EA\u30B2\u30FC\u30B7\u30E7\u30F3\u30D6\u30ED\u30C3\u30AF\u7DE8\u96C6 -FR-Designer_Function_Description_Area_Text=\u3053\u306E\u30AF\u30E9\u30B9\u306F\u7D99\u627F\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"com.fr.script.AbstractFunction"\u3002\u3092\u7D99\u627F\u3059\u3079\u304D\u3067\u3059\u3002\u30B3\u30F3\u30D1\u30A4\u30EB\u5F8C\u306E\u985E\u30D5\u30A1\u30A4\u30EB\u3092\nJ2EE\u30B5\u30FC\u30D0\u30FC "{R1}WEB-INF{R2}classes" \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3002\u306B\u30B3\u30D4\u30FC\u3057\u3066\u3001class\u306B\u5BFE\u5FDC\u3059\u308Bjava\u30D5\u30A1\u30A4\u30EB\u3082\u5F53\u76EE\u6B21\u306B\u7F6E\u3044\u3066\u304F\u3060\u3055\u3044\u3002\n\u4F8B\u3048\u3070\uFF1A{R3}classes +FR-Designer_Function_Description_Area_Text=\u3053\u306E\u30AF\u30E9\u30B9\u306F\u7D99\u627F\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"com.fr.script.AbstractFunction"\u3002\u3092\u7D99\u627F\u3059\u3079\u304D\u3067\u3059\u3002\u30B3\u30F3\u30D1\u30A4\u30EB\u5F8C\u306E\u985E\u30D5\u30A1\u30A4\u30EB\u3092\nJ2EE\u30B5\u30FC\u30D0\u30FC "{R1}" \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3002\u306B\u30B3\u30D4\u30FC\u3057\u3066\u3001class\u306B\u5BFE\u5FDC\u3059\u308Bjava\u30D5\u30A1\u30A4\u30EB\u3082\u5F53\u76EE\u6B21\u306B\u7F6E\u3044\u3066\u304F\u3060\u3055\u3044\u3002\n\u4F8B\u3048\u3070\uFF1A{R2} FR-Designer_PageSetup_Horizontal=\u6A2A\u65B9\u5411 FR-Designer_PageSetup_Vertical=\u7E26\u65B9\u5411 FR-Designer_Gradient_Direction=\u65B9\u5411\u3092\u5F90\u3005\u306B\u5909\u5316 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 0f18d5ba4..5bc3966dc 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 @@ -514,7 +514,7 @@ FR-Designer_Custom_Job_Description=\uC124\uBA85 FR-Designer_Property=\uC18D\uC131 FR-Designer_ClassName=\uD074\uB798\uC2A4\uB124\uC784 FR-Designer_Polyblock_Edit=\uCDE8\uD569\uBE14\uB7ED\uD3B8\uC9D1 -FR-Designer_Function_Description_Area_Text=\uD574\uB2F9\uD074\uB798\uC2A4\uB294\uACC4\uC2B9\uD574\uC57C\uD55C\uB2E4."com.fr.script.AbstractFunction".\uCEF4\uD30C\uC77C\uD6C4\uC758\uD074\uB798\uC2A4\uD30C\uC77C\uC744~\uB85C\uBCF5\uC0AC\nJ2EE\uC11C\uBC84 "{R1}WEB-INF{R2}classes" \uB514\uB809\uD130\uB9AC, \uD544\uC694\uC2DC class \uC0C1\uC751\uD558\uB294 java\uC18C\uC2A4\uD30C\uC77C\uB3C4\uD574\uB2F9\uB514\uB809\uD130\uB9AC\uD558\uB2E8\uC5D0\uB450\uC5B4\uD3B8\uC9D1\uBC0F\uCC3E\uC544\uBCF4\uAE30\uB97C\uD560\uC218\uC788\uC2B5\uB2C8\uB2E4.\n\uC608: {R3}classes +FR-Designer_Function_Description_Area_Text=\uD574\uB2F9\uD074\uB798\uC2A4\uB294\uACC4\uC2B9\uD574\uC57C\uD55C\uB2E4."com.fr.script.AbstractFunction".\uCEF4\uD30C\uC77C\uD6C4\uC758\uD074\uB798\uC2A4\uD30C\uC77C\uC744~\uB85C\uBCF5\uC0AC\nJ2EE\uC11C\uBC84 "{R1}" \uB514\uB809\uD130\uB9AC, \uD544\uC694\uC2DC class \uC0C1\uC751\uD558\uB294 java\uC18C\uC2A4\uD30C\uC77C\uB3C4\uD574\uB2F9\uB514\uB809\uD130\uB9AC\uD558\uB2E8\uC5D0\uB450\uC5B4\uD3B8\uC9D1\uBC0F\uCC3E\uC544\uBCF4\uAE30\uB97C\uD560\uC218\uC788\uC2B5\uB2C8\uB2E4.\n\uC608: {R2} FR-Designer_PageSetup_Horizontal=\uAC00\uB85C FR-Designer_PageSetup_Vertical=\uC138\uB85C FR-Designer_Gradient_Direction=\uADF8\uB77C\uB370\uC774\uC158 \uBC29\uD5A5 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 2d28fd796..669c1ea1f 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 @@ -544,7 +544,7 @@ FR-Designer_Custom_Job_Description=\u63CF\u8FF0 FR-Designer_Property=\u5C5E\u6027 FR-Designer_ClassName=\u7C7B\u540D FR-Designer_Polyblock_Edit=\u805A\u5408\u5757\u7F16\u8F91 -FR-Designer_Function_Description_Area_Text=\u8BE5\u7C7B\u5FC5\u987B\u7EE7\u627F"com.fr.script.AbstractFunction"\u3002\u5E94\u5C06\u7F16\u8BD1\u540E\u7684\u7C7B\u6587\u4EF6\u62F7\u8D1D\u5230\nJ2EE\u670D\u52A1\u5668 "{R1}WEB-INF{R2}classes" \u76EE\u5F55\uFF0C\u5982\u679C\u5FC5\u8981\u7684\u8BDD\u5C06class\u5BF9\u5E94\u7684java\u6E90\u6587\u4EF6\u4E5F\u653E\u7F6E\u5230\u8BE5\u76EE\u5F55\u4E0B\u65B9\u4FBF\u7F16\u8F91\u548C\u67E5\u770B\u3002\n\u4F8B\u5982\uFF1A{R3}classes +FR-Designer_Function_Description_Area_Text=\u8BE5\u7C7B\u5FC5\u987B\u7EE7\u627F"com.fr.script.AbstractFunction"\u3002\u5E94\u5C06\u7F16\u8BD1\u540E\u7684\u7C7B\u6587\u4EF6\u62F7\u8D1D\u5230\nJ2EE\u670D\u52A1\u5668 "{R1}" \u76EE\u5F55\uFF0C\u5982\u679C\u5FC5\u8981\u7684\u8BDD\u5C06class\u5BF9\u5E94\u7684java\u6E90\u6587\u4EF6\u4E5F\u653E\u7F6E\u5230\u8BE5\u76EE\u5F55\u4E0B\u65B9\u4FBF\u7F16\u8F91\u548C\u67E5\u770B\u3002\n\u4F8B\u5982\uFF1A{R2} FR-Designer_PageSetup_Horizontal=\u6A2A\u5411 FR-Designer_PageSetup_Vertical=\u7EB5\u5411 FR-Designer_Gradient_Direction=\u6E10\u53D8\u65B9\u5411 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 9312cbadf..43ca7268d 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 @@ -532,7 +532,7 @@ FR-Designer_Custom_Job_Description=\u63CF\u8FF0 FR-Designer_Property=\u5C6C\u6027 FR-Designer_ClassName=\u985E\u540D FR-Designer_Polyblock_Edit=\u805A\u5408\u584A\u7DE8\u8F2F -FR-Designer_Function_Description_Area_Text=\u8A72\u985E\u5FC5\u9808\u7E7C\u627F"com.fr.script.AbstractFunction"\u3002\u61C9\u5C07\u7DE8\u8B6F\u5F8C\u7684\u985E\u6A94\u6848\u62F7\u8C9D\u5230\nJ2EE\u4F3A\u670D\u5668 "{R1}WEB-INF{R2}classes" \u76EE\u9304\uFF0C\u5982\u679C\u5FC5\u8981\u7684\u8A71\u5C07class\u5C0D\u61C9\u7684java\u539F\u59CB\u6A94\u6848\u4E5F\u653E\u7F6E\u5230\u8A72\u76EE\u9304\u4E0B\u65B9\u4FBF\u7DE8\u8F2F\u548C\u67E5\u770B\u3002\n\u4F8B\u5982\uFF1A{R3}classes +FR-Designer_Function_Description_Area_Text=\u8A72\u985E\u5FC5\u9808\u7E7C\u627F"com.fr.script.AbstractFunction"\u3002\u61C9\u5C07\u7DE8\u8B6F\u5F8C\u7684\u985E\u6A94\u6848\u62F7\u8C9D\u5230\nJ2EE\u4F3A\u670D\u5668 "{R1}" \u76EE\u9304\uFF0C\u5982\u679C\u5FC5\u8981\u7684\u8A71\u5C07class\u5C0D\u61C9\u7684java\u539F\u59CB\u6A94\u6848\u4E5F\u653E\u7F6E\u5230\u8A72\u76EE\u9304\u4E0B\u65B9\u4FBF\u7DE8\u8F2F\u548C\u67E5\u770B\u3002\n\u4F8B\u5982\uFF1A{R2} FR-Designer_PageSetup_Horizontal=\u6A2A\u5411 FR-Designer_PageSetup_Vertical=\u7E31\u5411 FR-Designer_Gradient_Direction=\u6F38\u8B8A\u65B9\u5411 From 941ae3463c9fbb55d8bad845ef79986f9e93c8e4 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 20 Feb 2017 19:32:05 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/formula/FunctionManagerPane.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/design/formula/FunctionManagerPane.java b/designer_base/src/com/fr/design/formula/FunctionManagerPane.java index 844deb959..001bd5626 100644 --- a/designer_base/src/com/fr/design/formula/FunctionManagerPane.java +++ b/designer_base/src/com/fr/design/formula/FunctionManagerPane.java @@ -20,6 +20,7 @@ import com.fr.file.FunctionManagerProvider; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.stable.Nameable; +import com.fr.stable.ProductConstants; import com.fr.stable.project.ProjectConstants; import com.fr.stable.script.FunctionDef; @@ -160,8 +161,8 @@ public class FunctionManagerPane extends BasicPane { descriptionArea.setLineWrap(true); northPane.add(descriptionArea); - String path1 = getEscapePath(File.separator + "WEB-INF" + File.separator + "classes"); - String path2 = getEscapePath(FRContext.getCurrentEnv().getPath() + File.separator + "classes"); + String path1 = getEscapePath(File.separator + ProjectConstants.WEBINF_NAME + File.separator + ProjectConstants.CLASSES_NAME); + String path2 = getEscapePath(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.CLASSES_NAME); descriptionArea.setText(Inter.getLocText("FR-Designer_Function_Description_Area_Text", path1, path2)); JPanel descriptionPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); //Description Pane From ba719cab5edcfb234825a2ba11b119c9b3d3f3ba Mon Sep 17 00:00:00 2001 From: neil Date: Mon, 20 Feb 2017 19:52:21 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C=20?= =?UTF-8?q?designer=E6=89=93=E5=8C=85=E7=94=A81.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_form/build.dev.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_form/build.dev.gradle b/designer_form/build.dev.gradle index 20dc49a33..ae16b033e 100644 --- a/designer_form/build.dev.gradle +++ b/designer_form/build.dev.gradle @@ -4,7 +4,7 @@ tasks.withType(JavaCompile){ options.encoding = 'UTF-8' } //指定构建的jdk版本 -sourceCompatibility=1.8 +sourceCompatibility=1.7 //指定生成的jar包版本 version='8.0'