org.gnu.gtk
Class Adjustment

java.lang.Object
  |
  +--org.gnu.glib.GObject
        |
        +--org.gnu.gtk.GtkObject
              |
              +--org.gnu.gtk.Adjustment

public class Adjustment
extends GtkObject

This object stores geometry information, such as upper and lower bounds, step and page increments, and the size of a page. Other object use an Adjustment object to store their internal dimenstion settings. It also is passed as an argument to specify geometry.

See Also:
SpinButton, Range, HScrollBar, VScrollBar, HScale

Constructor Summary
Adjustment(double value, double lower, double upper, double stepIncrement, double pageIncrement, double pageSize)
          Constructs a new adjustment
Adjustment(int handle)
          Construct a new Adjustment from a handle to a native resource.
 
Method Summary
 void addListener(AdjustmentListener listener)
          Register an object to handle spin events.
 void clampPage(double lower, double upper)
          Updates the GtkAdjustment value to ensure that the range between lower and upper is in the current page (i.e.
 java.lang.Class getEventListenerClass(java.lang.String signal)
           
 GtkEventType getEventType(java.lang.String signal)
           
static Type getType()
          Retrieve the runtime type used by the GLib library.
 double getValue()
          Gets the current value of the adjustment.
 void removeListener(AdjustmentListener listener)
          Removes a listener
 void setValue(double value)
          Sets the GtkAdjustment value.
 
Methods inherited from class org.gnu.gtk.GtkObject
destroy
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, equals, getData, getHandle, removeEventHandler, setData
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Adjustment

public Adjustment(int handle)
Construct a new Adjustment from a handle to a native resource.


Adjustment

public Adjustment(double value,
                  double lower,
                  double upper,
                  double stepIncrement,
                  double pageIncrement,
                  double pageSize)
Constructs a new adjustment

Parameters:
value - The initial value.
lower - The minimum value.
upper - The maximum value.
stepIncrement - The step increment.
pageIncrement - The page increment.
pageSize - The page size.
Method Detail

setValue

public void setValue(double value)
Sets the GtkAdjustment value.


getValue

public double getValue()
Gets the current value of the adjustment.

Returns:
The current value of the adjustment.

clampPage

public void clampPage(double lower,
                      double upper)
Updates the GtkAdjustment value to ensure that the range between lower and upper is in the current page (i.e. between value and value + pageSize). If the range is larger than the page size, then only the start of it will be in the current page. A "changed" signal will be emitted if the value is changed.


getEventListenerClass

public java.lang.Class getEventListenerClass(java.lang.String signal)

getEventType

public GtkEventType getEventType(java.lang.String signal)

addListener

public void addListener(AdjustmentListener listener)
Register an object to handle spin events.

See Also:
SpinListener

removeListener

public void removeListener(AdjustmentListener listener)
Removes a listener

See Also:
addListener(AdjustmentListener)

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.


Please send any bug reports, comments, or suggestions for the API or documentation to java-gnome-developer@lists.sf.net