class org.aswing.JViewport extends Container
Interfaces | |||
Viewportable |
|
Sub classes | ||||
GridList |
|
JViewport is an basic viewport to view normal components. Generally JViewport works
with JScrollPane together, for example:
var scrollPane:JScrollPane = new JScrollPane(); var viewport:JViewport = new JViewport(yourScrollContentComponent, true, false); scrollPane.setViewport(viewport);
Then you'll get a scrollpane with scroll content and only vertical scrollbar. And the scroll content will always tracks the scroll pane width.
Authors: paling, ngrebenshikov
Show Events | Hide Events
|
Class Fields
Instance Fields
var fitViewHeight:Bool
If true, the view will always be set to the same height as the viewport.
If false, the view will be set to it's preffered height.
var fitViewWidth:Bool
If true, the view will always be set to the same width as the viewport.
If false, the view will be set to it's preffered width.
The horizontal alignment of the view if the view is narrower than extent width. One of the following values:
AsWingConstants.RIGHT
(the default)AsWingConstants.LEFT
AsWingConstants.CENTER
var verticalAlignment:Int
The vertical alignment of the view if the view is lower than extent height.
One of the following values:
- AsWingConstants.CENTER (the default)
- AsWingConstants.TOP
- AsWingConstants.BOTTOM
var viewPosition:IntPoint
The view's position.
It returns (0,0) if view is null.
@see setViewPosition to set view position loudly (to trigger events). @see Viewportable.setViewPosition
function new(?view:Component = null, ?fitViewWidth:Bool = false, ?fitViewHeight:Bool = false): Void
Create a viewport with view and size tracks properties.
See JViewport.view
,JViewport.firViewWidth
, JViewport.fitViewHeight
function addStateListener(listener:Dynamic ->Void?priority:Int = 0, ?useWeakReference:Bool = false): Void
Add a listener to listen the viewpoat state change event.
When the viewpoat's state changed, the state is all about:
viewPosition
verticalUnitIncrement
verticalBlockIncrement
horizontalUnitIncrement
horizontalBlockIncrement
@see org.aswing.event.InteractiveEvent.STATE_CHANGED
listener | the listener |
priority | the priority |
useWeakReference | Determines whether the reference to the listener is strong or weak. |
function ensureRectVisible(contentRect:IntRectangle, ?programmatic:Bool = true): Void
Make a scroll or not to ensure specified rect will be visible.
contentRect | the rect to be ensure visible |
programmatic | whether or not a programmatic call |
function getViewSize(): IntDimension
Usually the view's preffered size.
returns | the view's size, (0, 0) if view is null. |
function removeStateListener(listener:Dynamic ->Void): Void
Removes a state listener.
@see org.aswing.event.InteractiveEvent.STATE_CHANGED
listener | the listener to be removed. |
function scrollToBottomLeft(): Void
Scrolls to view bottom left content.
This will make the scrollbars of JScrollPane
scrolled automatically,
if it is located in a JScrollPane
.
function scrollToBottomRight(): Void
Scrolls to view bottom right content.
This will make the scrollbars of JScrollPane
scrolled automatically,
if it is located in a JScrollPane
.
function scrollToTopLeft(): Void
Scrolls to view top left content.
This will make the scrollbars of JScrollPane
scrolled automatically,
if it is located in a JScrollPane
.
function scrollToTopRight(): Void
Scrolls to view to right content.
This will make the scrollbars of JScrollPane
scrolled automatically,
if it is located in a JScrollPane
.