ImageVisual

open class ImageVisual(    image: BufferedImage,     width: Int = -1,     height: Int = -1,     offsetX: Int = 0,     offsetY: Int = 0,     val path: String = "") : SingleLayerVisual

Visual showing an Image.

The image gets stretched to the size of the component that this visual is embedded in.

A sub-image can be loaded by passing offsetX/offsetY for the TOP_LEFT corner and width/height for the sub-image size. If width or height is passed as -1, the remaining image from offsetX/offsetY will be loaded.

Parameters

image

Image to show.

width

Width of sub-image. Pass -1 to use full width. Default: -1.

height

Height of sub-image. Pass -1 to use full height. Default: -1.

offsetX

Left bound of sub-image. Default: 0.

offsetY

Top bound of sub-image. Default: 0.

Constructors

Link copied to clipboard
fun ImageVisual(    path: String,     width: Int = -1,     height: Int = -1,     offsetX: Int = 0,     offsetY: Int = 0)

Loads an ImageVisual from a path.

Link copied to clipboard
fun ImageVisual(    file: File,     width: Int = -1,     height: Int = -1,     offsetX: Int = 0,     offsetY: Int = 0)

Loads an ImageVisual from a file.

Link copied to clipboard
fun ImageVisual(    image: BufferedImage,     width: Int = -1,     height: Int = -1,     offsetX: Int = 0,     offsetY: Int = 0,     path: String = "")

Loads an ImageVisual from a BufferedImage.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun addListener(listener: Observer)

Adds a listener silently.

Link copied to clipboard
fun addListenerAndInvoke(listener: Observer)

Adds a listener and calls Observer.update on this new listener.

Link copied to clipboard
fun clearListeners()

Removes all listeners.

Link copied to clipboard
open override fun copy(): ImageVisual

Copies this ImageVisual to a new object.

Link copied to clipboard
fun notifyChange()

Notifies all listeners by calling Observer.update.

Link copied to clipboard
fun removeListener(listener: Observer): Boolean

Removes a listener.

Properties

Link copied to clipboard
open var backgroundRadius: BackgroundRadius?

Background radius.

Link copied to clipboard
var backgroundRadiusProperty: Property<BackgroundRadius?>

Property for backgroundRadius.

Link copied to clipboard
open var borderColor: BorderColor?

Border color.

Link copied to clipboard
var borderColorProperty: Property<BorderColor?>

Property for borderColor.

Link copied to clipboard
open var borderRadius: BorderRadius?

Border radius.

Link copied to clipboard
var borderRadiusProperty: Property<BorderRadius?>

Property for borderRadius.

Link copied to clipboard
open var borderStyle: BorderStyle?

Border style.

Link copied to clipboard
var borderStyleProperty: Property<BorderStyle?>

Property for borderStyle.

Link copied to clipboard
open var borderWidth: BorderWidth?

Border width.

Link copied to clipboard
var borderWidthProperty: Property<BorderWidth?>

Property for borderWidth.

Link copied to clipboard
open var cursor: Cursor?

Cursor.

Link copied to clipboard
var cursorProperty: Property<Cursor?>

Property for cursor.

Link copied to clipboard
var image: BufferedImage

The displayed image.

Link copied to clipboard
val imageProperty: Property<BufferedImage>

Property for the displayed image.

Link copied to clipboard
val path: String
Link copied to clipboard
var style: String

Css style that gets applied to this Visual.

Link copied to clipboard
val styleProperty: StringProperty

Property for the css style that gets applied to this Visual.

Link copied to clipboard
var transparency: Double

The transparency / alpha channel for this Visual.

Link copied to clipboard
val transparencyProperty: LimitedDoubleProperty

Property for the transparency / alpha channel for this Visual.