Package org.eclipse.sapphire.ui.swt.gef.commands

Examples of org.eclipse.sapphire.ui.swt.gef.commands.MoveShapeInFactoryCommand


    ShapeFactoryPart factoryPart = (ShapeFactoryPart)toMovePart.parent();
    List<ShapePart> childShapes = factoryPart.getChildren();

    if (!(after instanceof ShapeEditPart))
    {
         return new MoveShapeInFactoryCommand(factoryPart, toMovePart, -1);
    }
    else
    {
      ShapeEditPart afterShape = (ShapeEditPart)after;
      ShapePart afterShapePart = (ShapePart)(((ShapeModel)afterShape.getModel()).getSapphirePart());
     
      int oldIndex = childShapes.indexOf(toMovePart);
      int newIndex = childShapes.indexOf(afterShapePart);
      // subtract self from the index
      if (newIndex > oldIndex) {
        newIndex--;
      }
         return new MoveShapeInFactoryCommand(factoryPart, toMovePart, newIndex);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.ui.swt.gef.commands.MoveShapeInFactoryCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.