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

Examples of org.eclipse.sapphire.ui.swt.gef.parts.ShapeEditPart


        botRight.x - loc.x, botRight.y - loc.y);
       
    SapphireActionGroup actionGroup = null;
    if (editParts.size() == 1)
    {
      ShapeEditPart shapeEditPart = (ShapeEditPart)editParts.get(0);
      if (shapeEditPart instanceof DiagramNodeEditPart)
      {
        DiagramNodePart nodePart = nodeEditPart.getCastedModel().getModelPart();
        actionGroup = nodePart.getActions(SapphireActionSystem.CONTEXT_DIAGRAM_NODE);
      }
      else
      {
        ShapePart shapePart = (ShapePart)((ShapeModel)shapeEditPart.getModel()).getSapphirePart();
        actionGroup = shapePart.getActions(SapphireActionSystem.CONTEXT_DIAGRAM_NODE_SHAPE);
      }
    }
    else
    {
View Full Code Here


  protected Polyline getLineFeedback() {
    if (insertionLine == null) {
      insertionLine = new Polyline();
      insertionLine.setLineWidth(2);
      if (getHost() instanceof ShapeEditPart) {
        ShapeEditPart shapeEditPart = (ShapeEditPart)getHost();
        DiagramResourceCache resourceCache = shapeEditPart.getNodeEditPart().getCastedModel().getDiagramModel().getResourceCache();
        insertionLine.setForegroundColor(resourceCache.getOutlineColor());
      }
      insertionLine.addPoint(new Point(0, 0));
      insertionLine.addPoint(new Point(10, 10));
      addFeedback(insertionLine);
View Full Code Here

      for (Object obj : editParts)
      {
        EditPart editPart = (EditPart)obj;
        if (editPart instanceof ShapeEditPart)
        {
          ShapeEditPart shapeEditPart = (ShapeEditPart)editPart;
          if (shapeEditPart.getModel() instanceof ShapeModel)
          {
            ShapeModel shapeModel = (ShapeModel)shapeEditPart.getModel();
            ShapePart shapePart = (ShapePart)shapeModel.getSapphirePart();
            if (shapePart.parent() instanceof ShapeFactoryPart)
            {
              moveShapeFactoryPart = true;
              break;
View Full Code Here

public class ShapeSelectionEditPolicy extends NonResizableEditPolicy
{
 
  private IShapeFigure getShapeFigure() {
    if (getHost() instanceof ShapeEditPart) {
      ShapeEditPart part = (ShapeEditPart) getHost();
      if (part.getFigure() instanceof IShapeFigure) {
        return ((IShapeFigure) part.getFigure());
      }
    }
    return null;
  }
View Full Code Here

  @Override
  protected List<?> createSelectionHandles()
  {
    List<AbstractHandle> list = new ArrayList<AbstractHandle>();
    GraphicalEditPart owner = (GraphicalEditPart) getHost();
    ShapeEditPart shapeEditPart = (ShapeEditPart)owner;
    SelectionPresentation selectionPresentation = shapeEditPart.getShapePresentation().getSelectionPresentation();
    DiagramResourceCache resourceCache = shapeEditPart.getNodeEditPart().getCastedModel().getDiagramModel().getResourceCache();
    SapphireSurroundingHandle selectionHandle = new SapphireSurroundingHandle(owner, shapeEditPart.getConfigurationManager(),
        resourceCache, isDragAllowed());
    if (selectionPresentation != null)
    {
      selectionHandle.setLineOffset(selectionPresentation.getOffset().content());
      selectionHandle.setLineWidth(selectionPresentation.getWeight().content());
View Full Code Here

  {
    if (!(child instanceof ShapeEditPart))
    {
      return null;
    }
    ShapeEditPart toMove = (ShapeEditPart)child;
    ShapePart toMovePart = (ShapePart)(((ShapeModel)toMove.getModel()).getSapphirePart());
    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) {
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.ui.swt.gef.parts.ShapeEditPart

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.