From 4a78e4b8bb23696f34385d9f7da0726495b0af16 Mon Sep 17 00:00:00 2001 From: Fangjie Hu Date: Wed, 23 Nov 2016 09:34:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E4=B8=AD=E7=9A=84=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/ChartTypeButtonPane.java | 55 +++++++++---------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 6c48772b06..2d96eca315 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -62,20 +62,20 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen private boolean pressOtherButtonWhenEditing = false; -// private AWTEventListener awt = new AWTEventListener() { -// public void eventDispatched(AWTEvent event) { -// //没有进行鼠标点击,则返回 -// if (event instanceof MouseEvent && ((MouseEvent) event).getClickCount() > 0) { -// if (currentEditingEditor != null && !ComparatorUtils.equals(event.getSource(), currentEditingEditor)) { -// stopEditing(); -// if (event.getSource() instanceof ChartChangeButton) { -// ((ChartChangeButton) event.getSource()).mouseClick((MouseEvent) event); -// } -// populateBean(editingCollection); -// } -// } -// } -// }; + /*private AWTEventListener awt = new AWTEventListener() { + public void eventDispatched(AWTEvent event) { + //没有进行鼠标点击,则返回 + if (event instanceof MouseEvent && ((MouseEvent) event).getClickCount() > 0) { + if (currentEditingEditor != null && !ComparatorUtils.equals(event.getSource(), currentEditingEditor)) { + stopEditing(); + if (event.getSource() instanceof ChartChangeButton) { + ((ChartChangeButton) event.getSource()).mouseClick((MouseEvent) event); + } + populateBean(editingCollection); + } + } + } + };*/ public ChartTypeButtonPane(ChartTypePane chartTypePane){ this(); @@ -440,26 +440,23 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen } private void deleteAButton() { - if (indexList.contains(this) && indexList.size() > 1) { - indexList.remove(this); + //先重构属性,在重构面板,否则面板在重构过程中,会重新将属性中的切换图表加到indexList中,导致面板无法删除 + if (editingCollection != null) { + int count = editingCollection.getChartCount(); + for (int i = 0; i < count; i++) { + if (ComparatorUtils.equals(getButtonName(), editingCollection.getChartName(i))) { + editingCollection.removeNameObject(i); + break; + } + } + } + indexList.remove(this); + if (indexList.contains(this) && indexList.size() > 1) { if (this.isSelected()) { indexList.get(0).setSelected(true); changeCollectionSelected(indexList.get(0).getButtonName()); } - - if (editingCollection != null) { - int count = editingCollection.getChartCount(); - for (int i = 0; i < count; i++) { - if (ComparatorUtils.equals(getButtonName(), editingCollection.getChartName(i))) { - editingCollection.removeNameObject(i); - if (i <= editingCollection.getSelectedIndex()){ - editingCollection.setSelectedIndex(editingCollection.getSelectedIndex()-1); - } - break; - } - } - } } //获取图表收集器的状态