1 /* 2 * $Id: Scrollable.java,v 1.3 2004/12/01 07:54:07 hengels Exp $ 3 * Copyright 2000,2005 wingS development team. 4 * 5 * This file is part of wingS (http://www.j-wings.org). 6 * 7 * wingS is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU Lesser General Public License 9 * as published by the Free Software Foundation; either version 2.1 10 * of the License, or (at your option) any later version. 11 * 12 * Please see COPYING for the complete licence. 13 */ 14 package org.wings; 15 16 import java.awt.*; 17 18 /** 19 * @author <a HREF="mailto:haaf@mercatis.de">Armin Haaf</a> 20 * @version $Revision: 1.3 $ 21 */ 22 public interface Scrollable { 23 24 /** 25 * is the size of the component in respect to scrollable units. e.g. a 26 * {@link STable} 27 * has the scrollable viewport size: 28 * <pre> 29 * new Dimension(table.getColumnCount(), table.getRowCount()) 30 * </pre> 31 * a {@link SList}: 32 * <pre> 33 * new Dimension(1, list.getModel().getSize()) 34 * </pre> 35 */ 36 Rectangle getScrollableViewportSize(); 37 38 /** 39 * set the visible part of a scrollable. 40 */ 41 void setViewportSize(Rectangle d); 42 43 /** 44 * get the actual visible part of a scrollable. This may be valid only at 45 * rendering time. In fact, inside a {@link SScrollPane} 46 * synchronization with the adjustables is done 47 * short before component it rendered... 48 * You should never rely this values. This method is mainly needed to backup 49 * viewports... 50 */ 51 Rectangle getViewportSize(); 52 53 /** 54 * if scrolling is activated, the component can suggest it's extent. 55 * 56 * @return null if no preference 57 */ 58 Dimension getPreferredExtent(); 59 60 } 61 62 63