Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Point


        Box scaleBox = ModelFactory.eINSTANCE.createBox();
        MapGraphicBoxPrinter scale = new MapGraphicBoxPrinter(page);
        scale.setMapGraphic(MapGraphicChooserDialog.findResource(ScalebarMapGraphic.class));
        scaleBox.setBoxPrinter(scale);
        scaleBox.setID("Scalebar Box"); //$NON-NLS-1$
        scaleBox.setLocation(new Point(xPos, yPos));
        scaleBox.setSize(new Dimension(scaleWidth, scaleHeight));
        boxes.add(scaleBox);
    }
View Full Code Here


    protected int addLabelBox( String text, int xPos, int yPos, int labelWidth, int labelHeight,
            int fontSize, float scaleFactor ) {
        Box labelBox = ModelFactory.eINSTANCE.createBox();
        labelBox.setSize(new Dimension(labelWidth, labelHeight));
        labelBox.setLocation(new Point(xPos, yPos));
        LabelBoxPrinter labelBoxPrinter = new LabelBoxPrinter(scaleFactor);
        labelBox.setBoxPrinter(labelBoxPrinter);

        labelBox.setID("Standard Label"); //$NON-NLS-1$
        labelBoxPrinter.setText(text);
View Full Code Here

        Rectangle mapBounds = new Rectangle(xPos, yPos, mapWidth, mapHeight);
        mapBox.setSize(new Dimension(mapBounds.width, mapBounds.height));
        mapBox.setPaperSize(paperSize);

        mapBox.setLocation(new Point(mapBounds.x, mapBounds.y));
        boxes.add(mapBox);
        return mapBounds;
    }
View Full Code Here

        Box legendBox = ModelFactory.eINSTANCE.createBox();
        MapGraphicBoxPrinter legend = new MapGraphicBoxPrinter(page);
        legend.setMapGraphic(MapGraphicChooserDialog.findResource(LegendGraphic.class));
        legendBox.setBoxPrinter(legend);
        legendBox.setID("Legend Box"); //$NON-NLS-1$
        legendBox.setLocation(new Point(xPos, yPos));
        legendBox.setSize(new Dimension(legendWidth, legendHeight));
        boxes.add(legendBox);
    }
View Full Code Here

    public Rectangle getMapBounds() throws IllegalStateException {
        Rectangle bounds = null;
        for( Box box : boxes ) {
            if (box.getBoxPrinter() instanceof MapBoxPrinter) {
                Dimension size = box.getSize();
                Point location = box.getLocation();
                bounds = new Rectangle(location.x, location.y, size.width, size.height);
            }
        }
        return bounds;
    }
View Full Code Here

    String[] terms = tag.split(BioPAXL3Graph.MODEL_TAG_SEPARATOR);

    assert terms.length == 2 : "terms length: " + terms.length + "\n" + tag;

    node.setLocationAbs(new Point(Integer.parseInt(terms[0]), Integer.parseInt(terms[1])));

    return true;
  }
View Full Code Here

    List<DependencyGraphNode> nodes = graph.getNodes();
    List<DependencyGraphEdge> edges = getInternalSubGraphRelations(nodes);
   
    DependencyGraphNode centerNode = getCenterNodeOfSubgraph();      
       
    Point centerPosition = calculatePositionOfCenterNode(windowWidth, windowHeight);
        centerNode.setLocation(centerPosition.x,centerPosition.y);
                               
      int offset = 0;
        int distanceFromCenter = calculateDistanceFromCenterNode(nodes,edges);
       
      float angle = 0.0f;
      float angleOffset = 360.0f  / ((float)(nodes.size()-1));
     
        for(int i = 0; i < nodes.size(); i++)
        {
          if( nodes.get(i).isLocalRoot() )
          {
            offset++;
            continue;
          }
                   
          angle = (float)(i-offset) * angleOffset;
          angle = (float)(angle * Math.PI / 180.0f);
                             
          int posX = (int)(Math.cos(angle) * distanceFromCenter);
          int posY = (int)(Math.sin(angle) * distanceFromCenter);
         
          Point position = new PrecisionPoint(posX, posY);
          normalizeNodePositions(centerPosition, position, angle);        
                   
          nodes.get(i).setLocation(position.x,position.y);
        }
       
View Full Code Here

  }

  @Override
  public void setDimension(Dimension dim) {
    removeAllPoints();
    setStart(new Point(dim.width / 2, 0));
    addPoint(new Point(dim.width, dim.height / 2));
    addPoint(new Point(dim.width / 2, dim.height));
    addPoint(new Point(0, dim.height / 2));
    addPoint(new Point(dim.width / 2, 0));
  }
View Full Code Here

  @Override
  public void setDimension(Dimension dim) {
    removeAllPoints();
    int quantx = dim.width / 3;
    // int quanty = height/3 ;
    setStart(new Point(0, dim.height / 2));
    addPoint(new Point(quantx, 0));
    addPoint(new Point(2 * quantx, 0));
    addPoint(new Point(dim.width, dim.height / 2));
    addPoint(new Point(dim.width - quantx, dim.height));
    addPoint(new Point(dim.width - (2 * quantx), dim.height));
    addPoint(new Point(0, dim.height / 2));
  }
View Full Code Here

    mgr = new PortAnchorReferenceManager(figure, portName, isOutput);
  }

  @Override
  public Point getLocation(Point reference) {
    Point mgrReference = mgr.getReferencePoint(this);
    if (mgrReference == null) {
      return super.getLocation(reference);
    } else {
      return mgrReference;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.geometry.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.