Package org.eclipse.sapphire.ui.diagram.editor

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


    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();
        actionGroup = shapePart.getActions(SapphireActionSystem.CONTEXT_DIAGRAM_NODE_SHAPE);
View Full Code Here


      if (part instanceof DiagramConnectionPart || part instanceof SapphireDiagramEditorPagePart)
      {
        // Don't display context pad if the selection includes connections
        return;
      }
      DiagramNodePart nodePart = part.nearest(DiagramNodePart.class);
      if (!(selectedNodes.contains(nodePart)))
      {
        selectedNodes.add(nodePart);
      }
    }
View Full Code Here

  public void init(final DiagramModel diagramModel) {
    diagramNodeListener = new FilteredListener<DiagramNodeEvent>() {
      @Override
      protected void handleTypedEvent(DiagramNodeEvent event) {
          DiagramNodePart nodePart = (DiagramNodePart)event.part();
          if (event instanceof DiagramNodeAddEvent) {
            diagramModel.handleAddNode(nodePart);
          }
          else if (event instanceof DiagramNodeDeleteEvent) {
            diagramModel.handleRemoveNode(nodePart);
View Full Code Here

  }
 
  @Override
  protected List<TextPart> getContainedTextParts()
  {
    DiagramNodePart nodePart = getCastedModel().getModelPart();
    return nodePart.getContainedTextParts();
  }
View Full Code Here

      return true;
    }
    List<DiagramNodeModel> nodes = this.diagramModel.getNodes();
    for (DiagramNodeModel node : nodes)
    {
      DiagramNodePart nodePart = node.getModelPart();
      Bounds bounds = nodePart.getNodeBounds();
      if (bounds.getX() == -1 || bounds.getY() == -1)
      {
        return true;
      }
    }
View Full Code Here

    if (sapphirePart instanceof DiagramNodePart || sapphirePart instanceof ShapePart || sapphirePart instanceof DiagramConnectionPart)
    {
      GraphicalViewer viewer = this.getGraphicalViewer();
     
      Object editpartObj = null;
      DiagramNodePart nodePart = null;
      DiagramConnectionPart connPart = null;
      if (sapphirePart instanceof DiagramNodePart)
      {
        nodePart = (DiagramNodePart)sapphirePart;
        DiagramNodeModel nodeModel = this.getDiagramModel().getDiagramNodeModel(nodePart);
View Full Code Here

  public List<SapphireActionHandler> create()
  {
        final ListFactory<SapphireActionHandler> handlers = ListFactory.start();
        if (getPart() instanceof DiagramNodePart)
        {
          DiagramNodePart nodePart = (DiagramNodePart)getPart();
          SapphireDiagramEditorPagePart pagePart = nodePart.nearest(SapphireDiagramEditorPagePart.class);
          List<IDiagramConnectionDef> connectionDefs = pagePart.possibleConnectionDefs(nodePart);
          for (IDiagramConnectionDef connDef : connectionDefs)
          {
            NodeCreateConnectionActionHandler handler = new NodeCreateConnectionActionHandler(connDef);
            handlers.add(handler);
View Full Code Here

 
  public ValidationMarkerPresentation(DiagramPresentation parent, ValidationMarkerPart validationMarkerPart,
      DiagramResourceCache resourceCache)
  {
    super(parent, validationMarkerPart, resourceCache);
    DiagramNodePart nodePart = validationMarkerPart.nearest(DiagramNodePart.class);
    this.imageCache = nodePart.getSwtResourceCache();
   
    this.contributors = new ArrayList<PropertyEditorAssistContributor>();
   
        final List<Class<?>> contributorClasses = new ArrayList<Class<?>>();       
        contributorClasses.addAll( SYSTEM_CONTRIBUTORS );
View Full Code Here

  @Override
  protected IFigure createFigure()
  {
    ValidationMarkerModel markerModel = (ValidationMarkerModel)this.getModel();
    ValidationMarkerPart markerPart = (ValidationMarkerPart)markerModel.getSapphirePart();
    DiagramNodePart nodePart = markerPart.nearest(DiagramNodePart.class);
    ValidationMarkerSize size = markerPart.getSize();
    Image image = null;
       
    Element model = nodePart.getModelElement();   
    Status status = model.validation();
    if (status.severity() != Status.Severity.OK)
    {
      if (status.severity() == Status.Severity.WARNING)
      {
        if (size == ValidationMarkerSize.SMALL)
        {
          image = nodePart.getSwtResourceCache().image(IMG_WARNING_SMALL);
        }
        else
        {
          image = nodePart.getSwtResourceCache().image(IMG_WARNING);         
        }
      }
      else if (status.severity() == Status.Severity.ERROR)
      {
        if (size == ValidationMarkerSize.SMALL)
        {
          image = nodePart.getSwtResourceCache().image(IMG_ERROR_SMALL);
        }
        else
        {
          image = nodePart.getSwtResourceCache().image(IMG_ERROR);
        }
      }
    }
    if (image != null)
    {
View Full Code Here

  }
 
  private void refresh()
  {
    if (getFigure() != null) {
      DiagramNodePart nodePart = part().nearest(DiagramNodePart.class);
      final ImageData data = getImage();
      if (data != null) {  
        ((SapphireImageFigure)getFigure()).setImage(nodePart.getSwtResourceCache().image(data));
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.ui.diagram.editor.DiagramNodePart

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.