コード例 #1
0
  // -------------//
  // computeLine //
  // -------------//
  public void computeLine() {
    line = new BasicLine();

    for (GlyphSection section : glyph.getMembers()) {
      StickSection ss = (StickSection) section;
      line.includeLine(ss.getLine());
    }

    if (logger.isFineEnabled()) {
      logger.fine(
          line
              + " pointNb="
              + line.getNumberOfPoints()
              + " meanDistance="
              + (float) line.getMeanDistance());
    }
  }
コード例 #2
0
  // ------------//
  // renderLine //
  // ------------//
  public void renderLine(Graphics g) {
    if (glyph.getContourBox().intersects(g.getClipBounds())) {
      getLine(); // To make sure the line has been computed

      Point start =
          glyph
              .getLag()
              .switchRef(
                  new Point(getStart(), (int) Math.rint(line.yAt((double) getStart()))), null);
      Point stop =
          glyph
              .getLag()
              .switchRef(
                  new Point(getStop() + 1, (int) Math.rint(line.yAt((double) getStop() + 1))),
                  null);
      g.drawLine(start.x, start.y, stop.x, stop.y);
    }
  }
コード例 #3
0
  // --------------//
  // getStopPoint //
  // --------------//
  public PixelPoint getStopPoint() {
    Point stop = glyph.getLag().switchRef(new Point(getStop(), line.yAt(getStop())), null);

    return new PixelPoint(stop.x, stop.y);
  }
コード例 #4
0
  // ---------------//
  // getStartPoint //
  // ---------------//
  public PixelPoint getStartPoint() {
    Point start = glyph.getLag().switchRef(new Point(getStart(), line.yAt(getStart())), null);

    return new PixelPoint(start.x, start.y);
  }