Esempio n. 1
0
  /** repaint */
  private void paintWorld(Graphics g) {

    g.clearRect(0, 0, getWidth(), getHeight());
    g.setColor(backGround);
    g.fillRect(0, 0, getWidth(), getHeight());
    // sort before repaint
    Collections.sort(renders, comparatorDeep);
    for (IRenderToConvas render : renders) {
      render.render(g);
    }
  }
Esempio n. 2
0
        @Override
        public int compare(IRenderToConvas o1, IRenderToConvas o2) {

          return (o1.getDeep() < o2.getDeep()) ? -1 : 1;
        }