Compare commits

..

29 Commits

Author SHA1 Message Date
zhoudaxia 44d87863dd 8月30日 周浩 新增自动测试用例 2016-08-30 12:56:47 +08:00
zhoudaxia 9c491cce5a 8月30 周浩 自动测试代码提交 2016-08-30 12:27:51 +08:00
zhoudaxia 9ed847689b 8月29日 周浩 自动测试代码编写(失败) 2016-08-30 07:08:31 +08:00
zhoudaxia 8842b8e022 8月29日 周浩 测试用例新增 2016-08-30 06:57:41 +08:00
zhoudaxia 8ffa10f081 更新软件UML模型 2016-08-29 11:20:31 +08:00
zhoudaxia e227349b86 周浩 8月29日 更新软件模型 2016-08-29 11:02:31 +08:00
zhoudaxia c2814171d7 8月29日 周浩 文档:修改老师之前提出的问题
8月29日  周浩   模型:修改老师之前提出的问题
2016-08-29 08:28:06 +08:00
zhoudaxia 3e3b1a3b61 8月26日 周浩 更新viewoption部分代码,大部分代码提交在develop分支 2016-08-26 22:57:33 +08:00
zhoudaxia 6535d7a68c 8月26日 周浩 新增三个测试用例 2016-08-26 22:24:55 +08:00
zhoudaxia fee03c29a3 8月26日 周浩 根据老师的要求改进规范用例描述的表格 2016-08-26 22:17:35 +08:00
zhoudaxia ba3fa230c7 8月26日 周浩 根据老师指出的问题改进模型 2016-08-26 22:14:21 +08:00
zhoudaxia 1dd9d8f203 周浩 解决部分质量分析中的严重问题 2016-08-26 09:51:13 +08:00
zhoudaxia 952f32f70a 8月25日 周浩 新增测试用例新建编队的ui模块 2016-08-26 00:02:56 +08:00
zhoudaxia 744a227181 8月25日 周浩 更新雷达扫描有关代码 2016-08-25 23:49:20 +08:00
zhoudaxia de9067fb5a 周浩 8月25日 文档:根据老师指出的问题改进软件需求规格说明书 2016-08-25 23:44:06 +08:00
zhoudaxia 3a1168b886 周浩 8月25日 模型:根据老师提出的问题改进用例设计图 2016-08-25 23:40:48 +08:00
zhoudaxia 75d297de4d 8月24日 周浩 编写系统扫描线部分代码 2016-08-24 23:39:33 +08:00
zhoudaxia a8fa9e2565 8月24日 周浩 文档;新增3.1系统划分 2016-08-24 16:38:43 +08:00
zhoudaxia 999cb13278 周浩 8月24日 模型新增;界面原型 2016-08-24 11:25:53 +08:00
zhoudaxia faaeaed173 周浩 8月24日 更新:功能需求描述第一部分 2016-08-24 10:35:04 +08:00
zhoudaxia b13522bf24 周浩 8月24日 文档:新增4.6 和 第5部分全部 2016-08-24 09:15:44 +08:00
zhoudaxia 6becba7725 编写雷达扫描线有关代码 2016-08-24 00:15:06 +08:00
zhoudaxia 6da5fb7ebf 8月23日 周浩 模型:新增雷达扫描子系统用例图 2016-08-23 21:39:19 +08:00
zhoudaxia 27aaff2824 8月23日 周浩 文档新增:3.2.1和4.5两项内容 2016-08-23 21:17:01 +08:00
zhoudaxia 2789fa05ee 8月23日 周浩 文档:新增软件需求规格说明书3.2.1 2016-08-23 20:55:55 +08:00
zhoudaxia c121136564 周浩 8月22日 文档新增:软件需求规格说明书3.2
周浩 8月22日 模型新增:雷达扫描线子系统顺序图
周浩 8月22日 代码更新:ui界面,TeamCreator代码
2016-08-23 01:15:23 +08:00
zhoudaxia 593270f371 合并之后的代码更新 2016-08-22 08:40:28 +08:00
zhoudaxia 85ddb39aaa 周浩 8月19 新增需求文档界面约束
周浩 8月19 完善体系结构设计模型
周浩 8月19 完善ui类
2016-08-19 23:34:46 +08:00
zhoudaxia 1136dec32a 周浩 8月19 新增需求文档界面约束
周浩 8月19 新增需求文档界面约束
2016-08-19 23:31:38 +08:00
17 changed files with 85 additions and 73 deletions

View File

@ -103,38 +103,38 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
*
* @see #fieldWidth
*/
public int fieldWidth;
public static final int fieldWidth;
/**
* Contains the height of the battlefield.
*
* @see #fieldWidth
*/
public int fieldHeight;
public static final int fieldHeight;
/**
* Current number of other robots on the battle field.
*/
public int others;
public static final int others;
/**
* Current energy of this robot, where 100 means full energy and 0 means no energy (dead).
*/
public int energy;
public static final int energy;
/**
* Current horizontal location of this robot (in pixels).
*
* @see #robotY
*/
public int robotX;
public static final int robotX;
/**
* Current vertical location of this robot (in pixels).
*
* @see #robotX
*/
public int robotY;
public static final int robotY;
/**
* Current heading angle of this robot (in degrees).
@ -147,7 +147,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #turnBackLeft(int, int)
* @see #turnBackRight(int, int)
*/
public int heading;
public static final int heading;
/**
* Current gun heading angle of this robot (in degrees).
@ -158,7 +158,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #turnGunTo(int)
* @see #bearGunTo(int)
*/
public int gunHeading;
public static final int gunHeading;
/**
* Current gun heading angle of this robot compared to its body (in degrees).
@ -169,7 +169,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #turnGunTo(int)
* @see #bearGunTo(int)
*/
public int gunBearing;
public static final int gunBearing;
/**
* Flag specifying if the gun is ready to fire, i.e. gun heat <= 0.
@ -179,7 +179,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #fire()
* @see #fire(double)
*/
public boolean gunReady;
public static final boolean gunReady;
/**
* Current distance to the scanned nearest other robot (in pixels).
@ -193,7 +193,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #scannedVelocity
* @see #scannedHeading
*/
public int scannedDistance = -1;
public static final int scannedDistance = -1;
/**
* Current angle to the scanned nearest other robot (in degrees).
@ -207,7 +207,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #scannedVelocity
* @see #scannedHeading
*/
public int scannedAngle = -1;
public static final int scannedAngle = -1;
/**
* Current angle to the scanned nearest other robot (in degrees) compared to
@ -222,7 +222,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #scannedVelocity
* @see #scannedHeading
*/
public int scannedBearing = -1;
public static final int scannedBearing = -1;
/**
* Current velocity of the scanned nearest other robot.
@ -239,7 +239,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #scannedEnergy
* @see #scannedHeading
*/
public int scannedVelocity = -99;
public static final int scannedVelocity = -99;
/**
* Current heading of the scanned nearest other robot (in degrees).
@ -253,7 +253,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #scannedEnergy
* @see #scannedVelocity
*/
public int scannedHeading = -1;
public static final int scannedHeading = -1;
/**
* Current energy of scanned nearest other robot.
@ -266,7 +266,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #scannedBearing
* @see #scannedVelocity
*/
public int scannedEnergy = -1;
public static final int scannedEnergy = -1;
/**
* Latest angle from where this robot was hit by a bullet (in degrees).
@ -276,7 +276,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #onHitByBullet()
* @see #hitByBulletBearing
*/
public int hitByBulletAngle = -1;
public static final int hitByBulletAngle = -1;
/**
* Latest angle from where this robot was hit by a bullet (in degrees)
@ -287,7 +287,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #onHitByBullet()
* @see #hitByBulletAngle
*/
public int hitByBulletBearing = -1;
public static final int hitByBulletBearing = -1;
/**
* Latest angle where this robot has hit another robot (in degrees).
@ -297,7 +297,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #onHitRobot()
* @see #hitRobotBearing
*/
public int hitRobotAngle = -1;
public static final int hitRobotAngle = -1;
/**
* Latest angle where this robot has hit another robot (in degrees)
@ -308,7 +308,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #onHitRobot()
* @see #hitRobotAngle
*/
public int hitRobotBearing = -1;
public static final int hitRobotBearing = -1;
/**
* Latest angle where this robot has hit a wall (in degrees).
@ -318,7 +318,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #onHitWall()
* @see #hitWallBearing
*/
public int hitWallAngle = -1;
public static final int hitWallAngle = -1;
/**
* Latest angle where this robot has hit a wall (in degrees)
@ -329,7 +329,7 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot {
* @see #onHitWall()
* @see #hitWallAngle
*/
public int hitWallBearing = -1;
public static final int hitWallBearing = -1;
/**
* The robot event handler for this robot.

View File

@ -28,14 +28,6 @@ import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
/**
* Handles menu display and interaction for Robocode.
*
* @author Mathew A. Nelson (original)
* @author Flemming N. Larsen (contributor)
* @author Matthew Reeder (contributor)
* @author Luis Crespo (contributor)
*/
@SuppressWarnings("serial")
public class MenuBar extends JMenuBar {

View File

@ -16,9 +16,7 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* @author Flemming N. Larsen (original)
*/
@SuppressWarnings("serial")
public class PreferencesCommonOptionsTab extends WizardPanel {

View File

@ -20,11 +20,6 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* @author Mathew A. Nelson (original)
* @author Flemming N. Larsen (contributor)
* @author Ruben Moreno Montoliu (contributor)
*/
@SuppressWarnings("serial")
public class PreferencesDevelopmentOptionsTab extends WizardPanel {

View File

@ -17,11 +17,7 @@ import java.awt.*;
import java.awt.event.KeyEvent;
/**
* @author Mathew A. Nelson (original)
* @author Flemming N. Larsen (contributor)
* @author Matthew Reeder (contributor)
*/
@SuppressWarnings("serial")
public class PreferencesDialog extends JDialog implements WizardListener {

View File

@ -1,10 +1,4 @@
/**
* Copyright (c) 2001-2016 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://robocode.sourceforge.net/license/epl-v10.html
*/
package net.sf.robocode.ui.dialog;
@ -19,11 +13,7 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* @author Mathew A. Nelson (original)
* @author Flemming N. Larsen (contributor)
* @author Matthew Reeder (contributor)
*/
@SuppressWarnings("serial")
public class PreferencesViewOptionsTab extends WizardPanel {
@ -36,7 +26,7 @@ public class PreferencesViewOptionsTab extends WizardPanel {
private JCheckBox visibleRobotEnergyCheckBox;
private JCheckBox visibleRobotNameCheckBox;
private JCheckBox visibleScanArcsCheckBox;
private JCheckBox visibleScanArcsCheckBox; //
private JCheckBox visibleExplosionsCheckBox;
private JCheckBox visibleGroundCheckBox;
private JCheckBox visibleExplosionDebrisCheckBox;
@ -67,19 +57,32 @@ public class PreferencesViewOptionsTab extends WizardPanel {
public void actionPerformed(ActionEvent e) {
Object src = e.getSource();
if (src == enableAllViewOptionsButton) {
if (src == enableAllViewOptionsButton)
{
setAllViewOptionsButtonsEnabled(true);
} else if (src == disableAllViewOptionsButton) {
}
else if (src == disableAllViewOptionsButton)
{
setAllViewOptionsButtonsEnabled(false);
} else if (src == defaultViewOptionsButton) {
}
else if (src == defaultViewOptionsButton)
{
defaultViewOptionsButtonActionPerformed();
} else if (src == defaultTpsButton) {
}
else if (src == defaultTpsButton)
{
defaultTpsButtonActionPerformed();
} else if (src == minTpsButton) {
}
else if (src == minTpsButton)
{
minTpsButtonActionPerformed();
} else if (src == fastTpsButton) {
}
else if (src == fastTpsButton)
{
fastTpsButtonActionPerformed();
} else if (src == maxTpsButton) {
}
else if (src == maxTpsButton)
{
maxTpsButtonActionPerformed();
}
}
@ -103,6 +106,8 @@ public class PreferencesViewOptionsTab extends WizardPanel {
initialize();
}
//设置默认的设置
private void defaultViewOptionsButtonActionPerformed() {
setAllViewOptionsButtonsEnabled(true);
getVisibleScanArcsCheckBox().setSelected(false);
@ -326,12 +331,13 @@ public class PreferencesViewOptionsTab extends WizardPanel {
c.weightx = 1;
visibleOptionsPanel.add(getVisibleRobotEnergyCheckBox(), c);
visibleOptionsPanel.add(getVisibleRobotNameCheckBox(), c);
visibleOptionsPanel.add(getVisibleScanArcsCheckBox(), c);
visibleOptionsPanel.add(getVisibleExplosionsCheckBox(), c);
visibleOptionsPanel.add(getVisibleGroundCheckBox(), c);
visibleOptionsPanel.add(getVisibleExplosionDebrisCheckBox(), c);
visibleOptionsPanel.add(getVisibleSentryBorderCheckBox(), c);
//将扫描线复选框添加到嵌入板中
visibleOptionsPanel.add(getVisibleRobotNameCheckBox(), c);
c.insets = new Insets(10, 0, 0, 10);
c.gridwidth = 1;
@ -430,7 +436,6 @@ public class PreferencesViewOptionsTab extends WizardPanel {
getDisplayTpsCheckBox().setSelected(robocodeProperties.getOptionsViewTPS());
getVisibleRobotNameCheckBox().setSelected(robocodeProperties.getOptionsViewRobotNames());
getVisibleRobotEnergyCheckBox().setSelected(robocodeProperties.getOptionsViewRobotEnergy());
getVisibleScanArcsCheckBox().setSelected(robocodeProperties.getOptionsViewScanArcs());
getVisibleExplosionsCheckBox().setSelected(robocodeProperties.getOptionsViewExplosions());
getVisibleGroundCheckBox().setSelected(robocodeProperties.getOptionsViewGround());
getVisibleExplosionDebrisCheckBox().setSelected(robocodeProperties.getOptionsViewExplosionDebris());
@ -438,6 +443,9 @@ public class PreferencesViewOptionsTab extends WizardPanel {
getDesiredTpsTextField().setText("" + robocodeProperties.getOptionsBattleDesiredTPS());
getPreventSpeedupWhenMinimizedCheckBox().setSelected(
robocodeProperties.getOptionsViewPreventSpeedupWhenMinimized());
//根据传入的参数设置扫描线是否可见
getVisibleScanArcsCheckBox().setSelected(robocodeProperties.getOptionsViewScanArcs());
}
public void storePreferences() {
@ -447,13 +455,15 @@ public class PreferencesViewOptionsTab extends WizardPanel {
props.setOptionsViewTPS(getDisplayTpsCheckBox().isSelected());
props.setOptionsViewRobotNames(getVisibleRobotNameCheckBox().isSelected());
props.setOptionsViewRobotEnergy(getVisibleRobotEnergyCheckBox().isSelected());
props.setOptionsViewScanArcs(getVisibleScanArcsCheckBox().isSelected());
props.setOptionsViewExplosions(getVisibleExplosionsCheckBox().isSelected());
props.setOptionsViewGround(getVisibleGroundCheckBox().isSelected());
props.setOptionsViewExplosionDebris(getVisibleExplosionDebrisCheckBox().isSelected());
props.setOptionsViewSentryBorder(getVisibleSentryBorderCheckBox().isSelected());
props.setOptionsBattleDesiredTPS(Integer.parseInt(getDesiredTpsTextField().getText()));
props.setOptionsViewPreventSpeedupWhenMinimized(getPreventSpeedupWhenMinimizedCheckBox().isSelected());
//根据参数设置扫描线是否可见
props.setOptionsViewScanArcs(getVisibleScanArcsCheckBox().isSelected());
////////////////////
properties.saveProperties();
}

View File

@ -0,0 +1,23 @@
package net.sf.robocode.ui.dialog;
import static org.junit.Assert.*;
import org.junit.Test;
public class PreferencesViewOptionsTabTest {
private static PreferencesViewOptionsTab preferencesViewOptionsTab = new PreferencesViewOptionsTab(null);
@Test
public void testDefaultViewOptionsButtonActionPerformed() {
preferencesViewOptionsTab.defaultViewOptionsButtonActionPerformed();
assertEquals(true, preferencesViewOptionsTab.getVisibleExplosionDebrisCheckBox());
assertEquals(true, preferencesViewOptionsTab.getVisibleExplosionsCheckBox());
assertEquals(true, preferencesViewOptionsTab.getVisibleGroundCheckBox());
assertEquals(true, preferencesViewOptionsTab.getVisibleRobotEnergyCheckBox());
assertEquals(true, preferencesViewOptionsTab.getVisibleRobotNameCheckBox());
assertEquals(true, preferencesViewOptionsTab.getVisibleSentryBorderCheckBox());
assertEquals(false, preferencesViewOptionsTab.getVisibleScanArcsCheckBox());
}
}

View File

@ -108,15 +108,13 @@ public class TeamCreatorOptionsPanel extends WizardPanel {
getWebpageField().setText(u.toString());
}
getVersionLabel().setVisible(true);
getVersionField().setVisible(true);
getAuthorLabel().setVisible(true);
getAuthorField().setVisible(true);
getWebpageLabel().setVisible(true);
getWebpageField().setVisible(true);
getVersionLabel().setVisible(true);//设置版本标签可见
getVersionField().setVisible(true);//设置版本文本框可见
getAuthorLabel().setVisible(true);//设置作者标签可见
getAuthorField().setVisible(true);//设置作者文本框可见
getWebpageHelpLabel().setVisible(true);
getDescriptionLabel().setText(
"Please enter a short description of this team (up to 3 lines of 72 chars each).");
"请输入一段简短的描述.");
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.