Packages

c

org.scalafx.extras.image

ImageDisplay

class ImageDisplay extends AnyRef

Displays an image view with ability to zoom in, zoom out, zoom to fit. It can also automatically resizes to parent size. When zoomToFit is set to true the image is sized to fit the parent scroll pane.

Sample usage (full detains in ImageDisplayDemoApp)

object ImageDisplayDemoApp extends JFXApp3 {

  override def start(): Unit = {

    private val imageDisplay = new ImageDisplay()

    stage = new PrimaryStage {
      scene = new Scene(640, 480) {
        title = "ImageDisplay Demo"
        root = new BorderPane {
          top = new ToolBar {
            items = Seq(
              new Button("Open...") {
                onAction = () => onFileOpen()
              },
              new Button("Zoom In") {
                onAction = () => imageDisplay.zoomIn()
                disable <== imageDisplay.zoomToFit
              },
              new Button("Zoom Out") {
                onAction = () => imageDisplay.zoomOut()
                disable <== imageDisplay.zoomToFit
              },
              new ToggleButton("Zoom to fit") {
                selected <==> imageDisplay.zoomToFit
              }
            )
          }
          center = imageDisplay.view
        }
      }
    }
  }
}
Source
ImageDisplay.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ImageDisplay
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ImageDisplay()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val actualZoom: ReadOnlyDoubleProperty

    Actual zoom value.

    Actual zoom value. It should be the same as zoom when zoomToFit==false, it may be different if zoomToFit==true

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. val image: ObjectProperty[Image]

    Property containing image to be displayed.

    Property containing image to be displayed. If null the display will be blank (following JavaFX convention)

  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. val roi: ObjectProperty[Option[Rectangle]]

    Optional rectangular ROI to be displayed on the image

  18. def rotation: Double

    Image rotation in degrees.

    Image rotation in degrees. Default value is 0 (no rotation).

  19. def rotation_=(r: Double): Unit
  20. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. val view: Node

    ScalaFX node in containing this image display UI.

  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  26. val zoom: ObjectProperty[ZoomScale]

    Controls image zoom when zoomToFit is off.

    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.

  27. def zoomIn(): Unit

    Zoom in the view.

  28. def zoomOut(): Unit

    Zoom out the view.

  29. val zoomToFit: BooleanProperty

    When set to true the image fits to the size of the available view, maintaining its aspect ratio.

Inherited from AnyRef

Inherited from Any

Ungrouped