fr.umlv.lawrence
Class Application

java.lang.Object
  extended by fr.umlv.lawrence.Application

public class Application
extends Object


Constructor Summary
Application()
           
 
Method Summary
static void display(GridPane<?> pane, String title, boolean scrolls, boolean zoom)
          Opens a window containing the given view with given title, optionals scroll bars and optional ability to zoom using the mouse wheel.
static void display(GridPane<?> pane, String title, boolean scrolls, double zoomFactor, int minSize, int maxSize)
          Opens a window containing the given view with given title, optionals scroll bars and optional ability to zoom using the mouse wheel.
static void postInApplicationThread(Runnable runnable)
          Post a runnable to be executed by the application thread.
static ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
          Creates and executes a one-shot action that becomes enabled after the given delay in the application thread.
static ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
          Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given period; that is executions will commence after initialDelay then initialDelay+period, then initialDelay + 2 * period, and so on.
static ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
          Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given delay between the termination of one execution and the commencement of the next.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Application

public Application()
Method Detail

postInApplicationThread

public static void postInApplicationThread(Runnable runnable)
Post a runnable to be executed by the application thread.

Parameters:
runnable - the runnable to execute.

schedule

public static ScheduledFuture<?> schedule(Runnable command,
                                          long delay,
                                          TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay in the application thread.

Parameters:
command - the command to execute
delay - the time from now to delay execution
unit - the time unit of the delay parameter
Returns:
a ScheduledFuture representing pending completion of the task and whose get() method will return null upon completion.

scheduleAtFixedRate

public static ScheduledFuture<?> scheduleAtFixedRate(Runnable command,
                                                     long initialDelay,
                                                     long period,
                                                     TimeUnit unit)
Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given period; that is executions will commence after initialDelay then initialDelay+period, then initialDelay + 2 * period, and so on. If any execution of the task encounters an exception, subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the executor. If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute.

Parameters:
command - the command to execute
initialDelay - the time to delay first execution
period - the period between successive executions
unit - the time unit of the initialDelay and period parameters
Returns:
a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation

scheduleWithFixedDelay

public static ScheduledFuture<?> scheduleWithFixedDelay(Runnable command,
                                                        long initialDelay,
                                                        long delay,
                                                        TimeUnit unit)
Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given delay between the termination of one execution and the commencement of the next. If any execution of the task encounters an exception, subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the executor.

Parameters:
command - the command to execute
initialDelay - the time to delay first execution
delay - the time from now to delay execution
unit - the time unit of the initialDelay and period parameters
Returns:
a ScheduledFuture representing pending completion of the task, and whose get() method will throw an exception upon cancellation

display

public static void display(GridPane<?> pane,
                           String title,
                           boolean scrolls,
                           boolean zoom)
Opens a window containing the given view with given title, optionals scroll bars and optional ability to zoom using the mouse wheel.

Parameters:
pane - the grid pane to display
title - the title of the window
scrolls - tells wether scroll bars are to be displayed
zoom - tells wether wheel zooms

display

public static void display(GridPane<?> pane,
                           String title,
                           boolean scrolls,
                           double zoomFactor,
                           int minSize,
                           int maxSize)
Opens a window containing the given view with given title, optionals scroll bars and optional ability to zoom using the mouse wheel.

Parameters:
pane - the grid pane to display
title - the title of the window
scrolls - tells wether scroll bars are to be displayed
zoom - tells how much wether wheel zooms, 0 to disable this feature