Author: tchemit Date: 2008-01-22 02:45:59 +0000 (Tue, 22 Jan 2008) New Revision: 374 Removed: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/bean/PaginationBean.java Log: suppression des beans (on utilise uniquement les model d'ui) Deleted: trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/bean/PaginationBean.java =================================================================== --- trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/bean/PaginationBean.java 2008-01-22 02:45:23 UTC (rev 373) +++ trunk/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/bean/PaginationBean.java 2008-01-22 02:45:59 UTC (rev 374) @@ -1,96 +0,0 @@ -/* -* \#\#% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, -* Tony Chemit -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -* \#\#% */ -package fr.cemagref.simexplorer.is.ui.swing.bean; - -/** - * Le modèle de pagination d'une liste - * - * @author tony - */ -public class PaginationBean { - - /** the index */ - long firstIndex; - - /** size of the total flow */ - long size; - - /** size of a page */ - int width; - - public long getFirstIndex() { - return firstIndex; - } - - public long getSize() { - return size; - } - - public int getWidth() { - return width; - } - - public boolean hasNext() { - return size - firstIndex > width; - } - - public boolean hasPrevious() { - return firstIndex >= width; - } - - public int getCurrentPage() { - int page = (int) (firstIndex / width); - if (page > 0 && firstIndex % width > 0) { - page++; - } - return page; - } - - public int getNbPages() { - return (int) (size / width); - } - - public void increment() { - if (firstIndex + width > size) { - firstIndex = size - width; - return; - } - firstIndex += width; - } - - public void decrement() { - if (firstIndex < width) { - firstIndex = 0; - } else { - firstIndex -= width; - } - } - - public void setFirstIndex(long firstIndex) { - this.firstIndex = firstIndex; - } - - public void setSize(long size) { - this.size = size; - } - - public void setWidth(int width) { - this.width = width; - } -}