use of org.eclipse.gmf.runtime.notation.Location in project tdi-studio-se by Talend.
the class BusinessItemRelationshipNameViewFactory method createView.
/**
* @generated
*/
public View createView(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
Node view = (Node) super.createView(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
Location location = (Location) view.getLayoutConstraint();
IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
location.setX(mapMode.DPtoLP(0));
location.setY(mapMode.DPtoLP(40));
return view;
}
use of org.eclipse.gmf.runtime.notation.Location in project tdi-studio-se by Talend.
the class DirectionalBusinessItemRelationshipNameViewFactory method createView.
/**
* @generated
*/
public View createView(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
Node view = (Node) super.createView(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
Location location = (Location) view.getLayoutConstraint();
IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
location.setX(mapMode.DPtoLP(0));
location.setY(mapMode.DPtoLP(40));
return view;
}
use of org.eclipse.gmf.runtime.notation.Location in project tdi-studio-se by Talend.
the class BidirectionalBusinessItemRelationshipNameViewFactory method createView.
/**
* @generated
*/
public View createView(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
Node view = (Node) super.createView(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
Location location = (Location) view.getLayoutConstraint();
IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
location.setX(mapMode.DPtoLP(0));
location.setY(mapMode.DPtoLP(40));
return view;
}
use of org.eclipse.gmf.runtime.notation.Location in project statecharts by Yakindu.
the class TransitionViewFactory method decorateView.
@SuppressWarnings("unchecked")
@Override
protected void decorateView(View containerView, View view, IAdaptable element, String semanticHint, int index, boolean persisted) {
FontStyle fontStyle = NotationFactory.eINSTANCE.createFontStyle();
view.getStyles().add(fontStyle);
super.decorateView(containerView, view, element, semanticHint, index, persisted);
Node label = FactoryUtils.createLabel(view, SemanticHints.TRANSITION_EXPRESSION);
Location location = (Location) label.getLayoutConstraint();
location.setX(0);
location.setY(10);
}
use of org.eclipse.gmf.runtime.notation.Location in project statecharts by Yakindu.
the class SetLabelsOffsetOperation method updateGMFLabelsOffset.
/**
* Update the offset ({@link Bounds}) of the labels {@link Node}. This method
* must be called after setting the newPointList and the labelToUpdate. If the
* methods {@link #setLabelsToUpdate(ConnectionEditPart)} or
* {@link #setLabelsToUpdate(ConnectionEditPart, PointList)} are not called,
* this method has no effect.
*/
public void updateGMFLabelsOffset() {
if (labelsWithNewOffset != null) {
// Update Bounds of the three labels Node (Center, Begin and End)
Set<Entry<Node, Point>> entries = labelsWithNewOffset.entrySet();
for (Entry<Node, Point> entry : entries) {
LayoutConstraint layoutConstraint = entry.getKey().getLayoutConstraint();
if (layoutConstraint instanceof Location) {
Location bounds = (Location) layoutConstraint;
bounds.setX(entry.getValue().x);
bounds.setY(entry.getValue().y);
}
}
}
}
Aggregations