drag

Disable full window drag

别等时光非礼了梦想. 提交于 2020-01-06 08:43:31
问题 when I use AWTUtilities.setWindowOpaque(this, false); to make my JFrames' background transparent, you can change the location of my JFrame by dragging it anywhere in the window. My problem is, that I have Objects I want to use for drag and drop on this Frame, but when the JFrame moves when I try to drag an object its impossible to drop it anywhere else. Is there any way to solve this problem? By the way, I am on Mac using Mac OS 10.6.6 Thanks for your help! 回答1: Sorry for the my bad english.

Drag, scale and rotate multiple UIImageviews

*爱你&永不变心* 提交于 2020-01-06 08:04:33
问题 I've got it so far that I can move, scale and rotate all the objects, but the multiple objects all move together. I want them to move seperate. I guess I have to change the objectatIndex to 1, but it just crashes. I've used the following code: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSArray *allTouches = [touches allObjects]; UITouch* t; if([[event allTouches] count]==1){ if (CGRectContainsPoint([Birdie frame], [[allTouches objectAtIndex:0] locationInView

JavaFx connecting two child nodes with a line by dragging and dropping

£可爱£侵袭症+ 提交于 2020-01-05 05:42:06
问题 I have two nodes. I would like to click on one node, drag my cursor across to another node, and connect the two nodes with a line once the cursor is released. I have set up all the EventHandlers -- dragging and dropping the line works, but it doesn't bind to the second node. public class LinkHandler { static Node hoverNode; } This class is used to find what Node the cursor is hovering over. private void setLinkHandlers(Node node) { Line line = new Line(); this.getChildren().add(line); // On

WPF - how to best implement a panel with draggable/zoomable children?

北战南征 提交于 2020-01-04 14:28:31
问题 I'm trying to modify the default graph viewer of the Graph# library because its user interface is awful (just try dragging a node outside of the boundaries, you'll see!) The basic setup is this: there is a GraphCanvas control (inherited from Panel) which has children of Vertex and Edge control types. What I want to achieve is: GraphCanvas has scroll bars if the contents do not fit in the screen; GraphCanvas can also be scrolled by "dragging" it (just click on an empty space and drag);

How to modify a d3 force layout with voronoi polygons to trigger events on grouped elements?

瘦欲@ 提交于 2020-01-02 06:13:44
问题 The goal is to combine d3 force simulation, g elements, and voronoi polygons to make trigger events on nodes easier, such as dragging, mouseovers, tooltips and so on with a graph that can be dynamically modified. This follows the d3 Circle Dragging IV example. In the following code, when adding the clip path attribute to the g element and clippath elements: Why does dragging not trigger on the cells? Why do the nodes become obscured and the paths lose their styles on edges? How can this be

drag, zoom imageview without matrix android

只谈情不闲聊 提交于 2020-01-01 06:56:11
问题 i need a solution for implement drag and zoom , routate ImageView around screen onTouch event without using matrix. i searched a lot but all answers done it with matrix and because i have multi objects in screen matrix is not suitable for me, i want drag and zoom ImageView object not matrix in the ImageView, after some try i implement a class that drag view fine but in zoom it disturb, thanks if someone can help me and sorry for bad language skills and if i have misspelling. package com

Make a label update while dragging a slider

女生的网名这么多〃 提交于 2020-01-01 06:12:03
问题 I'm using a Slider in my javaFX project and I have a Label that updates when I move the slider. I want the Label to update whilst I'm dragging the Slider and not only when the drag is dropped. This is my code: betSlider.valueChangingProperty().addListener(new ChangeListener<Boolean>() { @Override public void changed(ObservableValue<? extends Boolean> source, Boolean oldValue, Boolean newValue) { betLabel.textProperty().setValue(String.valueOf((int)betSlider.getValue())); } }); 回答1: You just

Make a label update while dragging a slider

放肆的年华 提交于 2020-01-01 06:10:43
问题 I'm using a Slider in my javaFX project and I have a Label that updates when I move the slider. I want the Label to update whilst I'm dragging the Slider and not only when the drag is dropped. This is my code: betSlider.valueChangingProperty().addListener(new ChangeListener<Boolean>() { @Override public void changed(ObservableValue<? extends Boolean> source, Boolean oldValue, Boolean newValue) { betLabel.textProperty().setValue(String.valueOf((int)betSlider.getValue())); } }); 回答1: You just

Draggable window with pyqt4

风流意气都作罢 提交于 2020-01-01 03:49:12
问题 just a simple question: I'm using pyqt4 to render a simple window. Here's the code, I post the whole thing so it easier to explain. from PyQt4 import QtGui, QtCore, Qt import time import math class FenixGui(QtGui.QWidget): def __init__(self): super(FenixGui, self).__init__() # setting layout type hboxlayout = QtGui.QHBoxLayout(self) self.setLayout(hboxlayout) # hiding title bar self.setWindowFlags(QtCore.Qt.FramelessWindowHint) # setting window size and position self.setGeometry(200, 200, 862

how to drag object

自古美人都是妖i 提交于 2019-12-30 10:35:28
问题 i want to drag a box and i want my mouse cursor to be where i clicked in a rectangle while im draging rectangle. i tried this code and i got bunch of errors when i tried to drag. import objectdraw.*; import java.awt.*; public class TouchWindow extends WindowController { private FilledRect a; private boolean b; private Location c; private int x; private int y; public void begin() { b=false; a=new FilledRect(0,0,50,50,canvas); } public void onMouseClick(Location pt) { if(a.contains(pt)) { b