代码合并
This commit is contained in:
parent
46217e8275
commit
da1104c10c
|
@ -65,7 +65,7 @@ public class Module extends BaseModule {
|
||||||
Container.cache.addComponent("robocode.host.vb", DotNetHost.class);
|
Container.cache.addComponent("robocode.host.vb", DotNetHost.class);
|
||||||
Container.cache.addComponent("robocode.host.dotnet", DotNetHost.class);
|
Container.cache.addComponent("robocode.host.dotnet", DotNetHost.class);
|
||||||
|
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
Logger.logError(e);
|
Logger.logError(e);
|
||||||
throw new Error("Can't initialize .NET Robocode", e);
|
throw new Error("Can't initialize .NET Robocode", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,7 +240,7 @@ public class AutoExtract implements ActionListener {
|
||||||
// Set native look and feel
|
// Set native look and feel
|
||||||
try {
|
try {
|
||||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
} catch (Throwable t) {// For some reason Ubuntu 7 can cause a NullPointerException when trying to getting the LAF
|
} catch (RuntimeException t) {// For some reason Ubuntu 7 can cause a NullPointerException when trying to getting the LAF
|
||||||
}
|
}
|
||||||
|
|
||||||
File suggestedDir;
|
File suggestedDir;
|
||||||
|
|
|
@ -40,33 +40,33 @@ public class TestMaxTurnRate extends RobocodeTestBed {
|
||||||
if (event.getTurnSnapshot().getTurn() == 26) {
|
if (event.getTurnSnapshot().getTurn() == 26) {
|
||||||
final String out = buf.toString();
|
final String out = buf.toString();
|
||||||
|
|
||||||
Assert.assertTrue(out.contains("1: 0.0, 0.0") | out.contains("1: 0.0, -0.0"));
|
Assert.assertTrue(out.contains("1: 0.0, 0.0") || out.contains("1: 0.0, -0.0"));
|
||||||
Assert.assertTrue(out.contains("2: 0.0, -1.0") | out.contains("2: 0.0, -0.999999999"));
|
Assert.assertTrue(out.contains("2: 0.0, -1.0") || out.contains("2: 0.0, -0.999999999"));
|
||||||
Assert.assertTrue(out.contains("3: 0.0, -2.0") | out.contains("3: 0.0, -1.999999999"));
|
Assert.assertTrue(out.contains("3: 0.0, -2.0") || out.contains("3: 0.0, -1.999999999"));
|
||||||
Assert.assertTrue(out.contains("4: 0.0, -3.0") | out.contains("4: 0.0, -2.999999999"));
|
Assert.assertTrue(out.contains("4: 0.0, -3.0") || out.contains("4: 0.0, -2.999999999"));
|
||||||
Assert.assertTrue(out.contains("5: 0.0, -4.0") | out.contains("5: 0.0, -3.999999999"));
|
Assert.assertTrue(out.contains("5: 0.0, -4.0") || out.contains("5: 0.0, -3.999999999"));
|
||||||
Assert.assertTrue(out.contains("6: 0.0, -5.0") | out.contains("6: 0.0, -4.999999999"));
|
Assert.assertTrue(out.contains("6: 0.0, -5.0") || out.contains("6: 0.0, -4.999999999"));
|
||||||
Assert.assertTrue(out.contains("7: 0.0, -6.0") | out.contains("7: 0.0, -5.999999999"));
|
Assert.assertTrue(out.contains("7: 0.0, -6.0") || out.contains("7: 0.0, -5.999999999"));
|
||||||
Assert.assertTrue(out.contains("8: 0.0, -7.0") | out.contains("8: 0.0, -6.999999999"));
|
Assert.assertTrue(out.contains("8: 0.0, -7.0") || out.contains("8: 0.0, -6.999999999"));
|
||||||
Assert.assertTrue(out.contains("9: 0.0, -8.0") | out.contains("9: 0.0, -7.999999999"));
|
Assert.assertTrue(out.contains("9: 0.0, -8.0") || out.contains("9: 0.0, -7.999999999"));
|
||||||
Assert.assertTrue(out.contains("10: 0.0, -9.0") | out.contains("10: 0.0, -8.999999999"));
|
Assert.assertTrue(out.contains("10: 0.0, -9.0") || out.contains("10: 0.0, -8.999999999"));
|
||||||
Assert.assertTrue(out.contains("11: 0.0, -10.0") | out.contains("11: 0.0, -9.999999999"));
|
Assert.assertTrue(out.contains("11: 0.0, -10.0") || out.contains("11: 0.0, -9.999999999"));
|
||||||
Assert.assertTrue(out.contains("12: 0.0, -10.0") | out.contains("12: 0.0, -9.999999999"));
|
Assert.assertTrue(out.contains("12: 0.0, -10.0") || out.contains("12: 0.0, -9.999999999"));
|
||||||
Assert.assertTrue(out.contains("13: 0.0, -10.0") | out.contains("13: 0.0, -9.999999999"));
|
Assert.assertTrue(out.contains("13: 0.0, -10.0") || out.contains("13: 0.0, -9.999999999"));
|
||||||
|
|
||||||
Assert.assertTrue(out.contains("14: 0.0, 0.0") | out.contains("14: 0.0, -0.0"));
|
Assert.assertTrue(out.contains("14: 0.0, 0.0") || out.contains("14: 0.0, -0.0"));
|
||||||
Assert.assertTrue(out.contains("15: 0.0, 1.0") | out.contains("15: 0.0, 0.999999999"));
|
Assert.assertTrue(out.contains("15: 0.0, 1.0") || out.contains("15: 0.0, 0.999999999"));
|
||||||
Assert.assertTrue(out.contains("16: 0.0, 2.0") | out.contains("16: 0.0, 1.999999999"));
|
Assert.assertTrue(out.contains("16: 0.0, 2.0") || out.contains("16: 0.0, 1.999999999"));
|
||||||
Assert.assertTrue(out.contains("17: 0.0, 3.0") | out.contains("17: 0.0, 2.999999999"));
|
Assert.assertTrue(out.contains("17: 0.0, 3.0") || out.contains("17: 0.0, 2.999999999"));
|
||||||
Assert.assertTrue(out.contains("18: 0.0, 4.0") | out.contains("18: 0.0, 3.999999999"));
|
Assert.assertTrue(out.contains("18: 0.0, 4.0") || out.contains("18: 0.0, 3.999999999"));
|
||||||
Assert.assertTrue(out.contains("19: 0.0, 5.0") | out.contains("19: 0.0, 4.999999999"));
|
Assert.assertTrue(out.contains("19: 0.0, 5.0") || out.contains("19: 0.0, 4.999999999"));
|
||||||
Assert.assertTrue(out.contains("20: 0.0, 6.0") | out.contains("20: 0.0, 5.999999999"));
|
Assert.assertTrue(out.contains("20: 0.0, 6.0") || out.contains("20: 0.0, 5.999999999"));
|
||||||
Assert.assertTrue(out.contains("21: 0.0, 7.0") | out.contains("21: 0.0, 6.999999999"));
|
Assert.assertTrue(out.contains("21: 0.0, 7.0") || out.contains("21: 0.0, 6.999999999"));
|
||||||
Assert.assertTrue(out.contains("22: 0.0, 8.0") | out.contains("22: 0.0, 7.999999999"));
|
Assert.assertTrue(out.contains("22: 0.0, 8.0") || out.contains("22: 0.0, 7.999999999"));
|
||||||
Assert.assertTrue(out.contains("23: 0.0, 9.0") | out.contains("23: 0.0, 8.999999999"));
|
Assert.assertTrue(out.contains("23: 0.0, 9.0") || out.contains("23: 0.0, 8.999999999"));
|
||||||
Assert.assertTrue(out.contains("24: 0.0, 10.0") | out.contains("24: 0.0, 9.999999999"));
|
Assert.assertTrue(out.contains("24: 0.0, 10.0") || out.contains("24: 0.0, 9.999999999"));
|
||||||
Assert.assertTrue(out.contains("25: 0.0, 10.0") | out.contains("25: 0.0, 9.999999999"));
|
Assert.assertTrue(out.contains("25: 0.0, 10.0") || out.contains("25: 0.0, 9.999999999"));
|
||||||
Assert.assertTrue(out.contains("26: 0.0, 10.0") | out.contains("26: 0.0, 9.999999999"));
|
Assert.assertTrue(out.contains("26: 0.0, 10.0") || out.contains("26: 0.0, 9.999999999"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,7 +246,7 @@ public class AutoExtract implements ActionListener {
|
||||||
// Set native look and feel
|
// Set native look and feel
|
||||||
try {
|
try {
|
||||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
} catch (Throwable t) {// For some reason Ubuntu 7 can cause a NullPointerException when trying to getting the LAF
|
} catch (RuntimeException t) {// For some reason Ubuntu 7 can cause a NullPointerException when trying to getting the LAF
|
||||||
}
|
}
|
||||||
|
|
||||||
File installDir = null;
|
File installDir = null;
|
||||||
|
|
|
@ -113,7 +113,7 @@ public class HiddenAccess {
|
||||||
System.exit(-1);
|
System.exit(-1);
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
Logger.logError(e);
|
Logger.logError(e);
|
||||||
} catch (Error e) {
|
} catch (MyException e) {
|
||||||
Logger.logError(e);
|
Logger.logError(e);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class BattleEventDispatcher implements IBattleListener {
|
||||||
for (IBattleListener listener : listeners) {
|
for (IBattleListener listener : listeners) {
|
||||||
try {
|
try {
|
||||||
listener.onBattleStarted(event);
|
listener.onBattleStarted(event);
|
||||||
} catch (Throwable ex) {
|
} catch (RuntimeException ex) {
|
||||||
logError("onBattleStarted " + listener.getClass(), ex);
|
logError("onBattleStarted " + listener.getClass(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ public class BattleEventDispatcher implements IBattleListener {
|
||||||
for (IBattleListener listener : listeners) {
|
for (IBattleListener listener : listeners) {
|
||||||
try {
|
try {
|
||||||
listener.onBattleCompleted(event);
|
listener.onBattleCompleted(event);
|
||||||
} catch (Throwable ex) {
|
} catch (RuntimeException ex) {
|
||||||
logError("onBattleCompleted " + listener.getClass(), ex);
|
logError("onBattleCompleted " + listener.getClass(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ public class BattleEventDispatcher implements IBattleListener {
|
||||||
for (IBattleListener listener : listeners) {
|
for (IBattleListener listener : listeners) {
|
||||||
try {
|
try {
|
||||||
listener.onBattleFinished(event);
|
listener.onBattleFinished(event);
|
||||||
} catch (Throwable ex) {
|
} catch (RuntimeException ex) {
|
||||||
logError("onBattleFinished " + listener.getClass(), ex);
|
logError("onBattleFinished " + listener.getClass(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ public class BattleEventDispatcher implements IBattleListener {
|
||||||
for (IBattleListener listener : listeners) {
|
for (IBattleListener listener : listeners) {
|
||||||
try {
|
try {
|
||||||
listener.onBattlePaused(event);
|
listener.onBattlePaused(event);
|
||||||
} catch (Throwable ex) {
|
} catch (RuntimeException ex) {
|
||||||
logError("onBattlePaused " + listener.getClass(), ex);
|
logError("onBattlePaused " + listener.getClass(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ public class BattleEventDispatcher implements IBattleListener {
|
||||||
for (IBattleListener listener : listeners) {
|
for (IBattleListener listener : listeners) {
|
||||||
try {
|
try {
|
||||||
listener.onBattleResumed(event);
|
listener.onBattleResumed(event);
|
||||||
} catch (Throwable ex) {
|
} catch (RuntimeException ex) {
|
||||||
logError("onBattleResumed " + listener.getClass(), ex);
|
logError("onBattleResumed " + listener.getClass(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ public class BattleEventDispatcher implements IBattleListener {
|
||||||
for (IBattleListener listener : listeners) {
|
for (IBattleListener listener : listeners) {
|
||||||
try {
|
try {
|
||||||
listener.onRoundStarted(event);
|
listener.onRoundStarted(event);
|
||||||
} catch (Throwable ex) {
|
} catch (RuntimeException ex) {
|
||||||
logError("onRoundStarted " + listener.getClass(), ex);
|
logError("onRoundStarted " + listener.getClass(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ public class BattleEventDispatcher implements IBattleListener {
|
||||||
for (IBattleListener listener : listeners) {
|
for (IBattleListener listener : listeners) {
|
||||||
try {
|
try {
|
||||||
listener.onRoundEnded(event);
|
listener.onRoundEnded(event);
|
||||||
} catch (Throwable ex) {
|
} catch (RuntimeException ex) {
|
||||||
logError("onRoundEnded " + listener.getClass(), ex);
|
logError("onRoundEnded " + listener.getClass(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ public class BattleEventDispatcher implements IBattleListener {
|
||||||
for (IBattleListener listener : listeners) {
|
for (IBattleListener listener : listeners) {
|
||||||
try {
|
try {
|
||||||
listener.onTurnStarted(event);
|
listener.onTurnStarted(event);
|
||||||
} catch (Throwable ex) {
|
} catch (RuntimeException ex) {
|
||||||
logError("onTurnStarted " + listener.getClass(), ex);
|
logError("onTurnStarted " + listener.getClass(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ public class BattleEventDispatcher implements IBattleListener {
|
||||||
for (IBattleListener listener : listeners) {
|
for (IBattleListener listener : listeners) {
|
||||||
try {
|
try {
|
||||||
listener.onTurnEnded(event);
|
listener.onTurnEnded(event);
|
||||||
} catch (Throwable ex) {
|
} catch (RuntimeException ex) {
|
||||||
logError("onTurnEnded " + listener.getClass(), ex);
|
logError("onTurnEnded " + listener.getClass(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ public class BattleEventDispatcher implements IBattleListener {
|
||||||
for (IBattleListener listener : listeners) {
|
for (IBattleListener listener : listeners) {
|
||||||
try {
|
try {
|
||||||
listener.onBattleMessage(event);
|
listener.onBattleMessage(event);
|
||||||
} catch (Throwable ex) {
|
} catch (RuntimeException ex) {
|
||||||
logError("onBattleMessage " + listener.getClass(), ex);
|
logError("onBattleMessage " + listener.getClass(), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ public class BattleEventDispatcher implements IBattleListener {
|
||||||
for (IBattleListener listener : listeners) {
|
for (IBattleListener listener : listeners) {
|
||||||
try {
|
try {
|
||||||
listener.onBattleError(event);
|
listener.onBattleError(event);
|
||||||
} catch (Throwable ex) {
|
} catch (RuntimeException ex) {
|
||||||
Logger.realErr.println(listener.getClass() + " " + ex.getMessage());
|
Logger.realErr.println(listener.getClass() + " " + ex.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,7 +171,7 @@ public final class RobocodeMain extends RobocodeMainBase {
|
||||||
System.exit(8);
|
System.exit(8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
Logger.logError(e);
|
Logger.logError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class JavaHost implements IHost {
|
||||||
}
|
}
|
||||||
return checkInterfaces(robotClass, robotItem);
|
return checkInterfaces(robotClass, robotItem);
|
||||||
|
|
||||||
} catch (Throwable t) {
|
} catch (RuntimeException t) {
|
||||||
if (message) {
|
if (message) {
|
||||||
logError("Got an error with " + robotItem.getFullClassName() + ": " + t); // just message here
|
logError("Got an error with " + robotItem.getFullClassName() + ": " + t); // just message here
|
||||||
if (t.getMessage() != null && t.getMessage().contains("Bad version number in .class file")) {
|
if (t.getMessage() != null && t.getMessage().contains("Bad version number in .class file")) {
|
||||||
|
|
|
@ -382,7 +382,7 @@ public final class EventManager implements IEventManager {
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
currentTopEvent = null;
|
currentTopEvent = null;
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Error e) {
|
} catch (MyException e) {
|
||||||
currentTopEvent = null;
|
currentTopEvent = null;
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -157,7 +157,7 @@ abstract class HostingRobotProxy implements IHostingRobotProxy, IHostedThread {
|
||||||
private void loadClassBattle() {
|
private void loadClassBattle() {
|
||||||
try {
|
try {
|
||||||
robotClassLoader.loadRobotMainClass(true);
|
robotClassLoader.loadRobotMainClass(true);
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
println("SYSTEM: Could not load " + statics.getName() + " : ");
|
println("SYSTEM: Could not load " + statics.getName() + " : ");
|
||||||
println(e);
|
println(e);
|
||||||
drainEnergy();
|
drainEnergy();
|
||||||
|
@ -183,7 +183,7 @@ abstract class HostingRobotProxy implements IHostingRobotProxy, IHostedThread {
|
||||||
robot = null;
|
robot = null;
|
||||||
logError(e);
|
logError(e);
|
||||||
return false;
|
return false;
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
println("SYSTEM: An error occurred during initialization of " + statics.getName());
|
println("SYSTEM: An error occurred during initialization of " + statics.getName());
|
||||||
println("SYSTEM: " + e);
|
println("SYSTEM: " + e);
|
||||||
println(e);
|
println(e);
|
||||||
|
@ -247,7 +247,7 @@ abstract class HostingRobotProxy implements IHostingRobotProxy, IHostedThread {
|
||||||
println(e);
|
println(e);
|
||||||
logMessage(statics.getName() + " stopped successfully.");
|
logMessage(statics.getName() + " stopped successfully.");
|
||||||
throw e; // must be re-thrown in order to stop the thread
|
throw e; // must be re-thrown in order to stop the thread
|
||||||
} catch (Throwable t) {
|
} catch (RuntimeException t) {
|
||||||
drainEnergy();
|
drainEnergy();
|
||||||
println(t);
|
println(t);
|
||||||
logMessage(statics.getName() + ": Throwable: " + t); // without stack here
|
logMessage(statics.getName() + ": Throwable: " + t); // without stack here
|
||||||
|
|
|
@ -244,7 +244,7 @@ public class RobotClassLoader extends URLClassLoader implements IRobotClassLoade
|
||||||
} else {
|
} else {
|
||||||
warnIfStaticRobotInstanceFields();
|
warnIfStaticRobotInstanceFields();
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
robotClass = null;
|
robotClass = null;
|
||||||
throw new ClassNotFoundException(e.getMessage(), e);
|
throw new ClassNotFoundException(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
@ -289,7 +289,7 @@ public class RobotClassLoader extends URLClassLoader implements IRobotClassLoade
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (RuntimeException t) {
|
||||||
Logger.logError(t);
|
Logger.logError(t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -305,7 +305,7 @@ public class RobotClassLoader extends URLClassLoader implements IRobotClassLoade
|
||||||
Class<?> type = null;
|
Class<?> type = null;
|
||||||
try {
|
try {
|
||||||
type = loadRobotClassLocaly(className, false);
|
type = loadRobotClassLocaly(className, false);
|
||||||
} catch (Throwable t) {
|
} catch (RuntimeException t) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (type != null) {
|
if (type != null) {
|
||||||
|
@ -366,7 +366,7 @@ public class RobotClassLoader extends URLClassLoader implements IRobotClassLoade
|
||||||
modifiersField.setInt(field, modifiers & ~Modifier.FINAL); // Remove the FINAL modifier
|
modifiersField.setInt(field, modifiers & ~Modifier.FINAL); // Remove the FINAL modifier
|
||||||
field.set(null, null);
|
field.set(null, null);
|
||||||
|
|
||||||
} catch (Throwable ignore) {}
|
} catch (RuntimeException ignore) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -383,7 +383,7 @@ public class RobotClassLoader extends URLClassLoader implements IRobotClassLoade
|
||||||
for (Field field: type.getDeclaredFields()) {
|
for (Field field: type.getDeclaredFields()) {
|
||||||
fields.add(field);
|
fields.add(field);
|
||||||
}
|
}
|
||||||
} catch (Throwable ignore) {// NoClassDefFoundError does occur with some robots, e.g. sgp.Drunken [1.12]
|
} catch (RuntimeException ignore) {// NoClassDefFoundError does occur with some robots, e.g. sgp.Drunken [1.12]
|
||||||
// We ignore all exceptions and errors here so we can proceed to retrieve
|
// We ignore all exceptions and errors here so we can proceed to retrieve
|
||||||
// field from super classes.
|
// field from super classes.
|
||||||
}
|
}
|
||||||
|
|
|
@ -337,7 +337,7 @@ public class AutoExtract implements ActionListener {
|
||||||
// Set native look and feel
|
// Set native look and feel
|
||||||
try {
|
try {
|
||||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
} catch (Throwable t) {// For some reason Ubuntu 7 can cause a NullPointerException when trying to getting the LAF
|
} catch (RuntimeException t) {// For some reason Ubuntu 7 can cause a NullPointerException when trying to getting the LAF
|
||||||
}
|
}
|
||||||
|
|
||||||
AutoExtract extractor = new AutoExtract();
|
AutoExtract extractor = new AutoExtract();
|
||||||
|
|
|
@ -204,7 +204,7 @@ public class FileTransfer {
|
||||||
if (conn != null) {
|
if (conn != null) {
|
||||||
conn.disconnect();
|
conn.disconnect();
|
||||||
}
|
}
|
||||||
} catch (Throwable ignore) {// we expect this, right ?
|
} catch (RuntimeException ignore) {// we expect this, right ?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class AwtAttack extends AdvancedRobot {
|
||||||
};
|
};
|
||||||
|
|
||||||
javax.swing.SwingUtilities.invokeLater(doHack);
|
javax.swing.SwingUtilities.invokeLater(doHack);
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
// swalow security exception
|
// swalow security exception
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ public class AwtAttack extends AdvancedRobot {
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
// swalow security exception
|
// swalow security exception
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class ConstructorAwtAttack extends robocode.AdvancedRobot {
|
||||||
};
|
};
|
||||||
|
|
||||||
javax.swing.SwingUtilities.invokeLater(doHack);
|
javax.swing.SwingUtilities.invokeLater(doHack);
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
// swallow security exception
|
// swallow security exception
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ public class ConstructorAwtAttack extends robocode.AdvancedRobot {
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
// swallow security exception
|
// swallow security exception
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class ConstructorThreadAttack extends robocode.AdvancedRobot {
|
||||||
Thread t = new Thread(a);
|
Thread t = new Thread(a);
|
||||||
|
|
||||||
t.start();
|
t.start();
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
// swallow security exception
|
// swallow security exception
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ public class ConstructorThreadAttack extends robocode.AdvancedRobot {
|
||||||
Thread t = new Thread(tg, a);
|
Thread t = new Thread(tg, a);
|
||||||
|
|
||||||
t.start();
|
t.start();
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
// swallow security exception
|
// swallow security exception
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class FileAttack extends AdvancedRobot {
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
// swalow security exception
|
// swalow security exception
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ public class FileAttack extends AdvancedRobot {
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
// swalow security exception
|
// swalow security exception
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class IncludeNamespaceAttack extends AdvancedRobot {
|
||||||
private void namespaceAttack() {
|
private void namespaceAttack() {
|
||||||
try {
|
try {
|
||||||
HiddenAccess.createRules(10, 10, 10, 10, 1, false, 100);
|
HiddenAccess.createRules(10, 10, 10, 10, 1, false, 100);
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
// Swallow security exception
|
// Swallow security exception
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class ThreadAttack extends AdvancedRobot {
|
||||||
Thread t = new Thread(a);
|
Thread t = new Thread(a);
|
||||||
|
|
||||||
t.start();
|
t.start();
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
// swallow security exception
|
// swallow security exception
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ public class ThreadAttack extends AdvancedRobot {
|
||||||
Thread t = new Thread(tg, a);
|
Thread t = new Thread(tg, a);
|
||||||
|
|
||||||
t.start();
|
t.start();
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
// swallow security exception
|
// swallow security exception
|
||||||
e.printStackTrace(out);
|
e.printStackTrace(out);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class ThreadGroupAttack extends Robot {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
} catch (Throwable t) {
|
} catch (RuntimeException t) {
|
||||||
t.printStackTrace(out);
|
t.printStackTrace(out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class UndeadThread extends AdvancedRobot {
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
body();
|
body();
|
||||||
} catch (Throwable t) {
|
} catch (RuntimeException t) {
|
||||||
// spamming the console
|
// spamming the console
|
||||||
out.println("Swalowed it, HA HA HA HA HAAAAA !!!!!");
|
out.println("Swalowed it, HA HA HA HA HAAAAA !!!!!");
|
||||||
out.println(t);
|
out.println(t);
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class Assert extends org.junit.Assert {
|
||||||
public static void allAssertNear(double v1, double v2) {
|
public static void allAssertNear(double v1, double v2) {
|
||||||
try {
|
try {
|
||||||
assertNear(v1, v2);
|
assertNear(v1, v2);
|
||||||
} catch (Throwable ex) {
|
} catch (RuntimeException ex) {
|
||||||
ex.printStackTrace(System.err);
|
ex.printStackTrace(System.err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ public class Assert extends org.junit.Assert {
|
||||||
public static <T> void allAssertThat(T t, org.hamcrest.Matcher<T> tMatcher) {
|
public static <T> void allAssertThat(T t, org.hamcrest.Matcher<T> tMatcher) {
|
||||||
try {
|
try {
|
||||||
org.junit.Assert.assertThat(t, tMatcher);
|
org.junit.Assert.assertThat(t, tMatcher);
|
||||||
} catch (Throwable ex) {
|
} catch (RuntimeException ex) {
|
||||||
ex.printStackTrace(System.err);
|
ex.printStackTrace(System.err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,7 +146,7 @@ public class EditWindow extends JInternalFrame {
|
||||||
setModified(editorPanel.getEditorPane().isModified());
|
setModified(editorPanel.getEditorPane().isModified());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Throwable e) {
|
} catch (RuntimeException e) {
|
||||||
Logger.logError(e);
|
Logger.logError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class WindowMenuItem extends JCheckBoxMenuItem implements ActionListener
|
||||||
if (window.isIcon()) {
|
if (window.isIcon()) {
|
||||||
try {
|
try {
|
||||||
window.setIcon(false);
|
window.setIcon(false);
|
||||||
} catch (Throwable ignored) {}
|
} catch (RuntimeException ignored) {}
|
||||||
}
|
}
|
||||||
if (window.getDesktopPane() != null) {
|
if (window.getDesktopPane() != null) {
|
||||||
window.getDesktopPane().setSelectedFrame(window);
|
window.getDesktopPane().setSelectedFrame(window);
|
||||||
|
@ -83,7 +83,7 @@ public class WindowMenuItem extends JCheckBoxMenuItem implements ActionListener
|
||||||
window.grabFocus();
|
window.grabFocus();
|
||||||
try {
|
try {
|
||||||
window.setSelected(true);
|
window.setSelected(true);
|
||||||
} catch (Throwable ignored) {}
|
} catch (RuntimeException ignored) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -574,14 +574,14 @@ public class WindowManager implements IWindowManagerExt {
|
||||||
private void setLookAndFeel() {
|
private void setLookAndFeel() {
|
||||||
try {
|
try {
|
||||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
} catch (Throwable t) {
|
} catch (RuntimeException t) {
|
||||||
// Work-around for problems with setting Look and Feel described here:
|
// Work-around for problems with setting Look and Feel described here:
|
||||||
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6468089
|
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6468089
|
||||||
Locale.setDefault(Locale.US);
|
Locale.setDefault(Locale.US);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
} catch (Throwable t2) {
|
} catch (RuntimeException t2) {
|
||||||
// For some reason Ubuntu 7 can cause a NullPointerException when trying to getting the LAF
|
// For some reason Ubuntu 7 can cause a NullPointerException when trying to getting the LAF
|
||||||
System.err.println("Could not set the Look and Feel (LAF). The default LAF is used instead");
|
System.err.println("Could not set the Look and Feel (LAF). The default LAF is used instead");
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,7 @@ public final class AwtBattleAdaptor {
|
||||||
calculateFPS();
|
calculateFPS();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (RuntimeException t) {
|
||||||
Logger.logError(t);
|
Logger.logError(t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package net.sf.robocode.ui.dialog;
|
package net.sf.robocode.ui.dialog;
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,17 +31,14 @@ public class TeamCreator extends JDialog implements WizardListener {
|
||||||
private RobotSelectionPanel robotSelectionPanel;
|
private RobotSelectionPanel robotSelectionPanel;
|
||||||
private TeamCreatorOptionsPanel teamCreatorOptionsPanel;
|
private TeamCreatorOptionsPanel teamCreatorOptionsPanel;
|
||||||
|
|
||||||
private final int minRobots = 2;//每个编队至少两人
|
private final int minRobots = 2;
|
||||||
private final int maxRobots = 10;//每个编队最多10人
|
private final int maxRobots = 10;
|
||||||
|
|
||||||
private final EventHandler eventHandler = new EventHandler();
|
private final EventHandler eventHandler = new EventHandler();
|
||||||
|
|
||||||
//EventHandler具体实现ActionListener接口,实现动作的监听操作
|
|
||||||
class EventHandler implements ActionListener {
|
class EventHandler implements ActionListener {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
//e为传入的参数,传入临时变量e,为ActionEvent类型
|
|
||||||
if (e.getActionCommand().equals("Refresh")) {
|
if (e.getActionCommand().equals("Refresh")) {
|
||||||
//执行跟新操作
|
|
||||||
getRobotSelectionPanel().refreshRobotList(true);
|
getRobotSelectionPanel().refreshRobotList(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,12 +59,9 @@ public class TeamCreator extends JDialog implements WizardListener {
|
||||||
return teamCreatorOptionsPanel;
|
return teamCreatorOptionsPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取创建编队嵌入框中的内容
|
|
||||||
private JPanel getTeamCreatorContentPane() {
|
private JPanel getTeamCreatorContentPane() {
|
||||||
if (teamCreatorContentPane == null) {
|
if (teamCreatorContentPane == null) {
|
||||||
//如果嵌入框内容为空
|
|
||||||
teamCreatorContentPane = new JPanel();
|
teamCreatorContentPane = new JPanel();
|
||||||
//新建嵌入框
|
|
||||||
teamCreatorContentPane.setLayout(new BorderLayout());
|
teamCreatorContentPane.setLayout(new BorderLayout());
|
||||||
teamCreatorContentPane.add(getWizardController(), BorderLayout.SOUTH);
|
teamCreatorContentPane.add(getWizardController(), BorderLayout.SOUTH);
|
||||||
teamCreatorContentPane.add(getWizardPanel(), BorderLayout.CENTER);
|
teamCreatorContentPane.add(getWizardPanel(), BorderLayout.CENTER);
|
||||||
|
@ -82,12 +75,8 @@ public class TeamCreator extends JDialog implements WizardListener {
|
||||||
return teamCreatorContentPane;
|
return teamCreatorContentPane;
|
||||||
}
|
}
|
||||||
|
|
||||||
//选择机器人组成编队
|
protected RobotSelectionPanel getRobotSelectionPanel() {
|
||||||
protected RobotSelectionPanel getRobotSelectionPanel()
|
if (robotSelectionPanel == null) {
|
||||||
{
|
|
||||||
//如果当前选择为空
|
|
||||||
if (robotSelectionPanel == null)
|
|
||||||
{
|
|
||||||
robotSelectionPanel = net.sf.robocode.core.Container.createComponent(RobotSelectionPanel.class);
|
robotSelectionPanel = net.sf.robocode.core.Container.createComponent(RobotSelectionPanel.class);
|
||||||
robotSelectionPanel.setup(minRobots, maxRobots, false, "Select the robots for this team.", false, true, true,
|
robotSelectionPanel.setup(minRobots, maxRobots, false, "Select the robots for this team.", false, true, true,
|
||||||
false, false, false, null);
|
false, false, false, null);
|
||||||
|
@ -95,11 +84,8 @@ public class TeamCreator extends JDialog implements WizardListener {
|
||||||
return robotSelectionPanel;
|
return robotSelectionPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
//新建一个嵌入板
|
private WizardCardPanel getWizardPanel() {
|
||||||
private WizardCardPanel getWizardPanel()
|
if (wizardPanel == null) {
|
||||||
{
|
|
||||||
if (wizardPanel == null)
|
|
||||||
{
|
|
||||||
wizardPanel = new WizardCardPanel(this);
|
wizardPanel = new WizardCardPanel(this);
|
||||||
wizardPanel.add(getRobotSelectionPanel(), "Select robots");
|
wizardPanel.add(getRobotSelectionPanel(), "Select robots");
|
||||||
wizardPanel.add(getTeamCreatorOptionsPanel(), "Select options");
|
wizardPanel.add(getTeamCreatorOptionsPanel(), "Select options");
|
||||||
|
@ -107,27 +93,23 @@ public class TeamCreator extends JDialog implements WizardListener {
|
||||||
return wizardPanel;
|
return wizardPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
//窗口初始化
|
public void initialize() {
|
||||||
public void initialize()
|
|
||||||
{
|
|
||||||
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
setTitle("Create a team");
|
setTitle("Create a team");
|
||||||
setContentPane(getTeamCreatorContentPane());
|
setContentPane(getTeamCreatorContentPane());
|
||||||
}
|
}
|
||||||
|
|
||||||
private WizardController getWizardController() {
|
private WizardController getWizardController() {
|
||||||
if (wizardController == null)
|
if (wizardController == null) {
|
||||||
{
|
|
||||||
wizardController = getWizardPanel().getWizardController();
|
wizardController = getWizardPanel().getWizardController();
|
||||||
}
|
}
|
||||||
return wizardController;
|
return wizardController;
|
||||||
}
|
}
|
||||||
//添加取消键动作
|
|
||||||
public void cancelButtonActionPerformed() {
|
public void cancelButtonActionPerformed() {
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
//添加完成键动作
|
|
||||||
public void finishButtonActionPerformed() {
|
public void finishButtonActionPerformed() {
|
||||||
try {
|
try {
|
||||||
int rc = createTeam();
|
int rc = createTeam();
|
||||||
|
@ -145,14 +127,12 @@ public class TeamCreator extends JDialog implements WizardListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//将创建的编队写入数据库
|
|
||||||
public int createTeam() throws IOException {
|
public int createTeam() throws IOException {
|
||||||
File file = new File(repositoryManager.getRobotsDirectory(),
|
File file = new File(repositoryManager.getRobotsDirectory(),
|
||||||
teamCreatorOptionsPanel.getTeamPackage().replace('.', File.separatorChar)
|
teamCreatorOptionsPanel.getTeamPackage().replace('.', File.separatorChar)
|
||||||
+ teamCreatorOptionsPanel.getTeamNameField().getText() + ".team");
|
+ teamCreatorOptionsPanel.getTeamNameField().getText() + ".team");
|
||||||
|
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
//如果当前编队已经存在
|
|
||||||
int ok = JOptionPane.showConfirmDialog(this, file + " already exists. Are you sure you want to replace it?",
|
int ok = JOptionPane.showConfirmDialog(this, file + " already exists. Are you sure you want to replace it?",
|
||||||
"Warning", JOptionPane.YES_NO_CANCEL_OPTION);
|
"Warning", JOptionPane.YES_NO_CANCEL_OPTION);
|
||||||
|
|
||||||
|
@ -170,13 +150,10 @@ public class TeamCreator extends JDialog implements WizardListener {
|
||||||
String webPageFieldString = teamCreatorOptionsPanel.getWebpageField().getText();
|
String webPageFieldString = teamCreatorOptionsPanel.getWebpageField().getText();
|
||||||
|
|
||||||
if (webPageFieldString != null && webPageFieldString.length() > 0) {
|
if (webPageFieldString != null && webPageFieldString.length() > 0) {
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
webPageUrl = new URL(webPageFieldString);
|
webPageUrl = new URL(webPageFieldString);
|
||||||
} catch (MalformedURLException e)
|
} catch (MalformedURLException e) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
webPageUrl = new URL("http://" + webPageFieldString);
|
webPageUrl = new URL("http://" + webPageFieldString);
|
||||||
teamCreatorOptionsPanel.getWebpageField().setText(webPageUrl.toString());
|
teamCreatorOptionsPanel.getWebpageField().setText(webPageUrl.toString());
|
||||||
} catch (MalformedURLException ignored) {}
|
} catch (MalformedURLException ignored) {}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package net.sf.robocode.ui.dialog;
|
package net.sf.robocode.ui.dialog;
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,7 +17,6 @@ import java.net.URL;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class TeamCreatorOptionsPanel extends WizardPanel {
|
public class TeamCreatorOptionsPanel extends WizardPanel {
|
||||||
private TeamCreator teamCreator;
|
private TeamCreator teamCreator;
|
||||||
|
@ -41,20 +39,16 @@ public class TeamCreatorOptionsPanel extends WizardPanel {
|
||||||
|
|
||||||
private String teamPackage;
|
private String teamPackage;
|
||||||
|
|
||||||
private class EventHandler implements ComponentListener, DocumentListener
|
private class EventHandler implements ComponentListener, DocumentListener {
|
||||||
{
|
public void insertUpdate(DocumentEvent e) {
|
||||||
public void insertUpdate(DocumentEvent e)
|
|
||||||
{
|
|
||||||
fireStateChanged();
|
fireStateChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void changedUpdate(DocumentEvent e)
|
public void changedUpdate(DocumentEvent e) {
|
||||||
{
|
|
||||||
fireStateChanged();
|
fireStateChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeUpdate(DocumentEvent e)
|
public void removeUpdate(DocumentEvent e) {
|
||||||
{
|
|
||||||
fireStateChanged();
|
fireStateChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,38 +59,32 @@ public class TeamCreatorOptionsPanel extends WizardPanel {
|
||||||
public void componentShown(ComponentEvent e) {
|
public void componentShown(ComponentEvent e) {
|
||||||
List<IRobotSpecItem> selectedRobots;
|
List<IRobotSpecItem> selectedRobots;
|
||||||
|
|
||||||
if (teamCreator != null)
|
if (teamCreator != null) {
|
||||||
{
|
|
||||||
selectedRobots = teamCreator.getRobotSelectionPanel().getSelectedRobots();
|
selectedRobots = teamCreator.getRobotSelectionPanel().getSelectedRobots();
|
||||||
} else
|
} else {
|
||||||
{
|
|
||||||
selectedRobots = teamPackager.getRobotSelectionPanel().getSelectedRobots();
|
selectedRobots = teamPackager.getRobotSelectionPanel().getSelectedRobots();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedRobots != null)
|
if (selectedRobots != null) {
|
||||||
{
|
|
||||||
IRobotSpecItem robotSpecification = selectedRobots.get(0);
|
IRobotSpecItem robotSpecification = selectedRobots.get(0);
|
||||||
|
|
||||||
getTeamNameLabel().setText("Please choose a name for your team: (Must be a valid Java classname)");
|
getTeamNameLabel().setText("Please choose a name for your team: (Must be a valid Java classname)");
|
||||||
getTeamNameField().setText(robotSpecification.getShortClassName() + "Team");
|
getTeamNameField().setText(robotSpecification.getShortClassName() + "Team");
|
||||||
getTeamPackageLabel().setText(robotSpecification.getFullPackage() + ".");
|
getTeamPackageLabel().setText(robotSpecification.getFullPackage() + ".");
|
||||||
teamPackage = robotSpecification.getFullPackage();
|
teamPackage = robotSpecification.getFullPackage();
|
||||||
if (teamPackage != null)
|
if (teamPackage != null) {
|
||||||
{
|
|
||||||
teamPackage += ".";
|
teamPackage += ".";
|
||||||
}
|
}
|
||||||
|
|
||||||
String d = robotSpecification.getDescription();
|
String d = robotSpecification.getDescription();
|
||||||
|
|
||||||
if (d == null)
|
if (d == null) {
|
||||||
{
|
|
||||||
d = "";
|
d = "";
|
||||||
}
|
}
|
||||||
getDescriptionArea().setText(d);
|
getDescriptionArea().setText(d);
|
||||||
String a = robotSpecification.getAuthorName();
|
String a = robotSpecification.getAuthorName();
|
||||||
|
|
||||||
if (a == null)
|
if (a == null) {
|
||||||
{
|
|
||||||
a = "";
|
a = "";
|
||||||
}
|
}
|
||||||
getAuthorField().setText(a);
|
getAuthorField().setText(a);
|
||||||
|
@ -315,7 +303,11 @@ public class TeamCreatorOptionsPanel extends WizardPanel {
|
||||||
return teamPackageLabel;
|
return teamPackageLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 得到队伍包
|
||||||
|
*
|
||||||
|
* @return 返回一个字符串
|
||||||
|
*/
|
||||||
public String getTeamPackage() {
|
public String getTeamPackage() {
|
||||||
return (teamPackage != null) ? teamPackage : ".";
|
return (teamPackage != null) ? teamPackage : ".";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue