Is there any way in Vis.js, where I can link a new edge from a specific node, avoid using pointerdown/mousedown event? - vis.js

I'd like to start dragging a new edge without using mousedown/pointerdown (manual) event on a node, but instead linking the new edge from a node to the mouse.

Related

Canvas wrapped in pane (JavaFX)

We are trying to make frogger like game in JavaFX. We have classes such as player,car and log. The problem is that we are drawing our player directly on the canvas using gc.drawImage(), and the car/log objects are added to pane (we are using pathtransition to animate the logs). This is causing the player to end up underneath the log object. Is there anyway to get the player to end up on top the log? When the player intersects with the log, we want it to be placed on top of the log and follow it.

JavaFX: Perspective camera on custom widget

I am trying to create a "custom widget" (extends HBox) which renders 3D graphics.
The problem is that all the examples I see for setting the camera, show how to do it on the main "scene", which belongs to the main window.
I don't want any relation to the main Window, I want it to be an independent widget.
Is it anyway possible to do that?
I'll be glad if you can share some code example, as I feel pretty lost with it...
I am not quite sure if I understood you correctly, but if you want the camera to be transformable, you can insert it into the Scene Graph where ever you want. You can add it to a group node like this:
Group someGroup = new Group();
PerspectiveCamera camera = new PerspectiveCamera();
someGroup.getChildren().add(camera);
Scene s = new Scene(someGroup);
s.setCamera(camera);
When you now move the Group node the camera moves as well. You can add the camera to any Group node you want, but I am not sure what happens when you put it into a Group node that uses LayoutManagement like HBox.
The important thing is you always have to add the camera to the Scene that it is in.

Unity canvas overlap using networking

I am using the new unity networking using unity 5.3.1 , my player prefab is a UI canvas , so when another client joins the canvas's overlap and I cannot press any button on host or client .
What i want is to disable other canvase's on each players game and just leave the local players canvase active , I have tried islocalplayer , isclient ,isserver but nothing works .
Is there a way around this please do tell.
Here are some options I can think of:
1) Instead of making canvas a player object, make panel a player object, so that all your players are different panels under same canvas. Now, when object are under same canvas, they ray casting order is determined by the order in hierarchy.
The objects that are lower in the hierarchy occlude those that are higher. So, what you can do is moving your player object to the lowest position in objects hierarchy, so that it will occlude all other players. This can be done using Transform methods SetSiblingIndex and GetSiblingIndex, like
transform.SetSiblingIndex(100000/*some big number*/);
2) Disable raycasting on all other players - what if you can click some component on canvas or not is whether it is a raycast target. Images and Text components can be raycast targets, or more generally any component that inherits from Graphics. You can iterate over all components of type Graphics in all players except the local player and mark raycastTarget = false.
I figured it out and as #NikaKasradze said use only one canvas and put all gui listeners in the islocalplayer bool check .

Customising plots in Labview

I have an XY Graph in Labview. I have no problems with its basic functionality.
I'd like to have a marker on the plot (independent on the cursor) which would stay in a certain position that I could read out and display in the GUI. Also I want the user to be able to move the marker to a new position.
How can I implement this functionality?
I know the title isn't very well-chosen, so I'll be grateful for any edits.
Edited:
You can just add cursor.
Add a cursor, select the point style you like and click on Allow dragging as shown on the picture below.
You can modify or read the current position of the point using Cursor Position property of the XY Graph.
They’re called “annotations”; you can add an array of them via a property node.

JavaFX nodes - How to make them resizable by the end user?

I am developing a JavaFX application where a class I have developed (extended from javafx.scene.Parent) is created on-the-fly based on what entry the user has clicked in a ListView control.
Just to be clear about this node, it is not created using a layout tool like SceneBuilder, it is created at runtime based on the user's actions.
The constructor for my custom node class creates a VBox and a Label and uses passed coordinates (X,Y) in the constructor method to set its own Layout coords. I then use a custom utility class to make the node draggable. This new node is then added to the main application Pane.
However, I have failed to find out how I can make these nodes resizable by the user. That is, allow the user to mouse over the corner of the node, hold and drag to resize. An operation that all users are used to, no matter what the OS.
Has anyone done anything like this in JavaFX? (My searches on the subject only seem to pull up subjects on the automatic resizing that a parent node does with its child nodes.)
Many thanks,
Ian.
As you can see on the documentation of VBox you can only define minimum, prefered and maximum range, there's not really a way to make it manually resizable.
The only proper solution to solve your problem is to develop your own class to do it, because what you want seems very specific, with your problem description, I don't think use some layouts or panels will do what you exactly want.
I found something that you can use : Dragging to resize a JavaFX Region
This allows you to resize a region, all you have to do after is to put you VBox in this region, but notice in this article that :
Only height resizing is currently implemented.
This code won't work in JavaFX8, you'll have to check the comment to see how it worls in JavaFX8
Hope this helps.

Resources