FIM.Util.GUI
Class VerticalExtendingPanel
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--FIM.Util.GUI.VerticalExtendingPanel
- public class VerticalExtendingPanel
- extends JPanel
- implements Scrollable
A panel which will extend itself to fill the complete width of the parent and the height necessary
to contain the complete subelement. Will display a vertical scrollbar if necessary.
- Version:
- 1.0, 1.7.2000
- Author:
- Michael Sonntag
- See Also:
- Serialized Form
Fields inherited from class java.awt.Component |
actionListenerK,
adjustmentListenerK,
appContext,
background,
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
componentListener,
componentListenerK,
componentOrientation,
containerListenerK,
cursor,
dropTarget,
enabled,
eventMask,
focusListener,
focusListenerK,
font,
foreground,
hasFocus,
height,
incRate,
inputMethodListener,
inputMethodListenerK,
isInc,
isPacked,
itemListenerK,
keyListener,
keyListenerK,
LEFT_ALIGNMENT,
locale,
LOCK,
minSize,
mouseListener,
mouseListenerK,
mouseMotionListener,
mouseMotionListenerK,
newEventsOnly,
ownedWindowK,
parent,
peer,
peerFont,
popups,
prefSize,
RIGHT_ALIGNMENT,
textListenerK,
TOP_ALIGNMENT,
valid,
visible,
width,
windowListenerK,
x,
y |
Methods inherited from class javax.swing.JComponent |
_paintImmediately,
addAncestorListener,
addNotify,
addPropertyChangeListener,
addVetoableChangeListener,
alwaysOnTop,
bindingForKeyStroke,
computeVisibleRect,
computeVisibleRect,
contains,
createToolTip,
enableSerialization,
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,
processKeyBinding,
processKeyBindings,
processKeyBindingsForAllComponents,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
rectangleIsObscured,
registerKeyboardAction,
registerKeyboardAction,
registerWithKeyboardManager,
removeAncestorListener,
removeNotify,
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,
shouldDebugGraphics,
superProcessMouseMotionEvent,
unregisterKeyboardAction,
unregisterWithKeyboardManager,
update |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
applyOrientation,
countComponents,
deliverEvent,
dispatchEventImpl,
dispatchEventToSelf,
doLayout,
eventEnabled,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents_NoClientCode,
getComponents,
getLayout,
getMouseEventTarget,
getWindow,
insets,
invalidate,
invalidateTree,
isAncestorOf,
layout,
lightweightPrint,
list,
list,
locate,
minimumSize,
nextFocus,
paintComponents,
postProcessKeyEvent,
postsOldMouseEvents,
preferredSize,
preProcessKeyEvent,
print,
printComponents,
processContainerEvent,
processEvent,
proxyEnableEvents,
proxyRequestFocus,
remove,
remove,
removeAll,
removeContainerListener,
setFocusOwner,
setLayout,
transferFocus,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
areInputMethodsEnabled,
bounds,
checkImage,
checkImage,
coalesceEvents,
constructComponentName,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont_NoClientCode,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getNativeContainer,
getParent_NoClientCode,
getParent,
getPeer,
getSize,
getToolkit,
getToolkitImpl,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isEnabledImpl,
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,
removePropertyChangeListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setCursor,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
VerticalExtendingPanel
public VerticalExtendingPanel(LayoutManager layout,
boolean isDoubleBuffered)
- Creates a new VerticalExtendingPanel with the specified layout manager and buffering strategy.
- Parameters:
layout
- the layout manager to useisDoubleBuffered
- a boolean, true for double-buffering, which uses additional memory space
to achieve fast, flicker-free updates
VerticalExtendingPanel
public VerticalExtendingPanel(LayoutManager layout)
- Create a new buffered VerticalExtendingPanel with the specified layout manager.
- Parameters:
layout
- the layout manager to use
VerticalExtendingPanel
public VerticalExtendingPanel(boolean isDoubleBuffered)
- Create a new VerticalExtendingPanel with
FlowingLayout
and the specified buffering
strategy. If isDoubleBuffered
is true, the JPanel will use a double buffer.
- Parameters:
layout
- the layout manager to useisDoubleBuffered
- a boolean, true
for double-buffering, which uses additional
memory space to achieve fast, flicker-free updates- See Also:
FlowingLayout
VerticalExtendingPanel
public VerticalExtendingPanel()
- Create a new VerticalExtendingPanel with a double buffer and a
FlowingLayout
- See Also:
FlowingLayout
getPreferredScrollableViewportSize
public Dimension getPreferredScrollableViewportSize()
- Retrieve the preferred size of the viewport for a view component. Returns the preferred size
of the component itself.
- Specified by:
- getPreferredScrollableViewportSize in interface Scrollable
- Returns:
- the preferred size of the component
getScrollableTracksViewportWidth
public boolean getScrollableTracksViewportWidth()
- Return
true
if a viewport should always force the width of this Scrollable to match the width
of the viewport. This is exactly the desired here, so always true
is returned, disabling
horizontal scrolling.
- Specified by:
- getScrollableTracksViewportWidth in interface Scrollable
- Returns:
- always
true
getScrollableTracksViewportHeight
public boolean getScrollableTracksViewportHeight()
- The height of the scrollable will never be made to match the viewport: On the contrary,
we want the scrollable to extend till it fits all.
- Specified by:
- getScrollableTracksViewportHeight in interface Scrollable
- Returns:
- always
false
getScrollableUnitIncrement
public int getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
- Retrieve the increment to expose a new row. As we cannot tell exactly the height of each row
(they may differ) without recalculation, we return 1/4 of the visible height.
- Specified by:
- getScrollableUnitIncrement in interface Scrollable
- Parameters:
visibleRect
- the view area visible within the viewportorientation
- must be SwingConstants.VERTICAL here (HORIZONTAL will always return 0)direction
- less than zero to scroll up, greater than zero for down- Returns:
- the "unit" increment for scrolling in the specified direction
getScrollableBlockIncrement
public int getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
- Retrieve the increment to expose a new block/page. As we cannot tell exactly the height of each row
(they may differ) without recalculation, we return the visible height.
- Specified by:
- getScrollableBlockIncrement in interface Scrollable
- Parameters:
visibleRect
- the view area visible within the viewportorientation
- must be SwingConstants.VERTICAL here (HORIZONTAL will always return 0)direction
- less than zero to scroll up, greater than zero for down- Returns:
- the "unit" increment for scrolling in the specified direction
Submit a bug
Copyright 2000 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.