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

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


    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


    {
      List<ShapePresentation> presentations = this.shapeFactoryPresentation.getChildren();
      int size = presentations.size();
      for (int i = 0; i < size; i++)
      {
        ShapePresentation shapePresentation = presentations.get(i);
        ShapeModel childModel = ShapeModelFactory.createShapeModel(nodeModel, this, shapePresentation);
        assert childModel != null;
            this.children.add(childModel);
           
            ShapeModel separatorModel = getSeparatorModel(nodeModel, i);
View Full Code Here

    }
    presentation.init(this);
  }
 
  private ShapeModel getSeparatorModel(DiagramNodeModel nodeModel, int index) {
    ShapePresentation separatorPresentation = this.shapeFactoryPresentation.getSeparator();
    if (separatorPresentation != null) {
      if (separators == null) {
        separators = new ArrayList<ShapeModel>();
      }
      int size = separators.size();
View Full Code Here

    {
      List<ShapePresentation> presentations = this.shapeFactoryPresentation.getChildren();
      int size = presentations.size();
      for (int i = 0; i < size; i++)
      {
        ShapePresentation shapePresentation = presentations.get(i);

        // find existing ShapeModel
        ShapeModel childModel = getChildShapeModel(shapePresentation);
        if (childModel == null)
        {
View Full Code Here

    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

    {
      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());
       
        refresh();
      }
View Full Code Here

    int rowBottom = Integer.MIN_VALUE;
    int candidate = -1;
    for (int i = 0; i < children.size(); i++) {
      EditPart child = (EditPart) children.get(i);
      if (child instanceof ShapeEditPart) {
        ShapePresentation presentation = ((ShapeEditPart)child).getShapePresentation();
        if (presentation != null && presentation.isSeparator()) {
          continue;
        }
      }
      Rectangle rect = transposer
          .t(getAbsoluteBounds(((GraphicalEditPart) child)));
View Full Code Here

      return this.configManager;
    }

  @Override
  public boolean isSelectable() {
    ShapePresentation shapePresentation = getShapePresentation();
    if (shapePresentation != null && shapePresentation.isSeparator()) {
      return false;
    }
   
    return super.isSelectable();
  }
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 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.presentation.ShapePresentation

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.