All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.puresoltechnologies.javafx.tasks.TaskInfo Maven / Gradle / Ivy

There is a newer version: 0.13.0
Show newest version
package com.puresoltechnologies.javafx.tasks;

import java.util.Optional;

import javafx.concurrent.Task;
import javafx.scene.image.Image;

public class TaskInfo {

    private final Task task;
    private final Optional image;
    private final Optional message;

    public TaskInfo(Task task) {
	this.task = task;
	this.message = Optional.empty();
	this.image = Optional.empty();
    }

    public TaskInfo(Task task, Image image) {
	this.task = task;
	this.message = Optional.empty();
	this.image = Optional.of(image);
    }

    public TaskInfo(Task task, String message) {
	this.task = task;
	this.message = Optional.of(message);
	this.image = Optional.empty();
    }

    public TaskInfo(Task task, String message, Image image) {
	this.task = task;
	this.message = Optional.of(message);
	this.image = Optional.of(image);
    }

    public Task getTask() {
	return task;
    }

    public Optional getMessage() {
	return message;
    }

    public String getTitle() {
	return task.getTitle();
    }

    public Optional getImage() {
	return image;
    }

    public double getProgress() {
	return task.getProgress();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy