diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index c0070f71f..bec749760 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -553,4 +553,8 @@ FR-Designer_Auto_Adjust_Size=Auto adjust FR-Designer_Show_As_Download=Display the binary content using download link FR-Designer_File_Name_For_Download=File Name For Download FR-Designer_No=No -FR-Designer_Pagination=Page Break \ No newline at end of file +FR-Designer_Pagination=Page Break +FR-Designer-Move_Tab_First=move to first +FR-Designer-Move_Tab_End=move to end +FR-Designer-Move_Tab_Next=move to next +FR-Designer-Move_Tab_Prev=move to previous 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 8f2bae350..e003b6e42 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 @@ -554,3 +554,7 @@ FR-Designer_Show_As_Download=Display the binary content using download link FR-Designer_File_Name_For_Download=File Name For Download FR-Designer_No=No FR-Designer_Pagination=Page Break +FR-Designer-Move_Tab_First=move to first +FR-Designer-Move_Tab_End=move to end +FR-Designer-Move_Tab_Next=move to next +FR-Designer-Move_Tab_Prev=move to previous 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 1cbfc8e5d..b39bcfca0 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 @@ -533,3 +533,7 @@ FR-Designer_Show_As_Download=\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u30EA\u30F3\u3 FR-Designer_File_Name_For_Download=\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u30D5\u30A1\u30A4\u30EB\u540D FR-Designer_No=\u3044\u3044\u3048 FR-Designer_Pagination=\u30DA\u30FC\u30B8\u30F3\u30B0 +FR-Designer-Move_Tab_First= +FR-Designer-Move_Tab_End= +FR-Designer-Move_Tab_Next= +FR-Designer-Move_Tab_Prev= 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 23afd4037..849d7e6e1 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 @@ -527,4 +527,8 @@ FR-Designer_Auto_Adjust_Size=\uC790\uB3D9\uC870\uC815 FR-Designer_Show_As_Download=\uB2E4\uC6B4\uB85C\uB4DC\uB9C1\uD06C\uB85C2\uC9C4\uBC95\uB0B4\uC6A9\uBCF4\uC774\uAE30 FR-Designer_File_Name_For_Download=\uB2E4\uC6B4\uB85C\uB4DC\uD30C\uC77C\uBA85 FR-Designer_No=\uC544\uB2C8\uC624 -FR-Designer_Pagination=\uD398\uC774\uC9C0\uB098\uB204\uAE30 \ No newline at end of file +FR-Designer_Pagination=\uD398\uC774\uC9C0\uB098\uB204\uAE30 +FR-Designer-Move_Tab_First= +FR-Designer-Move_Tab_End= +FR-Designer-Move_Tab_Next= +FR-Designer-Move_Tab_Prev= 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 e00290c7c..50fdab60c 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 @@ -558,4 +558,8 @@ FR-Designer_Show_As_Download=\u7528\u4E0B\u8F7D\u94FE\u63A5\u663E\u793A\u4E8C\u8 FR-Designer_File_Name_For_Download=\u4E0B\u8F7D\u6587\u4EF6\u540D FR-Designer_No=\u5426 FR-Designer_Pagination=\u5206\u9875 +FR-Designer-Move_Tab_First=\u79FB\u52A8\u5230\u9996\u4F4D +FR-Designer-Move_Tab_End=\u79FB\u52A8\u5230\u672B\u5C3E +FR-Designer-Move_Tab_Next=\u5F80\u540E\u79FB\u52A8 +FR-Designer-Move_Tab_Prev=\u5F80\u524D\u79FB\u52A8 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 011819a9c..c88c665a4 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 @@ -546,3 +546,7 @@ FR-Designer_Show_As_Download=\u7528\u4E0B\u8F09\u93C8\u63A5\u986F\u793A\u4E8C\u9 FR-Designer_File_Name_For_Download=\u4E0B\u8F09\u6A94\u6848\u540D FR-Designer_No=\u5426 FR-Designer_Pagination=\u5206\u9801 +FR-Designer-Move_Tab_First=\u79FB\u52D5\u5230\u9996\u4F4D +FR-Designer-Move_Tab_End=\u79FB\u52D5\u5230\u672B\u5C3E +FR-Designer-Move_Tab_Next=\u5F80\u5F8C\u79FB\u52D5 +FR-Designer-Move_Tab_Prev=\u5F80\u524D\u79FB\u52D5 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 new file mode 100644 index 000000000..93a62287e --- /dev/null +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveCustomAction.java @@ -0,0 +1,32 @@ +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; + +/** + * Created by zhouping on 2017/2/9. + */ +public class TabMoveCustomAction extends FormUndoableAction { + private XCardSwitchButton xCardSwitchButton; + + public TabMoveCustomAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) { + super(t); + this.setName(""); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png")); + this.xCardSwitchButton = xCardSwitchButton; + } + + @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 new file mode 100644 index 000000000..ae101dbe4 --- /dev/null +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java @@ -0,0 +1,66 @@ +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.Inter; + +/** + * Created by zhouping on 2017/2/9. + */ +public class TabMoveEndAction extends FormUndoableAction { + private XCardSwitchButton xCardSwitchButton; + + public TabMoveEndAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) { + super(t); + this.setName(Inter.getLocText("FR-Designer-Move_Tab_End")); + this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/control/rightright.png")); + this.xCardSwitchButton = xCardSwitchButton; + } + + @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); + xwCardTagLayout.setSwitchingTab(false); + }catch (Exception e){ + xwCardTagLayout.setSwitchingTab(false); + FRLogger.getLogger().error(e.getMessage()); + return false; + } + return true; + } + + 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/TabMoveFirstAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java new file mode 100644 index 000000000..0d6047636 --- /dev/null +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java @@ -0,0 +1,65 @@ +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.Inter; + +/** + * Created by zhouping on 2017/2/9. + */ +public class TabMoveFirstAction extends FormUndoableAction { + private XCardSwitchButton xCardSwitchButton; + + public TabMoveFirstAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) { + super(t); + this.setName(Inter.getLocText("FR-Designer-Move_Tab_First")); + this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/control/leftleft.png")); + this.xCardSwitchButton = xCardSwitchButton; + } + + @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); + xwCardTagLayout.setSwitchingTab(false); + }catch (Exception e){ + xwCardTagLayout.setSwitchingTab(false); + FRLogger.getLogger().error(e.getMessage()); + return false; + } + return true; + } + + 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/TabMoveNextAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java new file mode 100644 index 000000000..15bfa7337 --- /dev/null +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java @@ -0,0 +1,64 @@ +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.Inter; + +/** + * Created by zhouping on 2017/2/9. + */ +public class TabMoveNextAction extends FormUndoableAction { + private XCardSwitchButton xCardSwitchButton; + + public TabMoveNextAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) { + super(t); + this.setName(Inter.getLocText("FR-Designer-Move_Tab_Next")); + this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/control/right.png")); + this.xCardSwitchButton = xCardSwitchButton; + } + + @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); + xwCardTagLayout.setSwitchingTab(false); + }catch (Exception e){ + xwCardTagLayout.setSwitchingTab(false); + FRLogger.getLogger().error(e.getMessage()); + return false; + } + return true; + } + + 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/TabMovePrevAction.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java new file mode 100644 index 000000000..cac70db82 --- /dev/null +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java @@ -0,0 +1,64 @@ +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.Inter; + +/** + * Created by zhouping on 2017/2/9. + */ +public class TabMovePrevAction extends FormUndoableAction { + private XCardSwitchButton xCardSwitchButton; + + public TabMovePrevAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) { + super(t); + this.setName(Inter.getLocText("FR-Designer-Move_Tab_Prev")); + this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/control/left.png")); + this.xCardSwitchButton = xCardSwitchButton; + } + + @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); + xwCardTagLayout.setSwitchingTab(false); + }catch (Exception e){ + xwCardTagLayout.setSwitchingTab(false); + FRLogger.getLogger().error(e.getMessage()); + return false; + } + return true; + } + + 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/XCardAddButton.java b/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardAddButton.java index fa4c1d4a9..85e26e877 100644 --- a/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardAddButton.java +++ b/designer_form/src/com/fr/design/designer/creator/cardlayout/XCardAddButton.java @@ -89,12 +89,12 @@ public class XCardAddButton extends XButton{ // addbutton对应的XWCardLayout和XWCardTagLayout暂未存入到xml中,重新打开之后先根据父子层获取 if(cardLayout == null && tagLayout ==null ){ - initRalateLayout(); + initRelateLayout(); } int index = cardLayout.toData().getWidgetCount(); //添加新的tab,并将原来的设为未选中状态 - setTabUnselectd(); + setTabUnselected(); addTab(index); this.tagLayout.adjustComponentWidth(); @@ -110,7 +110,7 @@ public class XCardAddButton extends XButton{ LayoutUtils.layoutRootContainer(designer.getRootComponent()); } - private void initRalateLayout(){ + private void initRelateLayout(){ XWCardTitleLayout titleLayout = (XWCardTitleLayout)this.getBackupParent(); this.tagLayout = titleLayout.getTagPart(); @@ -129,7 +129,7 @@ public class XCardAddButton extends XButton{ } //将原来的tab页设置为未选中状态 - private void setTabUnselectd(){ + private void setTabUnselected(){ for(int i=0;i minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { - if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { - designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - } - } - xElementCase.setHelpBtnOnFocus(false); - if (xElementCase.getCoverPane().getComponentCount() > 1) { - JComponent button1 = (JComponent) xElementCase.getCoverPane().getComponent(1); - int minX1 = button1.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue(); - int minY1 = button1.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue(); - if (e.getX() + GAP - xElementCase.getInsets().left > minX1 && e.getX() - GAP - xElementCase.getInsets().left < minX1 + button1.getWidth()) { - if (e.getY() + GAP - xElementCase.getInsets().top > minY1 && e.getY() - GAP - xElementCase.getInsets().top < minY1 + button1.getHeight()) { - designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - xElementCase.setHelpBtnOnFocus(true); - } - } - } - xElementCase.displayCoverPane(true); - xElementCase.setDirections(Direction.TOP_BOTTOM_LEFT_RIGHT); - + elementCaseMouseMoved(e, component); designer.repaint(); return; } @@ -322,6 +299,35 @@ public class EditingMouseListener extends MouseInputAdapter { designer.repaint(); } + private void elementCaseMouseMoved(MouseEvent e, XCreator component) { + xElementCase = (XElementCase)component; + UIButton button = (UIButton)xElementCase.getCoverPane().getComponent(0); + if(designer.getCursor().getType() == Cursor.HAND_CURSOR) { + designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } // component.getParent() 是报表块所在的XWTitleLayout + int minX = button.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue(); + if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { + if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { + designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + } + } + xElementCase.setHelpBtnOnFocus(false); + if (xElementCase.getCoverPane().getComponentCount() > 1) { + JComponent button1 = (JComponent) xElementCase.getCoverPane().getComponent(1); + int minX1 = button1.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue(); + int minY1 = button1.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue(); + if (e.getX() + GAP - xElementCase.getInsets().left > minX1 && e.getX() - GAP - xElementCase.getInsets().left < minX1 + button1.getWidth()) { + if (e.getY() + GAP - xElementCase.getInsets().top > minY1 && e.getY() - GAP - xElementCase.getInsets().top < minY1 + button1.getHeight()) { + designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + xElementCase.setHelpBtnOnFocus(true); + } + } + } + xElementCase.displayCoverPane(true); + xElementCase.setDirections(Direction.TOP_BOTTOM_LEFT_RIGHT); + } + private void setCoverPaneNotDisplay(MouseEvent e, boolean isLinkedHelpDialog) { if (xElementCase != null) { int x = getParentPositionX(xElementCase, 0) - designer.getArea().getHorizontalValue(); @@ -511,9 +517,6 @@ public class EditingMouseListener extends MouseInputAdapter { * @param e 鼠标事件 */ public void mouseClicked(MouseEvent e) { - if (e.getButton() != MouseEvent.BUTTON1) { - return; - } XCreator creator = designer.getComponentAt(e); creator = processTopLayoutMouseClick(creator);