use of org.csstudio.opibuilder.model.AbstractWidgetModel in project yamcs-studio by yamcs.
the class AbstractLayoutEditpart method layout.
/**
*Layout widgets.
* @param widgetModelList
* @param containerBounds
*/
public void layout(List<AbstractWidgetModel> widgetModelList, Rectangle containerBounds) {
int i = 0;
List<Rectangle> newBounds = getNewBounds(widgetModelList, containerBounds);
for (AbstractWidgetModel model : widgetModelList) {
model.setBounds(newBounds.get(i));
i++;
}
}
use of org.csstudio.opibuilder.model.AbstractWidgetModel in project yamcs-studio by yamcs.
the class GraphicalFeedbackChildEditPolicy method createSelectionHandles.
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected List<?> createSelectionHandles() {
// get default handles
List<Handle> handleList = super.createSelectionHandles();
// add contributed handles
GraphicalEditPart hostEP = (GraphicalEditPart) getHost();
List<Handle> contributedHandles = feedbackFactory.createCustomHandles(hostEP);
if (contributedHandles != null) {
handleList.addAll(contributedHandles);
}
if (hostEP.getModel() instanceof IPVWidgetModel && ((AbstractWidgetModel) (hostEP.getModel())).getProperty(IPVWidgetModel.PROP_PVNAME).isVisibleInPropSheet()) {
handleList.add(new PVWidgetSelectionHandle((GraphicalEditPart) hostEP));
}
return handleList;
}
use of org.csstudio.opibuilder.model.AbstractWidgetModel in project yamcs-studio by yamcs.
the class WidgetComponentEditPolicy method createDeleteCommand.
@Override
protected Command createDeleteCommand(GroupRequest deleteRequest) {
Object containerModel = getHost().getParent().getModel();
Object widget = getHost().getModel();
if (containerModel instanceof AbstractContainerModel && widget instanceof AbstractWidgetModel)
return new WidgetDeleteCommand((AbstractContainerModel) containerModel, (AbstractWidgetModel) widget);
return super.createDeleteCommand(deleteRequest);
}
use of org.csstudio.opibuilder.model.AbstractWidgetModel 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;
}
use of org.csstudio.opibuilder.model.AbstractWidgetModel in project yamcs-studio by yamcs.
the class WidgetTreeContainerEditPolicy method getCreateCommand.
@Override
protected Command getCreateCommand(CreateRequest request) {
AbstractWidgetModel widgetModel = (AbstractWidgetModel) request.getNewObject();
int index = findIndexOfTreeItemAt(request.getLocation());
return createCreateCommand(widgetModel, null, index, "Create Widget");
}
Aggregations