Drag[en]gine Script Module DragonScript  1.23
Dragengine.Gui.DefaultRangeModel Class Reference

Value of scrollbar like widgets. More...

Inheritance diagram for Dragengine.Gui.DefaultRangeModel:
Dragengine.Gui.RangeModel

Public Member Functions

void addListener (RangeModelListener listener)
 Add listener. 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 removeListener (RangeModelListener listener)
 Remove listener. 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

◆ addListener()

void Dragengine.Gui.DefaultRangeModel.addListener ( RangeModelListener  listener)

Add listener.

Exceptions
ENullPointerlistener is null.
EInvalidParamlistener is present.

Implements Dragengine.Gui.RangeModel.

◆ getIncrement()

int Dragengine.Gui.DefaultRangeModel.getIncrement ( )

Increment for changing the value by small increments.

Implements Dragengine.Gui.RangeModel.

◆ getMaximum()

int Dragengine.Gui.DefaultRangeModel.getMaximum ( )

Maximum value.

Implements Dragengine.Gui.RangeModel.

◆ getMinimum()

int Dragengine.Gui.DefaultRangeModel.getMinimum ( )

Minimum value.

Implements Dragengine.Gui.RangeModel.

◆ getPageSize()

int Dragengine.Gui.DefaultRangeModel.getPageSize ( )

Page size.

Implements Dragengine.Gui.RangeModel.

◆ getValue()

int Dragengine.Gui.DefaultRangeModel.getValue ( )

Current value.

Implements Dragengine.Gui.RangeModel.

◆ new() [1/2]

DefaultRangeModel Dragengine.Gui.DefaultRangeModel.new ( )

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

◆ new() [2/2]

DefaultRangeModel Dragengine.Gui.DefaultRangeModel.new ( int  minimum,
int  maximum,
int  pageSize,
int  value,
int  increment 
)

Create range model with values adjusted to satisfy invariants.

◆ removeListener()

void Dragengine.Gui.DefaultRangeModel.removeListener ( RangeModelListener  listener)

Remove listener.

Exceptions
EInvalidParamlistener is absent.

Implements Dragengine.Gui.RangeModel.

◆ setAll()

void Dragengine.Gui.DefaultRangeModel.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 Dragengine.Gui.RangeModel.

◆ setIncrement()

void Dragengine.Gui.DefaultRangeModel.setIncrement ( int  increment)

Set increment for changing the value by small increments.

Implements Dragengine.Gui.RangeModel.

◆ setMaximum()

void Dragengine.Gui.DefaultRangeModel.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 Dragengine.Gui.RangeModel.

◆ setMinimum()

void Dragengine.Gui.DefaultRangeModel.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 Dragengine.Gui.RangeModel.

◆ setPageSize()

void Dragengine.Gui.DefaultRangeModel.setPageSize ( int  pageSize)

Set page size.

pagesize is clamped to 1 or larger.

Implements Dragengine.Gui.RangeModel.

◆ setValue()

void Dragengine.Gui.DefaultRangeModel.setValue ( int  value)

Set current value.

Value is clamped to the range from minimum to maximum.

Implements Dragengine.Gui.RangeModel.


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