官术网_书友最值得收藏!

Working with Bounds Demo

There is a very nice public demo by Kishori Sharan that shows how bounds work: http://www.java2s.com/Tutorials/Java/JavaFX_How_to/Node/Know_how_three_bounds_layoutBounds_boundsInLocal_and_boundsInParent_are_computed_for_a_node.htm.

It uses a deprecated API, so I've fixed it and added it to our GitHub as chapter2/other/BoundsDemo.java.

In the following screenshot from this demo, there is a Rectangle with rotation and translate transformations, and a shadow effect: 

The smallest rectangle represents layoutBounds—it's the position of original Rectangle before any other changes.

The bigger rectangle around it is boundsInLocal—the size of the Rectangle after the shadow effect, which spills a bit over the edges.

The blurred rotated rectangle is an actual image you will see after applying all described effects. The large square around it is boundsInParent—the actual size the Rectangle takes on the Scene.

I strongly suggest playing with that demo to get a grasp of how bounds work.

主站蜘蛛池模板: 迁西县| 黄冈市| 洛川县| 乌拉特前旗| 龙里县| 丁青县| 宣恩县| 成都市| 鄂尔多斯市| 珠海市| 旬阳县| 金寨县| 临沭县| 牙克石市| 准格尔旗| 喜德县| 广宗县| 北安市| 伊春市| 广东省| 荥阳市| 绥阳县| 迭部县| 嘉祥县| 沽源县| 蚌埠市| 苍梧县| 中卫市| 隆子县| 太谷县| 南岸区| 叶城县| 石景山区| 庆安县| 峨山| 祁阳县| 五大连池市| 田林县| 祁门县| 新建县| 永州市|