Package org.eclipse.sapphire.ui

Examples of org.eclipse.sapphire.ui.Point


  {
      SapphireDiagramEditorPagePart diagramPart =
          (SapphireDiagramEditorPagePart)this.nodeTemplate.parent();

    DiagramNodePart nodePart = this.nodeTemplate.createNewDiagramNode();
    Point pt = diagramPart.getMouseLocation();
    nodePart.setNodeBounds(pt.getX(), pt.getY());
   
    // Select the new node and put it in direct-edit mode
    diagramPart.selectAndDirectEdit(nodePart);
    return nodePart;
 
View Full Code Here


            connPart.addBendpoint(index++, pt.getX().content(), pt.getY().content());
          }
         
          if (connLayout.getLabelX().content(false) != null && connLayout.getLabelY().content(false) != null)
          {
            Point labelPos = new Point(connLayout.getLabelX().content(), connLayout.getLabelY().content());
            connPart.setLabelPosition(labelPos);
          }
        }
      }
       
    }
   
    ElementList<DiagramConnectionLayout> connList = this.layoutModel.getDiagramConnectionsLayout();
    for (DiagramConnectionLayout connLayout : connList)
    {
      String connId = connLayout.getConnectionId().content();
      DiagramConnectionPart connPart = getConnectionPart(connService, ConnectionHashKey.createKey(null, connId));
      ElementList<DiagramBendPointLayout> bps = connLayout.getConnectionBendpoints();
      if (connPart != null)
      {
        int index = 0;
        for (DiagramBendPointLayout pt : bps)
        {
          connPart.addBendpoint(index++, pt.getX().content(), pt.getY().content());
        }
        List<Point> bendPoints = new ArrayList<Point>();
        bendPoints.addAll(connPart.getBendpoints());
       
        if (connLayout.getLabelX().content(false) != null &&
            connLayout.getLabelY().content(false) != null)
        {
          Point labelPos = new Point(connLayout.getLabelX().content(),
              connLayout.getLabelY().content());
          connPart.setLabelPosition(labelPos);
        }
      }
    }
View Full Code Here

  {
    ConnectionHashKey connKey = ConnectionHashKey.createKey(connPart);
    this.connectionBendPoints.put(connKey, connPart.getBendpoints());
    if (connPart.getLabel() != null && connPart.getLabelPosition() != null)
    {
      this.connectionLabelPositions.put(connKey, new Point(connPart.getLabelPosition()));
    }   
  }
View Full Code Here

      }
        else
        {
        for (int i = 0; i < bendpoints.size(); i++)
        {
          Point newPt = bendpoints.get(i);
          Point oldPt = oldBendpoints.get(i);
          if (newPt.getX() != oldPt.getX() || newPt.getY() != oldPt.getY())
          {
            changed = true;
            break;
          }
        }       
        }
     
      if (!changed)
      {
        if (connPart.getLabel() != null)
        {
          Point newPos = connPart.getLabelPosition();
          Point oldPos = this.connectionLabelPositions.get(key);
          if ((newPos == null && oldPos != null) ||
              (newPos != null && oldPos == null) ||
              (newPos != null && oldPos != null && !newPos.equals(oldPos)))
          {
            changed = true;
View Full Code Here

        this.showGrid = this.diagramPageDef.getGridDefinition().isVisible().content();
        this.showGuides = this.diagramPageDef.getGuidesDefinition().isVisible().content();
        this.gridUnit = this.diagramPageDef.getGridDefinition().getGridUnit().content();
        this.verticalGridUnit = this.diagramPageDef.getGridDefinition().getVerticalGridUnit().content();
        this.mouseLocation = new Point(0, 0);
       
        this.nodeTemplateListener = new NodeTemplateListener();
       
        this.nodeTemplates = new ArrayList<DiagramNodeTemplate>();
        this.nodeDefs = this.diagramPageDef.getDiagramNodeDefs();
View Full Code Here

        return this.propertiesViewContributionManager.getPropertiesViewContribution();
    }
 
    public void addBendpoint(int index, int x, int y)
    {
      this.bendPoints.add(index, new Point(x, y));
      notifyAddBendpoint();
    }
View Full Code Here

   
    public void updateBendpoint(int index, int x, int y)
    {
      if (index < this.bendPoints.size())
      {
        this.bendPoints.set(index, new Point(x, y));
      }
      notifyMoveBendpoint();
    }
View Full Code Here

      }
      else
      {
      for (int i = 0; i < bendpoints.size(); i++)
      {
        Point newPt = bendpoints.get(i);
        Point oldPt = this.bendPoints.get(i);
        if (newPt.getX() != oldPt.getX() || newPt.getY() != oldPt.getY())
        {
          changed = true;
          break;
        }
      }       
View Full Code Here

    {
      boolean changed = false;
     
      if (this.labelPosition == null && newPos != null)
      {
        this.labelPosition = new Point(newPos);
        changed = true;
      }
      else if (this.labelPosition != null && newPos == null)
      {
        this.labelPosition = null;
View Full Code Here

public class SpacerPart extends ShapePart
{
  public Point getSize()
  {
    LayoutConstraintDef constraint = getLayoutConstraint();
    Point size = new Point(constraint.getWidth().content() != null ? constraint.getWidth().content() : -1,
                constraint.getHeight().content() != null ? constraint.getHeight().content() : -1);
    return size;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.sapphire.ui.Point

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.