graph.fillRect(0, 0, bounds.width, bounds.height);
// setup some variables
final Point stepPos = getHexLocation(step.getPosition());
stepPos.translate(-bounds.x, -bounds.y);
final Polygon facingPoly = facingPolys[step.getFacing()];
final Polygon movePoly = movementPolys[step.getFacing()];
Point offsetCostPos;
Polygon myPoly;
Color col;
// set color
switch (step.getMovementType()) {
case IEntityMovementType.MOVE_RUN:
case IEntityMovementType.MOVE_VTOL_RUN:
case IEntityMovementType.MOVE_OVER_THRUST:
if (step.isUsingMASC()) {
col = GUIPreferences.getInstance().getColor(
"AdvancedMoveMASCColor");
} else {
col = GUIPreferences.getInstance().getColor(
"AdvancedMoveRunColor");
}
break;
case IEntityMovementType.MOVE_JUMP:
col = GUIPreferences.getInstance().getColor(
"AdvancedMoveJumpColor");
break;
case IEntityMovementType.MOVE_ILLEGAL:
col = GUIPreferences.getInstance().getColor(
"AdvancedMoveIllegalColor");
break;
default:
if (step.getType() == MovePath.STEP_BACKWARDS) {
col = GUIPreferences.getInstance().getColor(
"AdvancedMoveBackColor");
} else {
col = GUIPreferences.getInstance().getColor(
"AdvancedMoveDefaultColor");
}
break;
}
if(game.useVectorMove()) {
drawActiveVectors(step, stepPos, graph);
}
drawConditions(step, stepPos, graph, col);
// draw arrows and cost for the step
switch (step.getType()) {
case MovePath.STEP_FORWARDS:
case MovePath.STEP_SWIM:
case MovePath.STEP_BACKWARDS:
case MovePath.STEP_CHARGE:
case MovePath.STEP_DFA:
case MovePath.STEP_LATERAL_LEFT:
case MovePath.STEP_LATERAL_RIGHT:
case MovePath.STEP_LATERAL_LEFT_BACKWARDS:
case MovePath.STEP_LATERAL_RIGHT_BACKWARDS:
case MovePath.STEP_DEC:
case MovePath.STEP_DECN:
case MovePath.STEP_ACC:
case MovePath.STEP_ACCN:
case MovePath.STEP_LOOP:
// draw arrows showing them entering the next
myPoly = new Polygon(movePoly.xpoints, movePoly.ypoints,
movePoly.npoints);
graph.setColor(Color.darkGray);
myPoly.translate(stepPos.x + 1, stepPos.y + 1);
graph.drawPolygon(myPoly);
graph.setColor(col);
myPoly.translate(-1, -1);
graph.drawPolygon(myPoly);
// draw movement cost
drawMovementCost(step, stepPos, graph, col, true);
drawRemainingVelocity(step, stepPos, graph, true);
break;
case MovePath.STEP_GO_PRONE:
case MovePath.STEP_HULL_DOWN:
case MovePath.STEP_DOWN:
case MovePath.STEP_DIG_IN:
case MovePath.STEP_FORTIFY:
//draw arrow indicating dropping prone
// also doubles as the descent indication
Polygon downPoly = movementPolys[7];
myPoly = new Polygon(downPoly.xpoints, downPoly.ypoints,
downPoly.npoints);
graph.setColor(Color.darkGray);
myPoly.translate(stepPos.x, stepPos.y);
graph.drawPolygon(myPoly);
graph.setColor(col);
myPoly.translate(-1, -1);
graph.drawPolygon(myPoly);
offsetCostPos = new Point(stepPos.x + 1, stepPos.y + 15);
drawMovementCost(step, offsetCostPos, graph, col, false);
drawRemainingVelocity(step, stepPos, graph, true);
break;
case MovePath.STEP_GET_UP:
case MovePath.STEP_UP:
case MovePath.STEP_CAREFUL_STAND:
// draw arrow indicating standing up
// also doubles as the climb indication
// and triples as deceleration
Polygon upPoly = movementPolys[6];
myPoly = new Polygon(upPoly.xpoints, upPoly.ypoints,
upPoly.npoints);
graph.setColor(Color.darkGray);
myPoly.translate(stepPos.x, stepPos.y);
graph.drawPolygon(myPoly);
graph.setColor(col);
myPoly.translate(-1, -1);
graph.drawPolygon(myPoly);
offsetCostPos = new Point(stepPos.x, stepPos.y + 15);
drawMovementCost(step, offsetCostPos, graph, col, false);
drawRemainingVelocity(step, stepPos, graph, true);
break;
case MovePath.STEP_CLIMB_MODE_ON:
// draw climb mode indicator
String climb;
if (step.getParent().getEntity().getMovementMode() == IEntityMovementMode.WIGE) {
climb = Messages.getString("BoardView1.WIGEClimb"); //$NON-NLS-1$
} else {
climb = Messages.getString("BoardView1.Climb"); //$NON-NLS-1$
}
if (step.isPastDanger()) {
climb = "(" + climb + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
graph.setFont(new Font("SansSerif", Font.PLAIN, 12)); //$NON-NLS-1$
int climbX = stepPos.x
+ 42
- (graph.getFontMetrics(graph.getFont())
.stringWidth(climb) / 2);
graph.setColor(Color.darkGray);
graph.drawString(climb, climbX, stepPos.y + 39);
graph.setColor(col);
graph.drawString(climb, climbX - 1, stepPos.y + 38);
break;
case MovePath.STEP_CLIMB_MODE_OFF:
// cancel climb mode indicator
String climboff;
if (step.getParent().getEntity().getMovementMode() == IEntityMovementMode.WIGE) {
climboff = Messages.getString("BoardView1.WIGEClimbOff"); //$NON-NLS-1$
} else {
climboff = Messages.getString("BoardView1.ClimbOff"); //$NON-NLS-1$
}
if (step.isPastDanger()) {
climboff = "(" + climboff + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
graph.setFont(new Font("SansSerif", Font.PLAIN, 12)); //$NON-NLS-1$
int climboffX = stepPos.x
+ 42
- (graph.getFontMetrics(graph.getFont())
.stringWidth(climboff) / 2);
graph.setColor(Color.darkGray);
graph.drawString(climboff, climboffX, stepPos.y + 39);
graph.setColor(col);
graph.drawString(climboff, climboffX - 1, stepPos.y + 38);
break;
case MovePath.STEP_TURN_LEFT:
case MovePath.STEP_TURN_RIGHT:
case MovePath.STEP_THRUST:
case MovePath.STEP_YAW:
case MovePath.STEP_EVADE:
case MovePath.STEP_ROLL:
// draw arrows showing the facing
myPoly = new Polygon(facingPoly.xpoints,
facingPoly.ypoints, facingPoly.npoints);
graph.setColor(Color.darkGray);
myPoly.translate(stepPos.x + 1, stepPos.y + 1);
graph.drawPolygon(myPoly);
graph.setColor(col);