org.gnu.gtk
Class Adjustment

java.lang.Object
  extended byorg.gnu.glib.GObject
      extended byorg.gnu.gtk.GtkObject
          extended byorg.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, VScale

Field Summary
 
Fields inherited from class org.gnu.glib.GObject
eventsInitialized
 
Constructor Summary
Adjustment(double value, double lower, double upper, double stepIncrement, double pageIncrement, double pageSize)
          Constructs a new adjustment
Adjustment(Handle 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 (ie between value and value + pageSize).
protected static int findListener(java.util.Vector list, java.lang.Object listener)
          Give us a way to locate a specific listener in a Vector.
protected  void fireAdjustmentEvent(AdjustmentEvent event)
           
 java.lang.Class getEventListenerClass(java.lang.String signal)
           
 EventType getEventType(java.lang.String signal)
           
protected static double getLower(Handle cptr)
           
protected static double getPageIncrement(Handle cptr)
           
protected static double getPageSize(Handle cptr)
           
protected static double getStepIncrement(Handle cptr)
           
static Type getType()
          Retrieve the runtime type used by the GLib library.
protected static double getUpper(Handle cptr)
           
 double getValue()
          Gets the current value of the adjustment.
protected static void gtk_adjustment_changed(Handle adjustment)
           
protected static void gtk_adjustment_clamp_page(Handle adjustment, double lower, double upper)
           
protected static int gtk_adjustment_get_type()
           
protected static double gtk_adjustment_get_value(Handle adjustment)
           
protected static Handle gtk_adjustment_new(double value, double lower, double upper, double stepIncrement, double pageIncrement, double pageSize)
           
protected static void gtk_adjustment_set_value(Handle adjustment, double value)
           
protected static void gtk_adjustment_value_changed(Handle adjustment)
           
 void handleChanged()
           
 void removeListener(AdjustmentListener listener)
          Removes a listener
 void setValue(double value)
          Sets the GtkAdjustment value.
 
Methods inherited from class org.gnu.gtk.GtkObject
destroy, getFlags, gtk_object_destroy, gtk_object_get_type, gtk_object_sink, setFlags, sink
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, equals, freezeNotify, getBooleanProperty, getData, getData, getDoubleProperty, getFloatProperty, getGObjectFromHandle, getHandle, getIntFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getNullHandle, getPixbufProperty, getProperty, getStringFromHandle, getStringProperty, hashCode, hasProperty, instantiateJGObjectFromGType, notify, removeEventHandler, removeListener, retrieveGObject, setBooleanProperty, setData, setData, setDoubleProperty, setFloatProperty, setHandle, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Adjustment

public Adjustment(Handle 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 (ie 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)
Overrides:
getEventListenerClass in class GObject

getEventType

public EventType getEventType(java.lang.String signal)
Overrides:
getEventType in class GObject

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)

fireAdjustmentEvent

protected void fireAdjustmentEvent(AdjustmentEvent event)

handleChanged

public void handleChanged()

findListener

protected static int findListener(java.util.Vector list,
                                  java.lang.Object listener)
Give us a way to locate a specific listener in a Vector.

Parameters:
list - The Vector of listeners to search.
listener - The object that is to be located in the Vector.
Returns:
Returns the index of the listener in the Vector, or -1 if the listener is not contained in the Vector.

getType

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


getLower

protected static final double getLower(Handle cptr)

getUpper

protected static final double getUpper(Handle cptr)

getStepIncrement

protected static final double getStepIncrement(Handle cptr)

getPageIncrement

protected static final double getPageIncrement(Handle cptr)

getPageSize

protected static final double getPageSize(Handle cptr)

gtk_adjustment_get_type

protected static final int gtk_adjustment_get_type()

gtk_adjustment_new

protected static final Handle gtk_adjustment_new(double value,
                                                 double lower,
                                                 double upper,
                                                 double stepIncrement,
                                                 double pageIncrement,
                                                 double pageSize)

gtk_adjustment_changed

protected static final void gtk_adjustment_changed(Handle adjustment)

gtk_adjustment_value_changed

protected static final void gtk_adjustment_value_changed(Handle adjustment)

gtk_adjustment_clamp_page

protected static final void gtk_adjustment_clamp_page(Handle adjustment,
                                                      double lower,
                                                      double upper)

gtk_adjustment_get_value

protected static final double gtk_adjustment_get_value(Handle adjustment)

gtk_adjustment_set_value

protected static final void gtk_adjustment_set_value(Handle adjustment,
                                                     double value)