private void arrangeForFall(Container c) { int w = Display.getInstance().getDisplayWidth(); for (int iter = 0; iter < c.getComponentCount(); iter++) { Component cmp = c.getComponentAt(iter); cmp.setY(-c.getHeight()); } }
private void arrangeForConcentrate(Container c) { int w = Display.getInstance().getDisplayWidth(); int h = Display.getInstance().getDisplayHeight(); int[] positionX = {-100, w / 2, w + 100, w + 100, w + 100, w / 2, -100, -100}; int[] positionY = {-100, -100, -100, h / 2, h + 100, h + 100, h + 100, h / 2}; for (int iter = 0; iter < c.getComponentCount(); iter++) { Component cmp = c.getComponentAt(iter); cmp.setY(positionY[iter % positionY.length]); cmp.setX(positionX[iter % positionX.length]); } }
private void arrangeForInterlace(Container c) { int w = Display.getInstance().getDisplayWidth(); for (int iter = 0; iter < c.getComponentCount(); iter++) { Component cmp = c.getComponentAt(iter); if (iter % 2 == 0) { cmp.setX(-w); } else { cmp.setX(w); } } }