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

Examples of org.eclipse.sapphire.ui.swt.gef.model.ShapeModel


  {
    IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
    if (child == null)
      return;
   
    ShapeModel shapeModel = (ShapeModel)childEditPart.getModel();
    ShapePresentation shapePresentation = shapeModel.getShapePresentation();
    ContainerShapePresentation parentPresentation = getParentContainer(shapePresentation);
    IFigure parentFigure = parentPresentation.getFigure();
    Object layoutConstraint = ShapeUtil.getLayoutConstraint(shapePresentation,
        parentPresentation.getLayout());
    // find the offset for figure in presentation without an editpart
View Full Code Here


  {
    IFigure child = ((GraphicalEditPart) childEditPart).getFigure();
    if (child == null)
      return;
   
    ShapeModel shapeModel = (ShapeModel)childEditPart.getModel();
    ContainerShapePresentation parentPresentation = getParentContainer(shapeModel.getShapePresentation());
    IFigure parentFigure = parentPresentation.getFigure();
    parentFigure.remove(child);   
  }
View Full Code Here

    return null;
  }
 
  private boolean sameNodeModel(EditPart part1, EditPart part2) {
    if (part1 != null && part2 != null) {
      ShapeModel model1 = (ShapeModel)part1.getModel();
      ShapeModel model2 = (ShapeModel)part2.getModel();
      return model1.getNodeModel().equals(model2.getNodeModel());
    }
    return false;
  }
View Full Code Here

        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

      }
      else if (sapphirePart instanceof ShapePart)
      {
        nodePart = sapphirePart.nearest(DiagramNodePart.class);
        DiagramNodeModel nodeModel = this.getDiagramModel().getDiagramNodeModel(nodePart);
        ShapeModel shapeModel = ShapeModelUtil.getChildShapeModel(nodeModel.getShapeModel(), (ShapePart)sapphirePart);
        editpartObj = viewer.getEditPartRegistry().get(shapeModel);
      }
      else if (sapphirePart instanceof DiagramConnectionPart)
      {
        connPart = (DiagramConnectionPart)sapphirePart;
View Full Code Here

    if (!isActive())
    {
      super.activate();
      if (getModel() instanceof ShapeModel)
      {
        ShapeModel shapeModel = (ShapeModel)getModel();
        //shapeModel.getNodeModel().addPropertyChangeListener(this);
        shapeModel.addPropertyChangeListener(this);
      }
    }
  }
View Full Code Here

  {
    if (isActive())
    {
      if (getModel() instanceof ShapeModel)
      {
        ShapeModel shapeModel = (ShapeModel)getModel();
        //shapeModel.getNodeModel().removePropertyChangeListener(this);
        shapeModel.removePropertyChangeListener(this);
        super.deactivate();
      }
    }
  }
View Full Code Here

  }
 
  @Override
  protected IFigure createFigure()
  {
    ShapeModel shapeModel = (ShapeModel)getModel();
    ShapePresentation shapePresentation = shapeModel.getShapePresentation();
    shapePresentation.render();
//    IFigure fig = ShapeUtil.createFigureForShape(shapePresentation, 
//          nodeEditPart.getCastedModel().getDiagramModel().getResourceCache(), getConfigurationManager());
    return shapePresentation.getFigure();
  }
View Full Code Here

 
  public SapphirePart getSapphirePart()
  {
    if (getModel() instanceof ShapeModel)
    {
      ShapeModel shapeModel = (ShapeModel)getModel();
      return shapeModel.getSapphirePart();
    }
    return null;   
  }
View Full Code Here

  }
 
  public ShapePresentation getShapePresentation()
  {
    if (getModel() instanceof ShapeModel) {
      ShapeModel shapeModel = (ShapeModel)getModel();
      ShapePresentation shapePresentation = shapeModel.getShapePresentation();
      return shapePresentation;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.ui.swt.gef.model.ShapeModel

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.