Search in sources :

Example 1 with Bounds

use of org.eclipse.gmf.runtime.notation.Bounds in project statecharts by Yakindu.

the class StateTemplatesModification method setPreferredSize.

protected void setPreferredSize(View view) {
    Bounds bounds = (Bounds) ((Node) view).getLayoutConstraint();
    bounds.setWidth(-1);
    bounds.setHeight(-1);
}
Also used : Bounds(org.eclipse.gmf.runtime.notation.Bounds)

Example 2 with Bounds

use of org.eclipse.gmf.runtime.notation.Bounds in project statecharts by Yakindu.

the class FactoryUtils method setRegionViewLayoutConstraint.

private static void setRegionViewLayoutConstraint(Node regionView) {
    Bounds bounds = NotationFactory.eINSTANCE.createBounds();
    bounds.setX(INITIAL_TEXT_COMPARTMENT_WIDTH + INITIAL_TEXT_COMPARTMENT_X + SPACING);
    bounds.setY(INITIAL_TEXT_COMPARTMENT_Y);
    bounds.setHeight(INITIAL_REGION_HEIGHT);
    bounds.setWidth(INITIAL_REGION_WIDTH);
    regionView.setLayoutConstraint(bounds);
}
Also used : Bounds(org.eclipse.gmf.runtime.notation.Bounds)

Example 3 with Bounds

use of org.eclipse.gmf.runtime.notation.Bounds in project statecharts by Yakindu.

the class GroupStatesIntoCompositeRefactoring method moveSelectedStateNodesTo.

protected void moveSelectedStateNodesTo(View containerView, Bounds compositeBounds) {
    for (GraphicalEditPart editPart : getContextObjects()) {
        Node stateNode = (Node) editPart.getNotationView();
        ViewUtil.insertChildView(containerView, stateNode, ViewUtil.APPEND, true);
        Bounds newBounds = NotationFactory.eINSTANCE.createBounds();
        Bounds oldBounds = (Bounds) stateNode.getLayoutConstraint();
        // FIXME use bounds of region view
        newBounds.setX(oldBounds.getX() - compositeBounds.getX() - 7);
        // FIXME use bounds of region view
        newBounds.setY(oldBounds.getY() - compositeBounds.getY() - 34);
        ((Node) editPart.getNotationView()).setLayoutConstraint(newBounds);
    }
}
Also used : Node(org.eclipse.gmf.runtime.notation.Node) Bounds(org.eclipse.gmf.runtime.notation.Bounds) GraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart) IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)

Example 4 with Bounds

use of org.eclipse.gmf.runtime.notation.Bounds in project statecharts by Yakindu.

the class FactoryUtils method setInitialStateViewLayoutConstraint.

private static void setInitialStateViewLayoutConstraint(Node initialStateView) {
    Bounds bounds = NotationFactory.eINSTANCE.createBounds();
    bounds.setX(70);
    bounds.setY(20);
    initialStateView.setLayoutConstraint(bounds);
}
Also used : Bounds(org.eclipse.gmf.runtime.notation.Bounds)

Example 5 with Bounds

use of org.eclipse.gmf.runtime.notation.Bounds in project statecharts by Yakindu.

the class FactoryUtils method setStateViewLayoutConstraint.

private static void setStateViewLayoutConstraint(Node stateNode) {
    Bounds bounds = NotationFactory.eINSTANCE.createBounds();
    bounds.setX(40);
    bounds.setY(80);
    stateNode.setLayoutConstraint(bounds);
}
Also used : Bounds(org.eclipse.gmf.runtime.notation.Bounds)

Aggregations

Bounds (org.eclipse.gmf.runtime.notation.Bounds)9 Node (org.eclipse.gmf.runtime.notation.Node)3 Rectangle (org.eclipse.draw2d.geometry.Rectangle)2 GraphicalEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart)2 IGraphicalEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)2 Insets (org.eclipse.draw2d.geometry.Insets)1 PreferencesHint (org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint)1 Diagram (org.eclipse.gmf.runtime.notation.Diagram)1 View (org.eclipse.gmf.runtime.notation.View)1 State (org.yakindu.sct.model.sgraph.State)1