Class ch.component.scrollbar.AbstractScrollBarManager

Implemented Interfaces

ScrollBarManager

Description

Store the ScrollBarModel to manage.

The exemple beside show how a AbstractScrollBarManager can manage many ScrollBarModel :
var sc1:ScrollBar = ScrollBar.create(this.content1, this.mask1, ScrollType.VERTICAL);
var sc2:ScrollBar = ScrollBar.create(this.content2, this.mask2, ScrollType.VERTICAL);

//2 ways to adapt a manager to many scrollbar :
var scb1:ScrollClickButton = sc1.getUpButton(this.upButton);
scb1.addScrollBarModel(sc2.getModel());

var scb2:ScrollClickButton = new ScrollClickButton(this.upButton, 4);
scb2.addScrollBarModel(sc1.getModel());
scb2.addScrollBarModel(sc2.getModel());

This process allows you to manage a single ScrollBarModel that can be used by many ScrollBar.

See Also

Method Index

addScrollBarModel(), adjust(), getScrollBarModels(), isEnabled(), refresh(), removeScrollBarModel(), scroll(), setEnabled(), toString()

Method Detail

setEnabled

public function setEnabled(value:Boolean):Void

Set if the AbstractScrollBarManager is enabled or not.

This method simply set a Boolean to the specified value. The purpose of this method is to be overriden into the subclasses.

Parameters

value true to enable the AbstractScrollBarManager, false otherwise.

isEnabled

public function isEnabled(Void):Boolean

Get if the AbstractScrollBarManager is enabled or not.

Return

true if the AbstractScrollBarManager is enabled, false otherwise.

addScrollBarModel

public function addScrollBarModel(scr:ScrollBarModel):Void

Add a ScrollBarModel to manage.

Parameters

scrThe ScrollBarModel to add.

Specified By

addScrollBarModel() in ch.component.scrollbar.ScrollBarManager

removeScrollBarModel

public function removeScrollBarModel(scr:ScrollBarModel):Void

Remove a ScrollBarModel.

Parameters

scrThe ScrollBarModel to remove.

Specified By

removeScrollBarModel() in ch.component.scrollbar.ScrollBarManager

getScrollBarModels

public function getScrollBarModels(Void):Array

Get the ScrollBarModel to manage.

Return

An Array of ScrollBarModel.

scroll

public function scroll(value:Number):Void

Scroll all the managed ScrollBar with the specified value.

The source object provided by this method to the ch.component.scrollbar.ScrollBarModel.scroll() method is the current instance.

Note that this method works even if the AbstractScrollBarManager is disabled.

Parameters

valueThe pixel to scroll.

adjust

public function adjust(ratio:Number):Void

Adjust the all the ScrollBar within the specified ratio.

The source object provided by this method to the ch.component.scrollbar.ScrollBarModel.adjust() method is the current instance.

Note that this method works even if the AbstractScrollBarManager is disabled.

Parameters

ratioA Number between 0 and 1 inclusive.

refresh

public function refresh(Void):Void

Refresh the ScrollBarModel that listen the AbstractScrollBarManager.

Note that this method works even if the AbstractScrollBarManager is disabled.

toString

public function toString(Void):String

Represent the current instance into a String.

Return

A String representing the AbstractScrollBarManager instance.