From: Stéphane MOTTELET Date: Wed, 21 Apr 2021 12:56:27 +0000 (+0200) Subject: Revert "* Bug 16633: now Listbox callback can be triggered by item click" X-Git-Tag: 6.1.1~56 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=1c7afa75c642b22f896f7c3373485b79a181e591 Revert "* Bug 16633: now Listbox callback can be triggered by item click" There are redundant callbacks, which are unavoidable. This reverts commit bea89839ef0b59f42eb320f5da8f45c6a97435ef. Change-Id: I5bc1d93407c6f382d2c686df4df462355c5b19c0 --- diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md index babde46..13058a9 100644 --- a/scilab/CHANGES.md +++ b/scilab/CHANGES.md @@ -227,7 +227,6 @@ Feature changes and additions on 6.1.1 * `gamma` is extended to incomplete gamma integrals. * `close` is extended to close the help browser, xcos, or the variables browser or editor GUIs. * `polyint` is introduced to compute polynomial antiderivatives. -* Listbox uicontrol callback is now triggered by item click in single selection mode. For example, it allows successive execution of a demo in the demonstrations gui. * `det` is now actually extended to sparse matrices. * `deff` is upgraded: - The created function may be returned as output argument. diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/listbox/SwingScilabListBox.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/listbox/SwingScilabListBox.java index 4de22e7..e62cc01 100644 --- a/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/listbox/SwingScilabListBox.java +++ b/scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/listbox/SwingScilabListBox.java @@ -31,8 +31,6 @@ import java.awt.Font; import java.awt.event.AdjustmentEvent; import java.awt.event.AdjustmentListener; import java.io.IOException; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; import javax.swing.DefaultListModel; import javax.swing.Icon; @@ -142,21 +140,13 @@ public class SwingScilabListBox extends JScrollPane implements SwingViewObject, } GraphicController.getController().setProperty(uid, __GO_UI_VALUE__, scilabIndices); - if (callback != null && getList().getSelectionMode() == ListSelectionModel.MULTIPLE_INTERVAL_SELECTION) { + if (callback != null) { callback.actionPerformed(null); } } }; getList().addListSelectionListener(listListener); - getList().addMouseListener(new MouseAdapter() { - public void mouseReleased(MouseEvent evt) { - if (callback != null && getList().getSelectionMode() == ListSelectionModel.SINGLE_SELECTION) { - callback.actionPerformed(null); - } - } - }); - adjustmentListener = new AdjustmentListener() { public void adjustmentValueChanged(AdjustmentEvent arg0) { int listboxtopValue = getList().getUI().locationToIndex(getList(), getViewport().getViewPosition()) + 1;