670 if (eventException == null) return; 671 672 if (eventException instanceof UndeclaredThrowableException) { 673 eventException = ((UndeclaredThrowableException)eventException).getUndeclaredThrowable(); 674 } 675 throw new InvocationTargetException(eventException); 676 } 677 678 /** 679 * Schedules a {@code Runnable} execution on the Appkit thread after a delay 680 * @param r a {@code Runnable} to execute 681 * @param delay a delay in milliseconds 682 */ 683 native static void performOnMainThreadAfterDelay(Runnable r, long delay); 684 685 // DnD support 686 687 @Override 688 public DragSourceContextPeer createDragSourceContextPeer( 689 DragGestureEvent dge) throws InvalidDnDOperationException { 690 return CDragSourceContextPeer.createDragSourceContextPeer(dge); 691 } 692 693 @Override 694 public <T extends DragGestureRecognizer> T createDragGestureRecognizer( 695 Class<T> abstractRecognizerClass, DragSource ds, Component c, 696 int srcActions, DragGestureListener dgl) { 697 DragGestureRecognizer dgr = null; 698 699 // Create a new mouse drag gesture recognizer if we have a class match: 700 if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass)) 701 dgr = new CMouseDragGestureRecognizer(ds, c, srcActions, dgl); 702 703 return (T)dgr; 704 } 705 706 @Override 707 protected PlatformDropTarget createDropTarget(DropTarget dropTarget, 708 Component component, 709 LWComponentPeer<?, ?> peer) { 710 return new CDropTarget(dropTarget, component, peer); 711 } 712 713 // InputMethodSupport Method 714 /** 715 * Returns the default keyboard locale of the underlying operating system 716 */ | 670 if (eventException == null) return; 671 672 if (eventException instanceof UndeclaredThrowableException) { 673 eventException = ((UndeclaredThrowableException)eventException).getUndeclaredThrowable(); 674 } 675 throw new InvocationTargetException(eventException); 676 } 677 678 /** 679 * Schedules a {@code Runnable} execution on the Appkit thread after a delay 680 * @param r a {@code Runnable} to execute 681 * @param delay a delay in milliseconds 682 */ 683 native static void performOnMainThreadAfterDelay(Runnable r, long delay); 684 685 // DnD support 686 687 @Override 688 public DragSourceContextPeer createDragSourceContextPeer( 689 DragGestureEvent dge) throws InvalidDnDOperationException { 690 final LightweightFrame f = SunToolkit.getLightweightFrame(dge.getComponent()); 691 if (f != null) { 692 return f.createDragSourceContextPeer(dge); 693 } 694 695 return CDragSourceContextPeer.createDragSourceContextPeer(dge); 696 } 697 698 @Override 699 public <T extends DragGestureRecognizer> T createDragGestureRecognizer( 700 Class<T> abstractRecognizerClass, DragSource ds, Component c, 701 int srcActions, DragGestureListener dgl) { 702 final LightweightFrame f = SunToolkit.getLightweightFrame(c); 703 if (f != null) { 704 return f.createDragGestureRecognizer(abstractRecognizerClass, ds, c, srcActions, dgl); 705 } 706 707 DragGestureRecognizer dgr = null; 708 709 // Create a new mouse drag gesture recognizer if we have a class match: 710 if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass)) 711 dgr = new CMouseDragGestureRecognizer(ds, c, srcActions, dgl); 712 713 return (T)dgr; 714 } 715 716 @Override 717 protected PlatformDropTarget createDropTarget(DropTarget dropTarget, 718 Component component, 719 LWComponentPeer<?, ?> peer) { 720 return new CDropTarget(dropTarget, component, peer); 721 } 722 723 // InputMethodSupport Method 724 /** 725 * Returns the default keyboard locale of the underlying operating system 726 */ |