Code example for Deque

Methods: addFirst

0
		invalidate();
	} 
 
	public void undo() { 
		if (!lineList.isEmpty()) {
			undoStack.addFirst(lineList.get(lineList.size() - 1));
			lineList.remove(lineList.size() - 1);
			redoable = true;
			invalidate();
		} 
	} 
 
	public void redo() { 
		if (redoable && !undoStack.isEmpty()) {
			lineList.add(undoStack.removeFirst());
			invalidate();
		} 
	} 
 
	public void resetTranslate() { 
		dx = 0;