|
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: NEVER: Never show the ScrollBar AUTOMATIC: Show as needed, when the ScrollPane can no longer contain its view. ALWAYS: Always show the ScrollBar. To use, instantiate a ScrollPane object and call its setView(IFigure) method passing the IFigure that is desired to have scrolling ability.
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
|
static int |
AUTOMATIC
|
protected ScrollBar |
hBar
|
static int |
NEVER
|
protected ScrollBar |
vBar
|
protected Viewport |
viewport
|
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 if this IFigure is 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()
public ScrollBar getVerticalScrollBar()
public int getVerticalScrollBarVisibility()
public IFigure getContents()
public IFigure getView()
public Viewport getViewport()
Viewport
.
public boolean isOpaque()
IFigure
true
if this IFigure is opaque.
isOpaque
in interface IFigure
isOpaque
in class Figure
IFigure.isOpaque()
public void scrollHorizontalTo(int x)
public void scrollTo(Point location)
public void scrollVerticalTo(int y)
public void setContents(IFigure figure)
figure
- the contents of the viewportpublic void setHorizontalScrollBar(ScrollBar bar)
public void setHorizontalScrollBarVisibility(int v)
public void setScrollBarVisibility(int v)
public void setVerticalScrollBar(ScrollBar bar)
public void setVerticalScrollBarVisibility(int v)
public void setView(IFigure figure)
public void setViewport(Viewport vp)
public 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 |