net.rim.device.api.ui
Class Adjustment

java.lang.Object
  extended by net.rim.device.api.ui.Adjustment

public class Adjustment
extends Object

Abstract data structure used to establish a range of values and the step sizes contained within.

Since:
BlackBerry API 6.0.0

Constructor Summary
Adjustment(int value, int lower, int upper, int stepSize, int pageSize, int pageStepSize)
          Abstract data structure used to establish a range of values and the step sizes contained within.
 
Method Summary
 void addListener(AdjustmentListener listener)
          Register a listener to be notified of configuration and value change events.
 void configure(int value, int lower, int upper, int stepSize, int pageSize, int pageStepSize)
          Used to change everything at once in one synchronized method.
 int getCurrentPage()
          Get current page based on value vs page size.
 int getLower()
          Get lower bound.
 int getPageCount()
          Get the number of pages that will fit in this adjustment.
 int getPageSize()
          Get page size.
 int getPageStepSize()
          Get page step size.
 int getStepSize()
          Get step size.
 int getUpper()
          Get upper bound.
 int getValue()
          Get Value.
 void pageStepDown()
          Decrement Adjustment by page step amount.
 void pageStepUp()
          Increment Adjustment by page step amount.
 boolean removeListener(AdjustmentListener listener)
          Remove a listener so that it will no longer receive updates.
 void setLower(int lower)
          Set lower limit.
 void setPageSize(int size)
          Set page size.
 void setPageStep(int step)
          Set page step.
 void setStepSize(int step)
          Set step size.
 void setUpper(int upper)
          Set upper limit.
 void setValue(int value)
          Set current value.
 void stepDown()
          Decrement Adjustment by step amount.
 void stepUp()
          Increment Adjustment by step amount.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

Adjustment

public Adjustment(int value,
                  int lower,
                  int upper,
                  int stepSize,
                  int pageSize,
                  int pageStepSize)
Abstract data structure used to establish a range of values and the step sizes contained within.

Parameters:
value - represents the current value. Current value must be within lower and upper boundaries.
lower - represents the lowest possible value.
upper - represents the highest possible value.
stepSize - represents the increment used when adjusting the value. Should be at least 1.
pageSize - if greater than zero, the total range is divided into pages based on the specified size.
pageStepSize - represents the minimum increment used when moving between pages.
Since:
BlackBerry API 6.0.0


Method Detail

addListener

public void addListener(AdjustmentListener listener)
Register a listener to be notified of configuration and value change events.

Parameters:
listener - receives notifications.
Since:
BlackBerry API 6.0.0

configure

public void configure(int value,
                      int lower,
                      int upper,
                      int stepSize,
                      int pageSize,
                      int pageStepSize)
Used to change everything at once in one synchronized method.

Parameters:
value - represents the current value. Current value must be within lower and upper boundaries.
lower - represents the lowest possible value.
upper - represents the highest possible value.
stepSize - represents the increment used when adjusting the value. Should be at least 1.
pageSize - if greater than zero, the total range is divided into pages based on the specified size.
pageStepSize - represents the minimum increment used when moving between pages.
Since:
BlackBerry API 6.0.0

getCurrentPage

public int getCurrentPage()
Get current page based on value vs page size. Will return -1 if the page size is 0.

Returns:
int (currentValue - lower)/pageSize
Since:
BlackBerry API 6.0.0

getLower

public int getLower()
Get lower bound.

Returns:
the lower bound
Since:
BlackBerry API 6.0.0

getPageCount

public int getPageCount()
Get the number of pages that will fit in this adjustment. Will return -1 if the page size is 0.

Returns:
int (upper - lower)/pageSize
Since:
BlackBerry API 6.0.0

getPageSize

public int getPageSize()
Get page size.

Returns:
the pageSize
Since:
BlackBerry API 6.0.0

getPageStepSize

public int getPageStepSize()
Get page step size.

Returns:
the pageStep size
Since:
BlackBerry API 6.0.0

getStepSize

public int getStepSize()
Get step size.

Returns:
the step size
Since:
BlackBerry API 6.0.0

getUpper

public int getUpper()
Get upper bound.

Returns:
the upper bound
Since:
BlackBerry API 6.0.0

getValue

public int getValue()
Get Value.

Returns:
the current value
Since:
BlackBerry API 6.0.0

pageStepDown

public void pageStepDown()
Decrement Adjustment by page step amount.

Since:
BlackBerry API 6.0.0

pageStepUp

public void pageStepUp()
Increment Adjustment by page step amount.

Since:
BlackBerry API 6.0.0

removeListener

public boolean removeListener(AdjustmentListener listener)
Remove a listener so that it will no longer receive updates.

Parameters:
listener - receives notifications
Returns:
true if the argument was a registered listener
Since:
BlackBerry API 6.0.0

setLower

public void setLower(int lower)
Set lower limit.

Parameters:
lower - the minimum value.
Since:
BlackBerry API 6.0.0

setPageSize

public void setPageSize(int size)
Set page size. If greater than zero, the total range is divided into pages based on the specified size.

Parameters:
size - the pageSize to set.
Since:
BlackBerry API 6.0.0

setPageStep

public void setPageStep(int step)
Set page step.

Parameters:
step - the minimum step used for paging forward or backward.
Since:
BlackBerry API 6.0.0

setStepSize

public void setStepSize(int step)
Set step size.

Parameters:
step - the step size used for increments between lower and upper.
Since:
BlackBerry API 6.0.0

setUpper

public void setUpper(int upper)
Set upper limit.

Parameters:
upper - the max value.
Since:
BlackBerry API 6.0.0

setValue

public void setValue(int value)
Set current value.

Parameters:
value - the new value
Since:
BlackBerry API 6.0.0

stepDown

public void stepDown()
Decrement Adjustment by step amount.

Since:
BlackBerry API 6.0.0

stepUp

public void stepUp()
Increment Adjustment by step amount.

Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.