private static void Preencher(BitmapData imgDta, Pontos[] pontos) { CabET cab = new CabET(); criaET(cab, pontos); AET aet = new AET(); ET aux = cab.getInicio(); int y = aux.getNum(); aet.copia_para_AET(aux.getInicio()); aux = aux.getNext(); while (aet.getInicio() != null) { aet.removerYMax(y); if (aet.getInicio() != null) { aet.ordenarXMin(); aet.desenhar(imgDta, y); aet.atualizarXMin(); y++; if (aux != null && y == aux.getNum()) { aet.copia_para_AET(aux.getInicio()); aux = aux.getNext(); } } } }
public void insere(int y, int x, double inc, int ymin) { ET et = new ET(ymin, null); Caixa c = new Caixa(y, x, inc); et.setInicio(c); if (inicio == null) { inicio = et; } else { ET aux = inicio, ant = null; while (aux != null && ymin > aux.getNum()) { ant = aux; aux = aux.getNext(); } if (aux != null) { if (aux.getNum() == ymin) { c.setProx(aux.getInicio()); aux.getInicio().setAnt(c); aux.setInicio(c); } else { et.setNext(aux); if (ant != null) { ant.setNext(et); } else { inicio = et; } } } else { et.setNext(aux); ant.setNext(et); } } }