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

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


   * @return ContextButtonPadData in which the actions are splitted into two sets
   */
  private ContextButtonPadData getContextButtonPad(List<GraphicalEditPart> editParts)
  {
    ContextButtonPadData contextButtonPadData = new ContextButtonPadData();   
    DiagramNodeEditPart nodeEditPart = ((ShapeEditPart)editParts.get(0)).getNodeEditPart();
    if (nodeEditPart == null)
    {
      return contextButtonPadData;
    }
    org.eclipse.draw2d.geometry.Rectangle bounds = nodeEditPart.getFigure().getBounds();
    Point loc = bounds.getLocation();
    Point botRight = bounds.getBottomRight();
    contextButtonPadData.getPadLocation().set(loc.x, loc.y,
        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();
View Full Code Here


        context = SapphireActionSystem.CONTEXT_DIAGRAM_EDITOR;
        presentation = this.editor.getDiagramPresentation();
      }
      else if( editPart instanceof DiagramNodeEditPart )
      {
        DiagramNodeEditPart nodePart = (DiagramNodeEditPart)editPart;
        if (isMouseOnEditPart(nodePart))
        {
          context = SapphireActionSystem.CONTEXT_DIAGRAM_NODE;
          presentation = ((DiagramNodeEditPart)editPart).getPresentation();
        }
        else
        {
          this.editor.selectParts(emptySelection);
          context = SapphireActionSystem.CONTEXT_DIAGRAM_EDITOR;
          presentation = this.editor.getDiagramPresentation();
        }
      }
      else if (editPart instanceof ShapeEditPart)
      {
        DiagramNodeEditPart nodePart = ((ShapeEditPart)editPart).getNodeEditPart();
        if (isMouseOnEditPart(nodePart))
        {
          context = SapphireActionSystem.CONTEXT_DIAGRAM_NODE_SHAPE;
          presentation = ((ShapeEditPart)editPart).getShapePresentation();
        }
View Full Code Here

  public DiagramNodeResizableEditPolicy(DiagramResourceCache resourceCache) {
    this.resourceCache = resourceCache;
  }
 
  private SelectionPresentation getSelectionPresentation() {
    DiagramNodeEditPart owner = (DiagramNodeEditPart) getHost();
    return owner.getCastedModel().getShapeModel().getShapePresentation().getSelectionPresentation();
  }
View Full Code Here

    return new DiagramNodeResizeTracker((GraphicalEditPart) getHost(), direction);
  }

  private IShapeFigure getNodeFigure()
  {
    DiagramNodeEditPart part = (DiagramNodeEditPart) getHost();
    if (part.getFigure() instanceof IShapeFigure)
    {
      return ((IShapeFigure) part.getFigure());
    }
    return null;
  }
View Full Code Here

public class DiagramNodeSelectionEditPolicy extends NonResizableEditPolicy {

  private IShapeFigure getNodeFigure()
  {
    DiagramNodeEditPart part = (DiagramNodeEditPart) getHost();
    if (part.getFigure() instanceof IShapeFigure)
    {
      return ((IShapeFigure) part.getFigure());
    }
    return null;
  }
View Full Code Here

TOP

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

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.