Package org.fonteditor.elements.points

Examples of org.fonteditor.elements.points.FEPoint


  }

  private int findNearestPoint(int idx_p1, int idx_p2) { //, GlyphDisplayOptions gdo) {
    int dir = rnd.nextBoolean() ? -1 : 1;
    boolean flipped = false;
    FEPoint p1 = fepointlist.getPoint(idx_p1);
    FEPoint p2 = fepointlist.getPoint(idx_p2);
    int max = p1.squaredDistanceFrom(p2);
    FEPath path = fepathlist.getPath(p2);
    FEPointList fepl = path.getFEPointList();

    idx_p2 = fepl.getIndexOf(p2);
View Full Code Here


  }

  public CallBack getCallBackFix() {
    return new CallBack() {
      public void callback(Object o) {
        FEPoint point = (FEPoint) o;
        InstructionStream is = glyph.getInstructionStream();
        is.setPoint(point, point.getX() + dx, point.getY() + dy);
      }
    };
  }
View Full Code Here

  }

  public CallBack getCallBackFix() {
    return new CallBack() {
      public void callback(Object o) {
        FEPoint point = (FEPoint) o;
        InstructionStream is = glyph.getInstructionStream();
        is.setPoint(point, point.getX(), point.getY());
      }
    };
  }
View Full Code Here

    renderUneven(g, from, to, width, c);
  }

  public static void drawPolygon(Graphics g, Polygon p, Pen pen, Coords c)
  {
    FEPoint from = new FEPoint();
    FEPoint to = new FEPoint();

    for (int i = 1; i < p.npoints; i++)
    {
      from.setX(p.xpoints[i - 1]);
      from.setY(p.ypoints[i - 1]);
      to.setX(p.xpoints[i]);
      to.setY(p.ypoints[i]);
      pen.drawStroke(g, from, to, c);
    }

    from.setX(p.xpoints[0]);
    from.setY(p.ypoints[0]);
    to.setX(p.xpoints[p.npoints - 1]);
    to.setY(p.ypoints[p.npoints - 1]);
    pen.drawStroke(g, from, to, c);
  }
View Full Code Here

  }

  public static void drawRectangle(Graphics g, FEPoint p1, FEPoint p2,
      int width, Coords c)
  {
    FEPoint from = new FEPoint(0, 0);
    FEPoint to = new FEPoint(0, 0);

    from.setX(p1.getX());
    from.setY(p1.getY());
    to.setX(p1.getX());
    to.setY(p2.getY());
    renderRound(g, from, to, width, c);

    from.setX(p1.getX());
    from.setY(p2.getY());
    to.setX(p2.getX());
    to.setY(p2.getY());
    renderRound(g, from, to, width, c);

    from.setX(p2.getX());
    from.setY(p2.getY());
    to.setX(p2.getX());
    to.setY(p1.getY());
    renderRound(g, from, to, width, c);

    from.setX(p2.getX());
    from.setY(p1.getY());
    to.setX(p1.getX());
    to.setY(p1.getY());
    renderRound(g, from, to, width, c);
  }
View Full Code Here

  }

  public void translateAll(final int dx, final int dy) {
    fepointlist.executeOnEachPoint(new CallBack() {
      public void callback(Object o) {
        FEPoint p = (FEPoint) o;

        translatePoint(p.getInstructionPointer(), dx, dy);
      }
    });
  }
View Full Code Here

    g.setColor(Color.black);

    if (gdo.isBorder())
    {
      WideLine.drawRectangle(g, new FEPoint(BORDER_X_MIN, BORDER_Y_MIN),
          new FEPoint(BORDER_X_MAX, BORDER_Y_MAX), 0xE0,
          gdo.getCoords());
    }

    //resetRemakeFlag(); // performance hit...
    //    if (instruction_stream.isInNeedOfRemaking()) {
View Full Code Here

  }

  public void scaleAll(final float fx, final float fy) {
    fepointlist.executeOnEachPoint(new CallBack() {
      public void callback(Object o) {
        FEPoint p = (FEPoint) o;

        scalePoint(p.getInstructionPointer(), fx, fy);
      }
    });
  }
View Full Code Here

        / gdo.getCoords().getAAHeight();

    g.setColor(Color.lightGray);
    for (int x = GRID_BORDER_X_MIN; x <= GRID_BORDER_X_MAX; x += pix_siz_x)
    {
      WideLine.renderRound(g, new FEPoint(x, GRID_BORDER_Y_MIN),
          new FEPoint(x, GRID_BORDER_Y_MAX), grid_line_height,
          gdo.getCoords());
    }
    for (int y = GRID_BORDER_Y_MIN; y <= GRID_BORDER_Y_MAX; y += pix_siz_y)
    {
      WideLine.renderRound(g, new FEPoint(GRID_BORDER_X_MIN, y),
          new FEPoint(GRID_BORDER_X_MAX, y), grid_line_width,
          gdo.getCoords());
    }
  }
View Full Code Here

TOP

Related Classes of org.fonteditor.elements.points.FEPoint

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.