1
1
/*
2
- * Copyright (c) 2011-2021 , ScalaFX Project
2
+ * Copyright (c) 2011-2024 , ScalaFX Project
3
3
* All rights reserved.
4
4
*
5
5
* Redistribution and use in source and binary forms, with or without
@@ -78,7 +78,7 @@ import scalafx.scene.shape.Rectangle
78
78
* }
79
79
* }}}
80
80
*/
81
- class ImageDisplay () {
81
+ class ImageDisplay {
82
82
83
83
private val imageView = new ImageView {
84
84
preserveRatio = true
@@ -95,12 +95,12 @@ class ImageDisplay() {
95
95
96
96
private val scrollPane : ScrollPane = new ScrollPane {
97
97
self =>
98
- // setting `fitTo* = true` makes the image centered when view point is larger than the zoomed image.
98
+ // setting `fitTo* = true` makes the image centered when the view point is larger than the zoomed image.
99
99
fitToHeight = true
100
100
fitToWidth = true
101
101
// Wrap content in a group, as advised in ScrollPane documentation,
102
- // to get proper size for fitting with using `zoomToFit`.
103
- // This may not be needed , as wrapping in a group makes it difficult to center.
102
+ // to get the proper size for fitting with using `zoomToFit`.
103
+ // This may not be necessary , as wrapping in a group makes it difficult to center.
104
104
// content = new Group {
105
105
// children = new StackPane {
106
106
// children = Seq(imageView, overlayPane)
@@ -112,13 +112,15 @@ class ImageDisplay() {
112
112
}
113
113
114
114
/**
115
- * Controls image zoom when `zoomToFit` is off. Value of 1 mean no scaling.
116
- * Values larger than 1 make image larger. Values smaller than 1 make image smaller.
115
+ * Controls image zoom when `zoomToFit` is off.
116
+ * The value of 1 means no scaling.
117
+ * Values larger than 1 make image larger.
118
+ * Values smaller than 1 make image smaller.
117
119
*/
118
120
val zoom : ObjectProperty [ZoomScale ] = ObjectProperty [ZoomScale ](this , " Zoom" , ZoomScale .Zoom100Perc )
119
121
120
122
/**
121
- * When set to `true` the image fits to the size of the available view, maintaining its aspect ratio.
123
+ * When set to `true`, the image fits to the size of the available view, maintaining its aspect ratio.
122
124
*/
123
125
val zoomToFit : BooleanProperty = BooleanProperty (value = false )
124
126
@@ -147,7 +149,7 @@ class ImageDisplay() {
147
149
val flipY : BooleanProperty = BooleanProperty (value = false )
148
150
149
151
/**
150
- * Property containing image to be displayed. If `null` the display will be blank (following JavaFX convention)
152
+ * Property containing image to be displayed. If `null`, the display will be blank (following JavaFX convention)
151
153
*/
152
154
val image : ObjectProperty [javafx.scene.image.Image ] = imageView.image
153
155
0 commit comments