    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

##

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

##

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

##

add(Component)
  Adds the specified component to the viewport.
add(Component, int)
  Adds the specified component to this container at the given position.
add(Component, Object)
  Adds the specified component to the end of this container.
add(Component, Object, int)
  Adds the specified component to this container with the specified constraints at the specified index.
add(String, Component)
  Adds the specified component to this container.
addImpl(Component, Object, int)
  Adds the specified component to this container, if it is not already a child.
addInternal(Component)
addNotify()
  Creates the Panel's peer.
adjustmentValueChanged(JCAdjustmentEvent)
  Processes scrollbar events.
getHorizScrollbar()
getParameters()
  Reads the parameter values from the HTML page using the component's applet.
getScrollbarDisplay()
  Gets the ScrollbarDisplay value.
getScrollbarOffset()
  Gets the ScrollbarOffset value.
getVertScrollbar()
getViewport()
  Gets the viewport.
getViewportHeight()
  Gets the viewport's "virtual height".
getViewportWidth()
  Gets the viewport's "virtual width".
headerHeight()
keyPressed(KeyEvent)
keyReleased(KeyEvent)
keyTyped(KeyEvent)
layout()
  Positions the scrollbars and viewport.
preferredHeight()
  Gets the subclass' preferred height (default: 100).
preferredWidth()
  Gets the subclass' preferred width (default: 100).
reshapeHeader(int, int, int)
reshapeViewport(int, int, int, int)
  Reshapes the viewport to the specified size.
scrollHorizontal(int)
  Scrolls the window horizontally to the specified value.
scrollHorizontal(JCAdjustmentEvent, int)
  Scrolls the window horizontally to the specified value.
scrollHorizontal(JCScrollableInterface, JCAdjustmentEvent, int)
  Scrolls a scrollableInterface component horizontally.
scrollVertical(int)
  Scrolls the window vertically to the specified value.
scrollVertical(JCAdjustmentEvent, int)
  Scrolls the window vertically to the specified value.
scrollVertical(JCScrollableInterface, JCAdjustmentEvent, int)
  Scrolls a scrollableInterface component vertically.
setHorizScrollbarValues()
  This method may be overriden by a subclass to change the default values of the horizontal scrollbar.
setHorizScrollbarValues(int, int, int, int)
  This method may be overriden by a subclass to set the horizontal scrollbar's values.
setLayout(LayoutManager)
  Sets the layout manager for this container.
setScrollbarDisplay(int)
  Sets when to display the scrollbars:

      DISPLAY_ALWAYS           always displayed (default)
      DISPLAY_AS_NEEDED        displayed as necessary
      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

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

  HTML param name/value: "ScrollbarOffset"/int

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

##

DISPLAY_AS_NEEDED

     public static final int DISPLAY_AS_NEEDED

DISPLAY_ALWAYS

     public static final int DISPLAY_ALWAYS

DISPLAY_NONE

     public static final int DISPLAY_NONE

DISPLAY_VERTICAL_ONLY

     public static final int DISPLAY_VERTICAL_ONLY

DISPLAY_HORIZONTAL_ONLY

     public static final int DISPLAY_HORIZONTAL_ONLY

viewport

     protected Component viewport

  The component used as the viewing area into the scrolled component.

##

JCScrolledWindow

     public JCScrolledWindow()

  Creates an empty window. No parameters are read from an HTML file.

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

##

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

getScrollbarDisplay

     public int getScrollbarDisplay()

  Gets the ScrollbarDisplay value.

  See Also:
    setScrollbarDisplay

setScrollbarDisplay

     public void setScrollbarDisplay(int v)

  Sets when to display the scrollbars:

      DISPLAY_ALWAYS           always displayed (default)
      DISPLAY_AS_NEEDED        displayed as necessary
      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

getScrollbarOffset

     public int getScrollbarOffset()

  Gets the ScrollbarOffset value.

  See Also:
    setScrollbarOffset

setScrollbarOffset

     public void setScrollbarOffset(int v)

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

  HTML param name/value: "ScrollbarOffset"/int

getViewport

     public Component getViewport()

  Gets the viewport.

preferredWidth

     protected int preferredWidth()

  Gets the subclass' preferred width (default: 100).

  Overrides:
    preferredWidth in class JCContainer

preferredHeight

     protected int preferredHeight()

  Gets the subclass' preferred height (default: 100).

  Overrides:
    preferredHeight in class JCContainer

getViewportWidth

     protected int getViewportWidth()

  Gets the viewport's "virtual width". The default method returns the viewport's preferred width.

getViewportHeight

     protected int getViewportHeight()

  Gets the viewport's "virtual height". The default method returns the viewport's preferred height.

add

     public Component add(Component comp)

  Adds the specified component to the viewport.

  Overrides:
    add in class JCContainer

add

     public Component add(String name,
                          Component comp)

  Adds the specified component to this container.

  Overrides:
    add in class Container

add

     public Component add(Component comp,
                          int index)

  Adds the specified component to this container at the given position.

  Overrides:
    add in class Container

add

     public void add(Component comp,
                     Object constraints)

  Adds the specified component to the end of this container.

  Overrides:
    add in class Container

add

     public void add(Component comp,
                     Object constraints,
                     int index)

  Adds the specified component to this container with the specified constraints at the specified index.

  Overrides:
    add in class Container

addImpl

     protected void addImpl(Component comp,
                            Object constraints,
                            int index)

  Adds the specified component to this container, if it is not already a child.

  Overrides:
    addImpl in class JCContainer

addInternal

     protected void addInternal(Component comp)

addNotify

     public void addNotify()

  Creates the Panel's peer.

  Overrides:
    addNotify in class JCContainer

getVertScrollbar

     public JCScrollbar getVertScrollbar()

getHorizScrollbar

     public JCScrollbar getHorizScrollbar()

setHorizScrollbarValues

     protected void setHorizScrollbarValues()

  This method may be overriden by a subclass to change the default values of the horizontal scrollbar.

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

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

setVertScrollbarValues

     protected void setVertScrollbarValues()

  This method may be overriden by a subclass to change the default values of the vertical scrollbar.

reshapeHeader

     protected int reshapeHeader(int x,
                                 int y,
                                 int w)

headerHeight

     protected int headerHeight()

reshapeViewport

     protected void reshapeViewport(int x,
                                    int y,
                                    int w,
                                    int h)

  Reshapes the viewport to the specified size.

layout

     public void layout()

  Positions the scrollbars and viewport.

  Overrides:
    layout in class Container

scrollHorizontal

     protected void scrollHorizontal(JCScrollableInterface scrollable,
                                     JCAdjustmentEvent ev,
                                     int value)

  Scrolls a scrollableInterface component horizontally.

scrollVertical

     protected void scrollVertical(JCScrollableInterface scrollable,
                                   JCAdjustmentEvent ev,
                                   int value)

  Scrolls a scrollableInterface component vertically.

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.

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.

scrollVertical

     public void scrollVertical(int v)

  Scrolls the window vertically to the specified value.

scrollHorizontal

     public void scrollHorizontal(int v)

  Scrolls the window horizontally to the specified value.

keyPressed

     public void keyPressed(KeyEvent ev)

keyReleased

     public void keyReleased(KeyEvent ev)

keyTyped

     public void keyTyped(KeyEvent ev)

adjustmentValueChanged

     public void adjustmentValueChanged(JCAdjustmentEvent ev)

  Processes scrollbar events.

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