Package java.awt.geom

Examples of java.awt.geom.Point2D$Double


    return false;
  }

  @Override
  protected boolean onMouseDoubleClick(Point point) {
    final Point2D location = screen.convertScreenViewToWorld(point);

    final EntityView view = screen.getEntityViewAt(location.getX(), location.getY());

    if ((view != null) && view.isInteractive()) {
      // ... do the default action
      view.onAction();
      return true;
View Full Code Here


  }

  @Override
  protected void onMouseRightClick(Point point) {
    ignoreClick = false;
    final Point2D location = screen.convertScreenViewToWorld(point);
    final EntityView view = screen.getEntityViewAt(location.getX(), location.getY());

    if (view != null) {
      // ... show context menu (aka command list)
      final String[] actions = view.getActions();
View Full Code Here

    if (amount >= 1) {
      action.put("quantity", amount);
    }

    // 'move to'
    final Point2D location = screen.convertScreenViewToWorld(point);
    action.put("x", (int) location.getX());
    action.put("y", (int) location.getY());

    client.send(action);
  }
View Full Code Here

        float y2f = (float)drawer.fixY( x2f, y2.floatValue() );
        float x3f = x3.floatValue();
        float y3f = (float)drawer.fixY( x3f, y3.floatValue() );
       
        GeneralPath path = drawer.getLinePath();
        Point2D currentPoint = path.getCurrentPoint();
        float currentX = (float)currentPoint.getX();
        float currentY = (float)currentPoint.getY();
        drawer.getLinePath().curveTo(currentX,currentY,x2f,y2f,x3f,y3f);
    }
View Full Code Here

    g2.setColor(new Color(0.0f, 0.3f, 0.0f, 1.0f));
    g2.draw(spline);
  }

  private void resetSelection() {
    Point2D oldSelected = selected;
    selected = null;

    if (oldSelected != null) {
      Rectangle bounds = getDraggableArea(oldSelected).getBounds();
      repaint(bounds.x, bounds.y, bounds.width, bounds.height);
View Full Code Here

        y = 0.0;
      } else if (y > 1.0) {
        y = 1.0;
      }

      Point2D selectedCopy = (Point2D) selected.clone();
      selected.setLocation(x, y);
      support.firePropertyChange("control" + (selected == control1 ? "1" : "2"),
          selectedCopy, selected.clone());

      repaint();
View Full Code Here

        private Point2D value;

        @Override
        public Point2D evaluate(Point2D v0, Point2D v1,
                float fraction) {
            Point2D value = (Point2D) v0.clone();
            if (v0 != v1) {
                double x = value.getX();
                x += (v1.getX() - v0.getX()) * fraction;
                double y = value.getY();
                y += (v1.getY() - v0.getY()) * fraction;
                value.setLocation(x, y);
            } else {
                value.setLocation(v0.getX(), v0.getY());
            }
            return value;
        }
View Full Code Here

        return splineControlPanel;
    }

    public Interpolator getCurrentInterpolator() {
        SplineDisplay display = splineControlPanel.getDisplay();
        Point2D control1 = display.getControl1();
        Point2D control2 = display.getControl2();

        //The TimingFramework implementation doesn't respect the SMIL specification about the returned Y value
    /*Interpolator splines = new SplineInterpolator((float) control1.getX(),
        (float) control1.getY(),
        (float) control2.getX(), (float) control2.getY());*/

        Interpolator splines = new BezierInterpolator((float) control1.getX(),
                (float) control1.getY(),
                (float) control2.getX(), (float) control2.getY());

        return splines;
    }
View Full Code Here

                sy += yCoeffs[c] * t;
                c++;
            }
        }

        Point2D pt = (Point2D)destPt.clone();
        pt.setLocation(sx*postScaleX - 0.5, sy*postScaleY - 0.5);

        return pt;
    }
View Full Code Here

            c7*x3 + c8*x2*y1 + c9*x1*y2 + c10*y3;
        double sy = c11 + c12*x1 + c13*y1 +
            c14*x2 + c15*x1*y1 + c16*y2 +
            c17*x3 + c18*x2*y1 + c19*x1*y2 + c20*y3;

        Point2D pt = (Point2D)destPt.clone();
        pt.setLocation(sx*postScaleX - 0.5, sy*postScaleY - 0.5);

        return pt;
    }
View Full Code Here

TOP

Related Classes of java.awt.geom.Point2D$Double

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.