Package net.sf.myway.base.db

Examples of net.sf.myway.base.db.Point


    final Image img = new Image(Display.getDefault(), map.getFileName());
    final Rectangle bounds = img.getBounds();
    final CalibrationObject obj = new CalibrationObject();
    if (map.getUpperleft().equals(map.getUpperright())
      && map.getUpperleft().equals(map.getLowerleft())) {
      map.setUpperleft(new Point(25, 25));
      map.setUpperright(new Point(bounds.width - 25, 25));
      map.setLowerleft(new Point(25, bounds.height - 25));
      map.setLowerright(new Point(bounds.width - 25, bounds.height - 25));
    }
    obj.setMap(map);
    obj.setImage(img);
    setCalibrationObject(obj);
  }
View Full Code Here


    final double dlon = longitude.getVal() - _coordianteSystem.getWest().getVal();
    final int x = (int) (dlon / _coordianteSystem.getDeltaLongitude().getVal());
    final int y = (int) (dlat / _coordianteSystem.getDeltaLatitude().getVal());
    System.out.println("pos " + latitude + " " + longitude + " delta " + dlon + " " + dlat
      + " x,y=" + x + "," + y);
    return new Point(x, y);
  }
View Full Code Here

    final int fcol = _profile.getColor(type);
    final Color bgcolor = new Color(gc.getDevice(), (fcol & 0xff0000) >> 16,
      (fcol & 0xff00) >> 8, fcol & 0xff);
    final int[] poly = new int[object.getNodes().size() * 2];
    int idx = 0;
    Point p;
    for (final MapNodeRef point : object.getNodes()) {
      p = calcPos(point.getNode().getLatitude(), point.getNode().getLongitude());
      gc.setForeground(border);
      gc.setBackground(bgcolor);
      poly[idx++] = p.getX();
      poly[idx++] = p.getY();
    }
    if (type.isClosed()) {
      gc.fillPolygon(poly);
      gc.drawPolygon(poly);
    }
    else {
      gc.setLineWidth(5);
      gc.drawPolyline(poly);
      gc.setForeground(bgcolor);
      gc.setLineWidth(2);
      gc.drawPolyline(poly);
    }
    final String iconName = "net/sf/myway/map/icons/" + _profile.getIcon(type) + ".gif";
    final InputStream icon = Thread.currentThread().getContextClassLoader()
      .getResourceAsStream(iconName);
    if (icon != null) {
      final Image img = new Image(gc.getDevice(), icon);
      p = calcPos(object.getCenter().getNode().getLatitude(), object.getCenter().getNode()
        .getLongitude());
      gc.drawImage(img, p.getX() - img.getImageData().width / 2, p.getY()
        - img.getImageData().height / 2);
    }
    border.dispose();
    bgcolor.dispose();
  }
View Full Code Here

  /**
   * @param lowerleft
   *            the lowerleft to set
   */
  public void setLowerleft(final Point lowerleft) {
    final Point old = _lowerleft;
    _lowerleft = lowerleft;
    firePropertyChange(ScannedMapPropertySource.PROP_LOWER_LEFT, old, lowerleft);
  }
View Full Code Here

  /**
   * @param lowerright
   *            the lowerright to set
   */
  public void setLowerright(final Point lowerright) {
    final Point old = _lowerright;
    _lowerright = lowerright;
    firePropertyChange(ScannedMapPropertySource.PROP_LOWER_RIGHT, old, lowerright);
  }
View Full Code Here

  /**
   * @param upperleft
   *            the upperleft to set
   */
  public void setUpperleft(final Point upperleft) {
    final Point old = _upperleft;
    _upperleft = upperleft;
    firePropertyChange(ScannedMapPropertySource.PROP_UPPER_LEFT, old, upperleft);
  }
View Full Code Here

  /**
   * @param upperright
   *            the upperright to set
   */
  public void setUpperright(final Point upperright) {
    final Point old = _upperright;
    _upperright = upperright;
    firePropertyChange(ScannedMapPropertySource.PROP_UPPER_LEFT, old, upperright);
  }
View Full Code Here

    final Rectangle bounds = image.getBounds();
    fig.setBounds(new org.eclipse.draw2d.geometry.Rectangle(bounds));
    fig.setLayoutManager(new XYLayout());
    fig.setAlignment(PositionConstants.NORTH | PositionConstants.WEST);
    if (m.getUpperleft().equals(m.getUpperright()) && m.getUpperleft().equals(m.getLowerleft())) {
      m.setUpperleft(new Point(25, 25));
      m.setUpperright(new Point(bounds.width - 25, 25));
      m.setLowerleft(new Point(25, bounds.height - 25));
      m.setLowerright(new Point(bounds.width - 25, bounds.height - 25));
    }
    return fig;
  }
View Full Code Here

TOP

Related Classes of net.sf.myway.base.db.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.