Package org.eclipse.sapphire.ui

Examples of org.eclipse.sapphire.ui.Point


    this.spacerPresentation = spacerPresentation;
  }
 
  public Dimension getMinimumSize(int w, int h)
  {
    Point size = this.spacerPresentation.getMinimunSize();
    Dimension d = new Dimension(size.getX(), size.getY());
    return d;
  }
View Full Code Here


    return d;
  }

  public Dimension getMaximumSize()
  {
    Point size = this.spacerPresentation.getMaximumSize();
    Dimension d = new Dimension(size.getX(), size.getY());
    return d;
  }
View Full Code Here

    return d;
  }

  public Dimension getPreferredSize(int w, int h)
  {
    Point size = this.spacerPresentation.getSize();
    Point minSize = this.spacerPresentation.getMinimunSize();
    Point maxSize = this.spacerPresentation.getMaximumSize();
    int w2 = size.getX() != -1 ? size.getX() :
        (minSize.getX() != -1 ? minSize.getX() : (maxSize.getX() != -1 ? maxSize.getX() : -1));
    int h2 = size.getY() != -1 ? size.getY() :
      (minSize.getY() != -1 ? minSize.getY() : (maxSize.getY() != -1 ? maxSize.getY() : -1));
    Dimension d = new Dimension(w2, h2);
    return d;
  }
View Full Code Here

    ((Label)getFigure()).setText(getDiagramConnectionPart().getLabel());
  }
 
  private void refreshLabelLocation() {
    PolylineConnection parent = (PolylineConnection)getFigure().getParent();
    Point position = getDiagramConnectionPart().getLabelPosition();
    SapphireMidpointLocator locator = position == null ?
            new SapphireMidpointLocator(getConfigurationManager(), parent) :
            new SapphireMidpointLocator(getConfigurationManager(), parent, position.getX(), position.getY());
    parent.getLayoutManager().setConstraint(getFigure(), locator);
  }
View Full Code Here

 
  private void moveAllBendpoints(DiagramConnectionModel conn, int deltaX, int deltaY) {
    DiagramConnectionPart part = conn.getModelPart();
    List<Point> pts = part.getBendpoints();
    for (int i = 0; i < pts.size(); i++) {
      Point current = pts.get(i);
      part.updateBendpoint(i, current.getX() + deltaX, current.getY() + deltaY);
    }
  }
View Full Code Here

    if (connPart != null)
    {
      List<Point> bendpoints = new ArrayList<Point>();
      for (ConnectionBendpoint bendpoint : componentDependency.getConnectionBendpoints())
      {
        bendpoints.add(new Point(bendpoint.getX().content(), bendpoint.getY().content()));
      }
      connPart.resetBendpoints(bendpoints);
    }
  }
View Full Code Here

      final int bpInPartSize = bpInPartList.size();
     
      for( int i = 0, n = min( bpInModelSize, bpInPartSize ); i < n; i++ )
      {
          final ConnectionBendpoint bpInModel = bpInModelList.get( i );
          final Point bpInPart = bpInPartList.get( i );
         
          if (bpInModel.getX().content() != bpInPart.getX())
          {
            bpInModel.setX( bpInPart.getX() );
          }
          if (bpInModel.getY().content() != bpInPart.getY())
          {
            bpInModel.setY( bpInPart.getY() );
          }
      }
     
      if( bpInModelSize < bpInPartSize )
      {
          for( int i = bpInModelSize; i < bpInPartSize; i++ )
          {
              final ConnectionBendpoint bpInModel = bpInModelList.insert();
              final Point bpInPart = bpInPartList.get( i );
             
              bpInModel.setX( bpInPart.getX() );
              bpInModel.setY( bpInPart.getY() );
          }
      }
      else if( bpInModelSize > bpInPartSize )
      {
          for( int i = bpInModelSize - 1; i >= bpInPartSize; i-- )
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;
          }
        }       
View Full Code Here

        if( ! locations.isEmpty() )
        {
            final SapphireDiagramEditorPagePart diagram = context( SapphireDiagramEditorPagePart.class );
            final Map map = context( Map.class );
           
            final Point initialDropPosition = context.position();
           
            int x = initialDropPosition.getX();
            int y = initialDropPosition.getY();
           
            for( String locationName : locations )
            {
                if( ! map.hasLocation( locationName ) )
                {
View Full Code Here

      {
        this.bendPoints.addAll(bendPoints);
      }
      if (labelPosition != null)
      {
        this.labelPosition = new Point(labelPosition.getX(), labelPosition.getY());
      }
    }
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.