(MouseEvent e, boolean pressed)
| 380 | } |
| 381 | |
| 382 | void mouse(MouseEvent e, boolean pressed) { |
| 383 | // button three is used for popup menu |
| 384 | if(e.getButton()==MouseEvent.BUTTON3) { |
| 385 | return; |
| 386 | } |
| 387 | double x = drawingPanel.pixToX(e.getX()); |
| 388 | double y = drawingPanel.pixToY(e.getY()); |
| 389 | int i = indexFromPoint(x, y); |
| 390 | if(i==-1) { |
| 391 | return; |
| 392 | } |
| 393 | if(pressed) { |
| 394 | dragV = editValues[0]; |
| 395 | int len = editValues.length; |
| 396 | for(int j = 0; j<len; j++) { |
| 397 | if(getAtIndex(i)==editValues[j]) { |
| 398 | dragV = editValues[(j+1)%len]; |
| 399 | } |
| 400 | } |
| 401 | } |
| 402 | if(getAtIndex(i)!=dragV) { |
| 403 | setAtIndex(i, dragV); |
| 404 | drawingPanel.render(); |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | /** |
| 409 | * Gets the x coordinate for the given index. |
no test coverage detected