Changeset 147:777ab2eb85c2
- Timestamp:
- 08/08/2008 12:22:12 AM
(4 months ago)
- Author:
- marc@e0.local
- branch:
- default
- Message:
misc small UI fixes from Boston / Hyposurface visit
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r140 |
r147 |
|
| 96 | 96 | // to |
|---|
| 97 | 97 | // guess |
|---|
| 98 | | // what |
|---|
| | 98 | // whatq |
|---|
| 99 | 99 | // kind |
|---|
| 100 | 100 | // of |
|---|
| r126 |
r147 |
|
| 39 | 39 | { |
|---|
| 40 | 40 | super(fireOn, inside, control); |
|---|
| 41 | | this.oy = oy; |
|---|
| 42 | | this.ox = ox; |
|---|
| | 41 | // this.oy = oy; |
|---|
| | 42 | // this.ox = ox; |
|---|
| 43 | 43 | Rect oldParentFrame = inside.getFrame(null); |
|---|
| 44 | 44 | Rect oldFrame = control.getFrame(null); |
|---|
| … | … | |
| 46 | 46 | this.height = (float) oldFrame.h; |
|---|
| 47 | 47 | |
|---|
| 48 | | this.x = (float) ((oldFrame.x-oldParentFrame.x)/oldParentFrame.w); |
|---|
| 49 | | this.y = (float) ((oldFrame.y-oldParentFrame.y)/oldParentFrame.h); |
|---|
| 50 | | |
|---|
| 51 | | Rect newFrame = new Rect(oldParentFrame.x + x * oldParentFrame.w - ox, oldParentFrame.y + y * oldParentFrame.h - oy, width, height); |
|---|
| | 48 | // this.x = (float) ((oldFrame.x-oldParentFrame.x)/oldParentFrame.w); |
|---|
| | 49 | // this.y = (float) ((oldFrame.y-oldParentFrame.y)/oldParentFrame.h); |
|---|
| | 50 | |
|---|
| | 51 | this.x = 1; |
|---|
| | 52 | this.y = 0; |
|---|
| | 53 | this.ox = -(float) (-ox+oldFrame.x-oldParentFrame.x-oldParentFrame.w); |
|---|
| | 54 | this.oy = -(float) (-oy+oldFrame.y-oldParentFrame.y); |
|---|
| | 55 | |
|---|
| | 56 | Rect newFrame = new Rect(5+oldParentFrame.x + x * oldParentFrame.w - ox, oldParentFrame.y + y * oldParentFrame.h - oy, width, height); |
|---|
| 52 | 57 | new iVisualElementOverrides.MakeDispatchProxy().getOverrideProxyFor(control).shouldChangeFrame(control, newFrame, oldFrame, true); |
|---|
| 53 | 58 | } |
|---|
| r145 |
r147 |
|
| 130 | 130 | if (e == null) |
|---|
| 131 | 131 | return; |
|---|
| | 132 | if (e.equals("")) |
|---|
| | 133 | return; |
|---|
| 132 | 134 | |
|---|
| 133 | 135 | Ref<PythonScriptingSystem> refPss = new Ref<PythonScriptingSystem>(null); |
|---|
| … | … | |
| 987 | 989 | @Override |
|---|
| 988 | 990 | public VisitCode shouldChangeFrame(iVisualElement source, Rect newFrame, Rect oldFrame, boolean now) { |
|---|
| | 991 | |
|---|
| | 992 | |
|---|
| 989 | 993 | if (source == forElement) { |
|---|
| | 994 | System.out.println(" should change frame from <"+oldFrame+" -> "+newFrame+">"); |
|---|
| 990 | 995 | new VisualElementProperty<Rect>("oldFrame_").set(source, source, oldFrame); |
|---|
| 991 | 996 | } |
|---|
| r145 |
r147 |
|
| 35 | 35 | import field.math.linalg.Vector2; |
|---|
| 36 | 36 | import field.math.linalg.Vector4; |
|---|
| | 37 | import field.math.util.HungarianConvience2; |
|---|
| 37 | 38 | import field.namespace.generic.Generics.Triple; |
|---|
| 38 | | import field.util.HungarianConvience2; |
|---|
| 39 | 39 | |
|---|
| 40 | 40 | /** |
|---|
| r146 |
r147 |
|
| 205 | 205 | // a |
|---|
| 206 | 206 | // mouse |
|---|
| 207 | | // event! |
|---|
| | 207 | // event |
|---|
| | 208 | // ! |
|---|
| 208 | 209 | final MouseEvent me = new MouseEvent(arg0.getComponent(), MouseEvent.MOUSE_CLICKED, arg0.getWhen(), arg0.getModifiers(), (int) currentWindow.currentMouse.x, (int) currentWindow.currentMouse.y, 1, false); |
|---|
| 209 | 210 | |
|---|
| … | … | |
| 751 | 752 | }; |
|---|
| 752 | 753 | |
|---|
| 753 | | frame.addFocusListener(new FocusListener() { |
|---|
| 754 | | |
|---|
| 755 | | public void focusGained(FocusEvent e) { |
|---|
| 756 | | System.out.println(" frame has focus, requesting that the canvas gets some focus"); |
|---|
| 757 | | canvas.requestFocus(); |
|---|
| 758 | | } |
|---|
| 759 | | |
|---|
| 760 | | public void focusLost(FocusEvent e) { |
|---|
| 761 | | } |
|---|
| 762 | | }); |
|---|
| 763 | | |
|---|
| 764 | 754 | canvas.setAutoSwapBufferMode(false); |
|---|
| 765 | 755 | |
|---|
| … | … | |
| 1141 | 1131 | |
|---|
| 1142 | 1132 | public void transformMouseEvent(MouseEvent arg0) { |
|---|
| | 1133 | |
|---|
| 1143 | 1134 | Vector2 at = floatResMouseEvents.get(arg0); |
|---|
| 1144 | 1135 | if (at == null) { |
|---|
| … | … | |
| 1153 | 1144 | ReflectionTools.illegalSetObject(arg0, "y", Math.round(at.y * sy + ty)); |
|---|
| 1154 | 1145 | |
|---|
| 1155 | | floatResMouseEvents.put(arg0, new Vector2(at.x * sx + tx, at.y * sy + ty)); |
|---|
| | 1146 | Vector2 a = new Vector2(at.x * sx + tx, at.y * sy + ty); |
|---|
| | 1147 | |
|---|
| | 1148 | floatResMouseEvents.put(arg0, a); |
|---|
| 1156 | 1149 | } |
|---|
| 1157 | 1150 | |
|---|
| … | … | |
| 1185 | 1178 | |
|---|
| 1186 | 1179 | public void untransformMouseEvent(MouseEvent arg0) { |
|---|
| | 1180 | |
|---|
| 1187 | 1181 | Vector2 at = floatResMouseEvents.get(arg0); |
|---|
| 1188 | 1182 | if (at == null) { |
|---|
| … | … | |
| 1252 | 1246 | gl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA); |
|---|
| 1253 | 1247 | |
|---|
| 1254 | | // iVisualElementOverrides.MakeDispatchProxy.dispatchForwardCount |
|---|
| | 1248 | // iVisualElementOverrides.MakeDispatchProxy. |
|---|
| | 1249 | // dispatchForwardCount |
|---|
| 1255 | 1250 | // = 0; |
|---|
| 1256 | | // iVisualElementOverrides.MakeDispatchProxy.dispatchBackwardCount |
|---|
| | 1251 | // iVisualElementOverrides.MakeDispatchProxy. |
|---|
| | 1252 | // dispatchBackwardCount |
|---|
| 1257 | 1253 | // = 0; |
|---|
| 1258 | 1254 | |
|---|
| … | … | |
| 1290 | 1286 | |
|---|
| 1291 | 1287 | // masterProgram = |
|---|
| 1292 | | // (BasicCGProgram.fromFile("content/shaders/glComponentWindow_master.cg", |
|---|
| | 1288 | // (BasicCGProgram.fromFile( |
|---|
| | 1289 | // "content/shaders/glComponentWindow_master.cg" |
|---|
| | 1290 | // , |
|---|
| 1293 | 1291 | // false)); |
|---|
| 1294 | 1292 | masterProgram = new BasicGLSLangProgram("content/shaders/glComponentVertex.glslang", "content/shaders/glComponentGLSLangFragment.glslang"); |
|---|
| r140 |
r147 |
|
| 176 | 176 | arg0.consume(); |
|---|
| 177 | 177 | |
|---|
| | 178 | System.out.println(" computing currentResize :"+arg0.getX()+" "+arg0.getY()+" (( "+bounds+" ))"); |
|---|
| | 179 | |
|---|
| 178 | 180 | currentResize.clear(); |
|---|
| 179 | 181 | if (arg0.getX() - getX() < zone) |
|---|
| … | … | |
| 488 | 490 | } |
|---|
| 489 | 491 | } else { |
|---|
| | 492 | |
|---|
| 490 | 493 | |
|---|
| 491 | 494 | dragger.mousePressed(arg0); |
|---|
| … | … | |
| 500 | 503 | d.deselectAll(); |
|---|
| 501 | 504 | } |
|---|
| 502 | | System.out.println(" adding to selection"); |
|---|
| 503 | 505 | for (SelectionGroup<iComponent> d : getSelectionGroups()) |
|---|
| 504 | 506 | d.addToSelection(DraggableComponent.this); |
|---|
| r86 |
r147 |
|
| 177 | 177 | this.dirty = true; |
|---|
| 178 | 178 | if (getInside() != null) getInside().requestRedisplay(); |
|---|
| | 179 | |
|---|
| | 180 | for (SelectionGroup g : getMarkingGroups()) { |
|---|
| | 181 | g.register(this); |
|---|
| | 182 | if (marked) |
|---|
| | 183 | g.addToSelection(this); |
|---|
| | 184 | } |
|---|
| | 185 | |
|---|
| 179 | 186 | } |
|---|
| 180 | 187 | |
|---|
| r85 |
r147 |
|
| 86 | 86 | public void mouseDragged(MouseEvent arg0) { |
|---|
| 87 | 87 | |
|---|
| 88 | | float lx = RootComponent.this.getX(); |
|---|
| 89 | | float ly = RootComponent.this.getY(); |
|---|
| 90 | | |
|---|
| 91 | | GLComponentWindow.getCurrentWindow(RootComponent.this).untransformMouseEvent(arg0); |
|---|
| | 88 | float lx = RootComponent.this.getX(); |
|---|
| | 89 | float ly = RootComponent.this.getY(); |
|---|
| | 90 | |
|---|
| | 91 | //GLComponentWindow.getCurrentWindow(RootComponent.this).untransformMouseEvent(arg0); |
|---|
| 92 | 92 | |
|---|
| 93 | 93 | Vector2 mv = GLComponentWindow.mousePositionForEvent(arg0); |
|---|
| … | … | |
| 99 | 99 | for (SelectionGroup<iComponent> s : selectionGroups) { |
|---|
| 100 | 100 | for (iComponent d : s.getSelection()) { |
|---|
| 101 | | if (d != RootComponent.this) |
|---|
| 102 | | { |
|---|
| | 101 | if (d != RootComponent.this) { |
|---|
| 103 | 102 | handled = true; |
|---|
| 104 | | // d.handleResize(currentResize, dx, dy); |
|---|
| | 103 | // d |
|---|
| | 104 | // . |
|---|
| | 105 | // handleResize |
|---|
| | 106 | // ( |
|---|
| | 107 | // currentResize |
|---|
| | 108 | // , |
|---|
| | 109 | // dx |
|---|
| | 110 | // , |
|---|
| | 111 | // dy |
|---|
| | 112 | // ) |
|---|
| | 113 | // ; |
|---|
| 105 | 114 | } |
|---|
| 106 | 115 | } |
|---|
| 107 | 116 | } |
|---|
| 108 | | if (handled) return; |
|---|
| | 117 | if (handled) |
|---|
| | 118 | return; |
|---|
| 109 | 119 | |
|---|
| 110 | 120 | GLComponentWindow.getCurrentWindow(RootComponent.this).transformMouseEvent(arg0); |
|---|
| … | … | |
| 113 | 123 | |
|---|
| 114 | 124 | GLComponentWindow.getCurrentWindow(RootComponent.this).untransformMouseEvent(arg0); |
|---|
| 115 | | // need to rexpress lx in light of the potentially new |
|---|
| | 125 | // need to rexpress lx in light |
|---|
| | 126 | // of the potentially new |
|---|
| 116 | 127 | // viewport scale |
|---|
| 117 | 128 | mv = GLComponentWindow.mousePositionForEvent(arg0); |
|---|
| 118 | 129 | |
|---|
| 119 | | float lx2 = RootComponent.this.getX(); |
|---|
| 120 | | float ly2 = RootComponent.this.getY(); |
|---|
| | 130 | float lx2 = RootComponent.this.getX(); |
|---|
| | 131 | float ly2 = RootComponent.this.getY(); |
|---|
| 121 | 132 | |
|---|
| 122 | 133 | lastX = (mv.x) - (lx2 - lx); |
|---|
| 123 | 134 | lastY = (mv.y) - (ly2 - ly); |
|---|
| | 135 | |
|---|
| | 136 | GLComponentWindow.getCurrentWindow(RootComponent.this).transformMouseEvent(arg0); |
|---|
| | 137 | |
|---|
| 124 | 138 | |
|---|
| 125 | 139 | } |
|---|
| … | … | |
| 129 | 143 | |
|---|
| 130 | 144 | public void mouseExited(MouseEvent arg0) { |
|---|
| 131 | | // GLComponentWindow.getCurrentWindow(RootComponent.this).getCanvas().setCursor(Cursor.getDefaultCursor()); |
|---|
| | 145 | // GLComponentWindow. |
|---|
| | 146 | // getCurrentWindow |
|---|
| | 147 | // (RootComponent |
|---|
| | 148 | // .this).getCanvas |
|---|
| | 149 | // ().setCursor(Cursor |
|---|
| | 150 | // .getDefaultCursor()); |
|---|
| 132 | 151 | } |
|---|
| 133 | 152 | |
|---|
| … | … | |
| 175 | 194 | public void mousePressed(MouseEvent arg0) { |
|---|
| 176 | 195 | |
|---|
| 177 | | |
|---|
| 178 | | // if ((arg0.getModifiers() & MouseEvent.SHIFT_MASK) == |
|---|
| 179 | | // 0) for (SelectionGroup<Draggable> d : |
|---|
| | 196 | // if ((arg0.getModifiers() & |
|---|
| | 197 | // MouseEvent.SHIFT_MASK) == |
|---|
| | 198 | // 0) for |
|---|
| | 199 | // (SelectionGroup<Draggable> d |
|---|
| | 200 | // : |
|---|
| 180 | 201 | // selectionGroups) |
|---|
| 181 | 202 | // d.deselectAll(); |
|---|
| 182 | | // for (SelectionGroup<Draggable> d : selectionGroups) |
|---|
| 183 | | // d.addToSelection(WindowResizingComponent.this); |
|---|
| | 203 | // for |
|---|
| | 204 | // (SelectionGroup<Draggable> d |
|---|
| | 205 | // : selectionGroups) |
|---|
| | 206 | // d.addToSelection( |
|---|
| | 207 | // WindowResizingComponent |
|---|
| | 208 | // .this); |
|---|
| 184 | 209 | // |
|---|
| 185 | 210 | // setSelected(true); |
|---|
| … | … | |
| 206 | 231 | float ly = RootComponent.this.getY(); |
|---|
| 207 | 232 | |
|---|
| 208 | | GLComponentWindow.getCurrentWindow(RootComponent.this).untransformMouseEvent(arg0); |
|---|
| | 233 | //GLComponentWindow.getCurrentWindow(RootComponent.this).untransformMouseEvent(arg0); |
|---|
| 209 | 234 | |
|---|
| 210 | 235 | float xxx = GLComponentWindow.mousePositionForEvent(arg0).x; |
|---|
| 211 | | float yyy= GLComponentWindow.mousePositionForEvent(arg0).y; |
|---|
| 212 | | |
|---|
| 213 | | downX = lastX = xxx+ 0 * lx; |
|---|
| | 236 | float yyy = GLComponentWindow.mousePositionForEvent(arg0).y; |
|---|
| | 237 | |
|---|
| | 238 | downX = lastX = xxx + 0 * lx; |
|---|
| 214 | 239 | downY = lastY = yyy + 0 * ly; |
|---|
| 215 | 240 | } |
|---|
| … | … | |
| 356 | 381 | } |
|---|
| 357 | 382 | |
|---|
| 358 | | // lets try and translate around the center of the |
|---|
| | 383 | // lets try and translate around |
|---|
| | 384 | // the center of the |
|---|
| 359 | 385 | // window |
|---|
| 360 | 386 | |
|---|
| … | … | |
| 362 | 388 | int windowHeight = GLComponentWindow.getCurrentWindow(this).getFrame().getHeight(); |
|---|
| 363 | 389 | |
|---|
| 364 | | // the center of the window in transformed coords is: |
|---|
| | 390 | // the center of the window in |
|---|
| | 391 | // transformed coords is: |
|---|
| 365 | 392 | |
|---|
| 366 | 393 | float transformedCenterX = GLComponentWindow.getCurrentWindow(this).getXTranslation() + windowWidth * GLComponentWindow.getCurrentWindow(this).getXScale() / 2; |
|---|
| 367 | 394 | float transformedCenterY = GLComponentWindow.getCurrentWindow(this).getYTranslation() + windowHeight * GLComponentWindow.getCurrentWindow(this).getXScale() / 2; |
|---|
| 368 | 395 | |
|---|
| 369 | | // and we want this to remain constant dispite the |
|---|
| | 396 | // and we want this to remain |
|---|
| | 397 | // constant dispite the |
|---|
| 370 | 398 | // change in scale |
|---|
| 371 | 399 | |
|---|
| 372 | | // currently, it's uniform scale only |
|---|
| | 400 | // currently, it's uniform scale |
|---|
| | 401 | // only |
|---|
| 373 | 402 | GLComponentWindow.getCurrentWindow(this).setXScale(Math.min(20, Math.max(0.05f, GLComponentWindow.getCurrentWindow(this).getXScale() * sy))); |
|---|
| 374 | 403 | GLComponentWindow.getCurrentWindow(this).setYScale(Math.min(20, Math.max(0.05f, GLComponentWindow.getCurrentWindow(this).getYScale() * sy))); |
|---|
| … | … | |
| 389 | 418 | // atX and atY in window coordinates |
|---|
| 390 | 419 | public void handleResize(Set<Resize> currentResize, float dx, float dy, float atX, float atY) { |
|---|
| 391 | | |
|---|
| 392 | | |
|---|
| 393 | 420 | |
|---|
| 394 | 421 | if (currentResize.contains(Resize.translate)) |
|---|
| … | … | |
| 431 | 458 | } |
|---|
| 432 | 459 | |
|---|
| 433 | | // lets try and translate around the center of the |
|---|
| | 460 | // lets try and translate around |
|---|
| | 461 | // the center of the |
|---|
| 434 | 462 | // window |
|---|
| 435 | 463 | |
|---|
| … | … | |
| 437 | 465 | int windowHeight = GLComponentWindow.getCurrentWindow(this).getFrame().getHeight(); |
|---|
| 438 | 466 | |
|---|
| 439 | | // the center of the window in transformed coords is: |
|---|
| | 467 | // the center of the window in |
|---|
| | 468 | // transformed coords is: |
|---|
| 440 | 469 | |
|---|
| 441 | 470 | float transformedCenterX = GLComponentWindow.getCurrentWindow(this).getXTranslation() + atX * GLComponentWindow.getCurrentWindow(this).getXScale(); |
|---|
| 442 | 471 | float transformedCenterY = GLComponentWindow.getCurrentWindow(this).getYTranslation() + atY * GLComponentWindow.getCurrentWindow(this).getXScale(); |
|---|
| 443 | 472 | |
|---|
| 444 | | // and we want this to remain constant dispite the |
|---|
| | 473 | // and we want this to remain |
|---|
| | 474 | // constant dispite the |
|---|
| 445 | 475 | // change in scale |
|---|
| 446 | 476 | |
|---|
| 447 | | // currently, it's uniform scale only |
|---|
| | 477 | // currently, it's uniform scale |
|---|
| | 478 | // only |
|---|
| 448 | 479 | GLComponentWindow.getCurrentWindow(this).setXScale(Math.min(100, Math.max(0.01f, GLComponentWindow.getCurrentWindow(this).getXScale() * sy))); |
|---|
| 449 | 480 | GLComponentWindow.getCurrentWindow(this).setYScale(Math.min(100, Math.max(0.01f, GLComponentWindow.getCurrentWindow(this).getYScale() * sy))); |
|---|
| … | … | |
| 522 | 553 | inside.requestRedisplay(); |
|---|
| 523 | 554 | } |
|---|
| 524 | | System.out.println(" is <"+arg0+"> consumed ? <"+arg0.isConsumed()+">"); |
|---|
| 525 | 555 | |
|---|
| 526 | 556 | if (arg0.isConsumed()) |
|---|
| … | … | |
| 530 | 560 | updateBounds(); |
|---|
| 531 | 561 | dragger.mouseDragged(arg0); |
|---|
| | 562 | GLComponentWindow.getCurrentWindow(this).transformMouseEvent(arg0); |
|---|
| 532 | 563 | } |
|---|
| 533 | 564 | |
|---|
| … | … | |
| 544 | 575 | updateBounds(); |
|---|
| 545 | 576 | dragger.mouseEntered(arg0); |
|---|
| | 577 | GLComponentWindow.getCurrentWindow(this).transformMouseEvent(arg0); |
|---|
| 546 | 578 | } |
|---|
| 547 | 579 | |
|---|
| … | … | |
| 558 | 590 | updateBounds(); |
|---|
| 559 | 591 | dragger.mouseExited(arg0); |
|---|
| | 592 | GLComponentWindow.getCurrentWindow(this).transformMouseEvent(arg0); |
|---|
| 560 | 593 | } |
|---|
| 561 | 594 | |
|---|
| … | … | |
| 572 | 605 | updateBounds(); |
|---|
| 573 | 606 | dragger.mouseMoved(arg0); |
|---|
| | 607 | GLComponentWindow.getCurrentWindow(this).transformMouseEvent(arg0); |
|---|
| 574 | 608 | } |
|---|
| 575 | 609 | |
|---|
| … | … | |
| 580 | 614 | inside.requestRedisplay(); |
|---|
| 581 | 615 | } |
|---|
| 582 | | |
|---|
| 583 | | System.out.println(" mouse pressed inside root component, peers are <"+mousePeers+">"); |
|---|
| 584 | | |
|---|
| | 616 | |
|---|
| | 617 | |
|---|
| 585 | 618 | if (arg0.isConsumed()) |
|---|
| 586 | 619 | return; |
|---|
| 587 | 620 | GLComponentWindow.getCurrentWindow(this).untransformMouseEvent(arg0); |
|---|
| 588 | | |
|---|
| 589 | | if (arg0.isPopupTrigger()) { |
|---|
| 590 | | |
|---|
| 591 | | // assemble and present menu |
|---|
| 592 | | |
|---|
| 593 | | LinkedHashMap<String, iUpdateable> items = new LinkedHashMap<String, iUpdateable>(); |
|---|
| 594 | | overrides.menuItemsFor(null, items); |
|---|
| 595 | | |
|---|
| 596 | | JPopupMenu menu = new SmallMenu().createMenu(items); |
|---|
| 597 | | |
|---|
| 598 | | // |
|---|
| 599 | | Ref<GLComponentWindow> ref = new Ref<GLComponentWindow>(null); |
|---|
| 600 | | overrides.getProperty(null, iVisualElement.enclosingFrame, ref); |
|---|
| 601 | | if (ref.get() != null) { |
|---|
| 602 | | menu.show(ref.get().getCanvas(), (int) ref.get().getCurrentMouseInWindowCoordinates().x, (int) ref.get().getCurrentMouseInWindowCoordinates().y); |
|---|
| | 621 | try { |
|---|
| | 622 | if (arg0.isPopupTrigger()) { |
|---|
| | 623 | |
|---|
| | 624 | // assemble and |
|---|
| | 625 | // present menu |
|---|
| | 626 | |
|---|
| | 627 | LinkedHashMap<String, iUpdateable> items = new LinkedHashMap<String, iUpdateable>(); |
|---|
| | 628 | overrides.menuItemsFor(null, items); |
|---|
| | 629 | |
|---|
| | 630 | JPopupMenu menu = new SmallMenu().createMenu(items); |
|---|
| | 631 | |
|---|
| | 632 | // |
|---|
| | 633 | Ref<GLComponentWindow> ref = new Ref<GLComponentWindow>(null); |
|---|
| | 634 | overrides.getProperty(null, iVisualElement.enclosingFrame, ref); |
|---|
| | 635 | if (ref.get() != null) { |
|---|
| | 636 | menu.show(ref.get().getCanvas(), (int) ref.get().getCurrentMouseInWindowCoordinates().x, (int) ref.get().getCurrentMouseInWindowCoordinates().y); |
|---|
| | 637 | } else { |
|---|
| | 638 | } |
|---|
| 603 | 639 | } else { |
|---|
| 604 | | } |
|---|
| 605 | | } else { |
|---|
| 606 | | |
|---|
| 607 | | updateBounds(); |
|---|
| 608 | | this.inside = inside; |
|---|
| 609 | | dragger.mousePressed(arg0); |
|---|
| 610 | | ox = arg0.getX(); |
|---|
| 611 | | oy = arg0.getY(); |
|---|
| 612 | | |
|---|
| 613 | | if (!selected && hasFocus) { |
|---|
| 614 | | if ((arg0.getModifiers() & MouseEvent.SHIFT_MASK) == 0) |
|---|
| | 640 | |
|---|
| | 641 | updateBounds(); |
|---|
| | 642 | this.inside = inside; |
|---|
| | 643 | dragger.mousePressed(arg0); |
|---|
| | 644 | ox = arg0.getX(); |
|---|
| | 645 | oy = arg0.getY(); |
|---|
| | 646 | |
|---|
| | 647 | if (!selected && hasFocus) { |
|---|
| | 648 | if ((arg0.getModifiers() & MouseEvent.SHIFT_MASK) == 0) |
|---|
| | 649 | for (SelectionGroup<iComponent> d : selectionGroups) |
|---|
| | 650 | d.deselectAll(); |
|---|
| 615 | 651 | for (SelectionGroup<iComponent> d : selectionGroups) |
|---|
| 616 | | d.deselectAll(); |
|---|
| 617 | | for (SelectionGroup<iComponent> d : selectionGroups) |
|---|
| 618 | | d.addToSelection(RootComponent.this); |
|---|
| 619 | | RootComponent.this.setSelected(true); |
|---|
| 620 | | justSelected = true; |
|---|
| 621 | | } else |
|---|
| 622 | | justSelected = false; |
|---|
| | 652 | d.addToSelection(RootComponent.this); |
|---|
| | 653 | RootComponent.this.setSelected(true); |
|---|
| | 654 | justSelected = true; |
|---|
| | 655 | } else |
|---|
| | 656 | justSelected = false; |
|---|
| | 657 | } |
|---|
| | 658 | } finally { |
|---|
| | 659 | GLComponentWindow.getCurrentWindow(this).transformMouseEvent(arg0); |
|---|
| | 660 | |
|---|
| 623 | 661 | } |
|---|
| 624 | 662 | } |
|---|
| … | … | |
| 654 | 692 | } |
|---|
| 655 | 693 | dragger.mouseReleased(arg0); |
|---|
| | 694 | GLComponentWindow.getCurrentWindow(this).transformMouseEvent(arg0); |
|---|
| 656 | 695 | } |
|---|
| 657 | 696 | |
|---|