All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.bwt.JCScrolledWindow

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----jclass.bwt.JCContainer
                                   |
                                   +----jclass.bwt.JCScrolledWindow

public class JCScrolledWindow
extends JCContainer
implements KeyListener, JCAdjustmentListener
The JCScrolledWindow class combines one or two Scrollbars and a viewing area to implement a visible window (a "viewport") onto some other (usually larger) data display. The visible part of the window can be scrolled through the larger display by the use of the scrollbars.

Properties

Name Method
Background setBackground
ColumnAlignments setColumnAlignments
ColumnLeftMargin setColumnLeftMargin
ColumnRightMargin setColumnRightMargin
ColumnWidths setColumnWidths
Font setFont
Foreground setForeground
Insets setInsets
NumColumns setNumColumns
PreferredSize setPreferredSize
ScrollbarDisplay setScrollbarDisplay
ScrollbarOffset setScrollbarOffset
UserData setUserData


Variable Index

 o DISPLAY_ALWAYS
 o DISPLAY_AS_NEEDED
 o DISPLAY_HORIZONTAL_ONLY
 o DISPLAY_NONE
 o DISPLAY_VERTICAL_ONLY
 o viewport
The component used as the viewing area into the scrolled component.

Constructor Index

 o JCScrolledWindow()
Creates an empty window.
 o JCScrolledWindow(Applet, String)
Creates a window which reads parameters from the applet's HTML file.

Method Index

 o add(Component)
Adds the specified component to the viewport.
 o addInternal(Component)
 o addNotify()
Creates the Panel's peer.
 o adjustmentValueChanged(JCAdjustmentEvent)
Processes scrollbar events.
 o getHorizScrollbar()
 o getParameters()
Reads the parameter values from the HTML page using the component's applet.
 o getScrollbarDisplay()
Gets the ScrollbarDisplay value.
 o getScrollbarOffset()
Gets the ScrollbarOffset value.
 o getVertScrollbar()
 o getViewport()
Gets the viewport.
 o getViewportHeight()
Gets the viewport's "virtual height".
 o getViewportWidth()
Gets the viewport's "virtual width".
 o headerHeight()
 o keyPressed(KeyEvent)
 o keyReleased(KeyEvent)
 o keyTyped(KeyEvent)
 o layout()
Positions the scrollbars and viewport.
 o preferredHeight()
Gets the subclass' preferred height (default: 100).
 o preferredWidth()
Gets the subclass' preferred width (default: 100).
 o reshapeHeader(int, int, int)
 o reshapeViewport(int, int, int, int)
Reshapes the viewport to the specified size.
 o scrollHorizontal(int)
Scrolls the window horizontally to the specified value.
 o scrollHorizontal(JCAdjustmentEvent, int)
Scrolls the window horizontally to the specified value.
 o scrollHorizontal(JCScrollableInterface, JCAdjustmentEvent, int)
Scrolls a scrollableInterface component horizontally.
 o scrollVertical(int)
Scrolls the window vertically to the specified value.
 o scrollVertical(JCAdjustmentEvent, int)
Scrolls the window vertically to the specified value.
 o scrollVertical(JCScrollableInterface, JCAdjustmentEvent, int)
Scrolls a scrollableInterface component vertically.
 o setHorizScrollbarValues()
This method may be overriden by a subclass to change the default values of the horizontal scrollbar.
 o setHorizScrollbarValues(int, int, int, int)
This method may be overriden by a subclass to set the horizontal scrollbar's values.
 o setLayout(LayoutManager)
Sets the layout manager for this container.
 o setScrollbarDisplay(int)
Sets when to display the scrollbars:
DISPLAY_ALWAYS           always displayed
DISPLAY_AS_NEEDED        displayed as necessary (default)
DISPLAY_VERTICAL_ONLY    always display vertical scrollbar only
DISPLAY_HORIZONTAL_ONLY  always display horizontal scrollbar only
DISPLAY_NONE             don't display scrollbars

HTML param name/value: "ScrollbarDisplay"/enum

 o setScrollbarOffset(int)
Sets the distance between the scrollbars and the viewport (default: 0).

HTML param name/value: "ScrollbarOffset"/int

 o setVertScrollbarValues()
This method may be overriden by a subclass to change the default values of the vertical scrollbar.
 o setVertScrollbarValues(int, int, int, int)
This method may be overriden by a subclass to set the vertical scrollbar's values.

Variables

 o DISPLAY_AS_NEEDED
 public static final int DISPLAY_AS_NEEDED
 o DISPLAY_ALWAYS
 public static final int DISPLAY_ALWAYS
 o DISPLAY_NONE
 public static final int DISPLAY_NONE
 o DISPLAY_VERTICAL_ONLY
 public static final int DISPLAY_VERTICAL_ONLY
 o DISPLAY_HORIZONTAL_ONLY
 public static final int DISPLAY_HORIZONTAL_ONLY
 o viewport
 protected Component viewport
The component used as the viewing area into the scrolled component.

Constructors

 o JCScrolledWindow
 public JCScrolledWindow()
Creates an empty window. No parameters are read from an HTML file.

 o JCScrolledWindow
 public JCScrolledWindow(Applet applet,
                         String name)
Creates a window which reads parameters from the applet's HTML file.

Parameters:
applet - the applet whose PARAM tags are to be read
name - if this is not null, only parameters preceded by this name are read
See Also:
getParameter

Methods

 o getParameters
 protected void getParameters()
Reads the parameter values from the HTML page using the component's applet. The values will override those previously set.

Overrides:
getParameters in class JCContainer
 o getScrollbarDisplay
 public int getScrollbarDisplay()
Gets the ScrollbarDisplay value.

See Also:
setScrollbarDisplay
 o setScrollbarDisplay
 public void setScrollbarDisplay(int v)
Sets when to display the scrollbars:
DISPLAY_ALWAYS           always displayed
DISPLAY_AS_NEEDED        displayed as necessary (default)
DISPLAY_VERTICAL_ONLY    always display vertical scrollbar only
DISPLAY_HORIZONTAL_ONLY  always display horizontal scrollbar only
DISPLAY_NONE             don't display scrollbars

HTML param name/value: "ScrollbarDisplay"/enum

Throws: IllegalArgumentException
If an invalid value was set
 o getScrollbarOffset
 public int getScrollbarOffset()
Gets the ScrollbarOffset value.

See Also:
setScrollbarOffset
 o setScrollbarOffset
 public void setScrollbarOffset(int v)
Sets the distance between the scrollbars and the viewport (default: 0).

HTML param name/value: "ScrollbarOffset"/int

 o getViewport
 public Component getViewport()
Gets the viewport.

 o preferredWidth
 protected int preferredWidth()
Gets the subclass' preferred width (default: 100).

Overrides:
preferredWidth in class JCContainer
 o preferredHeight
 protected int preferredHeight()
Gets the subclass' preferred height (default: 100).

Overrides:
preferredHeight in class JCContainer
 o getViewportWidth
 protected int getViewportWidth()
Gets the viewport's "virtual width". The default method returns the viewport's preferred width.

 o getViewportHeight
 protected int getViewportHeight()
Gets the viewport's "virtual height". The default method returns the viewport's preferred height.

 o add
 public Component add(Component comp)
Adds the specified component to the viewport.

Overrides:
add in class JCContainer
 o addInternal
 protected void addInternal(Component comp)
 o addNotify
 public void addNotify()
Creates the Panel's peer.

Overrides:
addNotify in class JCContainer
 o getVertScrollbar
 public JCScrollbar getVertScrollbar()
 o getHorizScrollbar
 public JCScrollbar getHorizScrollbar()
 o setHorizScrollbarValues
 protected void setHorizScrollbarValues()
This method may be overriden by a subclass to change the default values of the horizontal scrollbar.

 o setHorizScrollbarValues
 protected void setHorizScrollbarValues(int value,
                                        int visible,
                                        int min,
                                        int max)
This method may be overriden by a subclass to set the horizontal scrollbar's values.

Parameters:
value - the scrollbar's value
visible - the amount visible per page (the slider size). The page increment this is also set to this value.
min - the minimum value of the scrollbar
max - the maximum value of the scrollbar
See Also:
setValues
 o setVertScrollbarValues
 protected void setVertScrollbarValues(int value,
                                       int visible,
                                       int min,
                                       int max)
This method may be overriden by a subclass to set the vertical scrollbar's values.

Parameters:
value - the scrollbar's value
visible - the amount visible per page (the slider size). The page increment this is also set to this value.
min - the minimum value of the scrollbar
max - the maximum value of the scrollbar
See Also:
setValues
 o setVertScrollbarValues
 protected void setVertScrollbarValues()
This method may be overriden by a subclass to change the default values of the vertical scrollbar.

 o reshapeHeader
 protected int reshapeHeader(int x,
                             int y,
                             int w)
 o headerHeight
 protected int headerHeight()
 o reshapeViewport
 protected void reshapeViewport(int x,
                                int y,
                                int w,
                                int h)
Reshapes the viewport to the specified size.

 o layout
 public synchronized void layout()
Positions the scrollbars and viewport.

Overrides:
layout in class Container
 o scrollHorizontal
 protected void scrollHorizontal(JCScrollableInterface scrollable,
                                 JCAdjustmentEvent ev,
                                 int value)
Scrolls a scrollableInterface component horizontally.

 o scrollVertical
 protected void scrollVertical(JCScrollableInterface scrollable,
                               JCAdjustmentEvent ev,
                               int value)
Scrolls a scrollableInterface component vertically.

 o scrollVertical
 protected void scrollVertical(JCAdjustmentEvent ev,
                               int value)
Scrolls the window vertically to the specified value. Subclasses may override this method to provide custom behavior.

 o scrollHorizontal
 protected void scrollHorizontal(JCAdjustmentEvent ev,
                                 int value)
Scrolls the window horizontally to the specified value. Subclasses may override this method to provide custom behavior.

 o scrollVertical
 public void scrollVertical(int v)
Scrolls the window vertically to the specified value.

 o scrollHorizontal
 public void scrollHorizontal(int v)
Scrolls the window horizontally to the specified value.

 o keyPressed
 public void keyPressed(KeyEvent ev)
 o keyReleased
 public void keyReleased(KeyEvent ev)
 o keyTyped
 public void keyTyped(KeyEvent ev)
 o adjustmentValueChanged
 public void adjustmentValueChanged(JCAdjustmentEvent ev)
Processes scrollbar events.

 o setLayout
 public final void setLayout(LayoutManager mgr)
Sets the layout manager for this container. This method is overridden to prevent the layout mgr from being set.

Overrides:
setLayout in class Container

All Packages  Class Hierarchy  This Package  Previous  Next  Index