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

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

Best Java code snippets using org.jhotdraw.draw.BezierFigure.removeNode (Showing top 8 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

  @Override
  public void undo() throws CannotUndoException {
    super.undo();
    willChange();
    removeNode(index);
    changed();
  }
});
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
public void redo() throws CannotRedoException {
  super.redo();
  view.removeFromSelection(f);
  f.willChange();
  f.removeNode(index);
  f.changed();
  view.addToSelection(f);
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
public void redo() throws CannotRedoException {
  super.redo();
  view.removeFromSelection(f);
  f.willChange();
  f.removeNode(index);
  f.changed();
  view.addToSelection(f);
}
origin: net.imagej/imagej-ui-swing

@Override
public void updateFigure(final OverlayView view, final BezierFigure figure) {
  super.updateFigure(view, figure);
  assert view.getData() instanceof GeneralPathOverlay;
  final GeneralPathOverlay gpo = (GeneralPathOverlay) view.getData();
  final GeneralPathRegionOfInterest gpr = gpo.getRegionOfInterest();
  final PathIterator pi = gpr.getGeneralPath().getPathIterator(null);
  final int nCount = figure.getNodeCount();
  int i = 0;
  final double[] pos = new double[6];
  while (!pi.isDone()) {
    pi.currentSegment(pos);
    final Node n = new Node(pos[0], pos[1]);
    if (i < nCount) figure.getNode(i).setTo(n);
    else figure.addNode(n);
    pi.next();
    i++;
  }
  while (i < figure.getNodeCount())
    figure.removeNode(i);
}
origin: net.imagej/imagej-ui-swing

@Override
public void updateFigure(final OverlayView view, final BezierFigure figure) {
  super.updateFigure(view, figure);
  final PolygonOverlay polygonOverlay = downcastOverlay(view.getData());
  final PolygonRegionOfInterest roi = polygonOverlay.getRegionOfInterest();
  final int vertexCount = roi.getVertexCount();
  while (figure.getNodeCount() > vertexCount) {
    figure.removeNode(vertexCount);
  }
  for (int i = 0; i < vertexCount; i++) {
    final RealLocalizable vertex = roi.getVertex(i);
    final double x = vertex.getDoublePosition(0);
    final double y = vertex.getDoublePosition(1);
    if (figure.getNodeCount() == i) {
      figure.addNode(new Node(x, y));
    }
    else {
      final Node node = figure.getNode(i);
      node.mask = 0;
      Arrays.fill(node.x, x);
      Arrays.fill(node.y, y);
    }
  }
}
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

Rectangle invalidatedArea = getDrawingArea();
f.willChange();
final BezierPath.Node removedNode = f.removeNode(index);
f.changed();
fireHandleRequestRemove(invalidatedArea);
origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

Rectangle invalidatedArea = getDrawingArea();
f.willChange();
final BezierPath.Node removedNode = f.removeNode(index);
f.changed();
fireHandleRequestRemove(invalidatedArea);
org.jhotdraw.drawBezierFigureremoveNode

Javadoc

Removes the Node at the specified index.

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.
  • restoreAttributesTo
  • getNodeCount,
  • restoreAttributesTo,
  • setAttributeEnabled,
  • setAttributes,
  • changed,
  • chop,
  • drawCaps,
  • findSegment,
  • fireUndoableEditHappened

Popular in Java

  • Making http post requests using okhttp
  • runOnUiThread (Activity)
  • getApplicationContext (Context)
  • onCreateOptionsMenu (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Path (java.nio.file)
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Best plugins for Eclipse
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