Tabnine Logo
BezierFigure.findSegment
Code IndexAdd Tabnine to your IDE (free)

How to use
findSegment
method
in
org.jhotdraw.draw.BezierFigure

Best Java code snippets using org.jhotdraw.draw.BezierFigure.findSegment (Showing top 2 results out of 315)

origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Joins two segments into one if the given Point2D.Double hits a node
 * of the polyline.
 * @return true if the two segments were joined.
 *
 * @param join a Point at a node on the bezier path
 * @param tolerance a tolerance, tolerance should take into account
 * the line width, plus 2 divided by the zoom factor. 
 */
public boolean joinSegments(Point2D.Double join, double tolerance) {
  int i = findSegment(join, tolerance);
  if (i != -1 && i > 1) {
    removeNode(i);
    return true;
  }
  return false;
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

/**
 * Splits the segment at the given Point2D.Double if a segment was hit.
 * @return the index of the segment or -1 if no segment was hit.
 *
 * @param split a Point on (or near) a line segment on the bezier path
 * @param tolerance a tolerance, tolerance should take into account
 * the line width, plus 2 divided by the zoom factor. 
 */
public int splitSegment(Point2D.Double split, double tolerance) {
  int i = findSegment(split, tolerance);
  if (i != -1) {
    addNode(i + 1, new BezierPath.Node(split));
  }
  return i + 1;
}
org.jhotdraw.drawBezierFigurefindSegment

Javadoc

Gets the segment of the polyline that is hit by the given Point2D.Double.

Popular methods of BezierFigure

  • <init>
    Creates an empty BezierFigure, for example without anyBezierPath.Nodes. The BezierFigure will not dr
  • clone
  • getBezierPath
    Returns a clone of the bezier path of this figure.
  • set
  • setBezierPath
  • addFigureListener
  • addNode
    Adds a control point.
  • createHandles
  • getBounds
  • getNode
    Gets a control point.
  • getNodeCount
    Gets the node count.
  • removeNode
    Removes the Node at the specified index.
  • getNodeCount,
  • removeNode,
  • restoreAttributesTo,
  • setAttributeEnabled,
  • setAttributes,
  • changed,
  • chop,
  • drawCaps,
  • fireUndoableEditHappened

Popular in Java

  • Running tasks concurrently on multiple threads
  • addToBackStack (FragmentTransaction)
  • putExtra (Intent)
  • scheduleAtFixedRate (Timer)
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Best IntelliJ plugins
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