JTP
Class Main

java.lang.Object
  extended by JTP.Main

public class Main
extends Object

Class from which JTP is launched.

Author:
V.Termanis

Field Summary
protected static String cpMessage
          Copyright message
protected static Color progressColor
          Colour for loading progress overlay on splash screen
protected static int progressHeight
          How much of the loading screen (height wise) should be filled with the overlay colour
protected static String version
          Version string
 
Constructor Summary
Main()
           
 
Method Summary
protected static boolean centered(JFrame frame)
          Tries to center the frame is possible.
static boolean develModeOn()
          Indicates whether development mode has been turned on.
static boolean inAppletMode()
          Queries whether the game is running as an applet.
static void main(String[] args)
          Launch method.
static void setAppletMode()
          Used by MainApplet class to indicate the game is running in applet mode.
protected static void setCustomLookAndFeel()
          Tries to apply custom look and feel.
protected static boolean setProperty(String name, String value)
          Sets a system property gracefully.
protected static String stackTraceToString(Exception e)
          Formats traceback stack by inserting line breaks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

protected static final String version
Version string

See Also:
Constant Field Values

cpMessage

protected static final String cpMessage
Copyright message

See Also:
Constant Field Values

progressColor

protected static final Color progressColor
Colour for loading progress overlay on splash screen


progressHeight

protected static final int progressHeight
How much of the loading screen (height wise) should be filled with the overlay colour

See Also:
Constant Field Values
Constructor Detail

Main

public Main()
Method Detail

main

public static void main(String[] args)
Launch method. Possible parameters (all will be ignored if more than one specified):
To use development mode start with JTP.Development flag set to true.


setCustomLookAndFeel

protected static void setCustomLookAndFeel()
Tries to apply custom look and feel.


stackTraceToString

protected static String stackTraceToString(Exception e)
Formats traceback stack by inserting line breaks.


setProperty

protected static boolean setProperty(String name,
                                     String value)
Sets a system property gracefully.

Parameters:
name - name of the property to set
value - value of the property to set
Returns:
true if the property was successfully set, false otherwise.

centered

protected static boolean centered(JFrame frame)
Tries to center the frame is possible.


develModeOn

public static boolean develModeOn()
Indicates whether development mode has been turned on. Note: To turn on development mode set JTP.Development=true.

Returns:
true if development mode is on.

setAppletMode

public static void setAppletMode()
Used by MainApplet class to indicate the game is running in applet mode. (So e.g. Exit button is not shown in the main menu and the progress file is saved to a meaningful location given the game is running through a browser plugin


inAppletMode

public static boolean inAppletMode()
Queries whether the game is running as an applet. (This has previously been set using setAppletMode.)

Returns:
true if the game is running in applet mode, false otherwise.