Tabnine Logo
java.awt.geom
Code IndexAdd Tabnine to your IDE (free)

How to use java.awt.geom

Best Java code snippets using java.awt.geom (Showing top 20 results out of 5,769)

origin: robolectric/robolectric

 private void resetLastPointFromPath() {
  Point2D last = mPath.getCurrentPoint();
  mLastX = (float) last.getX();
  mLastY = (float) last.getY();
 }
}
origin: robolectric/robolectric

/**
 * Fills the given {@link RectF} with the path bounds.
 *
 * @param bounds the RectF to be filled.
 */
public void fillBounds(RectF bounds) {
 Rectangle2D rect = mPath.getBounds2D();
 bounds.left = (float) rect.getMinX();
 bounds.right = (float) rect.getMaxX();
 bounds.top = (float) rect.getMinY();
 bounds.bottom = (float) rect.getMaxY();
}
origin: robolectric/robolectric

private boolean hasPoints() {
 return !mPath.getPathIterator(null).isDone();
}
origin: plantuml/plantuml

public Point2D getTranslated(Point2D p) {
  if (p == null) {
    return null;
  }
  return new Point2D.Double(p.getX() + dx, p.getY() + dy);
}
origin: plantuml/plantuml

private Point2D putOnCircle(Point2D p) {
  p = at.transform(p, null);
  final double coef = p.distance(new Point2D.Double()) / radius;
  p = new Point2D.Double(p.getX() / coef, p.getY() / coef);
  return at2.transform(p, null);
}
origin: igniterealtime/Smack

@Override
public Point2D getPoint2D(Point2D srcPt, Point2D dstPt) {
  if (dstPt == null)
    dstPt = new Point2D.Double();
  dstPt.setLocation(srcPt.getX(), srcPt.getY());
  return dstPt;
}
origin: robolectric/robolectric

@Implementation
protected void offset(float dx, float dy) {
 GeneralPath newPath = new GeneralPath();
 PathIterator iterator = mPath.getPathIterator(new AffineTransform(0, 0, dx, 0, 0, dy));
 newPath.append(iterator, false /*connect*/);
 mPath = newPath;
}
origin: robolectric/robolectric

protected AffineTransform getAffineTransform() {
 // the AffineTransform constructor takes the value in a different order
 // for a matrix [ 0 1 2 ]
 //              [ 3 4 5 ]
 // the order is 0, 3, 1, 4, 2, 5...
 return new AffineTransform(
   simpleMatrix.mValues[0],
   simpleMatrix.mValues[3],
   simpleMatrix.mValues[1],
   simpleMatrix.mValues[4],
   simpleMatrix.mValues[2],
   simpleMatrix.mValues[5]);
}
origin: plantuml/plantuml

private static Line2D symetric(Line2D line) {
  final double x1 = line.getX1();
  final double y1 = line.getY1();
  final double x2 = line.getX2();
  final double y2 = line.getY2();
  final double dx = x2 - x1;
  final double dy = y2 - y1;
  return new Line2D.Double(x1, y1, x1 - dx, y1 - dy);
}
origin: plantuml/plantuml

public static Point2D.Double getCenter(Line2D.Double l) {
  final double x = (l.getX1() + l.getX2()) / 2;
  final double y = (l.getY1() + l.getY2()) / 2;
  return new Point2D.Double(x, y);
}
origin: robolectric/robolectric

@Override
public Rectangle2D getBounds2D() {
 return new Rectangle2D.Double(x, y, width, height);
}
origin: robolectric/robolectric

@Implementation
protected void addCircle(float x, float y, float radius, Path.Direction dir) {
 mPath.append(new Ellipse2D.Float(x - radius, y - radius, radius * 2, radius * 2), false);
}
origin: robolectric/robolectric

@Implementation(minSdk = LOLLIPOP)
protected void addRoundRect(
  float left, float top, float right, float bottom, float rx, float ry, Path.Direction dir) {
 mPath.append(
   new RoundRectangle2D.Float(left, top, right - left, bottom - top, rx * 2, ry * 2), false);
}
origin: plantuml/plantuml

static private boolean contains(CubicCurve2D.Double cubic, Rectangle2D... rects) {
  for (Rectangle2D r : rects) {
    if (r.contains(cubic.getP1()) && r.contains(cubic.getP2())) {
      return true;
    }
  }
  return false;
}
origin: robolectric/robolectric

@Implementation(minSdk = LOLLIPOP)
protected void addArc(
  float left, float top, float right, float bottom, float startAngle, float sweepAngle) {
 mPath.append(
   new Arc2D.Float(
     left, top, right - left, bottom - top, -startAngle, -sweepAngle, Arc2D.OPEN),
   false);
}
origin: plantuml/plantuml

private Point2D mirror(Point2D center, Point2D pt) {
  final double x = 2 * center.getX() - pt.getX();
  final double y = 2 * center.getY() - pt.getY();
  return new Point2D.Double(x, y);
}
origin: robolectric/robolectric

@Implementation(minSdk = LOLLIPOP)
protected void addOval(float left, float top, float right, float bottom, Path.Direction dir) {
 mPath.append(new Ellipse2D.Float(left, top, right - left, bottom - top), false);
}
origin: plantuml/plantuml

public Point2D getFromAtoB(double dist) {
  final double dx = b.getX() - a.getX();
  final double dy = b.getY() - a.getY();
  final double coef = dist / length;
  final double x = dx * coef;
  final double y = dy * coef;
  return new Point2D.Double(a.getX() + x, a.getY() + y);
}
origin: plantuml/plantuml

public ExtremityCircleCross(Point2D p1) {
  this.px = p1.getX() - radius;
  this.py = p1.getY() - radius;
  this.dest = new Point2D.Double(p1.getX(), p1.getY());
}
origin: plantuml/plantuml

public ExtremityCircleConnect(Point2D p1, double ortho) {
  this.px = p1.getX() - radius;
  this.py = p1.getY() - radius;
  this.dest = new Point2D.Double(p1.getX(), p1.getY());
  this.ortho = ortho;
}
java.awt.geom

Most used classes

  • AffineTransform
  • Rectangle2D
  • Point2D
  • Rectangle2D$Double
  • Point2D$Double
  • Ellipse2D$Double,
  • Area,
  • PathIterator,
  • Line2D$Double,
  • Rectangle2D$Float,
  • Point2D$Float,
  • Ellipse2D$Float,
  • Line2D,
  • RoundRectangle2D$Double,
  • Path2D$Double,
  • Path2D,
  • Arc2D$Double,
  • RoundRectangle2D$Float,
  • Line2D$Float
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now