Show / Hide Table of Contents

Class UiHelper

Class containing Helper methods for modifying the Ui.

Inheritance
java.lang.Object
UiHelper
Inherited Members
java.lang.Object.clone()
java.lang.Object.equals(java.lang.Object)
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.hashCode()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.toString()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)
Namespace:
Assembly: .dll
Syntax
public final class UiHelper

Constructors

UiHelper()

Declaration
public UiHelper()

Methods

adjustVisual(Label label, double x, double y)

Simple method that sets relevant information for a given image view.

Declaration
public static void adjustVisual(Label label, double x, double y)
Parameters
Type Name Description
javafx.scene.control.Label label

the label that shall be adjusted.

double x

the x coordinate for the JavaFX positioning.

double y

the y coordinate for the JavaFX positioning.

adjustVisual(ImageView imageView, boolean visible, double x, double y)

Simple method that sets relevant information for a given image view.

Declaration
public static void adjustVisual(ImageView imageView, boolean visible, double x, double y)
Parameters
Type Name Description
javafx.scene.image.ImageView imageView

the image view that shall be adjusted.

boolean visible

the visibility for the given image view.

double x

the x coordinate for the JavaFX positioning.

double y

the y coordinate for the JavaFX positioning.

adjustVisual(ImageView imageView, boolean visible, double x, double y, double fitWidth, double fitHeight)

Simple method that sets relevant information for a given image view.

Declaration
public static void adjustVisual(ImageView imageView, boolean visible, double x, double y, double fitWidth, double fitHeight)
Parameters
Type Name Description
javafx.scene.image.ImageView imageView

the image view that shall be adjusted.

boolean visible

the visibility for the given image view.

double x

the x coordinate for the JavaFX positioning.

double y

the y coordinate for the JavaFX positioning.

double fitWidth

the fit width of the given image view.

double fitHeight

the fit height of the given image view.

adjustVisual(ImageView imageView, boolean visible, Vector2<Double> position)

Simple method that sets relevant information for a given image view.

Declaration
public static void adjustVisual(ImageView imageView, boolean visible, Vector2<Double> position)
Parameters
Type Name Description
javafx.scene.image.ImageView imageView

the image view that shall be adjusted.

boolean visible

the visibility for the given image view.

Vector2<java.lang.Double> position

the positioning vector for the given image view.

adjustVisual(ImageView imageView, boolean visible, Vector2<Double> position, Vector2<Double> fitSizes)

Simple method that sets relevant information for a given image view.

Declaration
public static void adjustVisual(ImageView imageView, boolean visible, Vector2<Double> position, Vector2<Double> fitSizes)
Parameters
Type Name Description
javafx.scene.image.ImageView imageView

the image view that shall be adjusted.

boolean visible

the visibility for the given image view.

Vector2<java.lang.Double> position

the positioning vector for the given image view.

Vector2<java.lang.Double> fitSizes

the fit size vector for the given image view.

adjustVisual(ImageView imageView, double x, double y)

Simple method that sets relevant information for a given image view.

Declaration
public static void adjustVisual(ImageView imageView, double x, double y)
Parameters
Type Name Description
javafx.scene.image.ImageView imageView

the image view that shall be adjusted.

double x

the x coordinate for the JavaFX positioning.

double y

the y coordinate for the JavaFX positioning.

adjustVisual(ImageView imageView, Vector2<Double> position)

Simple method that sets relevant information for a given image view.

Declaration
public static void adjustVisual(ImageView imageView, Vector2<Double> position)
Parameters
Type Name Description
javafx.scene.image.ImageView imageView

the image view that shall be adjusted.

Vector2<java.lang.Double> position

the positioning vector for the given image view.

adjustVisual(ImageView imageView, Vector2<Double> position, Vector2<Double> fitSizes)

Simple method that sets relevant information for a given image view.

Declaration
public static void adjustVisual(ImageView imageView, Vector2<Double> position, Vector2<Double> fitSizes)
Parameters
Type Name Description
javafx.scene.image.ImageView imageView

the image view that shall be adjusted.

Vector2<java.lang.Double> position

the positioning vector for the given image view.

Vector2<java.lang.Double> fitSizes

the fit size vector for the given image view.

greyScaleImage(Image inputImage, double contrast)

This method grey scales an image so that other colored elements can be better seen on it.

Declaration
public static ImageView greyScaleImage(Image inputImage, double contrast)
Parameters
Type Name Description
javafx.scene.image.Image inputImage

the image that needs to be grey-scaled.

double contrast

the contrast for the image.

Returns
Type Description
javafx.scene.image.ImageView

the grey-scaled image.

inovkeOnUiThread(Runnable runnable)

Runs a Runnable on the Ui thread. Use this when you you want to update the Ui but are not on the Ui tread.

Declaration
public static void inovkeOnUiThread(Runnable runnable)
Parameters
Type Name Description
java.lang.Runnable runnable

The runnable to run

recolorImage(Image inputImage, Color newColor)

This method recolors any input image pixel by pixel with a given JavaFX color.

Declaration
public static Image recolorImage(Image inputImage, Color newColor)
Parameters
Type Name Description
javafx.scene.image.Image inputImage

the image that needs to be recolored.

javafx.scene.paint.Color newColor

the new color for the given image.

Returns
Type Description
javafx.scene.image.Image

the recolored image.

resizeImage(ImageView resizeImage, Vector2<Double> sizeVector)

Reesizes an ImageView to the size of a given vector.

Declaration
public static ImageView resizeImage(ImageView resizeImage, Vector2<Double> sizeVector)
Parameters
Type Name Description
javafx.scene.image.ImageView resizeImage

The ImageView to resize

Vector2<java.lang.Double> sizeVector

The vector whose X and Y coordinates determine the new width and height respectively

Returns
Type Description
javafx.scene.image.ImageView

The resized ImageView

translateHexToRgbColor(String hexCode)

This method translates a hex color code to a JavaFX color.

Declaration
public static Color translateHexToRgbColor(String hexCode)
Parameters
Type Name Description
java.lang.String hexCode

the hex color code.

Returns
Type Description
javafx.scene.paint.Color

the equivalent JavaFX color.

In This Article
Back to top Generated by DocFX