public class ScrollPane extends Figure
ScrollBar visibilites are represented by integer class constants:
Figure.FigureIterator, Figure.IdentitySearch
IFigure.NoInsets
Modifier and Type | Field and Description |
---|---|
static int |
ALWAYS
Constant indicating to always show the ScrollBar
|
static int |
AUTOMATIC
Constant indicating to show as needed, when the ScrollPane can't contain
its view
|
protected ScrollBar |
hBar
The horizontal scrollbar
|
static int |
NEVER
Constant indicating to never show the ScrollBar
|
protected ScrollBar |
vBar
The vertical scrollbar
|
protected Viewport |
viewport
The viewport being scrolled
|
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
Constructor and Description |
---|
ScrollPane()
Constructs a new ScrollPane with a ScrollPaneLayout.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createHorizontalScrollBar()
Creates a new horizontally oriented ScrollBar and adds it to this
ScrollPane.
|
protected void |
createVerticalScrollBar()
Creates a new vertically oriented ScrollBar and adds it to this
ScrollPane.
|
protected void |
createViewport()
Creates a new Viewport and adds it to this ScrollPane.
|
IFigure |
getContents()
Returns the contents of the viewport.
|
ScrollBar |
getHorizontalScrollBar()
Returns the ScrollPane's horizontal ScrollBar.
|
int |
getHorizontalScrollBarVisibility()
Returns the visibility of the ScrollPane's horizontal ScrollBar.
|
ScrollBar |
getVerticalScrollBar()
Returns the ScrollPane's vertical ScrollBar.
|
int |
getVerticalScrollBarVisibility()
Returns the visibility of the ScrollPane's vertical ScrollBar.
|
IFigure |
getView()
Deprecated.
use getContents()
|
Viewport |
getViewport()
Returns the ScrollPane's
Viewport . |
boolean |
isOpaque()
Returns true because ScrollPanes are always opaque.
|
void |
scrollHorizontalTo(int x)
Scrolls the Scrollpane horizontally x pixels from its left-most position.
|
void |
scrollTo(Point location)
Scrolls the Scrollpane horizontally from its left-most position by
location.x pixels and vertically from its top-most position by location.y
pixels.
|
void |
scrollVerticalTo(int y)
Scrolls the Scrollpane vertically y pixels from its top-most position.
|
void |
setContents(IFigure figure)
Sets the contents of the current viewport.
|
void |
setHorizontalScrollBar(ScrollBar bar)
Sets the ScrollPane's horizontal ScrollBar to the passed ScrollBar.
|
void |
setHorizontalScrollBarVisibility(int v)
Sets the horizontal ScrollBar visibility of the ScrollPane to the passed
value.
|
void |
setScrollBarVisibility(int v)
Sets both the horizontal and vertical ScrollBar visibilities of the
ScrollPane to the passed value.
|
void |
setVerticalScrollBar(ScrollBar bar)
Sets the ScrollPane's vertical ScrollBar to the passed Scrollbar.
|
void |
setVerticalScrollBarVisibility(int v)
Sets the vertical ScrollBar visibility of the ScrollPane to the passed
value.
|
void |
setView(IFigure figure)
Deprecated.
call setContents(IFigure) instead
|
void |
setViewport(Viewport vp)
Sets the ScrollPane's Viewport to the passed value.
|
void |
validate()
Indicates that this figure should make itself valid.
|
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, 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, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, 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
public static final int NEVER
public static final int AUTOMATIC
public static final int ALWAYS
protected Viewport viewport
protected ScrollBar hBar
protected ScrollBar vBar
public ScrollPane()
protected void createHorizontalScrollBar()
protected void createViewport()
protected void createVerticalScrollBar()
public ScrollBar getHorizontalScrollBar()
public int getHorizontalScrollBarVisibility()
NEVER
,
AUTOMATIC
, and ALWAYS
. The default is
AUTOMATIC
.public ScrollBar getVerticalScrollBar()
public int getVerticalScrollBarVisibility()
NEVER
,
AUTOMATIC
, and ALWAYS
. The default is
AUTOMATIC
.public IFigure getContents()
public IFigure getView()
public Viewport getViewport()
Viewport
.public boolean isOpaque()
isOpaque
in interface IFigure
isOpaque
in class Figure
true
if this IFigure is opaqueIFigure.isOpaque()
public void scrollHorizontalTo(int x)
x
- the amount to scroll horizontallypublic void scrollTo(Point location)
location
- the point to scroll topublic void scrollVerticalTo(int y)
y
- the amount to scroll verticallypublic void setContents(IFigure figure)
figure
- the contents of the viewportpublic void setHorizontalScrollBar(ScrollBar bar)
bar
- the new horizontal scrollbarpublic void setHorizontalScrollBarVisibility(int v)
NEVER
, AUTOMATIC
, and ALWAYS
. The default is
AUTOMATIC
.v
- the new horizontal visibilitypublic void setScrollBarVisibility(int v)
NEVER
, AUTOMATIC
, and ALWAYS
.
The default is AUTOMATIC
.v
- the new vertical and horizontal visibilitypublic void setVerticalScrollBar(ScrollBar bar)
bar
- the new vertical scrollbarpublic void setVerticalScrollBarVisibility(int v)
NEVER
, AUTOMATIC
, and ALWAYS
. The default is
AUTOMATIC
.v
- the new vertical scrollbar visibilitypublic void setView(IFigure figure)
figure
- the new contentspublic void setViewport(Viewport vp)
vp
- the new viewportpublic void validate()
IFigure
validate
in interface IFigure
validate
in class Figure
IFigure.validate()
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.