Skip to content

Commit

Permalink
Some wording improvements in ScalaDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsacha committed Aug 9, 2024
1 parent 479dd7e commit cff44bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -78,7 +78,7 @@ import scalafx.scene.shape.Rectangle
* }
* }}}
*/
class ImageDisplay() {
class ImageDisplay {

private val imageView = new ImageView {
preserveRatio = true
Expand All @@ -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)
Expand All @@ -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)

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit cff44bc

Please sign in to comment.