Class org.aswing.JScrollBar

Description

Field Index

HORIZONTAL, ON_ADJUSTMENT_VALUE_CHANGED, VERTICAL

Inherited from Container

Inherited from Component

Inherited from EventDispatcher

Method Index

new JScrollBar()
addAdjustmentListener(), getBlockIncrement(), getMaximum(), getMinimum(), getModel(), getOrientation(), getUI(), getUIClassID(), getUnitIncrement(), getValue(), getValueIsAdjusting(), getVisibleAmount(), setBlockIncrement(), setEnabled(), setMaximum(), setMinimum(), setModel(), setUI(), setUnitIncrement(), setValue(), setValueIsAdjusting(), setValues(), setVisibleAmount(), updateUI()

Inherited from Container

Inherited from Component

Inherited from EventDispatcher

Constructor Detail

JScrollBar

public function JScrollBar(orientation:Number, value:Number, extent:Number, min:Number, max:Number)

JScrollBar(orientation:Number, value:Number, extent:Number, min:Number, max:Number)
JScrollBar(orientation:Number) default to value=0, extent=10, min=0, max=100

Creates a scrollbar with the specified orientation, value, extent, minimum, and maximum. The "extent" is the size of the viewable area. It is also known as the "visible amount".

Note: Use setBlockIncrement to set the block increment to a size slightly smaller than the view's extent. That way, when the user jumps the knob to an adjacent position, one or two lines of the original contents remain in view.

Parameters

orientationthe scrollbar's orientation to either VERTICAL or HORIZONTAL.
value
extent
min
max

Field Detail

HORIZONTAL

static public HORIZONTAL:Number
Horizontal orientation.

VERTICAL

static public VERTICAL:Number
Vertical orientation.

ON_ADJUSTMENT_VALUE_CHANGED

static public ON_ADJUSTMENT_VALUE_CHANGED:String
When the scrollbar's Adjustment Value Changed.
onAdjustmentValueChanged Event{source:JScrollBar}

Method Detail

setUI

public function setUI(ui:ScrollBarUI):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

getUI

public function getUI():ScrollBarUI

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

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

getOrientation

public function getOrientation():Number

Return

the orientation.

getModel

public function getModel():BoundedRangeModel

Returns data model that handles the scrollbar's four fundamental properties: minimum, maximum, value, extent.

Return

the data model

setModel

public function setModel(newModel:BoundedRangeModel):Void

Sets the model that handles the scrollbar's four fundamental properties: minimum, maximum, value, extent.

Parameters

setUnitIncrement

public function setUnitIncrement(unitIncrement:Number):Void

Sets the unit increment

Parameters

unitIncrementthe unit increment

See Also

getUnitIncrement

public function getUnitIncrement():Number

Returns the amount to change the scrollbar's value by, given a unit up/down request. A ScrollBarUI implementation typically calls this method when the user clicks on a scrollbar up/down arrow and uses the result to update the scrollbar's value. Subclasses my override this method to compute a value, e.g. the change required to scroll up or down one (variable height) line text or one row in a table.

The JScrollPane component creates scrollbars (by default) that then set the unit increment by the viewport, if it has one. The Viewportable interface provides a method to return the unit increment.

Return

the unit increment

See Also

  • JScrollPane
  • Viewportable

setBlockIncrement

public function setBlockIncrement(blockIncrement:Number):Void

Sets the block increment.

Parameters

blockIncrementthe block increment.

See Also

getBlockIncrement

public function getBlockIncrement():Number

Returns the amount to change the scrollbar's value by, given a block (usually "page") up/down request. A ScrollBarUI implementation typically calls this method when the user clicks above or below the scrollbar "knob" to change the value up or down by large amount. Subclasses my override this method to compute a value, e.g. the change required to scroll up or down one paragraph in a text document.

The JScrollPane component creates scrollbars (by default) that then set the block increment by the viewport, if it has one. The Viewportable interface provides a method to return the block increment.

Return

the block increment

See Also

  • JScrollPane
  • Viewportable

getValue

public function getValue():Number

Returns the scrollbar's value.

Return

the scrollbar's value property.

See Also

setValue

public function setValue(value:Number):Void

Sets the scrollbar's value. This method just forwards the value to the model.

Parameters

valuethe value to set.

See Also

getVisibleAmount

public function getVisibleAmount():Number

Returns the scrollbar's extent. In many scrollbar look and feel implementations the size of the scrollbar "knob" or "thumb" is proportional to the extent.

Return

the scrollbar's extent.

See Also

setVisibleAmount

public function setVisibleAmount(extent:Number):Void

Set the model's extent property.

Parameters

extentthe extent to set

See Also

getMinimum

public function getMinimum():Number

Returns the minimum value supported by the scrollbar (usually zero).

Return

the minimum value supported by the scrollbar

See Also

setMinimum

public function setMinimum(minimum:Number):Void

Sets the model's minimum property.

Parameters

minimumthe minimum to set.

See Also

getMaximum

public function getMaximum():Number

Returns the maximum value supported by the scrollbar.

Return

the maximum value supported by the scrollbar

See Also

setMaximum

public function setMaximum(maximum:Number):Void

Sets the model's maximum property.

Parameters

maximumthe maximum to set.

See Also

getValueIsAdjusting

public function getValueIsAdjusting():Boolean

True if the scrollbar knob is being dragged.

Return

the value of the model's valueIsAdjusting property

setValueIsAdjusting

public function setValueIsAdjusting(b:Boolean):Void

Sets the model's valueIsAdjusting property. Scrollbar look and feel implementations should set this property to true when a knob drag begins, and to false when the drag ends. The scrollbar model will not generate ChangeEvents while valueIsAdjusting is true.

See Also

setValues

public function setValues(newValue:Number, newExtent:Number, newMin:Number, newMax:Number):Void

Sets the four BoundedRangeModel properties after forcing the arguments to obey the usual constraints: "minimum le value le value+extent le maximum" ("le" means less or equals)

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

setEnabled

public function setEnabled(b:Boolean):Void

Description copied from Component

Enable or disable the component.

If a component is disabled, it will not fire mouse events. And some component will has different interface when enabled or disabled. But it will also eat mouse clicks when disable even it will not fire mouse events.

Overrides

setEnabled() in org.aswing.Component