From cff44bc9fcabbda54c2b31d4328bb44ca98f92d5 Mon Sep 17 00:00:00 2001 From: Jarek Sacha Date: Thu, 8 Aug 2024 20:10:15 -0400 Subject: [PATCH] Some wording improvements in ScalaDoc --- .../extras/image/ImageDisplayDemoApp.scala | 2 +- .../scalafx/extras/image/ImageDisplay.scala | 20 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/scalafx-extras-demos/src/main/scala/org/scalafx/extras/image/ImageDisplayDemoApp.scala b/scalafx-extras-demos/src/main/scala/org/scalafx/extras/image/ImageDisplayDemoApp.scala index 4fdf026..1f5ef77 100644 --- a/scalafx-extras-demos/src/main/scala/org/scalafx/extras/image/ImageDisplayDemoApp.scala +++ b/scalafx-extras-demos/src/main/scala/org/scalafx/extras/image/ImageDisplayDemoApp.scala @@ -107,7 +107,7 @@ object ImageDisplayDemoApp extends JFXApp3 { // --------------------------------------------------------------------------- /** - * Let user select image file and load it. + * Let user select an image file and load it. */ def onFileOpen(): Unit = { val fileChooser = new FileChooser() diff --git a/scalafx-extras/src/main/scala/org/scalafx/extras/image/ImageDisplay.scala b/scalafx-extras/src/main/scala/org/scalafx/extras/image/ImageDisplay.scala index 69737f3..70ba797 100644 --- a/scalafx-extras/src/main/scala/org/scalafx/extras/image/ImageDisplay.scala +++ b/scalafx-extras/src/main/scala/org/scalafx/extras/image/ImageDisplay.scala @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2021, ScalaFX Project + * Copyright (c) 2011-2024, ScalaFX Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -78,7 +78,7 @@ import scalafx.scene.shape.Rectangle * } * }}} */ -class ImageDisplay() { +class ImageDisplay { private val imageView = new ImageView { preserveRatio = true @@ -95,12 +95,12 @@ class ImageDisplay() { private val scrollPane: ScrollPane = new ScrollPane { self => - // setting `fitTo* = true` makes the image centered when view point is larger than the zoomed image. + // setting `fitTo* = true` makes the image centered when the view point is larger than the zoomed image. fitToHeight = true fitToWidth = true // Wrap content in a group, as advised in ScrollPane documentation, - // to get proper size for fitting with using `zoomToFit`. - // This may not be needed, as wrapping in a group makes it difficult to center. + // to get the proper size for fitting with using `zoomToFit`. + // This may not be necessary, as wrapping in a group makes it difficult to center. // content = new Group { // children = new StackPane { // children = Seq(imageView, overlayPane) @@ -112,13 +112,15 @@ class ImageDisplay() { } /** - * Controls image zoom when `zoomToFit` is off. Value of 1 mean no scaling. - * Values larger than 1 make image larger. Values smaller than 1 make image smaller. + * Controls image zoom when `zoomToFit` is off. + * The value of 1 means no scaling. + * Values larger than 1 make image larger. + * Values smaller than 1 make image smaller. */ val zoom: ObjectProperty[ZoomScale] = ObjectProperty[ZoomScale](this, "Zoom", ZoomScale.Zoom100Perc) /** - * When set to `true` the image fits to the size of the available view, maintaining its aspect ratio. + * When set to `true`, the image fits to the size of the available view, maintaining its aspect ratio. */ val zoomToFit: BooleanProperty = BooleanProperty(value = false) @@ -147,7 +149,7 @@ class ImageDisplay() { val flipY: BooleanProperty = BooleanProperty(value = false) /** - * Property containing image to be displayed. If `null` the display will be blank (following JavaFX convention) + * Property containing image to be displayed. If `null`, the display will be blank (following JavaFX convention) */ val image: ObjectProperty[javafx.scene.image.Image] = imageView.image