|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.Component
org.apache.pivot.wtk.Container
org.apache.pivot.wtk.Viewport
@DefaultProperty(value="view") public abstract class Viewport
Abstract base class for viewport components. Viewports provide a windowed view on a component (called the "view") that is too large to fit within a given area. They are generally scrollable.
Even though this class is a Container
, no components should be
added to it via the add()
method. The component that gets the
windowed (or scrollable) view should be added via the setView()
method (or the "view" property).
Nested Class Summary | |
---|---|
static interface |
Viewport.Skin
Viewport skin interface. |
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Container |
---|
Container.EDT_Checker |
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component |
---|
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary |
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence |
---|
Sequence.Tree<T> |
Constructor Summary | |
---|---|
Viewport()
|
Method Summary | |
---|---|
int |
getScrollLeft()
|
int |
getScrollTop()
|
Component |
getView()
Returns the (single) component (typically a Container )
that we are providing a windowed (or scrollable) view of. |
Bounds |
getViewportBounds()
The bounds of the Viewport within the container, for example, in ScrollPaneSkin, this excludes the scrollbars. |
ListenerList<ViewportListener> |
getViewportListeners()
|
boolean |
isConsumeRepaint()
Returns the consumeRepaint flag, which controls whether the viewport will propagate repaints to its parent or consume them. |
boolean |
isRepaintAllViewport()
Tell if the viewport painting mode is optimized (repaint only needed area, default), or repaint all. |
Sequence<Component> |
remove(int index,
int count)
This method should not be called to remove child components from the Viewport because the viewable child(ren) are set by the setView(org.apache.pivot.wtk.Component) method instead. |
void |
repaint(int x,
int y,
int width,
int height,
boolean immediate)
Flags an area as needing to be repainted. |
void |
setConsumeRepaint(boolean consumeRepaint)
Sets the consumeRepaint flag, which controls whether the viewport will propagate repaints to its parent or consume them. |
void |
setRepaintAllViewport(boolean repaintAllViewport)
Set the viewport painting mode. |
void |
setScrollLeft(int scrollLeft)
|
void |
setScrollTop(int scrollTop)
|
protected void |
setSkin(Skin skin)
Sets the skin, replacing any previous skin. |
void |
setView(Component view)
Set the single component (typically a Container ) that
we will provide a windowed (or scrollable) view of. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Viewport()
Method Detail |
---|
protected void setSkin(Skin skin)
Component
setSkin
in class Component
skin
- The new skin.public int getScrollTop()
public void setScrollTop(int scrollTop)
public int getScrollLeft()
public void setScrollLeft(int scrollLeft)
public Component getView()
Container
)
that we are providing a windowed (or scrollable) view of.
public void setView(Component view)
Container
) that
we will provide a windowed (or scrollable) view of.
public boolean isConsumeRepaint()
public void setConsumeRepaint(boolean consumeRepaint)
consumeRepaint
- true to consume repaints that bubble up through this viewport;
false to propagate them up like normal.public Bounds getViewportBounds()
public void repaint(int x, int y, int width, int height, boolean immediate)
Component
repaint
in class Container
public Sequence<Component> remove(int index, int count)
setView(org.apache.pivot.wtk.Component)
method instead. Any attempt to
remove the "view" component with this method will result
in an exception.
remove
in interface Sequence<Component>
remove
in class Container
index
- The starting index to remove.count
- The number of items to remove, beginning with index.
public ListenerList<ViewportListener> getViewportListeners()
public boolean isRepaintAllViewport()
This is implemented as a workaround for various painting issues on some platforms.
So, if you experience problems with the scrolled-in area not being painted properly
by default, consider setting this property true using the
setRepaintAllViewport
method.
public void setRepaintAllViewport(boolean repaintAllViewport)
This is implemented as a workaround for various painting issues on some platforms. So, if you experience problems with the scrolled-in area not being painted properly by default, consider setting this property true (default is false).
repaintAllViewport
- false means optimized (repaint only needed area, default), while true means repaint all
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |