実際のものだと長すぎるので本題と関係ない要素は割愛していますが
次のようなFXMLでDrawAreaとIDを付けたPaneがあります。
このPaneにマウスホイールを動かすとScrollEventが発生するようにして
Paneの大きさをを変えつつ位置を移動する処理を作っています。
ある程度できたのですが、細かい位置の補正をするために、Windowの中で
親要素のScrollPaneが配置されている左上の絶対座標を取得したいのですが、
いろいろ調べても中々答えを見出すことができません。
ご存じの方、ご教示いただけますでしょうか。
FXML
1<AnchorPane prefHeight="817.0" prefWidth="1125.0" > 2 <children> 3 <MenuBar AnchorPane.topAnchor="0.0"> 4 <menus> 5 ・・・・・・ 6 </menus> 7 </MenuBar> 8 <SplitPane dividerPositions="0.21104185218165628"> 9 <items> 10 <SplitPane dividerPositions="0.5" orientation="VERTICAL"> 11 <items> 12 ・・・・・・ 13 </items> 14 </SplitPane> 15 <ScrollPane prefHeight="806.0" prefWidth="821.0"> 16 <content> 17 <Pane fx:id="DrawArea" prefWidth="1920.0" prefHeight="1080.0" > 18 <children> 19 </children> 20 </Pane> 21 </content> 22 </ScrollPane> 23 </items> 24 </SplitPane> 25 </children> 26</AnchorPane>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/12/20 04:34
2016/12/20 04:53