01: package org.osbl.client.wings;
02:
03: import org.wings.*;
04: import org.wings.event.SViewportChangeListener;
05: import org.wings.io.Device;
06: import org.apache.commons.logging.Log;
07: import org.apache.commons.logging.LogFactory;
08:
09: import java.io.IOException;
10: import java.awt.*;
11:
12: /**
13: * An SPanel, that implements the Scrollable interface. It can be used in conjunction with SScrollPane
14: * with a non paging layout as returned by the method asScrollPane.
15: */
16: public class XScrollablePanel extends SPanel implements Scrollable {
17: private SScrollPane scrollPane;
18:
19: public XScrollablePanel() {
20: super .setLayout(new SBorderLayout());
21: }
22:
23: public XScrollablePanel(SComponent comp) {
24: this ();
25: add(comp, SBorderLayout.CENTER);
26: }
27:
28: public XScrollablePanel(SComponent comp, SDimension preferredSize) {
29: this ();
30: setPreferredSize(preferredSize);
31: add(comp, SBorderLayout.CENTER);
32: }
33:
34: public Rectangle getScrollableViewportSize() {
35: return null;
36: }
37:
38: public void setViewportSize(Rectangle d) {
39: }
40:
41: public void addViewportChangeListener(SViewportChangeListener l) {
42: }
43:
44: public void removeViewportChangeListener(SViewportChangeListener l) {
45: }
46:
47: public Rectangle getViewportSize() {
48: return null;
49: }
50:
51: public Dimension getPreferredExtent() {
52: return null;
53: }
54:
55: public SScrollPane asScrollPane() {
56: if (scrollPane == null) {
57: scrollPane = new SScrollPane(this);
58: scrollPane.setPreferredSize(SDimension.FULLAREA);
59: scrollPane.setMode(SScrollPane.MODE_COMPLETE);
60: }
61: return scrollPane;
62: }
63: }
|