changeset 190:a761c95c1998

Improvements in JavaDoc, further reduction in warnings
author rbair
date Fri, 23 Dec 2011 17:46:08 -0800
parents 73451d92cae1
children e1b7538273be
files javafx-concurrent/src/javafx/concurrent/Task.java javafx-concurrent/src/javafx/concurrent/Worker.java
diffstat 2 files changed, 42 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-concurrent/src/javafx/concurrent/Task.java	Fri Dec 23 17:39:14 2011 -0800
+++ b/javafx-concurrent/src/javafx/concurrent/Task.java	Fri Dec 23 17:46:08 2011 -0800
@@ -25,29 +25,13 @@
 
 package javafx.concurrent;
 
-import com.sun.javafx.scene.NodeEventDispatcher;
 import java.util.concurrent.Callable;
 import java.util.concurrent.FutureTask;
 import java.util.concurrent.atomic.AtomicReference;
 import javafx.application.Platform;
-import javafx.beans.property.BooleanProperty;
-import javafx.beans.property.DoubleProperty;
-import javafx.beans.property.ObjectProperty;
-import javafx.beans.property.ReadOnlyBooleanProperty;
-import javafx.beans.property.ReadOnlyDoubleProperty;
-import javafx.beans.property.ReadOnlyObjectProperty;
-import javafx.beans.property.ReadOnlyStringProperty;
-import javafx.beans.property.SimpleBooleanProperty;
-import javafx.beans.property.SimpleDoubleProperty;
-import javafx.beans.property.SimpleObjectProperty;
-import javafx.beans.property.SimpleStringProperty;
-import javafx.beans.property.StringProperty;
+import javafx.beans.property.*;
+import javafx.event.*;
 import static javafx.concurrent.WorkerStateEvent.*;
-import javafx.event.Event;
-import javafx.event.EventDispatchChain;
-import javafx.event.EventHandler;
-import javafx.event.EventTarget;
-import javafx.event.EventType;
 
 /**
  * <p>
@@ -227,7 +211,7 @@
 
     /**
      * A protected convenience method for subclasses, called whenever the
-     * state of the Task has transitioned to the {@link State.SCHEDULED} state.
+     * state of the Task has transitioned to the SCHEDULED state.
      * This method is invoked after any listeners of the state property
      * and after the Task has been fully transitioned to the new state.
      */
@@ -265,7 +249,7 @@
 
     /**
      * A protected convenience method for subclasses, called whenever the
-     * state of the Task has transitioned to the {@link State.RUNNING} state.
+     * state of the Task has transitioned to the RUNNING state.
      * This method is invoked after any listeners of the state property
      * and after the Task has been fully transitioned to the new state.
      */
@@ -303,7 +287,7 @@
 
     /**
      * A protected convenience method for subclasses, called whenever the
-     * state of the Task has transitioned to the {@link State.SUCCEEDED} state.
+     * state of the Task has transitioned to the SUCCEEDED state.
      * This method is invoked after any listeners of the state property
      * and after the Task has been fully transitioned to the new state.
      */
@@ -341,7 +325,7 @@
 
     /**
      * A protected convenience method for subclasses, called whenever the
-     * state of the Task has transitioned to the {@link State.CANCELLED} state.
+     * state of the Task has transitioned to the CANCELLED state.
      * This method is invoked after any listeners of the state property
      * and after the Task has been fully transitioned to the new state.
      */
@@ -379,7 +363,7 @@
 
     /**
      * A protected convenience method for subclasses, called whenever the
-     * state of the Task has transitioned to the {@link State.FAILED} state.
+     * state of the Task has transitioned to the FAILED state.
      * This method is invoked after any listeners of the state property
      * and after the Task has been fully transitioned to the new state.
      */
--- a/javafx-concurrent/src/javafx/concurrent/Worker.java	Fri Dec 23 17:39:14 2011 -0800
+++ b/javafx-concurrent/src/javafx/concurrent/Worker.java	Fri Dec 23 17:46:08 2011 -0800
@@ -163,12 +163,15 @@
      * end states (SUCCEEDED, CANCELLED, or FAILED) back to READY and then
      * immediately to SCHEDULED and RUNNING. These state transitions may occur
      * immediately one after the other, but will always occur in the prescribed order.
+     *
+     * @return The current state of this Worker
      */
     public State getState();
 
     /**
      * Gets the ReadOnlyObjectProperty representing the current state.
-     * @return
+     *
+     * @return The property representing the state
      */
     public ReadOnlyObjectProperty<State> stateProperty();
 
@@ -176,12 +179,15 @@
      * Specifies the value, or result, of this Worker. This is set upon entering
      * the SUCCEEDED state, and cleared (set to null) if the Worker is reinitialized
      * (that is, if the Worker is a reusable Worker and is reset or restarted).
+     *
+     * @return the current value of this Worker
      */
     public V getValue();
 
     /**
      * Gets the ReadOnlyObjectProperty representing the value.
-     * @return
+     *
+     * @return The property representing the current value
      */
     public ReadOnlyObjectProperty<V> valueProperty();
 
@@ -190,12 +196,15 @@
      * If this property value is {@code null}, there is no known exception, even if
      * the status is FAILED. If this property is not {@code null}, it will most
      * likely contain an exception that describes the cause of failure.
+     *
+     * @return the exception, if one occurred
      */
     public Throwable getException();
 
     /**
      * Gets the ReadOnlyObjectProperty representing any exception which occurred.
-     * @return
+     *
+     * @return the property representing the exception
      */
     public ReadOnlyObjectProperty<Throwable> exceptionProperty();
 
@@ -209,12 +218,14 @@
      *
      * @see #totalWorkProperty
      * @see #progressProperty
+     * @return the amount of work done
      */
     public double getWorkDone();
 
     /**
      * Gets the ReadOnlyLongProperty representing the current progress.
-     * @return
+     *
+     * @return The property representing the amount of work done
      */
     public ReadOnlyDoubleProperty workDoneProperty();
 
@@ -226,6 +237,7 @@
      *
      * @see #workDoneProperty
      * @see #progressProperty
+     * @return the total work to be done
      */
     public double getTotalWork();
 
@@ -234,7 +246,8 @@
      * that needs to be done. These "work units" have meaning to the Worker
      * implementation, such as the number of bytes that need to be downloaded
      * or the number of images to process or some other such metric.
-     * @return
+     *
+     * @return the property representing the total work to be done
      */
     public ReadOnlyDoubleProperty totalWorkProperty();
 
@@ -247,12 +260,14 @@
      *
      * @see #workDoneProperty
      * @see #totalWorkProperty
+     * @return the current progress
      */
     public double getProgress();
 
     /**
      * Gets the ReadOnlyLongProperty representing the progress.
-     * @return
+     *
+     * @return the property representing the progress
      */
     public ReadOnlyDoubleProperty progressProperty();
 
@@ -261,44 +276,53 @@
      * {@link javafx.scene.control.ProgressIndicator}, you will typically bind the visibility
      * of the ProgressIndicator to the Worker's running property, and the progress of the
      * ProgressIndicator to the Worker's progress property.
+     *
+     * @return true if this Worker is running
      */
     public boolean isRunning();
 
     /**
      * Gets the ReadOnlyBooleanProperty representing whether the Worker is running.
-     * @return
+     *
+     * @return the property representing whether the worker is running
      */
     public ReadOnlyBooleanProperty runningProperty();
 
     /**
      * Gets a message associated with the current state of this Worker. This may
      * be something such as "Processing image 1 of 3", for example.
-     * @return
+     *
+     * @return the current message
      */
     public String getMessage();
 
     /**
      * Gets the ReadOnlyStringProperty representing the message.
-     * @return
+     *
+     * @return a property representing the current message
      */
     public ReadOnlyStringProperty messageProperty();
 
     /**
      * An optional title that should be associated with this Worker.
      * This may be something such as "Modifying Images".
-     * @return
+     *
+     * @return the current title
      */
     public String getTitle();
 
     /**
      * Gets the ReadOnlyStringProperty representing the title.
-     * @return
+     *
+     * @return the property representing the current title
      */
     public ReadOnlyStringProperty titleProperty();
 
     /**
      * Terminates execution of this Worker. Calling this method will either
      * remove this Worker from the execution queue or stop execution.
+     *
+     * @return returns true if the cancel was successful
      */
     public boolean cancel();
 }