mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-29 07:50:29 -04:00
fixed a bug in the state management
This commit is contained in:
parent
d2ec993056
commit
adec19bc5c
@ -1042,6 +1042,7 @@ public final class Main extends JFrame implements ClosingWindowListener.ConfirmS
|
||||
circuitComponent.setManualChangeObserver(new MicroStepObserver(model));
|
||||
}
|
||||
});
|
||||
stateManager.setActualState(stoppedState);
|
||||
}
|
||||
|
||||
private void clearModelDescription() {
|
||||
|
@ -43,13 +43,15 @@ public class ModifyMoveSelected implements Modification {
|
||||
@Override
|
||||
public void modify(Circuit circuit, ElementLibrary library) {
|
||||
ArrayList<Movable> list = circuit.getElementsToMove(min, max);
|
||||
for (Movable m : list)
|
||||
m.move(accumulatedDelta);
|
||||
if (list != null) {
|
||||
for (Movable m : list)
|
||||
m.move(accumulatedDelta);
|
||||
|
||||
for (int i = 0; i < accumulatedRotate; i++)
|
||||
rotateElements(list, center);
|
||||
for (int i = 0; i < accumulatedRotate; i++)
|
||||
rotateElements(list, center);
|
||||
|
||||
circuit.elementsMoved();
|
||||
circuit.elementsMoved();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -48,4 +48,13 @@ public class StateManager {
|
||||
public boolean isActive(State state) {
|
||||
return actualState == state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the actual state. Ony used to init the state manager
|
||||
*
|
||||
* @param active the state which is active.
|
||||
*/
|
||||
public void setActualState(State active) {
|
||||
this.actualState = active;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user