From b7343f7b9927e900060ba02a0935c17970141686 Mon Sep 17 00:00:00 2001 From: frharry Date: Fri, 10 Mar 2017 17:07:40 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-1344=20=E8=A1=A8=E5=8D=95=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E7=BF=BB=E9=A1=B5=E6=94=B9=E8=BF=9B=E5=B9=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B1=80=E9=83=A8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/FormToolBarButton.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java b/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java index 0e08197d37..a9651c7fa8 100644 --- a/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java +++ b/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java @@ -99,12 +99,14 @@ public class FormToolBarButton extends JButton implements MouseListener { * @param e 鼠标点击事件 */ public void mouseClicked(MouseEvent e) { + //该button只在报表块工具栏中使用, + //parent只有FormToolBarPane一种,故可以直接强转 + final FormToolBarPane toolBarPane = (FormToolBarPane) this.getParent(); if (BaseUtils.isAuthorityEditing()) { auhtorityMouseAction(); return; } if (e.getClickCount() >= 2) { - final FormToolBarPane toolBarPane = (FormToolBarPane) this.getParent(); final FormEditToolBar editToolBar = new FormEditToolBar(); editToolBar.populate(toolBarPane.getFToolBar(), this); BasicDialog dialog = editToolBar.showWindow(DesignerContext.getDesignerFrame()); @@ -119,11 +121,9 @@ public class FormToolBarButton extends JButton implements MouseListener { private void auhtorityMouseAction() { - if (this.getParent() instanceof FormToolBarPane && this.isEnabled()) { + if (this.isEnabled()) { this.setSelected(!this.isSelected()); - } - } /**