MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / propertyChange

Method propertyChange

src/javajs/async/AsyncDialog.java:231–250  ·  view source on GitHub ↗

Switch from property change to action.

(PropertyChangeEvent evt)

Source from the content-addressed store, hash-verified

229 *
230 */
231 @Override
232 public void propertyChange(PropertyChangeEvent evt) {
233 value = evt.getNewValue();
234 switch (evt.getPropertyName()) {
235 case "inputValue":
236 process(value);
237 break;
238 case "value":
239 if (value != null && options == null && !(value instanceof Integer)) {
240 process(getOptionIndex(((JOptionPane) evt.getSource()).getOptions(), value));
241 return;
242 }
243 if (options != null) {
244 int i = getOptionIndex(options, value);
245 value = Integer.valueOf(i >= 0 ? i : JOptionPane.CLOSED_OPTION);
246 }
247 process(value);
248 break;
249 }
250 }
251
252 private int getOptionIndex(Object[] options, Object val) {
253 if (options != null)

Callers

nothing calls this directly

Calls 4

processMethod · 0.95
getOptionIndexMethod · 0.95
getSourceMethod · 0.80
getPropertyNameMethod · 0.65

Tested by

no test coverage detected