Class WhatNextManager
java.lang.Object
net.sf.colossus.common.WhatNextManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA demon thread which is started by triggerTimedQuit.static enumThe various constants for activities what the Start class should do as next thing, typically when a dialog is closed or a games ended. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate booleanprivate static final Loggerprivate final Optionsprivate WhatNextManager.WhatToDoNext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintbooleanReturns true if this action was caused by interactive means.voidsetWhatToDoNext(WhatNextManager.WhatToDoNext whatToDoNext, boolean triggerQuitTimer) A convenient shortcut to the 3-argument-form, for the many calls where interactive is to be set to false.voidsetWhatToDoNext(WhatNextManager.WhatToDoNext whatToDoNext, boolean triggerQuitTimer, boolean interactive) Set the action what shall be executed next.voidsetWhatToDoNext(WhatNextManager.WhatToDoNext whatToDoNext, String loadFile, boolean interactive) static voidsleepFor(long millis) voidTrigger a timed Quit, which will (by using a demon thread) terminate the JVM after a timeout (currently 10 (120) seconds) - unless the JVM has quit already anyway because cleanup has succeeded as planned.
-
Field Details
-
LOGGER
-
startOptions
-
interactive
private boolean interactive -
whatToDoNext
-
howManyGamesLeft
private int howManyGamesLeft
-
-
Constructor Details
-
WhatNextManager
-
-
Method Details
-
getWhatToDoNext
-
isInteractive
public boolean isInteractive()Returns true if this action was caused by interactive means. If so, it makes sense to display a error message dialog box if something went wrong.- Returns:
- action to do is marked as "was triggered interactively"
-
setWhatToDoNext
public void setWhatToDoNext(WhatNextManager.WhatToDoNext whatToDoNext, boolean triggerQuitTimer, boolean interactive) Set the action what shall be executed next. Trigger also the timer for the "Timed Quit", if requested so.- Parameters:
whatToDoNext-triggerQuitTimer-interactive-
-
setWhatToDoNext
A convenient shortcut to the 3-argument-form, for the many calls where interactive is to be set to false.- Parameters:
whatToDoNext-triggerQuitTimer-
-
getStartOptions
- Returns:
- Returns the same startOptions object that Start object uses.
-
setWhatToDoNext
public void setWhatToDoNext(WhatNextManager.WhatToDoNext whatToDoNext, String loadFile, boolean interactive) -
getHowManyGamesLeft
public int getHowManyGamesLeft() -
decrementHowManyGamesLeft
public int decrementHowManyGamesLeft() -
triggerTimedQuit
public void triggerTimedQuit()Trigger a timed Quit, which will (by using a demon thread) terminate the JVM after a timeout (currently 10 (120) seconds) - unless the JVM has quit already anyway because cleanup has succeeded as planned. -
sleepFor
public static void sleepFor(long millis)
-