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

Method mousePressed

src/org/opensourcephysics/tools/EjsTool.java:509–524  ·  view source on GitHub ↗
(java.awt.event.MouseEvent evt)

Source from the content-addressed store, hash-verified

507 final JDialog dialog = new JDialog();
508 java.awt.event.MouseAdapter mouseListener = new java.awt.event.MouseAdapter() {
509 @Override
510 public void mousePressed(java.awt.event.MouseEvent evt) {
511 AbstractButton button = (AbstractButton) (evt.getSource());
512 String aCmd = button.getActionCommand();
513 if (aCmd.equals("ok")) { //$NON-NLS-1$
514 returnValue.value = true;
515 dialog.setVisible(false);
516 } else if (aCmd.equals("cancel")) { //$NON-NLS-1$
517 returnValue.value = false;
518 dialog.setVisible(false);
519 } else if (aCmd.equals("selectall")) { //$NON-NLS-1$
520 list.setSelectionInterval(0, listModel.getSize() - 1);
521 } else if (aCmd.equals("selectnone")) { //$NON-NLS-1$
522 list.removeSelectionInterval(0, listModel.getSize() - 1);
523 }
524 }
525
526 };
527 JButton okButton = new JButton(DisplayRes.getString("GUIUtils.Ok")); //$NON-NLS-1$

Callers

nothing calls this directly

Calls 7

getSourceMethod · 0.80
setSelectionIntervalMethod · 0.80
getActionCommandMethod · 0.65
equalsMethod · 0.65
setVisibleMethod · 0.65
getSizeMethod · 0.65

Tested by

no test coverage detected