01: /*
02: * Copyright 2000,2005 wingS development team.
03: *
04: * This file is part of wingS (http://wingsframework.org).
05: *
06: * wingS is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU Lesser General Public License
08: * as published by the Free Software Foundation; either version 2.1
09: * of the License, or (at your option) any later version.
10: *
11: * Please see COPYING for the complete licence.
12: */
13: package org.wings;
14:
15: import java.awt.Rectangle;
16:
17: import org.wings.event.SViewportChangeListener;
18:
19: /**
20: * For scrollable components, i.e. components that can show only a part of it's content.
21: *
22: * @author <a href="mailto:haaf@mercatis.de">Armin Haaf</a>
23: */
24: public interface Scrollable {
25:
26: /**
27: * The size of the component in respect to scrollable units.
28: * E.g. a {@link STable} has the scrollable viewport size:
29: * <pre>
30: * new Dimension(table.getColumnCount(), table.getRowCount())
31: * </pre>
32: * a {@link SList}:
33: * <pre>
34: * new Dimension(1, list.getModel().getSize())
35: * </pre>
36: */
37: Rectangle getScrollableViewportSize();
38:
39: /**
40: * Returns the actual visible part of a scrollable.
41: */
42: Rectangle getViewportSize();
43:
44: /**
45: * Sets the actual visible part of a scrollable.
46: */
47: void setViewportSize(Rectangle d);
48:
49: /**
50: * Adds the given <code>SViewportChangeListener</code> to the scrollable.
51: *
52: * @param l the listener to be added
53: */
54: void addViewportChangeListener(SViewportChangeListener l);
55:
56: /**
57: * Removes the given <code>SViewportChangeListener</code> from the scrollable.
58: *
59: * @param l the listener to be removed
60: */
61: void removeViewportChangeListener(SViewportChangeListener l);
62: }
|