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

Examples of org.eclipse.sapphire.ui.swt.gef.presentation.ContainerShapePresentation


    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
    int offset = ShapeUtil.getPresentationCount(parentPresentation, shapePresentation);
    parentFigure.add(child, layoutConstraint, index + offset);
  }
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

   
    ShapeFactoryPresentation factory = (ShapeFactoryPresentation)getCastedModel().getShapePresentation();
    int newIndex = index + factory.getIndex();
    ShapeModel shapeModel = (ShapeModel)childEditPart.getModel();
    ShapePresentation shapePresentation = shapeModel.getShapePresentation();
    ContainerShapePresentation parentPresentation = getParentContainer(shapePresentation);
    Object layoutConstraint = ShapeUtil.getLayoutConstraint(shapePresentation,
        parentPresentation.getLayout());
    IFigure parentFigure = parentPresentation.getFigure();
    parentFigure.add(child, layoutConstraint, newIndex);
  }
View Full Code Here

    presentation.init(this);
  }
   
  public void refreshChildren()
  {
    ContainerShapePresentation presentation = getContainerShapePresentation();
    presentation.refreshChildren();
    List<ShapeModel> refreshedChildren = new ArrayList<ShapeModel>();
    for (ShapePresentation shapePresentation : presentation.getChildren()) {
      // find existing ShapeModel
      ShapeModel childModel = getChildShapeModel(shapePresentation);
      if (childModel == null) {
        childModel = ShapeModelFactory.createShapeModel(getNodeModel(), this, shapePresentation);
      }
View Full Code Here

    {
      return parent;
    }
    else if (parent instanceof ContainerShapePresentation)
    {
      ContainerShapePresentation container = (ContainerShapePresentation)parent;
      for (ShapePresentation child :container.getChildren())
      {
        ShapePresentation presentation = getChildShapePresentation(child, shapePart);
        if (presentation != null)
        {
          return presentation;
        }
      }
    }
    else if (parent instanceof ShapeFactoryPresentation)
    {
      ShapeFactoryPresentation container = (ShapeFactoryPresentation)parent;
      for (ShapePresentation child : container.getChildren())
      {
        ShapePresentation presentation = getChildShapePresentation(child, shapePart);
        if (presentation != null)
        {
          return presentation;
View Full Code Here

    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
    int offset = ShapeUtil.getPresentationCount(parentPresentation, shapePresentation);
    parentFigure.add(child, layoutConstraint, index + offset);
    refreshNodeBounds();
  }
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

   
    IFigure updateFigure = updateShape.getFigure();
    IFigure containerFigure = updateShape.getParentFigure();
    if (updateShape.visible())
    {     
      ContainerShapePresentation containerPresentation = (ContainerShapePresentation)updateShape.parent();
      // find the parent figure
      if (containerFigure != null)
      {
        int index = containerPresentation.getChildFigureIndex(updateShape);
        if (updateFigure != null)
        {
          // first delete it
          containerFigure.remove(updateFigure);
        }
        // add it
        updateShape.render();
        updateFigure = updateShape.getFigure();
        if (updateFigure != null)
        {
          Object layoutConstraint = getLayoutConstraint(updateShape, containerPresentation.getLayout());
          if (layoutConstraint != null)
          {
            containerFigure.add(updateFigure, layoutConstraint, index);
          }
          else
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.ui.swt.gef.presentation.ContainerShapePresentation

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.