Commit 1ddac008 authored by ics's avatar ics

Code method addNewScanCommandBox in CommandZoneSynchronizer.

parent 05c15462
4.0.46 dd/mm/2020
------
* Licence was missing in some files.
* Fix bug: jar from NomadGUISpecialModules were saved in home directory instead of tmp.
* Code method addNewScanCommandBox in CommandZoneSynchronizer.
4.0.45 08/07/2020
......
......@@ -1074,8 +1074,7 @@ public class ServerCommandZone extends CommandZone implements ServerCommandState
@Override
public void onAddNewScanCommandBox(ContainerType type, int commandBoxId, String scanName, int commandBoxIdToMove, boolean above, int newCommandBoxId) {
debug("onAddNewScanCommandBox BEFORE");
System.out.println("CODE METHOD onAddNewScanCommandBox in " + getClass().getCanonicalName());
// commandZoneSynchronizer.onAddNewScanCommandBox(newCommandBoxId, scanName, commandBoxIdToMove, above, type, commandBoxId);
commandZoneSynchronizer.addNewScanCommandBox(newCommandBoxId, scanName, commandBoxIdToMove, above, type, commandBoxId);
debug("onAddNewScanCommandBox AFTER");
}
......
......@@ -244,6 +244,15 @@ public class CommandZoneSynchronizer {
}
public void addNewForLoopCommandBoxAtEnd(int commandBoxId, ContainerType type, int parentCommandBoxId) {
addForLoopCommandBox(commandBoxId, type, parentCommandBoxId, -1, false);
}
public void addNewForLoopCommandBox(int commandBoxId, int commandBoxToMoveId, boolean above, ContainerType type, int parentCommandBoxId) {
addForLoopCommandBox(commandBoxId, type, parentCommandBoxId, commandBoxToMoveId, above);
}
/**
* This method gathers common code to add a for loop command box at end or anywhere in the server command zone.
......@@ -281,17 +290,16 @@ public class CommandZoneSynchronizer {
}
public void addNewForLoopCommandBoxAtEnd(int commandBoxId, ContainerType type, int parentCommandBoxId) {
addForLoopCommandBox(commandBoxId, type, parentCommandBoxId, -1, false);
public void addNewScanCommandBoxAtEnd(int commandBoxId, ContainerType type, String scanName, int parentCommandBoxId) {
addScanCommandBox(commandBoxId, type, scanName, parentCommandBoxId, -1, false);
}
public void addNewForLoopCommandBox(int commandBoxId, int commandBoxToMoveId, boolean above, ContainerType type, int parentCommandBoxId) {
addForLoopCommandBox(commandBoxId, type, parentCommandBoxId, commandBoxToMoveId, above);
public void addNewScanCommandBox(int commandBoxId, String scanName, int commandBoxToMoveId, boolean above, ContainerType type, int parentCommandBoxId) {
addScanCommandBox(commandBoxId, type, scanName, parentCommandBoxId, commandBoxToMoveId, above);
}
public void addNewScanCommandBoxAtEnd(int commandBoxId, ContainerType type, String scanName, int parentCommandBoxId) {
private void addScanCommandBox(int commandBoxId, ContainerType type, String scanName, int parentCommandBoxId, int commandBoxToMoveId, boolean above) {
AbstractCommandZone targetCommandZone = getTargetCommandZone(parentCommandBoxId, type);
ServerCommandBox serverCommandBox = new fr.ill.ics.nscclient.command.ServerScanCommandBox(serverCommandZone.getServerId(), commandBoxId);
......@@ -312,7 +320,13 @@ public class CommandZoneSynchronizer {
ModifiableCommandZone modifiableCommandZone = (ModifiableCommandZone)targetCommandZone;
CommandBoxPeer commandBoxPeer = modifiableCommandZone.getCommandZonePeer().replaceGhostWithScanContainerCommandBoxPeer();
commandBox = new ServerScanContainerCommandBox(modifiableCommandZone, commandBoxPeer, selectionTreeData, scanCommandWrapper);
modifiableCommandZone.addCommandBox(commandBox);
if (commandBoxToMoveId != -1) {
moveCommandBox(modifiableCommandZone, commandBoxToMoveId, commandBox, above);
} else {
// Command box is added at the end of the command zone and has not been inserted yet in the commandboxes vector
// (in case of an insertion between others boxes, the command box is inserted in the commandboxes vector in moveCommandBox method)
modifiableCommandZone.addCommandBox(commandBox);
}
}
((ScanContainerCommandBox)commandBox).initForClientSynchronisation();
}
......
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