Class PublicTask<T>

java.lang.Object
java.util.concurrent.FutureTask<T>
javafx.concurrent.Task<T>
com.imyeyu.fx.task.PublicTask<T>
All Implemented Interfaces:
Runnable, Future<T>, RunnableFuture<T>, javafx.concurrent.Worker<T>, javafx.event.EventTarget

public abstract class PublicTask<T> extends javafx.concurrent.Task<T>
Task 提升权限,所有操作视 UI 线程状态选择性调度(UI 繁忙时不更新),数据计算不应在更新回调中
Since:
2022-01-08 16:24
Author:
夜雨
  • Nested Class Summary

    Nested classes/interfaces inherited from interface Future

    Future.State

    Nested classes/interfaces inherited from interface javafx.concurrent.Worker

    javafx.concurrent.Worker.State
  • Property Summary

    Properties inherited from class javafx.concurrent.Task

    exception, message, onCancelled, onFailed, onRunning, onScheduled, onSucceeded, progress, running, state, title, totalWork, value, workDone
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    更新消息
    void
    updateProgress(double workDone, double max)
    更新进度(自动计算百分比)
    void
    updateProgress(long workDone, long max)
    更新进度(自动计算百分比)
    void
    更新标题
    void
    updateValue(T value)
    更新数据

    Methods inherited from class javafx.concurrent.Task

    addEventFilter, addEventHandler, buildEventDispatchChain, call, cancel, cancel, cancelled, exceptionProperty, failed, fireEvent, getException, getMessage, getOnCancelled, getOnFailed, getOnRunning, getOnScheduled, getOnSucceeded, getProgress, getState, getTitle, getTotalWork, getValue, getWorkDone, isRunning, messageProperty, onCancelledProperty, onFailedProperty, onRunningProperty, onScheduledProperty, onSucceededProperty, progressProperty, removeEventFilter, removeEventHandler, running, runningProperty, scheduled, setEventHandler, setOnCancelled, setOnFailed, setOnRunning, setOnScheduled, setOnSucceeded, stateProperty, succeeded, titleProperty, totalWorkProperty, valueProperty, workDoneProperty

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PublicTask

      public PublicTask()
  • Method Details

    • updateValue

      public void updateValue(T value)
      更新数据
      Overrides:
      updateValue in class javafx.concurrent.Task<T>
      Parameters:
      value - 数据对象
    • updateMessage

      public void updateMessage(String message)
      更新消息
      Overrides:
      updateMessage in class javafx.concurrent.Task<T>
      Parameters:
      message - 消息
    • updateProgress

      public void updateProgress(long workDone, long max)
      更新进度(自动计算百分比)
      Overrides:
      updateProgress in class javafx.concurrent.Task<T>
      Parameters:
      workDone - 已完成
      max - 最大
    • updateProgress

      public void updateProgress(double workDone, double max)
      更新进度(自动计算百分比)
      Overrides:
      updateProgress in class javafx.concurrent.Task<T>
      Parameters:
      workDone - 已完成
      max - 最大
    • updateTitle

      public void updateTitle(String title)
      更新标题
      Overrides:
      updateTitle in class javafx.concurrent.Task<T>
      Parameters:
      title - 标题