|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--uk.co.ist.mwt.ScrollablePanel | +--uk.co.ist.mwt.ScrolledPanel
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.
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Fields inherited from class uk.co.ist.mwt.ScrollablePanel |
scrollHorz,
scrollVert,
workArea |
Fields inherited from class javax.swing.JComponent |
accessibleContext,
listenerList,
TOOL_TIP_TEXT_KEY,
ui,
UNDEFINED_CONDITION,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW |
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 | |
protected void |
addImpl(java.awt.Component comp,
java.lang.Object constraints,
int pos)
Add a component to the Panel; overriden so that any children added are put into the clipWindow. |
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 |
remove(java.awt.Component comp)
Remove a component from the panel; overriden so that any children are removed from the clipWindow. |
void |
removeAll()
Remove all components from the panel; actually removes those 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,
layoutContainer,
layoutSize,
minimumLayoutSize,
preferredLayoutSize,
removeLayoutComponent,
setScrollbarPlacement,
setScrollHorz,
setScrollVert,
setupWorkArea,
sizeOfComponent |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext,
getUIClassID,
paramString,
updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paint,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction,
update |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public ScrolledPanel()
Method Detail |
public void setAlwaysShowScrollbars(boolean whether)
public void setWorkAreaPlacement(int newPlacement)
ScrollConstants.kSouthEast
,
ScrollConstants.kSouthWest
,
ScrollConstants.kNorthEast
,
ScrollConstants.kNorthWest
,
ScrollConstants.kSouth
,
ScrollConstants.kNorth
,
ScrollConstants.kEast
,
ScrollConstants.kWest
,
ScrollConstants.kFill
public boolean vsbNeeded(java.awt.Dimension pSz)
public boolean hsbNeeded(java.awt.Dimension pSz)
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
e
- the eventprotected void addImpl(java.awt.Component comp, java.lang.Object constraints, int pos)
comp
- the component to addpos
- the position in the list of children at which to add it;
-1 means 'at the end'.remove(java.awt.Component)
public void remove(java.awt.Component comp)
comp
- the component to removeContainer.add(java.awt.Component)
public void removeAll()
public java.awt.Component getComponentAt(int x, int y)
x
- the x co-ordinate within this component which the desired
component containsy
- the y co-ordinate within this component which the desired
component contains
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |