List of usage examples for com.google.gwt.query.client GQuery empty
public GQuery empty()
From source file:be.dramaix.ai.slidingpuzzle.client.Puzzle.java
License:Apache License
public void loadState(State s) { GQuery puzzle = SELECTOR.getPuzzleBoard(); puzzle.empty(); byte[] board = s.getAllCells(); for (int i = 0; i < board.length; i++) { byte value = board[i]; GQuery cell = $("<div class='tile'></div>"); if (value == 0) { cell.addClass("empty"); } else {//from w w w.ja v a 2s .c om cell.html("" + value); } puzzle.append(cell); } // int puzzleDimension = TILE_DIMENSION * dimension; puzzle.height(puzzleDimension).width(puzzleDimension); }