private void paintAlphabet(IAlphabet iAlphabet) { Text text = new Text(iAlphabet.getAlphabet()); actors.put(iAlphabet.getAlphabet(), text); Board board = (Board) getWorld(); if (board == null) { System.out.println("NULL"); } board.addObject(text, iAlphabet.getX(), iAlphabet.getY()); }
public void repaint() { // Iterator itr = alphabets.entrySet().iterator(); Board board = (Board) getWorld(); List<Text> remainingActors = board.getObjects(Text.class); board.removeObjects(remainingActors); // itr = null; // itr = alphabets.entrySet().iterator(); actors.clear(); for (IAlphabet iAlphabet : alphabets) { paintAlphabet(iAlphabet); } }
public void removeAlphabet(String alphabet) { Text text = actors.get(alphabet); Board board = (Board) getWorld(); board.removeObject(text); }