Package org.eclipse.draw2d
Class ScrollPane
java.lang.Object
org.eclipse.draw2d.Figure
org.eclipse.draw2d.ScrollPane
- All Implemented Interfaces:
- IFigure
- Direct Known Subclasses:
- PuristicScrollPane
A class which implements automatic horizontal and/or vertical scrolling for a
 single IFigure child.
 
ScrollBar visibilites are represented by integer class constants:
- NEVER: Never show the ScrollBar
- AUTOMATIC: Show as needed, when the ScrollPane can no longer contain its view
- ALWAYS: Always show the ScrollBar
- 
Nested Class SummaryNested classes/interfaces inherited from class org.eclipse.draw2d.FigureFigure.FigureIterator, Figure.IdentitySearch, Figure.ReverseFigureChildrenIteratorNested classes/interfaces inherited from interface org.eclipse.draw2d.IFigureIFigure.NoInsets
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intConstant indicating to always show the ScrollBarstatic final intConstant indicating to show as needed, when the ScrollPane can't contain its viewprotected ScrollBarThe horizontal scrollbarstatic final intConstant indicating to never show the ScrollBarprotected ScrollBarThe vertical scrollbarprotected ViewportThe viewport being scrolledFields inherited from class org.eclipse.draw2d.FigurebgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTipFields inherited from interface org.eclipse.draw2d.IFigureMAX_DIMENSION, MIN_DIMENSION, NO_INSETS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidCreates a new horizontally oriented ScrollBar and adds it to this ScrollPane.protected voidCreates a new vertically oriented ScrollBar and adds it to this ScrollPane.protected voidCreates a new Viewport and adds it to this ScrollPane.Returns the contents of the viewport.Returns the ScrollPane's horizontal ScrollBar.intReturns the visibility of the ScrollPane's horizontal ScrollBar.Returns the ScrollPane's vertical ScrollBar.intReturns the visibility of the ScrollPane's vertical ScrollBar.getView()Deprecated.use getContents()Returns the ScrollPane'sViewport.booleanisOpaque()Returns true because ScrollPanes are always opaque.voidscrollHorizontalTo(int x) Scrolls the Scrollpane horizontally x pixels from its left-most position.voidScrolls the Scrollpane horizontally from its left-most position by location.x pixels and vertically from its top-most position by location.y pixels.voidscrollVerticalTo(int y) Scrolls the Scrollpane vertically y pixels from its top-most position.voidsetContents(IFigure figure) Sets the contents of the current viewport.voidSets the ScrollPane's horizontal ScrollBar to the passed ScrollBar.voidSets the horizontal ScrollBar visibility of the ScrollPane to the passed value.voidsetScrollBarVisibility(int v) Sets both the horizontal and vertical ScrollBar visibilities of the ScrollPane to the passed value.voidSets the ScrollPane's vertical ScrollBar to the passed Scrollbar.voidSets the vertical ScrollBar visibility of the ScrollPane to the passed value.voidDeprecated.call setContents(IFigure) insteadvoidsetViewport(Viewport vp) Sets the ScrollPane's Viewport to the passed value.voidvalidate()Indicates that this figure should make itself valid.Methods inherited from class org.eclipse.draw2d.Figureadd, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getChildrenRevIterable, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getListenersIterable, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, handleMouseWheelScrolled, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, optimizeClip, paint, paintBorder, paintChildren, paintClientArea, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates
- 
Field Details- 
NEVERpublic static final int NEVERConstant indicating to never show the ScrollBar- See Also:
 
- 
AUTOMATICpublic static final int AUTOMATICConstant indicating to show as needed, when the ScrollPane can't contain its view- See Also:
 
- 
ALWAYSpublic static final int ALWAYSConstant indicating to always show the ScrollBar- See Also:
 
- 
viewportThe viewport being scrolled
- 
hBarThe horizontal scrollbar
- 
vBarThe vertical scrollbar
 
- 
- 
Constructor Details- 
ScrollPanepublic ScrollPane()Constructs a new ScrollPane with a ScrollPaneLayout.- Since:
- 2.0
 
 
- 
- 
Method Details- 
createHorizontalScrollBarprotected void createHorizontalScrollBar()Creates a new horizontally oriented ScrollBar and adds it to this ScrollPane.- Since:
- 2.0
 
- 
createViewportprotected void createViewport()Creates a new Viewport and adds it to this ScrollPane.- Since:
- 2.0
 
- 
createVerticalScrollBarprotected void createVerticalScrollBar()Creates a new vertically oriented ScrollBar and adds it to this ScrollPane.- Since:
- 2.0
 
- 
getHorizontalScrollBarReturns the ScrollPane's horizontal ScrollBar.- Returns:
- the horizontal scrollbar
- Since:
- 2.0
 
- 
getHorizontalScrollBarVisibilitypublic int getHorizontalScrollBarVisibility()Returns the visibility of the ScrollPane's horizontal ScrollBar. These are represented by the integer class constantsNEVER,AUTOMATIC, andALWAYS. The default isAUTOMATIC.- Returns:
- the visiblity of the horizontal scrollbar
- Since:
- 2.0
 
- 
getVerticalScrollBarReturns the ScrollPane's vertical ScrollBar.- Returns:
- teh vertical scrollbar
- Since:
- 2.0
 
- 
getVerticalScrollBarVisibilitypublic int getVerticalScrollBarVisibility()Returns the visibility of the ScrollPane's vertical ScrollBar. These are represented by the integer class constantsNEVER,AUTOMATIC, andALWAYS. The default isAUTOMATIC.- Returns:
- the visibility of the vertical scrollbar
- Since:
- 2.0
 
- 
getContentsReturns the contents of the viewport.- Returns:
- the contents of the viewport
 
- 
getViewDeprecated.use getContents()Returns the ScrollPane's view. The view is the IFigure that is the contents of the ScrollPane.- Returns:
- the contents
- Since:
- 2.0
 
- 
getViewportReturns the ScrollPane'sViewport.- Returns:
- the viewport
- Since:
- 2.0
 
- 
isOpaquepublic boolean isOpaque()Returns true because ScrollPanes are always opaque.
- 
scrollHorizontalTopublic void scrollHorizontalTo(int x) Scrolls the Scrollpane horizontally x pixels from its left-most position.- Parameters:
- x- the amount to scroll horizontally
- Since:
- 2.0
 
- 
scrollToScrolls the Scrollpane horizontally from its left-most position by location.x pixels and vertically from its top-most position by location.y pixels.- Parameters:
- location- the point to scroll to
- Since:
- 2.0
 
- 
scrollVerticalTopublic void scrollVerticalTo(int y) Scrolls the Scrollpane vertically y pixels from its top-most position.- Parameters:
- y- the amount to scroll vertically
- Since:
- 2.0
 
- 
setContentsSets the contents of the current viewport.- Parameters:
- figure- the contents of the viewport
 
- 
setHorizontalScrollBarSets the ScrollPane's horizontal ScrollBar to the passed ScrollBar.- Parameters:
- bar- the new horizontal scrollbar
- Since:
- 2.0
 
- 
setHorizontalScrollBarVisibilitypublic void setHorizontalScrollBarVisibility(int v) Sets the horizontal ScrollBar visibility of the ScrollPane to the passed value. These are represented by the integer class constantsNEVER,AUTOMATIC, andALWAYS. The default isAUTOMATIC.- Parameters:
- v- the new horizontal visibility
- Since:
- 2.0
 
- 
setScrollBarVisibilitypublic void setScrollBarVisibility(int v) Sets both the horizontal and vertical ScrollBar visibilities of the ScrollPane to the passed value. These are represented by the integer class constantsNEVER,AUTOMATIC, andALWAYS. The default isAUTOMATIC.- Parameters:
- v- the new vertical and horizontal visibility
- Since:
- 2.0
 
- 
setVerticalScrollBarSets the ScrollPane's vertical ScrollBar to the passed Scrollbar.- Parameters:
- bar- the new vertical scrollbar
- Since:
- 2.0
 
- 
setVerticalScrollBarVisibilitypublic void setVerticalScrollBarVisibility(int v) Sets the vertical ScrollBar visibility of the ScrollPane to the passed value. These are represented by the integer class constantsNEVER,AUTOMATIC, andALWAYS. The default isAUTOMATIC.- Parameters:
- v- the new vertical scrollbar visibility
- Since:
- 2.0
 
- 
setViewDeprecated.call setContents(IFigure) insteadSets the ScrollPane's view to the passed IFigure. The view is the top-level IFigure which represents the contents of the ScrollPane.- Parameters:
- figure- the new contents
- Since:
- 2.0
 
- 
setViewportSets the ScrollPane's Viewport to the passed value.- Parameters:
- vp- the new viewport
- Since:
- 2.0
 
- 
validatepublic void validate()Description copied from interface:IFigureIndicates that this figure should make itself valid. Validation includes invoking layout on a LayoutManager if present, and then validating all children figures. Default validation uses pre-order, depth-first ordering.
 
-