Hi Sven,

As you mentioned, some fixes are also required at SB level  (the strings passed 
to DataFormat).
I'm going to file a JIRA against Scene Builder for that.

I did a sample Swing test with Scene Builder Kit and reproduced the exception 
reported in RT-36240. However it seems that this exception does not prevent 
SB to complete its drag and drop gestures. Does it match what you've observed ?

Cheers.

Eric



Le 17 mars 2014 à 14:49, Sven Reimers <sven.reim...@gmail.com> a écrit :

> Created RT-36240
> 
> -Sven
> Am 17.03.2014 13:10 schrieb "Kevin Rushforth" <kevin.rushfo...@oracle.com>:
> 
>> Hi Sven,
>> 
>> If you file the bug then yes, we can look at it for 8u20 (there is no
>> "earlier").
>> 
>> And thanks to Petr for providing the evaluation for this.
>> 
>> -- Kevin
>> 
>> 
>> Sven Reimers wrote:
>> 
>>> Ok.
>>> 
>>> Will file an issue and if possible create a patch.
>>> 
>>> Any this could end up in 8u20 (or earlier)?
>>> 
>>> Thanks
>>> 
>>> -Sven
>>> Am 17.03.2014 11:05 schrieb "Petr Pchelko" <petr.pche...@oracle.com>:
>>> 
>>> 
>>> 
>>>> Ok, I see.
>>>> 
>>>> This is the problem in FX interop.
>>>> In javafx.embed.swing.SwingDnD.DnDTransferable class. It's wrapper that
>>>> wraps the FX dragboard into the Swing Trasferable.
>>>> It is a simple class and many features are simply not implemented. The
>>>> implementation is very basic - it just creates the DataFlavor with the
>>>> mime-type corresponding to the DataFormat mime-type. However it does not
>>>> take into account the representation class. This works fine for basic
>>>> types
>>>> like text or may be image, but it completely does not work for custom
>>>> types
>>>> with custom representation classes.
>>>> 
>>>> You could file a bug for this.
>>>> 
>>>> With best regards. Petr.
>>>> 
>>>> On 17.03.2014, at 13:39, Sven Reimers <sven.reim...@gmail.com> wrote:
>>>> 
>>>> The problem seems to be in AbstractDragSource in SceneBuilder. It defines
>>>> a javafx.scene.input.DataFormat.
>>>> This seems to cause problems if running embedded in Swing. I do not
>>>> define
>>>> my own DataFlavors..
>>>> 
>>>> Any further help appreciated..
>>>> 
>>>> -Sven
>>>> Am 17.03.2014 09:54 schrieb "Petr Pchelko" <petr.pche...@oracle.com>:
>>>> 
>>>> 
>>>> 
>>>>> Hello, Sven.
>>>>> 
>>>>> Looks like you are not specifying the representation class for the
>>>>> DataFlavor and it defaults
>>>>> to the InputStream. So, scene builder puts a ByteBuffer while the
>>>>> DataTransferer is trying to treat it as an
>>>>> InputStream.
>>>>> 
>>>>> Could you please try to explicitly specify the representation class in
>>>>> the DataFlavor you are trying to put?
>>>>> Like this: new DataFlavor("scene.builder/internal;
>>>>> class=java.nio.HeapByteBuffer", "SceneBuilder internal DF"")
>>>>> 
>>>>> With best regards. Petr.
>>>>> 
>>>>> On 17.03.2014, at 0:13, Sven Reimers <sven.reim...@gmail.com> wrote:
>>>>> 
>>>>> 
>>>>> 
>>>>>> Ok... figured it out. It seems scene.builder.internal crashes the Swing
>>>>>> parsing mechanism for mime types in the data transfer. Changing it to
>>>>>> scene.builder/internal fixes this problem.
>>>>>> 
>>>>>> Shall I open an issue in Jira for it?
>>>>>> 
>>>>>> Having fixed this I get another problem :-(
>>>>>> (see stacktrace below)
>>>>>> 
>>>>>> Not sure how to fix this... investigating now.
>>>>>> 
>>>>>> -Sven
>>>>>> 
>>>>>> java.lang.ClassCastException: java.nio.HeapByteBuffer cannot be cast to
>>>>>> java.io.InputStream
>>>>>> at
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> sun.awt.datatransfer.DataTransferer.translateTransferable(
>>>>> DataTransferer.java:1372)
>>>>> 
>>>>> 
>>>>>> at
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> sun.lwawt.macosx.CDataTransferer.translateTransferable(
>>>>> CDataTransferer.java:131)
>>>>> 
>>>>> 
>>>>>> at sun.awt.datatransfer.DataTransferer$6.run(DataTransferer.java:2380)
>>>>>> at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
>>>>>> at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744)
>>>>>> at java.awt.EventQueue.access$400(EventQueue.java:97)
>>>>>> at java.awt.EventQueue$3.run(EventQueue.java:697)
>>>>>> at java.awt.EventQueue$3.run(EventQueue.java:691)
>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>> at
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> java.security.ProtectionDomain$1.doIntersectionPrivilege(
>>>>> ProtectionDomain.java:75)
>>>>> 
>>>>> 
>>>>>> at
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> java.security.ProtectionDomain$1.doIntersectionPrivilege(
>>>>> ProtectionDomain.java:86)
>>>>> 
>>>>> 
>>>>>> at java.awt.EventQueue$4.run(EventQueue.java:719)
>>>>>> at java.awt.EventQueue$4.run(EventQueue.java:717)
>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>> at
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> java.security.ProtectionDomain$1.doIntersectionPrivilege(
>>>>> ProtectionDomain.java:75)
>>>>> 
>>>>> 
>>>>>> at java.awt.EventQueue.dispatchEvent(EventQueue.java:716)
>>>>>> at
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> org.netbeans.core.TimableEventQueue.dispatchEvent(
>>>>> TimableEventQueue.java:159)
>>>>> 
>>>>> 
>>>>>> at
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> java.awt.EventDispatchThread.pumpOneEventForFilters(
>>>>> EventDispatchThread.java:201)
>>>>> 
>>>>> 
>>>>>> at
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> java.awt.EventDispatchThread.pumpEventsForFilter(
>>>>> EventDispatchThread.java:116)
>>>>> 
>>>>> 
>>>>>> at
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> java.awt.EventDispatchThread.pumpEventsForHierarchy(
>>>>> EventDispatchThread.java:105)
>>>>> 
>>>>> 
>>>>>> at java.awt.EventDispatchThread.pumpEvents(
>>>>>> EventDispatchThread.java:101)
>>>>>> at java.awt.EventDispatchThread.pumpEvents(
>>>>>> EventDispatchThread.java:93)
>>>>>> at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
>>>>>> 
>>>>>> 
>>>>>> On Sun, Mar 16, 2014 at 8:30 PM, Sven Reimers <sven.reim...@gmail.com
>>>>>> wrote:
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>> Hi guys,
>>>>>>> 
>>>>>>> hope someone can help me with the exception pasted below.
>>>>>>> 
>>>>>>> Any idea how to go on from here?
>>>>>>> 
>>>>>>> The code is available at
>>>>>>> 
>>>>>>> 
>>>>>> https://bitbucket.org/sreimers/nbscenebuilder/
>>>>> 
>>>>> 
>>>>>> Thanks
>>>>>>> 
>>>>>>> -Sven
>>>>>>> 
>>>>>>> java.lang.IllegalArgumentException: failed to
>>>>>>> 
>>>>>>> 
>>>>>> parse:scene.builder.internal
>>>>> 
>>>>> 
>>>>>> at java.awt.datatransfer.DataFlavor.<init>(DataFlavor.java:488)
>>>>>>> at
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> javafx.embed.swing.SwingDnD$DnDTransferable.getTransferDataFlavors(
>>>>> SwingDnD.java:398)
>>>>> 
>>>>> 
>>>>>> at
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> sun.awt.datatransfer.DataTransferer.getFormatsForTransferable(
>>>>> DataTransferer.java:655)
>>>>> 
>>>>> 
>>>>>> at
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> sun.awt.dnd.SunDragSourceContextPeer.startDrag(
>>>>> SunDragSourceContextPeer.java:131)
>>>>> 
>>>>> 
>>>>>> at
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> sun.lwawt.macosx.CDragSourceContextPeer.startDrag(
>>>>> CDragSourceContextPeer.java:88)
>>>>> 
>>>>> 
>>>>>> at java.awt.dnd.DragSource.startDrag(DragSource.java:321)
>>>>>>> at java.awt.dnd.DragSource.startDrag(DragSource.java:426)
>>>>>>> at java.awt.dnd.DragGestureEvent.startDrag(DragGestureEvent.java:237)
>>>>>>> at javafx.embed.swing.SwingDnD.startDrag(SwingDnD.java:284)
>>>>>>> at javafx.embed.swing.SwingDnD.access$1000(SwingDnD.java:73)
>>>>>>> at javafx.embed.swing.SwingDnD$4$1.run(SwingDnD.java:249)
>>>>>>> at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
>>>>>>> at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744)
>>>>>>> at java.awt.EventQueue.access$400(EventQueue.java:97)
>>>>>>> at java.awt.EventQueue$3.run(EventQueue.java:697)
>>>>>>> at java.awt.EventQueue$3.run(EventQueue.java:691)
>>>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>>>> at
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> java.security.ProtectionDomain$1.doIntersectionPrivilege(
>>>>> ProtectionDomain.java:75)
>>>>> 
>>>>> 
>>>>>> at java.awt.EventQueue.dispatchEvent(EventQueue.java:714)
>>>>>>> at
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> org.netbeans.core.TimableEventQueue.dispatchEvent(
>>>>> TimableEventQueue.java:159)
>>>>> 
>>>>> 
>>>>>> [catch] at
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> java.awt.EventDispatchThread.pumpOneEventForFilters(
>>>>> EventDispatchThread.java:201)
>>>>> 
>>>>> 
>>>>>> at
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> java.awt.EventDispatchThread.pumpEventsForFilter(
>>>>> EventDispatchThread.java:116)
>>>>> 
>>>>> 
>>>>>> at
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> java.awt.EventDispatchThread.pumpEventsForHierarchy(
>>>>> EventDispatchThread.java:105)
>>>>> 
>>>>> 
>>>>>> at
>>>>>>> 
>>>>>>> 
>>>>>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
>>>>> 
>>>>> 
>>>>>> at java.awt.EventDispatchThread.pumpEvents(
>>>>>>> EventDispatchThread.java:93)
>>>>>>> at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
>>>>>>> 
>>>>>>> --
>>>>>>> Sven Reimers
>>>>>>> 
>>>>>>> * Senior Expert Software Architect
>>>>>>> * NetBeans Dream Team Member: http://dreamteam.netbeans.org
>>>>>>> * Community Leader  NetBeans: http://community.java.net/netbeans
>>>>>>>                             Desktop Java:
>>>>>>> http://community.java.net/javadesktop
>>>>>>> * JUG Leader JUG Bodensee: http://www.jug-bodensee.de
>>>>>>> * Duke's Choice Award Winner 2009
>>>>>>> * Blog: https://www.java.net//blog/sven
>>>>>>> 
>>>>>>> * XING: https://www.xing.com/profile/Sven_Reimers8
>>>>>>> * LinkedIn: http://www.linkedin.com/in/svenreimers
>>>>>>> 
>>>>>>> Join the NetBeans Groups:
>>>>>>> * XING: http://www.xing.com/group-20148.82db20
>>>>>>> * NUGM: http://haug-server.dyndns.org/display/NUGM/Home
>>>>>>> * LinkedIn: http://www.linkedin.com/groups?gid=1860468
>>>>>>>                  http://www.linkedin.com/groups?gid=107402
>>>>>>>                  http://www.linkedin.com/groups?gid=1684717
>>>>>>> * Oracle: https://mix.oracle.com/groups/18497
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Sven Reimers
>>>>>> 
>>>>>> * Senior Expert Software Architect
>>>>>> * NetBeans Dream Team Member: http://dreamteam.netbeans.org
>>>>>> * Community Leader  NetBeans: http://community.java.net/netbeans
>>>>>>                             Desktop Java:
>>>>>> http://community.java.net/javadesktop
>>>>>> * JUG Leader JUG Bodensee: http://www.jug-bodensee.de
>>>>>> * Duke's Choice Award Winner 2009
>>>>>> * Blog: https://www.java.net//blog/sven
>>>>>> 
>>>>>> * XING: https://www.xing.com/profile/Sven_Reimers8
>>>>>> * LinkedIn: http://www.linkedin.com/in/svenreimers
>>>>>> 
>>>>>> Join the NetBeans Groups:
>>>>>> * XING: http://www.xing.com/group-20148.82db20
>>>>>> * NUGM: http://haug-server.dyndns.org/display/NUGM/Home
>>>>>> * LinkedIn: http://www.linkedin.com/groups?gid=1860468
>>>>>>                  http://www.linkedin.com/groups?gid=107402
>>>>>>                  http://www.linkedin.com/groups?gid=1684717
>>>>>> * Oracle: https://mix.oracle.com/groups/18497
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 

Reply via email to