package org.CG.drawings;

import javax.media.opengl.GL;

/**
 *
 * @author ldavid
 */
public class FilledPolygon extends Polygon {

    @Override
    protected void drawShape(GL gl) {
        edges.stream().forEach((edge) -> {
            edge.draw(gl);
        });
    }
}

@@ -34,241 +34,1546 @@
 java
-x.media.opengl.GL;%0A%0A/**%0A *%0A * @author ldavid%0A */%0Apublic class FilledPolygon extends Polygon %7B%0A%0A    @Override%0A    protected void drawShape(GL gl) %7B%0A        edges.stream().forEach((edge
+.util.LinkedList;%0Aimport java.util.List;%0Aimport javafx.util.Pair;%0Aimport javax.media.opengl.GL;%0Aimport org.CG.infrastructure.Point;%0Aimport org.CG.infrastructure.ScanLineAlgorithm;%0A%0A/**%0A *%0A * @author ldavid%0A */%0Apublic class FilledPolygon extends Polygon %7B%0A%0A    @Override%0A    protected void drawShape(GL gl) %7B%0A        int yMin = 0, yMax = 0;%0A%0A        List%3CPair%3CPoint, Point%3E%3E edgePoints = new LinkedList%3C%3E();%0A        if (finished) %7B%0A            yMin = Math.min(lines.getFirst().getStart().getY(), lines.getFirst().getEnd().getY());%0A            yMax = Math.min(lines.getFirst().getStart().getY(), lines.getFirst().getEnd().getY());%0A        %7D%0A%0A        for (Line line : lines) %7B%0A            edgePoints.add(new Pair%3C%3E(line.getStart(), line.getEnd()));%0A%0A            if (finished) %7B%0A                if (line.getStart().getY() %3C yMin) %7B%0A                    yMin = line.getStart().getY();%0A                %7D else if (line.getStart().getY() %3C yMin) %7B%0A                    yMin = line.getStart().getY();%0A                %7D%0A%0A                if (line.getEnd().getY(
 ) 
--
 %3E 
-%7B%0A            edge.draw(gl);%0A        %7D);%0A    %7D
+yMax) %7B%0A                    yMax = line.getEnd().getY();%0A                %7D else if (line.getEnd().getY() %3E yMax) %7B%0A                    yMax = line.getEnd().getY();%0A                %7D%0A            %7D%0A%0A            line.draw(gl);%0A        %7D;%0A%0A        if (finished) %7B%0A            gl.glColor3ub(color.getRed(), color.getGreen(), color.getBlue());%0A            gl.glBegin(glDrawingType);%0A%0A            new ScanLineAlgorithm(edgePoints, yMin, yMax).draw(gl);%0A%0A            gl.glEnd();%0A        %7D%0A    %7D%0A
 %0A%7D%0A

Update FilledPolygon to use the SL algorithm