Agent System POND 1.2 (28.2.2002)

FIM.Util.GUI
Class VerticalExtendingPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--FIM.Util.GUI.VerticalExtendingPanel
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Scrollable, Serializable

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

Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent, JComponent.ActionStandin, JComponent.IntVector, JComponent.KeyboardState
 
Inner classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.AWTTreeLock
 
Fields inherited from class javax.swing.JComponent
_bounds, accessibleContext, listenerList, paintingChild, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
component, containerListener, layoutMgr, listeningBoundsChildren, listeningChildren, ncomponents
 
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, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
VerticalExtendingPanel()
          Create a new VerticalExtendingPanel with a double buffer and a FlowingLayout
VerticalExtendingPanel(boolean isDoubleBuffered)
          Create a new VerticalExtendingPanel with FlowingLayout and the specified buffering strategy.
VerticalExtendingPanel(LayoutManager layout)
          Create a new buffered VerticalExtendingPanel with the specified layout manager.
VerticalExtendingPanel(LayoutManager layout, boolean isDoubleBuffered)
          Creates a new VerticalExtendingPanel with the specified layout manager and buffering strategy.
 
Method Summary
 Dimension getPreferredScrollableViewportSize()
          Retrieve the preferred size of the viewport for a view component.
 int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
          Retrieve the increment to expose a new block/page.
 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.
 boolean getScrollableTracksViewportWidth()
          Return true if a viewport should always force the width of this Scrollable to match the width of the viewport.
 int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
          Retrieve the increment to expose a new row.
 
Methods inherited from class javax.swing.JPanel
, getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
_paintImmediately, addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, alwaysOnTop, checkIfChildObscuredBySibling, componentInputMapChanged, computeVisibleRect, computeVisibleRect, compWriteObjectNotify, contains, createToolTip, disable, enable, enableSerialization, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getCreatedDoubleBuffer, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyBindings, processKeyBindingsForAllComponents, processKeyEvent, processMouseMotionEvent, putClientProperty, rectangleIsObscured, rectangleIsObscuredBySibling, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setCreatedDoubleBuffer, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPaintingChild, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, shouldDebugGraphics, superProcessMouseMotionEvent, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getLayout, getMouseEventTarget, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paintComponents, paintHeavyweightComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFocusOwner, setLayout, transferFocus, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, constructComponentName, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getToolkit, getToolkitImpl, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isEnabledImpl, isLightweight, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resetGC, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, 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

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 use
isDoubleBuffered - 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 use
isDoubleBuffered - 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
Method Detail

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 viewport
orientation - 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 viewport
orientation - 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

Agent System POND 1.2 (28.2.2002)

Submit a bug

Copyright 2001,2002 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.