简体   繁体   English

如何在JavaFX中将X,Y整数坐标转换为正确的像素坐标

[英]How to turn X, Y integer coordinates into the correct pixel coordinates in JavaFX

I have a dataset that contains X and Y coordinates as integers. 我有一个数据集,其中包含X和Y坐标为整数。 There are many different files and the X,Y coordinates differ from being close to each other to being negative and far from each other. 有许多不同的文件,并且X,Y坐标从彼此接近到彼此为负且彼此远离。 The coordinates are supposed to show where a node in a network is supposed to be, but I am having problems representing this in GUI using javafx. 坐标应该显示网络中节点应该位于的位置,但是我在使用javafx的GUI中表示此问题。 Some (most) of the files contain X,Y coordinates that are to small and so they cluster at the center of the screen, but if I scale them by multiplication then other files which have other X,Y values will appear outside the window. 一些(大多数)文件包含较小的X,Y坐标,因此它们聚集在屏幕的中心,但是如果我通过乘法对其进行缩放,则具有其他X,Y值的其他文件将出现在窗口外部。

How most of the files look 大多数文件的外观

使用网格窗格,或确保您具有可调整大小的约束,而不是锚定窗格

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM