use of org.csstudio.opibuilder.commands.ConnectionReconnectCommand in project yamcs-studio by yamcs.
the class WidgetNodeEditPolicy method getReconnectTargetCommand.
@Override
protected Command getReconnectTargetCommand(ReconnectRequest request) {
var connection = (ConnectionModel) request.getConnectionEditPart().getModel();
var newTarget = getWidgetEditPart().getWidgetModel();
var anchor = getWidgetEditPart().getTargetConnectionAnchor(request);
var newTerminal = getWidgetEditPart().getTerminalNameFromAnchor(anchor);
var cmd = new ConnectionReconnectCommand(connection);
cmd.setNewTarget(newTarget);
cmd.setNewTargetTerminal(newTerminal);
// clear point list
return cmd.chain(new SetWidgetPropertyCommand(connection, ConnectionModel.PROP_POINTS, new PointList()));
}
use of org.csstudio.opibuilder.commands.ConnectionReconnectCommand in project yamcs-studio by yamcs.
the class WidgetNodeEditPolicy method getReconnectSourceCommand.
@Override
protected Command getReconnectSourceCommand(ReconnectRequest request) {
var connection = (ConnectionModel) request.getConnectionEditPart().getModel();
var newSource = getWidgetEditPart().getWidgetModel();
var anchor = getWidgetEditPart().getTargetConnectionAnchor(request);
var newTerminal = getWidgetEditPart().getTerminalNameFromAnchor(anchor);
var cmd = new ConnectionReconnectCommand(connection);
cmd.setNewSource(newSource);
cmd.setNewSourceTerminal(newTerminal);
// clear point list
return cmd.chain(new SetWidgetPropertyCommand(connection, ConnectionModel.PROP_POINTS, new PointList()));
}
Aggregations