// -------------// // 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()); } }
// ------------// // 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); } }
// --------------// // getStopPoint // // --------------// public PixelPoint getStopPoint() { Point stop = glyph.getLag().switchRef(new Point(getStop(), line.yAt(getStop())), null); return new PixelPoint(stop.x, stop.y); }
// ---------------// // getStartPoint // // ---------------// public PixelPoint getStartPoint() { Point start = glyph.getLag().switchRef(new Point(getStart(), line.yAt(getStart())), null); return new PixelPoint(start.x, start.y); }