Package jltk.gui

Class Image


  • public class Image
    extends Control
    A object of this class is used to show an image.
    Version:
    18.8.2022
    Author:
    ms
    • Field Detail

      • fxImageView

        protected javafx.scene.image.ImageView fxImageView
      • fxImage

        protected javafx.scene.image.Image fxImage
      • fxLabel

        protected javafx.scene.control.Label fxLabel
    • Constructor Detail

      • Image

        public Image​(double pLeft,
                     double pTop,
                     double pWidth,
                     double pHeight,
                     String pFile)
        Loads the image from the specified file. The image is scaled to the specified width and height.
        Parameters:
        pLeft - The horizontal coordinate
        pTop - The vertical coordinate
        pWidth - The width of the label
        pHeight - The height of the image
        pImage - The filename of the image.
      • Image

        public Image​(double pLeft,
                     double pTop,
                     double pWidth,
                     String pFile)
        Loads the image from the specified file. The image is scaled to the specified width. The height is scaled to preserve ratio.
        Parameters:
        pLeft - The horizontal coordinate
        pTop - The vertical coordinate
        pWidth - The width of the label
        pImage - The filename of the image.
      • Image

        public Image​(Window pWindow,
                     double pLeft,
                     double pTop,
                     double pWidth,
                     String pFile)
        Loads the image from the specified file. The image is scaled to the specified width. The height is scaled to preserve ratio. The image is placed on the specified window.
        Parameters:
        pWindow - The window, the image should be place
        pLeft - The horizontal coordinate
        pTop - The vertical coordinate
        pWidth - The width of the label
        pImage - The filename of the image.
      • Image

        public Image​(Window pWindow,
                     double pLeft,
                     double pTop,
                     double pWidth,
                     double pHeight,
                     String pFile)
        Loads the image from a file. The image is scaled to the specified width and height and placed on the specified window
        Parameters:
        pWindow - The window, the image should be placed
        pLeft - The horizontal coordinate
        pTop - The vertical coordinate
        pWidth - The width of the label
        pHeight - The height of the image
        pImage - The filename of the image.
    • Method Detail

      • setImage

        public void setImage​(String pFile)
        Set a new image and scale it to the width an height of the old image
        Parameters:
        pFile - The filename of the new image.
      • setOnImageClicked

        public void setOnImageClicked​(String pMethodName)
        Set the name of the method, which will be invoked, if the image is clicked.