mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-30 00:18:37 -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));
|
circuitComponent.setManualChangeObserver(new MicroStepObserver(model));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
stateManager.setActualState(stoppedState);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearModelDescription() {
|
private void clearModelDescription() {
|
||||||
|
@ -43,6 +43,7 @@ public class ModifyMoveSelected implements Modification {
|
|||||||
@Override
|
@Override
|
||||||
public void modify(Circuit circuit, ElementLibrary library) {
|
public void modify(Circuit circuit, ElementLibrary library) {
|
||||||
ArrayList<Movable> list = circuit.getElementsToMove(min, max);
|
ArrayList<Movable> list = circuit.getElementsToMove(min, max);
|
||||||
|
if (list != null) {
|
||||||
for (Movable m : list)
|
for (Movable m : list)
|
||||||
m.move(accumulatedDelta);
|
m.move(accumulatedDelta);
|
||||||
|
|
||||||
@ -51,6 +52,7 @@ public class ModifyMoveSelected implements Modification {
|
|||||||
|
|
||||||
circuit.elementsMoved();
|
circuit.elementsMoved();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rotates the given elements
|
* Rotates the given elements
|
||||||
|
@ -48,4 +48,13 @@ public class StateManager {
|
|||||||
public boolean isActive(State state) {
|
public boolean isActive(State state) {
|
||||||
return actualState == 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