isDevMode -> InDebugMode

+ Random indention changes.
This commit is contained in:
Dane
2013-06-21 12:11:51 -04:00
parent 3607799354
commit a48c7fbb28
5 changed files with 39 additions and 39 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ public final class Landing {
t.printStackTrace();
}
Directories.validate();
Core.enableDevMode();
Core.setDebug(true);
ServerSelector.getInstance().setVisible(true);
}
+7 -11
View File
@@ -6,22 +6,18 @@ package org.parabot.core;
*
*/
public class Core {
private static boolean devMode = false;
/**
* Enables the developers mode
*/
public static void enableDevMode() {
devMode = true;
private static boolean debug = false;
public static void setDebug(boolean debug) {
Core.debug = debug;
}
/**
* Determines if bot is in developers mode
* @return <b>true</b> if bot is in developers mode
* @return if the botclient is in debug mode.
*/
public static boolean isDevMode() {
return devMode;
public static boolean inDebugMode() {
return debug;
}
}
@@ -27,10 +27,11 @@ public class ServerManifestParser {
/**
* Gets server descriptions
*
* @return list of descriptions
*/
public ServerDescription[] getDescriptions() {
if(Core.isDevMode()) {
if (Core.inDebugMode()) {
return localDesc();
}
return publicDesc();
@@ -16,6 +16,7 @@ import org.parabot.core.logging.SystemConsoleHandler;
import org.parabot.core.logging.TextAreaLogHandler;
public class LogArea extends JScrollPane {
private static final long serialVersionUID = 6571141103751675714L;
private static LogArea instance = null;
private static LogTextArea logArea = new LogTextArea();
@@ -1,6 +1,7 @@
package org.parabot.environment;
import java.lang.reflect.Constructor;
import org.parabot.core.Context;
import org.parabot.core.Core;
import org.parabot.core.classpath.ClassPath;
@@ -22,6 +23,7 @@ public class Environment {
/**
* Loads a new environment
*
* @param url
*/
public static void load(final ServerDescription desc, final String serverName) {
@@ -30,12 +32,12 @@ public class Environment {
BotUI.getInstance().setVisible(true);
}
final ClassPath classPath = Core.isDevMode() ? null : new ClassPath();
final ServerCache cache = Core.isDevMode() ? ServerManifestParser.cache.get(desc) : null;
final ClassPath classPath = Core.inDebugMode() ? null : new ClassPath();
final ServerCache cache = Core.inDebugMode() ? ServerManifestParser.cache.get(desc) : null;
final ServerLoader serverLoader = Core.isDevMode() ? cache.getLoader() : new ServerLoader(classPath);
final ServerLoader serverLoader = Core.inDebugMode() ? cache.getLoader() : new ServerLoader(classPath);
String[] serverProviders = null;
if(!Core.isDevMode()) {
if (!Core.inDebugMode()) {
serverProviders = serverLoader.getServerClassNames();
if (serverProviders == null) {
throw new RuntimeException("No server provided.");
@@ -47,7 +49,7 @@ public class Environment {
@Override
public void run() {
try {
final ServerProvider server = !Core.isDevMode() ? fetchServerProvider(serverLoader) : cache.getProviders()[desc.providerIndex];
final ServerProvider server = !Core.inDebugMode() ? fetchServerProvider(serverLoader) : cache.getProviders()[desc.providerIndex];
final Context context = new Context(server);
context.setEnvironment(serverLoader);
BotToolbar.getInstance().addTab(context, serverName);