00001 package edu.stanford.hci.r3.render.ink;
00002
00003 import java.awt.Graphics2D;
00004 import java.awt.geom.Path2D;
00005 import java.util.List;
00006
00007 import edu.stanford.hci.r3.pen.ink.InkStroke;
00008
00020 class RenderingTechniqueLinear implements RenderingTechnique {
00021
00022
00023
00024
00025
00026
00027 public void render(Graphics2D g2d, List<InkStroke> strokes) {
00028 g2d.setStroke(DEFAULT_INK_STROKE);
00029 for (InkStroke stroke : strokes) {
00030 final Path2D.Double path = new Path2D.Double();
00031 final double[] x = stroke.getXSamples();
00032 final double[] y = stroke.getYSamples();
00033 path.moveTo(x[0], y[0]);
00034 for (int i = 1; i < stroke.getNumSamples(); i++) {
00035 path.lineTo(x[i], y[i]);
00036 }
00037 g2d.draw(path);
00038 }
00039 }
00040 }