Search in sources :

Example 1 with ConnectionCreateCommand

use of org.csstudio.opibuilder.commands.ConnectionCreateCommand in project yamcs-studio by yamcs.

the class WidgetNodeEditPolicy method getConnectionCreateCommand.

@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
    AbstractWidgetModel source = getWidgetEditPart().getWidgetModel();
    ConnectionAnchor anchor = getWidgetEditPart().getSourceConnectionAnchor(request);
    String sourceTerminal = getWidgetEditPart().getTerminalNameFromAnchor(anchor);
    ConnectionCreateCommand cmd = new ConnectionCreateCommand(source, sourceTerminal);
    request.setStartCommand(cmd);
    return cmd;
}
Also used : ConnectionAnchor(org.eclipse.draw2d.ConnectionAnchor) AbstractWidgetModel(org.csstudio.opibuilder.model.AbstractWidgetModel) ConnectionCreateCommand(org.csstudio.opibuilder.commands.ConnectionCreateCommand)

Example 2 with ConnectionCreateCommand

use of org.csstudio.opibuilder.commands.ConnectionCreateCommand in project yamcs-studio by yamcs.

the class WidgetNodeEditPolicy method getConnectionCompleteCommand.

@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
    ConnectionCreateCommand cmd = (ConnectionCreateCommand) request.getStartCommand();
    cmd.setTarget(getWidgetEditPart().getWidgetModel());
    ConnectionAnchor anchor = getWidgetEditPart().getTargetConnectionAnchor(request);
    if (anchor == null)
        return null;
    cmd.setTargetTerminal(getWidgetEditPart().getTerminalNameFromAnchor(anchor));
    return cmd;
}
Also used : ConnectionAnchor(org.eclipse.draw2d.ConnectionAnchor) ConnectionCreateCommand(org.csstudio.opibuilder.commands.ConnectionCreateCommand)

Aggregations

ConnectionCreateCommand (org.csstudio.opibuilder.commands.ConnectionCreateCommand)2 ConnectionAnchor (org.eclipse.draw2d.ConnectionAnchor)2 AbstractWidgetModel (org.csstudio.opibuilder.model.AbstractWidgetModel)1