|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.draw2d.Figure | +--org.eclipse.draw2d.ScrollPane
A class which implements automatic horizontal and/or vertical scrolling for a single IFigure child.
ScrollBar visibilites are represented by integer class constants:
Nested Class Summary |
Nested classes inherited from class org.eclipse.draw2d.Figure |
Figure.FigureIterator |
Nested classes inherited from class org.eclipse.draw2d.IFigure |
IFigure.NoInsets |
Field Summary | |
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 |
Fields inherited from class org.eclipse.draw2d.Figure |
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip |
Fields inherited from interface org.eclipse.draw2d.IFigure |
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS |
Constructor Summary | |
ScrollPane()
Constructs a new ScrollPane with a ScrollPaneLayout. |
Method Summary | |
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()
Causes this IFigure to layout itself, as well as its children. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NEVER
public static final int AUTOMATIC
public static final int ALWAYS
protected Viewport viewport
protected ScrollBar hBar
protected ScrollBar vBar
Constructor Detail |
public ScrollPane()
Method Detail |
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
IFigure.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()
|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |