congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
org.jhotdraw.geom
Code IndexAdd Tabnine to your IDE (free)

How to use org.jhotdraw.geom

Best Java code snippets using org.jhotdraw.geom (Showing top 20 results out of 315)

origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Gets the point coordinate of a control point.
 */
public Point2D.Double getPoint(int index, int coord) {
  return path.get(index).getControlPoint(coord);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Adds a node to the path.
 * <p>
 * This is a convenience method for adding a node with a single control
 * point C0 to the path.
 */
public void add(Point2D.Double c0) {
  add(new Node(0, c0, c0, c0));
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Gets a control point.
 */
public BezierPath.Node getNode(int index) {
  return (BezierPath.Node) path.get(index).clone();
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Sets the insets.
 *
 * @param i The new insets.
 */
public void set(Insets2D i) {
  set(i.getTop(), i.getLeft(), i.getBottom(), i.getRight());
}

origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Tests if there are more points to read.
 * @return true if there are more points to read
 */
@Override
public boolean isDone() {
  return (index >= path.size() + (path.isClosed() ? 2 : 0));
}

origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

public Point2D.Double getOutermostPoint() {
  return path.get(path.indexOfOutermostNode()).getControlPoint(0);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Gets the node count.
 */
public int getNodeCount() {
  return path.size();
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Returns a point on the edge of the bezier path which crosses the line
 * from the center of the bezier path to the specified point.
 * If no edge crosses the line, the nearest C0 control point is returned.
 */
public Point2D.Double chop(Point2D.Double p) {
  return Geom.chop(this, p);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
public Rectangle2D.Double getBounds() {
  Rectangle2D.Double bounds = path.getBounds2D();
  return bounds;
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Translates the vertices of the <code>Polygon</code> by
 * <code>deltaX</code> along the x axis and by
 * <code>deltaY</code> along the y axis.
 * @param deltaX the amount to translate along the X axis
 * @param deltaY the amount to translate along the Y axis
 * 
 */
@Override
public void translate(double deltaX, double deltaY) {
  translate((float) deltaX, (float) deltaY);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

  @Override
  public PathIterator getPathIterator(AffineTransform at) {
    return new PolygonPathIteratorFloat(this, at);
  }
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Removes the Point2D.Double at the specified index.
 */
protected void removeAllNodes() {
  path.clear();
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Sets the size of this <code>Dimension2DDouble</code> object to the specified size.
 * This method is included for completeness, to parallel the
 * <code>setSize</code> method defined by <code>Component</code>.
 * @param    d  the new size for this <code>Dimension2DDouble</code> object
 * @see      Dimension2DDouble#getSize
 * @see      java.awt.Component#setSize
 * @since    JDK1.1
 */
public void setSize(Dimension2DDouble d) {
setSize(d.width, d.height);
}    
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Determines whether the specified {@link Point} is inside this 
 * <code>Polygon</code>.
 * @param p the specified <code>Point</code> to be tested
 * @return <code>true</code> if the <code>Polygon</code> contains the
 *             <code>Point</code>; <code>false</code> otherwise.
 * @see #contains(double, double)
 * 
 */
public boolean contains(Point p) {
  return contains(p.x, p.y);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

  @Override
  public PathIterator getPathIterator(AffineTransform at) {
    return new PolygonPathIteratorDouble(this, at);
  }
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Normalizes the input vector and returns it.
 */
private static Point2D.Double v2Normalize(Point2D.Double v) {
  double len = v2Length(v);
  if (len != 0.0) {
    v.x /= len;
    v.y /= len;
  }
  return v;
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Adds a node to the path.
 * <p>
 * This is a convenience method for adding a node with a single control
 * point C0 to the path.
 */
public void add(double x, double y) {
  add(new Node(0, x, y, x, y, x, y));
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Convenience method for getting the point coordinate of
 * the first control point of the specified node.
 */
public Point2D.Double getPoint(int index) {
  return path.get(index).getControlPoint(0);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Adds a set of nodes to the path.
 * <p>
 * Convenience method for adding multiple nodes with a single control point
 * C0.
 */
public void addPolyline(Collection<Point2D.Double> points) {
  for (Point2D.Double c0 : points) {
    add(new Node(0, c0, c0, c0));
  }
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Adds a node to the path.
 * <p>
 * This is a convenience method for adding a node with three control points
 * C0, C1 and C2, and a mask.
 *
 * @param ctrlMask An or-combination of C0_MASK,C1_MASK and C2_MASK.
 * @param c0 The coordinates of the C0 control point.
 * @param c1 The coordinates of the C1 control point.
 * @param c2 The coordinates of the C2 control point.
 */
public void add(int ctrlMask, Point2D.Double c0, Point2D.Double c1, Point2D.Double c2) {
  add(new Node(ctrlMask, c0, c1, c2));
}
org.jhotdraw.geom

Most used classes

  • BezierPath
    BezierPath allows the construction of paths consisting of straight lines, quadratic curves and cubic
  • Geom
    Some geometric utilities.
  • BezierPath$Node
    Defines a vertex (node) of the bezier path. A vertex consists of three control points: C0, C1 and C2
  • Bezier
    Provides algorithms for fitting Bezier curves to a set of digitized points. Source: Phoenix: An Int
  • BezierPathIterator
    This class represents the iterator for a BezierPath. It can be used to retrieve all of the elements
  • Dimension2DDouble,
  • DoubleStroke,
  • GrowStroke,
  • Insets2D$Double,
  • Insets2D,
  • Polygon2D$Double,
  • Polygon2D$Float,
  • Polygon2D$PolygonPathIteratorDouble,
  • Polygon2D$PolygonPathIteratorFloat,
  • Polygon2D,
  • QuadTree$QuadNode,
  • QuadTree,
  • Shapes
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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