|
||||||||
| 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
The ScrollablePanel provides a base mechanism for scrolling components. It is a Panel which lays out its work area child and two scrollbars in an appropriate manner. It can be regarded as the equivalent of a XmScrolledWindow with a scrolling policy of XmAPPLICATION_DEFINED. If you want fuller built-in functionality, you need to use the ScrolledPanel, which is a subclass of this providing the equivalent of the XmAUTOMATIC scrolling policy.
| Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Field Summary | |
protected java.awt.Scrollbar |
scrollHorz
The horizontal scroll bar for this panel |
protected java.awt.Scrollbar |
scrollVert
The vertical scroll bar for this panel |
protected java.awt.Component |
workArea
The work area child (eg. |
| 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 |
| Fields inherited from interface uk.co.ist.mwt.ScrollConstants |
kEast,
kFill,
kNorth,
kNorthEast,
kNorthWest,
kSouth,
kSouthEast,
kSouthWest,
kWest |
| Constructor Summary | |
ScrollablePanel()
Simple constructor, setting the panel's layout to itself... |
|
| Method Summary | |
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Add the specified component with the specified name to the layout. |
int |
getScrollbarPlacement()
Getter for scrollbar placement |
java.awt.Scrollbar |
getScrollHorz()
Gets the horizontal scroll bar |
java.awt.Scrollbar |
getScrollVert()
Gets the vertical scroll bar |
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 |
layoutContainer(java.awt.Container parent)
Lay out the container in the specified panel. |
protected java.awt.Dimension |
layoutSize(java.awt.Container parent,
boolean minimum)
Calculate the dimensions, minimum or preferred, for the specified panel given the components in the specified parent container. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent)
Calculate the minimum size dimensions for the specified panel given the components in the specified parent container. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
Calculate the preferred size dimensions for the specified panel given the components in the specified parent container. |
void |
removeLayoutComponent(java.awt.Component comp)
Remove the specified component from the layout. |
void |
setScrollbarPlacement(int newPlacement)
An accessor method to allow the specification of the point in the container where the scroll bars meet; if the value is invalid the change is ignored. |
void |
setScrollHorz(java.awt.Scrollbar s)
Sets the horizontal scroll bar |
void |
setScrollVert(java.awt.Scrollbar s)
Sets the vertical scroll bar |
protected void |
setupWorkArea(java.awt.Container parent)
Method to set up an internal reference to the work area of the Panel, using the children of the parent container passed in. |
protected java.awt.Dimension |
sizeOfComponent(java.awt.Component comp,
boolean minimum)
Calculate the dimensions, minimum or preferred, of a given component comp |
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 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,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
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 |
| Field Detail |
protected java.awt.Scrollbar scrollVert
protected java.awt.Scrollbar scrollHorz
protected java.awt.Component workArea
| Constructor Detail |
public ScrollablePanel()
| Method Detail |
public void setScrollbarPlacement(int newPlacement)
ScrollConstants.kSouthEast,
ScrollConstants.kSouthWest,
ScrollConstants.kNorthEast,
ScrollConstants.kNorthWestpublic int getScrollbarPlacement()
setScrollbarPlacement(int)public void setScrollVert(java.awt.Scrollbar s)
public java.awt.Scrollbar getScrollVert()
public void setScrollHorz(java.awt.Scrollbar s)
public java.awt.Scrollbar getScrollHorz()
public void addLayoutComponent(java.lang.String name,
java.awt.Component comp)
name - the component namecomp - the component to be addedremoveLayoutComponent(java.awt.Component)public void removeLayoutComponent(java.awt.Component comp)
comp - the component to be removedaddLayoutComponent(java.lang.String, java.awt.Component)
protected java.awt.Dimension sizeOfComponent(java.awt.Component comp,
boolean minimum)
comp - the commponent to find a size forminimum - a flag to say whether we want the minimum sizelayoutSize(java.awt.Container, boolean)
protected java.awt.Dimension layoutSize(java.awt.Container parent,
boolean minimum)
parent - the component to be laid outminimum - a flag to say whether we're looking for the minimum sizeminimumLayoutSize(java.awt.Container),
preferredLayoutSize(java.awt.Container)public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
parent - the component to be laid outminimumLayoutSize(java.awt.Container),
layoutSize(java.awt.Container, boolean)public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
parent - the component to be laid outpreferredLayoutSize(java.awt.Container),
layoutSize(java.awt.Container, boolean)public boolean vsbNeeded(java.awt.Dimension pSz)
public boolean hsbNeeded(java.awt.Dimension pSz)
public void layoutContainer(java.awt.Container parent)
parent - the component which needs to be laid outprotected void setupWorkArea(java.awt.Container parent)
parent - the container wholse children should be searched for
and appropriate work area.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||