Examples of ShapePart


Examples of org.eclipse.sapphire.ui.diagram.editor.ShapePart

        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
    {
      SapphireDiagramEditorPagePart pagePart = getEditor().getPart();
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.editor.ShapePart

    else if (ContainerShapeModel.SHAPE_VISIBILITY_UPDATES.equals(prop))
    {
      Object obj = evt.getNewValue();
      if (obj instanceof ShapePart)
      {
        ShapePart shapePart = (ShapePart)obj;
        ShapePresentation parentPresentation = getCastedModel().getShapePresentation();
        ShapePresentation shapePresentation = ShapeModelUtil.getChildShapePresentation(parentPresentation, shapePart);
        ShapeUtil.updateFigureForShape(shapePresentation, getCastedModel().getNodeModel().getDiagramModel().getResourceCache(),
            getConfigurationManager());
       
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.editor.ShapePart

        {
          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

Examples of org.eclipse.sapphire.ui.diagram.editor.ShapePart

 
  public void init(final ContainerShapeModel model) {
    partVisibilityListener = new FilteredListener<PartVisibilityEvent>() {
      @Override
      protected void handleTypedEvent(PartVisibilityEvent event) {
        ShapePart shapePart = (ShapePart)event.part();
        model.handleVisibilityChange(shapePart);
      }
    };
    part().attach(partVisibilityListener);
  }
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.editor.ShapePart

 
  public void init(final DiagramNodeModel model) {
    partVisibilityListener = new FilteredListener<PartVisibilityEvent>() {
      @Override
      protected void handleTypedEvent(PartVisibilityEvent event) {
        ShapePart shapePart = (ShapePart)event.part();
        model.handleVisibilityChange(shapePart);
      }
    };
    getShapePresentation().part().attach(partVisibilityListener);
    shapeUpdateListener = new FilteredListener<ShapeUpdateEvent>() {
      @Override
      protected void handleTypedEvent(ShapeUpdateEvent event) {
        ShapePart shapePart = event.getPart();
              ShapePresentation shapePresentation = ShapeModelUtil.getChildShapePresentation(getShapePresentation(), shapePart);
          ShapeUtil.updateFigureForShape(shapePresentation, resourceCache, getConfigurationManager());
      }
    };
    getShapePresentation().part().attach(shapeUpdateListener);
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.editor.ShapePart

    return this.nodePresentation.part();
  }
   
  public String getLabel()
  {
    ShapePart shapePart = getModelPart().getShapePart();
    if (shapePart instanceof ContainerShapePart)
    {
      ContainerShapePart containerShapePart = (ContainerShapePart)shapePart;
      List<TextPart> textParts = ShapePart.getContainedShapeParts(containerShapePart, TextPart.class);
      if (!textParts.isEmpty())
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.editor.ShapePart

  {
    List<ShapeModel> activeChildren = new ArrayList<ShapeModel>();
    List<ShapeModel> modelChildren = containerShapeModel.getChildren();
    for (ShapeModel shapeModel : modelChildren)
    {
      ShapePart shapePart = (ShapePart)shapeModel.getSapphirePart();
      if (shapePart.isActive() || shapeModel instanceof RectangleModel)
      {
        activeChildren.add(shapeModel);
      }
    }
    return activeChildren;
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.editor.ShapePart

      if (evt.getNewValue() == null) {
        performDirectEdit();
      } else if (evt.getNewValue() instanceof TextPart) {
        performDirectEdit((TextPart)evt.getNewValue());
      } else if (evt.getNewValue() instanceof ShapePart) {
        ShapePart container = (ShapePart)evt.getNewValue();
        List<TextPart> textParts = ShapePart.getContainedShapeParts(container, TextPart.class);
        if (!textParts.isEmpty()) {
          performDirectEdit(textParts.get(0));
        }
      }
View Full Code Here

Examples of org.eclipse.sapphire.ui.diagram.editor.ShapePart

    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

Examples of org.eclipse.sapphire.ui.diagram.editor.ShapePart

 
  @Override
  protected Object run(Presentation context)
  {
      final Element element = this.factory.getModelElementList().insert( this.type );
    final ShapePart shapePart = this.factory.getShapePart( element );
    SapphireDiagramEditorPagePart diagramPart = this.nodePart.nearest(SapphireDiagramEditorPagePart.class);
    if (shapePart.isEditable())
    {
      diagramPart.selectAndDirectEdit(shapePart);
    }
    return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.