Commit 3ce638c4 authored by Nico Mack's avatar Nico Mack

Code cleanup

parent aa9451d4
...@@ -69,10 +69,10 @@ public class StateManager { ...@@ -69,10 +69,10 @@ public class StateManager {
protected Timer movementTimer = new Timer(Attenuator.getMovementCooldown(), new MovementTimerListener()); protected Timer movementTimer = new Timer(Attenuator.getMovementCooldown(), new MovementTimerListener());
/** Flag raised by ActionListener of rotationTimer */ /** Flag raised by ActionListener of rotationTimer */
private boolean rotationTimerExpired = false; protected boolean rotationTimerExpired = false;
/** Flag raised by ActionListener of movementTimer */ /** Flag raised by ActionListener of movementTimer */
private boolean movementTimerExpired = false; protected boolean movementTimerExpired = false;
/** The last position change managed by the {@link StateManager}. */ /** The last position change managed by the {@link StateManager}. */
private Point lastPosition; private Point lastPosition;
...@@ -103,7 +103,7 @@ public class StateManager { ...@@ -103,7 +103,7 @@ public class StateManager {
private static final Logger logger = LoggerFactory.getLogger(StateManager.class.getSimpleName()); private static final Logger logger = LoggerFactory.getLogger(StateManager.class.getSimpleName());
public static final Point UNDEFINED = new Point(-10, -10, 0); private static final Point UNDEFINED = new Point(-10, -10, 0);
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// *************************************************************************** // ***************************************************************************
...@@ -279,13 +279,8 @@ public class StateManager { ...@@ -279,13 +279,8 @@ public class StateManager {
@Override @Override
public void actionPerformed(@Nullable ActionEvent event) { public void actionPerformed(@Nullable ActionEvent event) {
rotationTimerExpired = true; rotationTimerExpired = true;
// checkForConsistency();
wasRotating = true; wasRotating = true;
rotationTimer.stop(); rotationTimer.stop();
if (logger.isTraceEnabled()) {
logger.trace("Rotation stopped!"); //$NON-NLS-1$
}
} }
} }
...@@ -301,13 +296,8 @@ public class StateManager { ...@@ -301,13 +296,8 @@ public class StateManager {
@Override @Override
public void actionPerformed(@Nullable ActionEvent event) { public void actionPerformed(@Nullable ActionEvent event) {
movementTimerExpired = true; movementTimerExpired = true;
// checkForConsistency();
wasMoving = true; wasMoving = true;
movementTimer.stop(); movementTimer.stop();
if (logger.isTraceEnabled()) {
logger.trace("Movement stopped!"); //$NON-NLS-1$
}
} }
} }
...@@ -400,7 +390,7 @@ public class StateManager { ...@@ -400,7 +390,7 @@ public class StateManager {
while (stateIterator.hasNext()) { while (stateIterator.hasNext()) {
NuiState state = stateIterator.next(); NuiState state = stateIterator.next();
Transition transition = state.move(position); // TODO ConcurrentModificationException Transition transition = state.move(position);
if (transition != null) { if (transition != null) {
transitions.add(transition); transitions.add(transition);
if (logger.isTraceEnabled()) { if (logger.isTraceEnabled()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment