org.sunflow.system

Class UI


public final class UI
extends java.lang.Object

Static singleton interface to a UserInterface object. This is set to a text console by default.

Nested Class Summary

class
UI.Module
class
UI.PrintLevel

Method Summary

static String
formatOutput(UI.Module m, UI.PrintLevel level, String s)
static void
printDetailed(UI.Module m, String s, Object... args)
static void
printError(UI.Module m, String s, Object... args)
static void
printInfo(UI.Module m, String s, Object... args)
static void
printWarning(UI.Module m, String s, Object... args)
static void
set(UserInterface ui)
Sets the active user interface implementation.
static void
taskCancel()
Cancel the currently active task.
static boolean
taskCanceled()
Check to see if the current task should be aborted.
static void
taskStart(String s, int min, int max)
static void
taskStop()
static void
taskUpdate(int current)
static void
verbosity(int verbosity)

Method Details

formatOutput

public static final String formatOutput(UI.Module m,
                                        UI.PrintLevel level,
                                        String s)

printDetailed

public static final void printDetailed(UI.Module m,
                                       String s,
                                       Object... args)

printError

public static final void printError(UI.Module m,
                                    String s,
                                    Object... args)

printInfo

public static final void printInfo(UI.Module m,
                                   String s,
                                   Object... args)

printWarning

public static final void printWarning(UI.Module m,
                                      String s,
                                      Object... args)

set

public static final void set(UserInterface ui)
Sets the active user interface implementation. Passing null silences printing completely.
Parameters:
ui - object to recieve all user interface calls

taskCancel

public static final void taskCancel()
Cancel the currently active task. This forces the application to abort as soon as possible.

taskCanceled

public static final boolean taskCanceled()
Check to see if the current task should be aborted.
Returns:
true if the current task should be stopped, false otherwise

taskStart

public static final void taskStart(String s,
                                   int min,
                                   int max)

taskStop

public static final void taskStop()

taskUpdate

public static final void taskUpdate(int current)

verbosity

public static final void verbosity(int verbosity)