Packageorg.aswing
Interfacepublic interface Viewportable
ImplementorsJList, JTable, JTextArea, JTree, JViewport

A viewportable object can scrolled by JScrollPane, JScrollBar to view its viewed content in a visible area.

See also

JScrollPane
JViewport
JList
JTextArea


Public Methods
 MethodDefined by
  
addStateListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a listener to listen the viewpoat state change event.
Viewportable
  
Returns the size of the visible part of the view in view logic coordinates.
Viewportable
  
Return the block value for the Horizontal scrolling.
Viewportable
  
Returns the unit value for the Horizontal scrolling.
Viewportable
  
Return the block value for the Vertical scrolling.
Viewportable
  
Returns the unit value for the Vertical scrolling.
Viewportable
  
Return the component of the viewportable's pane which would added to displayed on the stage.
Viewportable
  
Returns the view coordinates that appear in the upper left hand corner of the viewport, or 0,0 if there's no view.
Viewportable
  
Returns the viewportable view's amount size if view all content in view logic coordinates.
Viewportable
  
removeStateListener(listener:Function):void
Removes a state listener.
Viewportable
  
scrollRectToVisible(contentRect:IntRectangle, programmatic:Boolean = true):void
Scrolls the view so that IntRectangle within the view becomes visible.
Viewportable
  
setHorizontalBlockIncrement(increment:int):void
Sets the block value for the Horizontal scrolling.
Viewportable
  
setHorizontalUnitIncrement(increment:int):void
Sets the unit value for the Horizontal scrolling.
Viewportable
  
setVerticalBlockIncrement(increment:int):void
Sets the block value for the Vertical scrolling.
Viewportable
  
setVerticalUnitIncrement(increment:int):void
Sets the unit value for the Vertical scrolling.
Viewportable
  
Before JScrollPane analyse the scroll properties(call getExtentSize and getViewSize), it will call this method to set the size of viewport will be to test.
Viewportable
  
setViewPosition(p:IntPoint, programmatic:Boolean = true):void
Sets the view coordinates that appear in the upper left hand corner of the viewport.
Viewportable
Events
 EventSummaryDefined by
   Dispatched when the viewport's state changed.Viewportable
Method detail
addStateListener()method
public function addStateListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void

Add a listener to listen the viewpoat state change event.

When the viewpoat's state changed, the state is all about:

Parameters
listener:Function — the listener
 
priority:int (default = 0) — the priority
 
useWeakReference:Boolean (default = false) — Determines whether the reference to the listener is strong or weak.

See also

org.aswing.event.InteractiveEvent.STATE_CHANGED
getExtentSize()method 
public function getExtentSize():IntDimension

Returns the size of the visible part of the view in view logic coordinates.

Returns
IntDimension — a IntDimension object giving the size of the view
getHorizontalBlockIncrement()method 
public function getHorizontalBlockIncrement():int

Return the block value for the Horizontal scrolling.

Returns
int
getHorizontalUnitIncrement()method 
public function getHorizontalUnitIncrement():int

Returns the unit value for the Horizontal scrolling.

Returns
int
getVerticalBlockIncrement()method 
public function getVerticalBlockIncrement():int

Return the block value for the Vertical scrolling.

Returns
int
getVerticalUnitIncrement()method 
public function getVerticalUnitIncrement():int

Returns the unit value for the Vertical scrolling.

Returns
int
getViewportPane()method 
public function getViewportPane():Component

Return the component of the viewportable's pane which would added to displayed on the stage.

Returns
Component — the component of the viewportable pane.
getViewPosition()method 
public function getViewPosition():IntPoint

Returns the view coordinates that appear in the upper left hand corner of the viewport, or 0,0 if there's no view. in view logic coordinates.

Returns
IntPoint — a IntPoint object giving the upper left coordinates
getViewSize()method 
public function getViewSize():IntDimension

Returns the viewportable view's amount size if view all content in view logic coordinates. Usually the view's preffered size.

Returns
IntDimension — the view's size.
removeStateListener()method 
public function removeStateListener(listener:Function):void

Removes a state listener.

Parameters
listener:Function — the listener to be removed.

See also

org.aswing.event.InteractiveEvent.STATE_CHANGED
scrollRectToVisible()method 
public function scrollRectToVisible(contentRect:IntRectangle, programmatic:Boolean = true):void

Scrolls the view so that IntRectangle within the view becomes visible. in view logic coordinates.

Note that this method will not scroll outside of the valid viewport; for example, if contentRect is larger than the viewport, scrolling will be confined to the viewport's bounds. Parameters

contentRect:IntRectangle — the IntRectangle to display
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change.
setHorizontalBlockIncrement()method 
public function setHorizontalBlockIncrement(increment:int):void

Sets the block value for the Horizontal scrolling.

Parameters
increment:int
setHorizontalUnitIncrement()method 
public function setHorizontalUnitIncrement(increment:int):void

Sets the unit value for the Horizontal scrolling.

Parameters
increment:int
setVerticalBlockIncrement()method 
public function setVerticalBlockIncrement(increment:int):void

Sets the block value for the Vertical scrolling.

Parameters
increment:int
setVerticalUnitIncrement()method 
public function setVerticalUnitIncrement(increment:int):void

Sets the unit value for the Vertical scrolling.

Parameters
increment:int
setViewportTestSize()method 
public function setViewportTestSize(s:IntDimension):void

Before JScrollPane analyse the scroll properties(call getExtentSize and getViewSize), it will call this method to set the size of viewport will be to test.

Parameters
s:IntDimension — the size to test
setViewPosition()method 
public function setViewPosition(p:IntPoint, programmatic:Boolean = true):void

Sets the view coordinates that appear in the upper left hand corner of the viewport. in view logic coordinates.

Parameters
p:IntPoint — a IntPoint object giving the upper left coordinates
 
programmatic:Boolean (default = true) — indicate if this is a programmatic change.
Event detail
stateChangedevent 
Event object type: org.aswing.event.InteractiveEvent
InteractiveEvent.type property = org.aswing.event.InteractiveEvent.STATE_CHANGED

Dispatched when the viewport's state changed. the state is all about:

The InteractiveEvent.STATE_CHANGED constant defines the value of the type property of the event object for a stateChanged event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
isProgrammatic()True means this event is fired by the programmatic reason, false means user mouse/keyboard interaction reason.
currentTargetThe Object that defines the event listener that handles the event. For example, if you use comp.addEventListener() to register an event listener, comp is the value of the currentTarget.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.