drag-and-drop

Custom object drag-and-drop from embedded FX (JFXPanel) to Swing

情到浓时终转凉″ 提交于 2020-01-02 06:56:40
问题 This question is a follow-up question to Custom object drag-and-drop from FX to Swing. I'm working on a plugin for a Swing application that uses JavaFX for some graphical user interfaces. We added drag-and-drop functionality to improve the user experience. First, we were using an external JavaFX window ( Stage ) for our Scene , now we want to embed it directly into the Swing application via a JFXPanel . Now, the strange thing is, that it seems to make a big difference for drag-and-drop

ListBox ItemContainerGenerator returns null even when listbox has items

折月煮酒 提交于 2020-01-02 05:58:13
问题 I've a listbox with couple of items, till the time no scrollbar appears everything goes perfectly fine but once scrollbar comes then ItemContainerGenerator returns null. I read some blogs and found it may be because of vertualization stackpanel. If i disable that then it may work but in my case it would make listbox too much heavy and less efficient. Here is the code for listbox: <ListBox x:Name="EventListBox" DockPanel.Dock="Top" Margin="5,5,5,5" FocusVisualStyle="{x:Null}" ItemsSource="

Drag and Drop - Is it possible to get the URL?

落花浮王杯 提交于 2020-01-02 04:55:09
问题 I implemented a simple drag and drop. The main purpose is for users to drag and drop images from a browser. Is it possible for me get the URL that this image was dragged from? So lets say, I am on SO and I drag and drop the logo. Is there a way for me to know that this was from http://stackoverflow.com ? Thanks 回答1: For images which aren't also links, the following code will log the URL a dragged image came from. This works for me in Safari & Firefox. @implementation DragView - (void

android dragshadowbuilder shadow size

為{幸葍}努か 提交于 2020-01-02 03:25:32
问题 I try to increase shadow of image when dragging start I created custom dragshadowbuilder and increase size double, but nothing happend. public class ImageDragShadowBuilder extends View.DragShadowBuilder { public ImageDragShadowBuilder(View v) { super(v); } @Override public void onProvideShadowMetrics(Point shadowSize, Point touchPoint) { shadowSize.set(getView().getWidth()*2, getView().getHeight()*2); touchPoint.set(getView().getWidth() / 2, getView().getHeight() / 2); }} What is the reason?

How to swap element with jQuery UI draggable and droppable?

跟風遠走 提交于 2020-01-01 22:28:14
问题 I have two div.containers. Both containers have div.item. With jQuery, how can I swap div.item elements by drag & drop? Both element should able to re-swap again. Is there any simple way to do this? Thanks... 回答1: @Ei Maung.. I got smooth solution from your dirty solution.. $(document).ready(function () { src = null; options = { revert:true, /*axis: 'x',*/ opacity: 0.8, start: function() { src = $(this).parent(); } }; $(".item").draggable(options); $(".container").droppable({ drop: function

How to swap element with jQuery UI draggable and droppable?

假如想象 提交于 2020-01-01 22:28:10
问题 I have two div.containers. Both containers have div.item. With jQuery, how can I swap div.item elements by drag & drop? Both element should able to re-swap again. Is there any simple way to do this? Thanks... 回答1: @Ei Maung.. I got smooth solution from your dirty solution.. $(document).ready(function () { src = null; options = { revert:true, /*axis: 'x',*/ opacity: 0.8, start: function() { src = $(this).parent(); } }; $(".item").draggable(options); $(".container").droppable({ drop: function

How to prevent black background when saving a div to png

社会主义新天地 提交于 2020-01-01 22:16:48
问题 I´m using HTML2canvas, filesaver.js and canvas2blob.js to achieve an in-browser save-dialogue. The on-the-fly canvas-creation and saving works fine except the image background is black. The problem is the base64-encoded image of the div with id="drop1" (the user drags and drops an image from his desktop to the html and then that image is put as background as base64). How can I achieve a visible output in the png file? my JS: // save img magic // html2canvas.js linked with filesaver.js and

Drag and drop UIButton but limit to boundaries

天涯浪子 提交于 2020-01-01 19:53:24
问题 I’m not asking for givemesamplecodenow responses, just a nudge in the right direction would be much appreciated. My searches haven’t been any good. I have a UIButton that I am able to move freely around the screen. I would like to limit the drag area on this object so it can only be moved up and down or side to side. I believe I need to get the x,y coordinates of the boundaries and then restrict movement outside this area. But that’s a far as I have got. My knowledge doesn’t stretch any

Drag and drop UIButton but limit to boundaries

白昼怎懂夜的黑 提交于 2020-01-01 19:53:03
问题 I’m not asking for givemesamplecodenow responses, just a nudge in the right direction would be much appreciated. My searches haven’t been any good. I have a UIButton that I am able to move freely around the screen. I would like to limit the drag area on this object so it can only be moved up and down or side to side. I believe I need to get the x,y coordinates of the boundaries and then restrict movement outside this area. But that’s a far as I have got. My knowledge doesn’t stretch any

On Drop - Clone a Different node or corresponding Element from the server

懵懂的女人 提交于 2020-01-01 18:18:48
问题 On the drop (after drag) -- how can I clone a different (corresponding) element that resides somewhere else or back on the server, i.e. target and clone a different element on the server For e.g. On client side the corresponding icons map to the server elements icon_chartXY == Server side ChartXY etc.. 1) in the browser on the left , I have small icons/pictures that represent various charts (xy, or barchart). 2) After dragging the icons, then drop into a larger During clone - How can I GET or