< prev index next >

modules/graphics/src/main/java/javafx/concurrent/Task.java

Print this page

        

@@ -75,15 +75,17 @@
  *     can also call it directly (by invoking the {@link javafx.concurrent.Task#run()} method)
  *     from another background thread. This allows for composition of work, or pass it to
  *     a new Thread constructed and executed manually. Finally, since you can
  *     manually create a new Thread, passing it a Runnable, it is possible to use
  *     the following idiom:
+ * </p>
  *     <pre><code>
  *         Thread th = new Thread(task);
  *         th.setDaemon(true);
  *         th.start();
  *     </code></pre>
+ * <p>
  *     Note that this code sets the daemon flag of the Thread to true. If you
  *     want a background thread to prevent the VM from existing after the last
  *     stage is closed, then you would want daemon to be false. However, if
  *     you want the background threads to simply terminate after all the
  *     stages are closed, then you must set daemon to true.

@@ -441,11 +443,11 @@
  * <pre><code>
  *     Task&lt;ObservableList&lt;Rectangle&gt;&gt; task = new Task&lt;ObservableList&lt;Rectangle&gt;&gt;() {
  *         @Override protected ObservableList&lt;Rectangle&gt; call() throws Exception {
  *             updateMessage("Creating Rectangles");
  *             ObservableList&lt;Rectangle&gt; results = FXCollections.observableArrayList();
- *             for (int i=0; i<100; i++) {
+ *             for (int i=0; i&lt;100; i++) {
  *                 if (isCancelled()) break;
  *                 Rectangle r = new Rectangle(10, 10);
  *                 r.setX(10 * i);
  *                 results.add(r);
  *                 updateProgress(i, 100);

@@ -521,22 +523,22 @@
  * result.</p>
  *
  * <pre><code>
  *     public class PartialResultsTask extends Task&lt;ObservableList&lt;Rectangle&gt;&gt; {
  *         // Uses Java 7 diamond operator
- *         private ReadOnlyObjectWrapper<ObservableList<Rectangle>> partialResults =
- *                 new ReadOnlyObjectWrapper<>(this, "partialResults",
- *                         FXCollections.observableArrayList(new ArrayList<Rectangle>()));
+ *         private ReadOnlyObjectWrapper&lt;ObservableList&lt;Rectangle&gt;&gt; partialResults =
+ *                 new ReadOnlyObjectWrapper&lt;&gt;(this, "partialResults",
+ *                         FXCollections.observableArrayList(new ArrayList&lt;Rectangle&gt;()));
  *
- *         public final ObservableList<Rectangle> getPartialResults() { return partialResults.get(); }
- *         public final ReadOnlyObjectProperty<ObservableList<Rectangle>> partialResultsProperty() {
+ *         public final ObservableList&lt;Rectangle&gt; getPartialResults() { return partialResults.get(); }
+ *         public final ReadOnlyObjectProperty&lt;ObservableList&lt;Rectangle&gt;&gt; partialResultsProperty() {
  *             return partialResults.getReadOnlyProperty();
  *         }
  *
- *         @Override protected ObservableList<Rectangle> call() throws Exception {
+ *         @Override protected ObservableList&lt;Rectangle&gt; call() throws Exception {
  *             updateMessage("Creating Rectangles...");
- *             for (int i=0; i<100; i++) {
+ *             for (int i=0; i&lt;100; i++) {
  *                 if (isCancelled()) break;
  *                 final Rectangle r = new Rectangle(10, 10);
  *                 r.setX(10 * i);
  *                 Platform.runLater(new Runnable() {
  *                     @Override public void run() {

@@ -561,11 +563,11 @@
  *
  * <pre><code>
  *     final Group group = new Group();
  *     Task&lt;Void&gt; task = new Task&lt;Void&gt;() {
  *         @Override protected Void call() throws Exception {
- *             for (int i=0; i<100; i++) {
+ *             for (int i=0; i&lt;100; i++) {
  *                 if (isCancelled()) break;
  *                 final Rectangle r = new Rectangle(10, 10);
  *                 r.setX(10 * i);
  *                 Platform.runLater(new Runnable() {
  *                     @Override public void run() {
< prev index next >