Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class uk.co.ist.mwt.ScrolledPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--uk.co.ist.mwt.ScrollablePanel
                          |
                          +--uk.co.ist.mwt.ScrolledPanel

public class ScrolledPanel
extends ScrollablePanel
implements java.awt.event.AdjustmentListener
The ScrolledPanel provides a mechanism for scrolling components. It can take one child component, and provides two Scrollbars to allow it to be scrolled. It handles all scrolling events from the Scrollbars, sorting out page increments and the like based on its current size.

Children added to this panel are actually added to its clipwindow child, which only displays one of them.

See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
ScrolledPanel()
          Create a ScrolledPanel with everything set to the default
 
Method Summary
void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
          A method to catch scrollbar events to handle scrolling
java.awt.Component getComponentAt(int x, int y)
          Locate a component; as we're hiding the existence of the internal clipWindow, we must return one of its children if the click is inside it.
boolean hsbNeeded(java.awt.Dimension pSz)
          Function to determine whether the ScrollablePanel needs a horizontal scroll bar if it's compressed into the parent passed in
void removeAll()
          Remove all components from the panel; actually removes those from the clipWindow.
void remove(java.awt.Component comp)
          Remove a component from the panel; overriden so that any children are removed from the clipWindow.
void setAlwaysShowScrollbars(boolean whether)
          Set whether we should always show the scroll bars for this ScrolledPanel, even if they are not necessary
void setWorkAreaPlacement(int newPlacement)
          An accessor method to allow the specification of the point in the clip window where the work area is placed if it is smaller than the clip window; if the value is invalid the change is ignored.
boolean vsbNeeded(java.awt.Dimension pSz)
          Function to determine whether the ScrollablePanel needs a vertical scroll bar if it's compressed into the parent passed in
 
Methods inherited from class uk.co.ist.mwt.ScrollablePanel
addLayoutComponent, getScrollbarPlacement, getScrollHorz, getScrollVert, hsbNeeded, layoutContainer, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent, setScrollbarPlacement, setScrollHorz, setScrollVert, vsbNeeded
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getComponent, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paint, preferredSize, printComponents, print, removeAll, remove, remove, removeContainerListener, removeNotify, setLayout, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Constructor Detail

ScrolledPanel

public ScrolledPanel()
Create a ScrolledPanel with everything set to the default
Method Detail

setAlwaysShowScrollbars

public void setAlwaysShowScrollbars(boolean whether)
Set whether we should always show the scroll bars for this ScrolledPanel, even if they are not necessary

setWorkAreaPlacement

public void setWorkAreaPlacement(int newPlacement)
An accessor method to allow the specification of the point in the clip window where the work area is placed if it is smaller than the clip window; if the value is invalid the change is ignored. The panel is only re-laid-out if the new value is different to the old one.
See Also:
#kSouthEast, #kSouthWest, #kNorthEast, #kNorthWest, #kSouth, #kNorth, #kEast, #kWest, #kFill

vsbNeeded

public boolean vsbNeeded(java.awt.Dimension pSz)
Function to determine whether the ScrollablePanel needs a vertical scroll bar if it's compressed into the parent passed in
Overrides:
vsbNeeded in class ScrollablePanel

hsbNeeded

public boolean hsbNeeded(java.awt.Dimension pSz)
Function to determine whether the ScrollablePanel needs a horizontal scroll bar if it's compressed into the parent passed in
Overrides:
hsbNeeded in class ScrollablePanel

adjustmentValueChanged

public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
A method to catch scrollbar events to handle scrolling
Specified by:
adjustmentValueChanged(java.awt.event.AdjustmentEvent) in interface java.awt.event.AdjustmentListener
Parameters:
e - the event

remove

public void remove(java.awt.Component comp)
Remove a component from the panel; overriden so that any children are removed from the clipWindow.
Parameters:
comp - the component to remove
Overrides:
remove in class java.awt.Container
See Also:
add

removeAll

public void removeAll()
Remove all components from the panel; actually removes those from the clipWindow.
Overrides:
removeAll in class java.awt.Container

getComponentAt

public java.awt.Component getComponentAt(int x,
                                int y)
Locate a component; as we're hiding the existence of the internal clipWindow, we must return one of its children if the click is inside it.
Parameters:
x - the x co-ordinate within this component which the desired component contains
y - the y co-ordinate within this component which the desired component contains
Overrides:
getComponentAt in class java.awt.Container

Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD