Class org.aswing.JScrollPane

Description

Field Index

ON_ADJUSTMENT_VALUE_CHANGED, ON_VIEWPORT_CHANGED, SCROLLBAR_ALWAYS, SCROLLBAR_AS_NEEDED, SCROLLBAR_NEVER

Inherited from Container

Inherited from Component

Inherited from EventDispatcher

Method Index

new JScrollPane()
addAdjustmentListener(), append(), getHorizontalScrollBar(), getHorizontalScrollBarPolicy(), getUIClassID(), getVerticalScrollBar(), getVerticalScrollBarPolicy(), getViewport(), getViewportView(), getVisibleRect(), insert(), isValidateRoot(), setHorizontalScrollBar(), setHorizontalScrollBarPolicy(), setLayout(), setUI(), setVerticalScrollBar(), setVerticalScrollBarPolicy(), setView(), setViewportView(), updateUI()

Inherited from Container

Inherited from Component

Inherited from EventDispatcher

Constructor Detail

JScrollPane

public function JScrollPane(viewOrViewport:Object, vsbPolicy:Number, hsbPolicy:Number)

JScrollPane(view:Component, vsbPolicy:Number, hsbPolicy:Number)
JScrollPane(view:Component, vsbPolicy:Number)
JScrollPane(view:Component)
JScrollPane(viewport:Viewportable, vsbPolicy:Number, hsbPolicy:Number)
JScrollPane(viewport:Viewportable, vsbPolicy:Number)
JScrollPane(viewport:Viewportable)
JScrollPane()

Create a JScrollPane, you can specified a Component to be view, then here will create a JViewport to manager the view's scroll, or a Viewportable to be the view, it mananger the scroll itself. If view is not instanceof either, no view will be viewed.

Parameters

viewOrViewportthe scroll content component or a Viewportable
vsbPolicySCROLLBAR_AS_NEEDED or SCROLLBAR_NEVER or SCROLLBAR_ALWAYS, default SCROLLBAR_AS_NEEDED
hsbPolicySCROLLBAR_AS_NEEDED or SCROLLBAR_NEVER or SCROLLBAR_ALWAYS, default SCROLLBAR_AS_NEEDED

See Also

Field Detail

ON_ADJUSTMENT_VALUE_CHANGED

static public ON_ADJUSTMENT_VALUE_CHANGED:String
When one of the scrollpane's scrollbar Adjustment Value Changed.
onAdjustmentValueChanged Event{source:JScrollBar, pane:JScrollPane}

See Also

ON_VIEWPORT_CHANGED

static public ON_VIEWPORT_CHANGED:String
When the current viewport was replaced to another.
onViewportChanged Event{source:JScrollPane, oldViewport:Viewportable, newViewport:Viewportable}

SCROLLBAR_AS_NEEDED

static public SCROLLBAR_AS_NEEDED:Number
scrollbar are displayed only when needed.

SCROLLBAR_NEVER

static public SCROLLBAR_NEVER:Number
scrollbar are never displayed.

SCROLLBAR_ALWAYS

static public SCROLLBAR_ALWAYS:Number
scrollbar are always displayed.

Method Detail

updateUI

public function updateUI():Void

Description copied from Component

Resets the UI property to a value from the current look and feel. Component subclasses must override this method like this:

   public void updateUI() {
      setUI((SliderUI)UIManager.getUI(this);
   }
  

Overrides

updateUI() in org.aswing.Component

setUI

public function setUI(newUI:ScrollPaneUI):Void

Description copied from Component

Sets the look and feel delegate for this component. Component subclasses generally override this method to narrow the argument type. For example, in JSlider:

 public void setUI(SliderUI newUI) {
     super.setUI(newUI);
 }
  

Additionally Component subclasses must provide a getUI method that returns the correct type. For example:

 public SliderUI getUI() {
     return (SliderUI)ui;
 }
 

Overrides

setUI() in org.aswing.Component

getUIClassID

public function getUIClassID():String

Description copied from Component

Returns the UIDefaults key used to look up the name of the org.aswing.plaf.ComponentUI class that defines the look and feel for this component. Most applications will never need to call this method. Subclasses of Component that support pluggable look and feel should override this method to return a UIDefaults key that maps to the ComponentUI subclass that defines their look and feel.

Overrides

getUIClassID() in org.aswing.Component

setLayout

public function setLayout(layout:LayoutManager):Void

Throws

Errorwhen the layout is not ScrollPaneLayout instance.

Overrides

setLayout() in org.aswing.Container

isValidateRoot

public function isValidateRoot():Boolean

Return

true always here.

Overrides

isValidateRoot() in org.aswing.Component

setView

public function setView(viewOrViewport:Object):Void

Sets the view to viewed and scrolled by this scrollpane. if this view is not a Viewportable implementation, then here will create a JViewport to manager the view's scroll, else the Viewportable will be the viewport.
If view is not instanceof either, no view will be set.
If you want to make a component viewed by your way, you have two way:

  • 1.Make your component a Viewportable implementation.
  • 2.Make a your new Viewportable likes JViewport, recommend you extends the JViewport, then make your component to be the viewport's view like JViewport does.

setView(view:Component)
setView(view:Viewportable)

Parameters

viewOrViewporta component or a Viewportable object.

See Also

setViewportView

public function setViewportView(view:Component):Void

Creates a JViewport and then sets its view. Applications that don't provide the view directly to the JScrollPane constructor should use this method to specify the scrollable child that's going to be displayed in the scrollpane. For example:

 JScrollPane scrollpane = new JScrollPane();
 scrollpane.setViewportView(myBigComponentToScroll);
 
Applications should not add children directly to the scrollpane.

Parameters

viewthe component to add to the viewport

See Also

getViewportView

public function getViewportView():Component

Returns the view currently in the scrollpane.

getViewport

public function getViewport():Viewportable

getVisibleRect

public function getVisibleRect():Rectangle

Returns the visible extent rectangle related the current scroll properties.

Return

the visible extent rectangle

addAdjustmentListener

public function addAdjustmentListener(func:Function, obj:Object):Object

Shortcut to and ON_ADJUSTMENT_VALUE_CHANGED listener.

addAdjustmentListener(func:Function)
addAdjustmentListener(func:Function, obj:Object)

Parameters

functhe function which want to handler the event.
objcontext in which to run the function of param func.

See Also

setHorizontalScrollBar

public function setHorizontalScrollBar(horizontalScrollBar:JScrollBar):Void

Adds the scrollbar that controls the viewport's horizontal view position to the scrollpane.

getHorizontalScrollBar

public function getHorizontalScrollBar():JScrollBar

setHorizontalScrollBarPolicy

public function setHorizontalScrollBarPolicy(policy:Number):Void

getHorizontalScrollBarPolicy

public function getHorizontalScrollBarPolicy():Number

setVerticalScrollBar

public function setVerticalScrollBar(verticalScrollBar:JScrollBar):Void

Adds the scrollbar that controls the viewport's vertical view position to the scrollpane.

getVerticalScrollBar

public function getVerticalScrollBar():JScrollBar

setVerticalScrollBarPolicy

public function setVerticalScrollBarPolicy(policy:Number):Void

getVerticalScrollBarPolicy

public function getVerticalScrollBarPolicy():Number

append

public function append(com:Component, constraints:Object):Void

Throws

Errorwhen append child to JScrollPane

Overrides

append() in org.aswing.Container

insert

public function insert(i:Number, com:Component, constraints:Object):Void

Throws

Errorwhen append child to JScrollPane

Overrides

insert() in org.aswing.Container