Commit 4f3dd07b authored by yannick legoc's avatar yannick legoc

Merged V3.2

parents 0c462a1e 9e8716f0
3.2.7 dd/mm/yyyy
-----
3.2.6 18/10/2019
-----
* Do not access to the command zone value of a property when its containerId is 0 but the database value.
* Reviewed the ServerControlCommandBox hierarchy and removed thenBlock argument.
3.2.5 08/07/2019
------
* Moved Property.ExpressionResult to expression package so that it is accessible to other classes.
......
......@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fr.ill.ics</groupId>
<artifactId>nomadcommandsystem</artifactId>
<version>3.3.0</version>
<version>3.3.1-SNAPSHOT</version>
<name>NomadCommandSystem</name>
<description>Java bridge for the communication with the Nomad server</description>
<scm>
......
......@@ -60,60 +60,60 @@ public class ControlCommandWrapper extends CommandWrapper {
return "";
}
public AtomicCommandWrapper addNewCommand(boolean thenBlock, String controllerName, boolean isSettings) {
return new AtomicCommandWrapper(serverControlCommandBox.addNewAtomicCommandBoxAtEnd(thenBlock, getCommandId(controllerName), isSettings));
public AtomicCommandWrapper addNewCommand(String controllerName, boolean isSettings) {
return new AtomicCommandWrapper(serverControlCommandBox.addNewAtomicCommandBoxAtEnd(getCommandId(controllerName), isSettings));
}
public AtomicCommandWrapper addNewCommand(boolean thenBlock, String controllerName, boolean isSettings, IServerCommand serverCommandToShift, boolean above) {
return new AtomicCommandWrapper(serverControlCommandBox.addNewAtomicCommandBox(thenBlock, getCommandId(controllerName), isSettings, serverCommandToShift.getServerCommandBox(), above));
public AtomicCommandWrapper addNewCommand(String controllerName, boolean isSettings, IServerCommand serverCommandToShift, boolean above) {
return new AtomicCommandWrapper(serverControlCommandBox.addNewAtomicCommandBox(getCommandId(controllerName), isSettings, serverCommandToShift.getServerCommandBox(), above));
}
public ScanCommandWrapper addNewScan(boolean thenBlock, String scanName) {
return new ScanCommandWrapper(serverControlCommandBox.addNewScanCommandBoxAtEnd(thenBlock, scanName));
public ScanCommandWrapper addNewScan(String scanName) {
return new ScanCommandWrapper(serverControlCommandBox.addNewScanCommandBoxAtEnd(scanName));
}
public ScanCommandWrapper addNewScan(boolean thenBlock, String scanName, IServerCommand serverCommandToShift, boolean above) {
return new ScanCommandWrapper(serverControlCommandBox.addNewScanCommandBox(thenBlock, scanName, serverCommandToShift.getServerCommandBox(), above));
public ScanCommandWrapper addNewScan(String scanName, IServerCommand serverCommandToShift, boolean above) {
return new ScanCommandWrapper(serverControlCommandBox.addNewScanCommandBox(scanName, serverCommandToShift.getServerCommandBox(), above));
}
public ForLoopCommandWrapper addNewForLoop(boolean thenBlock, String variableName) {
return new ForLoopCommandWrapper(serverControlCommandBox.addNewForLoopCommandBoxAtEnd(thenBlock, variableName));
public ForLoopCommandWrapper addNewForLoop(String variableName) {
return new ForLoopCommandWrapper(serverControlCommandBox.addNewForLoopCommandBoxAtEnd(variableName));
}
public ForLoopCommandWrapper addNewForLoop(boolean thenBlock, String variableName, IServerCommand serverCommandToShift, boolean above) {
return new ForLoopCommandWrapper(serverControlCommandBox.addNewForLoopCommandBox(thenBlock, variableName, serverCommandToShift.getServerCommandBox(), above));
public ForLoopCommandWrapper addNewForLoop(String variableName, IServerCommand serverCommandToShift, boolean above) {
return new ForLoopCommandWrapper(serverControlCommandBox.addNewForLoopCommandBox(variableName, serverCommandToShift.getServerCommandBox(), above));
}
public GenericCommandWrapper addNewGenericCommand(boolean thenBlock, int boxType) {
return new GenericCommandWrapper(serverControlCommandBox.addNewGenericCommandBox(thenBlock, boxType));
public GenericCommandWrapper addNewGenericCommand(int boxType) {
return new GenericCommandWrapper(serverControlCommandBox.addNewGenericCommandBox(boxType));
}
public GenericCommandWrapper addNewGenericCommand(boolean thenBlock, int boxType, IServerCommand serverCommandToShift, boolean above) {
return new GenericCommandWrapper(serverControlCommandBox.addNewGenericCommandBox(thenBlock, boxType, serverCommandToShift.getServerCommandBox(), above));
public GenericCommandWrapper addNewGenericCommand(int boxType, IServerCommand serverCommandToShift, boolean above) {
return new GenericCommandWrapper(serverControlCommandBox.addNewGenericCommandBox(boxType, serverCommandToShift.getServerCommandBox(), above));
}
public ControlCommandWrapper addNewControlCommand(boolean thenBlock, int boxType) {
return new ControlCommandWrapper(serverControlCommandBox.addNewControlCommandBox(thenBlock, boxType));
public ControlCommandWrapper addNewControlCommand(int boxType) {
return new ControlCommandWrapper(serverControlCommandBox.addNewControlCommandBox(boxType));
}
public ControlCommandWrapper addNewControlCommand(boolean thenBlock, int boxType, IServerCommand serverCommandToShift, boolean above) {
return new ControlCommandWrapper(serverControlCommandBox.addNewControlCommandBox(thenBlock, boxType, serverCommandToShift.getServerCommandBox(), above));
public ControlCommandWrapper addNewControlCommand(int boxType, IServerCommand serverCommandToShift, boolean above) {
return new ControlCommandWrapper(serverControlCommandBox.addNewControlCommandBox(boxType, serverCommandToShift.getServerCommandBox(), above));
}
public boolean moveCommand(boolean thenBlock, IServerCommand serverCommandToMove, IServerCommand serverCommandToShift, boolean above) {
return serverControlCommandBox.moveCommandBox(thenBlock, serverCommandToMove.getServerCommandBox(), serverCommandToShift.getServerCommandBox(), above);
public boolean moveCommand(IServerCommand serverCommandToMove, IServerCommand serverCommandToShift, boolean above) {
return serverControlCommandBox.moveCommandBox(serverCommandToMove.getServerCommandBox(), serverCommandToShift.getServerCommandBox(), above);
}
public boolean moveCommandToEnd(boolean thenBlock, IServerCommand serverCommandToMove) {
return serverControlCommandBox.moveCommandBoxToEnd(thenBlock, serverCommandToMove.getServerCommandBox());
public boolean moveCommandToEnd(IServerCommand serverCommandToMove) {
return serverControlCommandBox.moveCommandBoxToEnd(serverCommandToMove.getServerCommandBox());
}
public boolean deleteCommand(boolean thenBlock, IServerCommand serverCommandToDelete) {
return serverControlCommandBox.deleteCommandBox(thenBlock, serverCommandToDelete.getServerCommandBox());
public boolean deleteCommand(IServerCommand serverCommandToDelete) {
return serverControlCommandBox.deleteCommandBox(serverCommandToDelete.getServerCommandBox());
}
public CommandZoneIteratorWrapper iterator(boolean thenBlock) {
return new CommandZoneIteratorWrapper(serverControlCommandBox.getContent(thenBlock));
public CommandZoneIteratorWrapper iterator() {
return new CommandZoneIteratorWrapper(serverControlCommandBox.getContent());
}
public int getDatabaseId() {
......
......@@ -300,8 +300,11 @@ public abstract class Property implements ServerPropertyChangeListener, ICommand
}
public String getServerValue() {
try {
if (isCommandBox) {
// Do get the command zone value when containerId is 0 (command box ID), because it cannot success.
// This test prevents from bad access when the property is just created and has no command box ID.
if (isCommandBox && containerId != 0) {
// Get the value from the command zone and format it.
return this.propertyFormat.formatForDisplay(CommandZoneAccessor.getInstance(serverId).getStringValue(containerId, id));
} else {
......
......@@ -48,7 +48,7 @@ public class CommandZoneAccessor {
private Map<Integer, Boolean> commandConflicts = new HashMap<Integer, Boolean>();
public enum ExecutionPhaseState {CONSTRUCTION, RUNNING, FINISHED, PAUSED};
public enum ContainerType {COMMANDZONE, IFTHEN, IFELSE, FORLOOP, SCAN};
public enum ContainerType {COMMANDZONE, IFTHEN, BREAK, IFELSE, FORLOOP, SCAN};
public enum ForLoopType {RANGE, VALUES};
public enum ForLoopStepType {DELTA, NBPOINTS};
public enum ExpressionStatus {VALID_EXPRESSION, INVALID_EXPRESSION};
......@@ -1567,9 +1567,15 @@ public class CommandZoneAccessor {
} else if (boxType == CommandZoneRequests.CommandBoxDescriptor.CommandBoxType.GENERIC) {
content.add(new ServerGenericCommandBox(serverId, id));
} else if (boxType == CommandZoneRequests.CommandBoxDescriptor.CommandBoxType.CONTROL) {
content.add(new ServerControlCommandBox(serverId, id));
} else if (boxType == CommandZoneRequests.CommandBoxDescriptor.CommandBoxType.IFTHEN) {
content.add(new ServerIfCommandBox(serverId, id));
} else if (boxType == CommandZoneRequests.CommandBoxDescriptor.CommandBoxType.BREAK) {
content.add(new ServerBreakCommandBox(serverId, id));
} else if (boxType == CommandZoneRequests.CommandBoxDescriptor.CommandBoxType.IFTHENELSE) {
content.add(new ServerIfCommandBox(serverId, id));
}
}
......@@ -1898,7 +1904,15 @@ public class CommandZoneAccessor {
processError(response.getError(), commandBoxID);
}
else {
return new ServerControlCommandBox(serverId, response.getValue());
if (boxType == ServerControlCommandBox.IF_BOX) {
return new ServerIfCommandBox(serverId, response.getValue());
}
else if (boxType == ServerControlCommandBox.BREAK_BOX) {
return new ServerBreakCommandBox(serverId, response.getValue());
}
else if (boxType == ServerControlCommandBox.IF_ELSE_BOX) {
return new ServerIfCommandBox(serverId, response.getValue());
}
}
}
catch (InvalidProtocolBufferException e) {
......@@ -1936,7 +1950,15 @@ public class CommandZoneAccessor {
processError(response.getError(), commandBoxID);
}
else {
return new ServerControlCommandBox(serverId, response.getValue());
if (boxType == ServerControlCommandBox.IF_BOX) {
return new ServerIfCommandBox(serverId, response.getValue());
}
else if (boxType == ServerControlCommandBox.BREAK_BOX) {
return new ServerBreakCommandBox(serverId, response.getValue());
}
else if (boxType == ServerControlCommandBox.IF_ELSE_BOX) {
return new ServerIfCommandBox(serverId, response.getValue());
}
}
}
catch (InvalidProtocolBufferException e) {
......
......@@ -18,7 +18,8 @@
package fr.ill.ics.nscclient.command;
import java.util.LinkedHashSet;
import java.util.Set;
public class ServerBreakCommandBox extends ServerControlCommandBox {
......@@ -26,8 +27,73 @@ public class ServerBreakCommandBox extends ServerControlCommandBox {
super(serverId, commandBoxId);
}
public int getNumberOfCommandBoxes() {
return 1;
public Set<ServerCommandBox> getContent() {
return new LinkedHashSet<ServerCommandBox>();
}
public ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(int commandID, boolean isSettings) {
// Must never be called.
return null;
}
public ServerAtomicCommandBox addNewAtomicCommandBox(int commandID, boolean isSettings, ServerCommandBox commandBoxToMove, boolean above) {
// Must never be called.
return null;
}
public ServerScanCommandBox addNewScanCommandBoxAtEnd(String scanName) {
// Must never be called.
return null;
}
public ServerScanCommandBox addNewScanCommandBox(String scanName, ServerCommandBox commandBoxToMove, boolean above) {
// Must never be called.
return null;
}
public ServerForLoopCommandBox addNewForLoopCommandBoxAtEnd(String variableName) {
// Must never be called.
return null;
}
public ServerForLoopCommandBox addNewForLoopCommandBox(String variableName, ServerCommandBox commandBoxToMove, boolean above) {
// Must never be called.
return null;
}
public ServerGenericCommandBox addNewGenericCommandBox(int boxType) {
// Must never be called.
return null;
}
public ServerGenericCommandBox addNewGenericCommandBox(int boxType, ServerCommandBox commandBoxToMove, boolean above) {
// Must never be called.
return null;
}
public ServerControlCommandBox addNewControlCommandBox(int boxType) {
// Must never be called.
return null;
}
public ServerControlCommandBox addNewControlCommandBox(int boxType, ServerCommandBox commandBoxToMove, boolean above) {
// Must never be called.
return null;
}
public boolean moveCommandBox(ServerCommandBox commandBoxToMove, ServerCommandBox commandBoxToShift, boolean above) {
// Must never be called.
return false;
}
public boolean moveCommandBoxToEnd(ServerCommandBox commandBoxToMove) {
// Must never be called.
return false;
}
public boolean deleteCommandBox(ServerCommandBox commandBoxToDelete) {
// Must never be called.
return false;
}
}
\ No newline at end of file
......@@ -26,15 +26,34 @@ import fr.ill.ics.nscclient.command.CommandZoneAccessor.InvalidExpressionExcepti
public class ServerControlCommandBox extends ServerCommandBox {
public abstract class ServerControlCommandBox extends ServerCommandBox {
public final static int IF_BOX = 0;
public final static int BREAK_BOX = 1;
public final static int IF_ELSE_BOX = 2;
private int boxType;
public ServerControlCommandBox(String serverId, int commandBoxId) {
super(serverId, commandBoxId);
}
private CommandZoneAccessor.ContainerType convertContainerType(boolean thenBlock) {
return (thenBlock ? CommandZoneAccessor.ContainerType.IFTHEN : CommandZoneAccessor.ContainerType.IFELSE);
}
boxType = CommandZoneAccessor.getInstance(serverId).getBoxType(commandBoxId);
}
// private CommandZoneAccessor.ContainerType getContainerType() {
//
// switch (boxType) {
//
// case IF_BOX:
// return CommandZoneAccessor.ContainerType.IFTHEN;
// case BREAK_BOX:
// return CommandZoneAccessor.ContainerType.BREAK;
// case IF_ELSE_BOX:
// return CommandZoneAccessor.ContainerType.IFELSE;
// }
//
// return CommandZoneAccessor.ContainerType.IFTHEN;
// }
public void setExpression(String expression) throws InvalidExpressionException {
ExpressionResult result = CommandZoneAccessor.getInstance(serverId).setExpression(commandBoxId, expression);
......@@ -45,76 +64,44 @@ public class ServerControlCommandBox extends ServerCommandBox {
}
public int getBoxType() {
return CommandZoneAccessor.getInstance(serverId).getBoxType(commandBoxId);
return boxType;
}
public Set<ServerCommandBox> getContent(boolean thenBlock) {
return CommandZoneAccessor.getInstance(serverId).getContent(convertContainerType(thenBlock), commandBoxId);
}
public abstract Set<ServerCommandBox> getContent();
public ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(boolean thenBlock, int commandID, boolean isSettings) {
return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBoxAtEnd(convertContainerType(thenBlock), commandBoxId, commandID, isSettings);
}
public abstract ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(int commandID, boolean isSettings);
public ServerAtomicCommandBox addNewAtomicCommandBox(boolean thenBlock, int commandID, boolean isSettings, ServerCommandBox commandBoxToMove, boolean above) {
return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBox(convertContainerType(thenBlock), commandBoxId, commandID, isSettings, commandBoxToMove.getId(), above);
}
public abstract ServerAtomicCommandBox addNewAtomicCommandBox(int commandID, boolean isSettings, ServerCommandBox commandBoxToMove, boolean above);
public ServerScanCommandBox addNewScanCommandBoxAtEnd(boolean thenBlock, String scanName) {
return CommandZoneAccessor.getInstance(serverId).addNewScanCommandBoxAtEnd(convertContainerType(thenBlock), commandBoxId, scanName);
}
public abstract ServerScanCommandBox addNewScanCommandBoxAtEnd(String scanName);
public ServerScanCommandBox addNewScanCommandBox(boolean thenBlock, String scanName, ServerCommandBox commandBoxToMove, boolean above) {
return CommandZoneAccessor.getInstance(serverId).addNewScanCommandBox(convertContainerType(thenBlock), commandBoxId, scanName, commandBoxToMove.getId(), above);
}
public abstract ServerScanCommandBox addNewScanCommandBox(String scanName, ServerCommandBox commandBoxToMove, boolean above);
public ServerForLoopCommandBox addNewForLoopCommandBoxAtEnd(boolean thenBlock, String variableName) {
return CommandZoneAccessor.getInstance(serverId).addNewForLoopCommandBoxAtEnd(convertContainerType(thenBlock), commandBoxId, variableName);
}
public abstract ServerForLoopCommandBox addNewForLoopCommandBoxAtEnd(String variableName);
public ServerForLoopCommandBox addNewForLoopCommandBox(boolean thenBlock, String variableName, ServerCommandBox commandBoxToMove, boolean above) {
return CommandZoneAccessor.getInstance(serverId).addNewForLoopCommandBox(convertContainerType(thenBlock), commandBoxId, variableName, commandBoxToMove.getId(), above);
}
public abstract ServerForLoopCommandBox addNewForLoopCommandBox(String variableName, ServerCommandBox commandBoxToMove, boolean above);
public ServerGenericCommandBox addNewGenericCommandBox(boolean thenBlock, int boxType) {
return CommandZoneAccessor.getInstance(serverId).addNewGenericCommandBoxAtEnd(convertContainerType(thenBlock), commandBoxId, boxType);
}
public abstract ServerGenericCommandBox addNewGenericCommandBox(int boxType);
public ServerGenericCommandBox addNewGenericCommandBox(boolean thenBlock, int boxType, ServerCommandBox commandBoxToMove, boolean above) {
return CommandZoneAccessor.getInstance(serverId).addNewGenericCommandBox(convertContainerType(thenBlock), commandBoxId, boxType, commandBoxToMove.getId(), above);
}
public abstract ServerGenericCommandBox addNewGenericCommandBox(int boxType, ServerCommandBox commandBoxToMove, boolean above);
public ServerControlCommandBox addNewControlCommandBox(boolean thenBlock, int boxType) {
return CommandZoneAccessor.getInstance(serverId).addNewControlCommandBoxAtEnd(convertContainerType(thenBlock), commandBoxId, boxType);
}
public abstract ServerControlCommandBox addNewControlCommandBox(int boxType);
public ServerControlCommandBox addNewControlCommandBox(boolean thenBlock, int boxType, ServerCommandBox commandBoxToMove, boolean above) {
return CommandZoneAccessor.getInstance(serverId).addNewControlCommandBox(convertContainerType(thenBlock), commandBoxId, boxType, commandBoxToMove.getId(), above);
}
public abstract ServerControlCommandBox addNewControlCommandBox(int boxType, ServerCommandBox commandBoxToMove, boolean above);
public boolean moveCommandBox(boolean thenBlock, ServerCommandBox commandBoxToMove, ServerCommandBox commandBoxToShift, boolean above) {
return CommandZoneAccessor.getInstance(serverId).moveCommandBox(convertContainerType(thenBlock), commandBoxId, commandBoxToMove.getId(), commandBoxToShift.getId(), above);
}
public abstract boolean moveCommandBox(ServerCommandBox commandBoxToMove, ServerCommandBox commandBoxToShift, boolean above);
public boolean moveCommandBoxToEnd(boolean thenBlock, ServerCommandBox commandBoxToMove) {
return CommandZoneAccessor.getInstance(serverId).moveCommandBoxToEnd(convertContainerType(thenBlock), commandBoxId, commandBoxToMove.getId());
}
public abstract boolean moveCommandBoxToEnd(ServerCommandBox commandBoxToMove);
public boolean deleteCommandBox(boolean thenBlock, ServerCommandBox commandBoxToDelete) {
return CommandZoneAccessor.getInstance(serverId).deleteCommandBox(convertContainerType(thenBlock), commandBoxId, commandBoxToDelete.getId());
}
public abstract boolean deleteCommandBox(ServerCommandBox commandBoxToDelete);
public int getNumberOfCommandBoxes() {
int nbCommandBoxes = 0;
Iterator<ServerCommandBox> it = getContent(true).iterator();
while (it.hasNext()) {
nbCommandBoxes = nbCommandBoxes + it.next().getNumberOfCommandBoxes();
}
it = getContent(false).iterator();
Iterator<ServerCommandBox> it = getContent().iterator();
while (it.hasNext()) {
nbCommandBoxes = nbCommandBoxes + it.next().getNumberOfCommandBoxes();
}
return 1 + nbCommandBoxes;
}
......
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
package fr.ill.ics.nscclient.command;
import java.util.Set;
public class ServerIfCommandBox extends ServerControlCommandBox {
public ServerIfCommandBox(String serverId, int commandBoxId) {
super(serverId, commandBoxId);
}
public Set<ServerCommandBox> getContent() {
return CommandZoneAccessor.getInstance(serverId).getContent(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId);
}
public ServerAtomicCommandBox addNewAtomicCommandBoxAtEnd(int commandID, boolean isSettings) {
return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBoxAtEnd(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, commandID, isSettings);
}
public ServerAtomicCommandBox addNewAtomicCommandBox(int commandID, boolean isSettings, ServerCommandBox commandBoxToMove, boolean above) {
return CommandZoneAccessor.getInstance(serverId).addNewAtomicCommandBox(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, commandID, isSettings, commandBoxToMove.getId(), above);
}
public ServerScanCommandBox addNewScanCommandBoxAtEnd(String scanName) {
return CommandZoneAccessor.getInstance(serverId).addNewScanCommandBoxAtEnd(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, scanName);
}
public ServerScanCommandBox addNewScanCommandBox(String scanName, ServerCommandBox commandBoxToMove, boolean above) {
return CommandZoneAccessor.getInstance(serverId).addNewScanCommandBox(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, scanName, commandBoxToMove.getId(), above);
}
public ServerForLoopCommandBox addNewForLoopCommandBoxAtEnd(String variableName) {
return CommandZoneAccessor.getInstance(serverId).addNewForLoopCommandBoxAtEnd(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, variableName);
}
public ServerForLoopCommandBox addNewForLoopCommandBox(String variableName, ServerCommandBox commandBoxToMove, boolean above) {
return CommandZoneAccessor.getInstance(serverId).addNewForLoopCommandBox(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, variableName, commandBoxToMove.getId(), above);
}
public ServerGenericCommandBox addNewGenericCommandBox(int boxType) {
return CommandZoneAccessor.getInstance(serverId).addNewGenericCommandBoxAtEnd(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, boxType);
}
public ServerGenericCommandBox addNewGenericCommandBox(int boxType, ServerCommandBox commandBoxToMove, boolean above) {
return CommandZoneAccessor.getInstance(serverId).addNewGenericCommandBox(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, boxType, commandBoxToMove.getId(), above);
}
public ServerControlCommandBox addNewControlCommandBox(int boxType) {
return CommandZoneAccessor.getInstance(serverId).addNewControlCommandBoxAtEnd(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, boxType);
}
public ServerControlCommandBox addNewControlCommandBox(int boxType, ServerCommandBox commandBoxToMove, boolean above) {
return CommandZoneAccessor.getInstance(serverId).addNewControlCommandBox(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, boxType, commandBoxToMove.getId(), above);
}
public boolean moveCommandBox(ServerCommandBox commandBoxToMove, ServerCommandBox commandBoxToShift, boolean above) {
return CommandZoneAccessor.getInstance(serverId).moveCommandBox(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, commandBoxToMove.getId(), commandBoxToShift.getId(), above);
}
public boolean moveCommandBoxToEnd(ServerCommandBox commandBoxToMove) {
return CommandZoneAccessor.getInstance(serverId).moveCommandBoxToEnd(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, commandBoxToMove.getId());
}
public boolean deleteCommandBox(ServerCommandBox commandBoxToDelete) {
return CommandZoneAccessor.getInstance(serverId).deleteCommandBox(CommandZoneAccessor.ContainerType.IFTHEN, commandBoxId, commandBoxToDelete.getId());
}
}
\ No newline at end of file
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