Drag[en]gine Script Module DragonScript Script API  1.0
DefaultRangeModel Class Reference

Value of scrollbar like widgets. More...

Inheritance diagram for DefaultRangeModel:
RangeModel

Public Member Functions

void addNotifier (RangeModelNotifier notifier)
 Add notifier. More...
 
int getIncrement ()
 Increment for changing the value by small increments. More...
 
int getMaximum ()
 Maximum value. More...
 
int getMinimum ()
 Minimum value. More...
 
int getPageSize ()
 Page size. More...
 
int getValue ()
 Current value. More...
 
DefaultRangeModel new ()
 Create range model from 0 to 100 with 10 page an 1 increment. More...
 
DefaultRangeModel new (int minimum, int maximum, int pageSize, int value, int increment)
 Create range model with values adjusted to satisfy invariants. More...
 
void removeNotifier (RangeModelNotifier notifier)
 Remove notifier. More...
 
void setAll (int minimum, int maximum, int pageSize, int value, int increment)
 Set all properties. More...
 
void setIncrement (int increment)
 Set increment for changing the value by small increments. More...
 
void setMaximum (int maximum)
 Set maximum value. More...
 
void setMinimum (int minimum)
 Set minimum value. More...
 
void setPageSize (int pageSize)
 Set page size. More...
 
void setValue (int value)
 Set current value. More...
 

Detailed Description

Value of scrollbar like widgets.

Provides value range, page size and current value. The range model is responsible for checking all constraints are met at all time. These are the constraints:

  • minimum_value <= maximum_value
  • page_size >= 1
  • value >= minimum_value
  • value <= maximum_value

If a parameter is changed breaking one or more of these constraints the range model implementor has to adjusted the parameters to fix the constraints.

The increment is used by scroll bars to change the value is the users clicks the scroll buttons.

Member Function Documentation

§ addNotifier()

void addNotifier ( RangeModelNotifier  notifier)

Add notifier.

Exceptions
ENullPointernotifier is null.
EInvalidParamnotifier is present.

Implements RangeModel.

§ getIncrement()

int getIncrement ( )

Increment for changing the value by small increments.

Implements RangeModel.

§ getMaximum()

int getMaximum ( )

Maximum value.

Implements RangeModel.

§ getMinimum()

int getMinimum ( )

Minimum value.

Implements RangeModel.

§ getPageSize()

int getPageSize ( )

Page size.

Implements RangeModel.

§ getValue()

int getValue ( )

Current value.

Implements RangeModel.

§ new() [1/2]

Create range model from 0 to 100 with 10 page an 1 increment.

§ new() [2/2]

DefaultRangeModel new ( int  minimum,
int  maximum,
int  pageSize,
int  value,
int  increment 
)

Create range model with values adjusted to satisfy invariants.

§ removeNotifier()

void removeNotifier ( RangeModelNotifier  notifier)

Remove notifier.

Exceptions
EInvalidParamnotifier is absent.

Implements RangeModel.

§ setAll()

void setAll ( int  minimum,
int  maximum,
int  pageSize,
int  value,
int  increment 
)

Set all properties.

maximum is clampted to minimum or larger. pageSize is clamped to 1 or larger. value is clamped to the range from minimum to maximum.

Implements RangeModel.

§ setIncrement()

void setIncrement ( int  increment)

Set increment for changing the value by small increments.

Implements RangeModel.

§ setMaximum()

void setMaximum ( int  maximum)

Set maximum value.

If maximum is less than minimum the minimum is set to the maximum. Value is clamped to the range from minimum to maximum.

Implements RangeModel.

§ setMinimum()

void setMinimum ( int  minimum)

Set minimum value.

If minimum is larger than maximum the maximum is set to the minimum. Value is clamped to the range from minimum to maximum.

Implements RangeModel.

§ setPageSize()

void setPageSize ( int  pageSize)

Set page size.

pagesize is clamped to 1 or larger.

Implements RangeModel.

§ setValue()

void setValue ( int  value)

Set current value.

Value is clamped to the range from minimum to maximum.

Implements RangeModel.


The documentation for this class was generated from the following file: