public void dibuja() { this.actualizaObjetos(); if (this.isMuestra()) { for (Item ele : this.getObjetos()) { if (ele.isMoviendo() && !this.desplazar.isMoviendo()) { ele.setFillBox(200); } else { ele.setFillBox(255); } if (this.getLimiteInfer() < ele.getLimiteSup() && ele.getLimiteSup() < this.getLimiteSuper()) { ele.dibuja(); } else { if (this.getLimiteInfer() < ele.getLimiteInf() && ele.getLimiteInf() < this.getLimiteSuper()) { ele.dibuja(); } } } } if (this.isEncima()) { desplazar.dibuja(); } }
public Lista(PApplet parent, float posX, float posY) { super(parent); super.setObjeto(this); this.setNombre("Lista"); this.setObjetos(new ArrayList<Item>()); this.setMuestra(false); this.setPosX(posX); this.setPosY(posY); this.setParent(parent); this.setWidth(200); this.generaObjetos(parent, 100); desplazar = new Desplazar(parent); desplazar.setPosX(this.getPosX() + this.getWidth() / 2 - 10); desplazar.setPosY(this.getPosY()); desplazar.setWidth(30); desplazar.setHeight(300); desplazar.setRadio(5); desplazar.setMax(700); desplazar.setValor(350); }