summaryrefslogtreecommitdiffstats
path: root/scilab
diff options
context:
space:
mode:
authorStéphane MOTTELET <stephane.mottelet@utc.fr>2021-04-21 14:56:27 +0200
committerClément David <clement.david@esi-group.com>2021-04-28 08:40:26 +0200
commit1c7afa75c642b22f896f7c3373485b79a181e591 (patch)
tree0380a961b7a66d8faa1f0060eaa1394899e4818a /scilab
parentf5b48580f7950b38c8e822d6ee9e8a8b91ab3c3b (diff)
downloadscilab-1c7afa75c642b22f896f7c3373485b79a181e591.zip
scilab-1c7afa75c642b22f896f7c3373485b79a181e591.tar.gz
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
Diffstat (limited to 'scilab')
-rw-r--r--scilab/CHANGES.md1
-rw-r--r--scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/listbox/SwingScilabListBox.java12
2 files changed, 1 insertions, 12 deletions
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
227* `gamma` is extended to incomplete gamma integrals. 227* `gamma` is extended to incomplete gamma integrals.
228* `close` is extended to close the help browser, xcos, or the variables browser or editor GUIs. 228* `close` is extended to close the help browser, xcos, or the variables browser or editor GUIs.
229* `polyint` is introduced to compute polynomial antiderivatives. 229* `polyint` is introduced to compute polynomial antiderivatives.
230* 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.
231* `det` is now actually extended to sparse matrices. 230* `det` is now actually extended to sparse matrices.
232* `deff` is upgraded: 231* `deff` is upgraded:
233 - The created function may be returned as output argument. 232 - 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;
31import java.awt.event.AdjustmentEvent; 31import java.awt.event.AdjustmentEvent;
32import java.awt.event.AdjustmentListener; 32import java.awt.event.AdjustmentListener;
33import java.io.IOException; 33import java.io.IOException;
34import java.awt.event.MouseAdapter;
35import java.awt.event.MouseEvent;
36 34
37import javax.swing.DefaultListModel; 35import javax.swing.DefaultListModel;
38import javax.swing.Icon; 36import javax.swing.Icon;
@@ -142,21 +140,13 @@ public class SwingScilabListBox extends JScrollPane implements SwingViewObject,
142 } 140 }
143 141
144 GraphicController.getController().setProperty(uid, __GO_UI_VALUE__, scilabIndices); 142 GraphicController.getController().setProperty(uid, __GO_UI_VALUE__, scilabIndices);
145 if (callback != null && getList().getSelectionMode() == ListSelectionModel.MULTIPLE_INTERVAL_SELECTION) { 143 if (callback != null) {
146 callback.actionPerformed(null); 144 callback.actionPerformed(null);
147 } 145 }
148 } 146 }
149 }; 147 };
150 getList().addListSelectionListener(listListener); 148 getList().addListSelectionListener(listListener);
151 149
152 getList().addMouseListener(new MouseAdapter() {
153 public void mouseReleased(MouseEvent evt) {
154 if (callback != null && getList().getSelectionMode() == ListSelectionModel.SINGLE_SELECTION) {
155 callback.actionPerformed(null);
156 }
157 }
158 });
159
160 adjustmentListener = new AdjustmentListener() { 150 adjustmentListener = new AdjustmentListener() {
161 public void adjustmentValueChanged(AdjustmentEvent arg0) { 151 public void adjustmentValueChanged(AdjustmentEvent arg0) {
162 int listboxtopValue = getList().getUI().locationToIndex(getList(), getViewport().getViewPosition()) + 1; 152 int listboxtopValue = getList().getUI().locationToIndex(getList(), getViewport().getViewPosition()) + 1;