Tag: 放大

你如何在Kotlin中实现JavaFX ZoomEvent?

我参与了一个名为“Path Visualizer”的应用程序,它与JavaFXcanvas一起工作。 我对JavaFX很新,并且已经遍布互联网寻找解决这个问题的答案。 我的短期目标是允许跟踪板的缩放function。 这是我的代码片段,不包括主要的方法(注意:你可以在我实现缩放方法之前忽略代码,我只是想包括它,因为它可能是有帮助的): override fun start(stage: Stage) { stage.title = “Path Visualizer” // set up the paths and autos selectedAutonomous = Autonomous(“Auto1”) mapAutonomous.put(selectedAutonomous!!.name, selectedAutonomous!!) selectedPath = DefaultPath selectedAutonomous!!.putPath(selectedPath!!.name, selectedPath!!) // setup the layout val buttonsBox = VBox() buttonsBox.spacing = 10.0 addControlsToButtonsBox(buttonsBox) val stackPane = StackPane(canvas) val splitPane = SplitPane(stackPane, buttonsBox) splitPane.setDividerPositions(0.7) stage.scene = […]