Class Image

    • Constructor Detail

      • Image

        public Image()
    • Method Detail

      • getBaseline

        public int getBaseline()
        Description copied from interface: Visual
        Returns the visual's baseline.
        Specified by:
        getBaseline in interface Visual
        Returns:
        The baseline relative to the origin of the visual, or -1 if this visual does not have a baseline.
      • update

        public void update​(int x,
                           int y,
                           int width,
                           int height)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • load

        public static Image load​(java.net.URL location)
                          throws TaskExecutionException
        Load an image from the given URL location, but without any listener. The load will be done synchronously, on the current thread. Any errors will be wrapped in the TaskExecutionException that is thrown.
        Parameters:
        location - The URL where the image can be found.
        Returns:
        The loaded image.
        Throws:
        TaskExecutionException - if there were problems loading the image.
        See Also:
        Image.LoadTask
      • load

        public static Image.LoadTask load​(java.net.URL location,
                                          TaskListener<Image> loadListener)
        Load an image from the given URL location, in the background, and return a reference to the background task.
        Parameters:
        location - The URL where the image can be found.
        loadListener - A listener for completion of the background task.
        Returns:
        A reference to the background task.
      • loadFromCache

        public static Image loadFromCache​(java.net.URL location)
        Load an image. First try to find it in the resource cached kept by the ApplicationContext. If not found, load it in the foreground and cache the result.
        Parameters:
        location - The URL where the image can be found.
        Returns:
        The loaded image.
        Throws:
        java.lang.IllegalArgumentException - wrapping the TaskExecutionException, which in turn will wrap the underlying problem.