org.gnu.gtk

Class 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(Vector list, Object listener)
Give us a way to locate a specific listener in a Vector.
protected void
fireAdjustmentEvent(AdjustmentEvent event)
Class
getEventListenerClass(String signal)
EventType
getEventType(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, getType, 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, getEventListenerClass, getEventType, getFloatProperty, getGObjectFromHandle, getHandle, getIntFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getNullHandle, getPixbufProperty, getProperty, getStringFromHandle, getStringProperty, hasProperty, hashCode, instantiateJGObjectFromGType, notify, removeEventHandler, removeListener, retrieveGObject, setBooleanProperty, setData, setData, setDoubleProperty, setFloatProperty, setHandle, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify

Constructor Details

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.


Adjustment

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

Method Details

addListener

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

See Also:
SpinListener


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.


findListener

protected static int findListener(Vector list,
                                  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.


fireAdjustmentEvent

protected void fireAdjustmentEvent(AdjustmentEvent event)


getEventListenerClass

public Class getEventListenerClass(String signal)
Overrides:
getEventListenerClass in interface GObject


getEventType

public EventType getEventType(String signal)
Overrides:
getEventType in interface GObject


getLower

protected static final double getLower(Handle cptr)


getPageIncrement

protected static final double getPageIncrement(Handle cptr)


getPageSize

protected static final double getPageSize(Handle cptr)


getStepIncrement

protected static final double getStepIncrement(Handle cptr)


getType

public static Type getType()
Retrieve the runtime type used by the GLib library.
Overrides:
getType in interface GtkObject


getUpper

protected static final double getUpper(Handle cptr)


getValue

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

Returns:
The current value of the adjustment.


gtk_adjustment_changed

protected static final void gtk_adjustment_changed(Handle adjustment)


gtk_adjustment_clamp_page

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


gtk_adjustment_get_type

protected static final int gtk_adjustment_get_type()


gtk_adjustment_get_value

protected static final double gtk_adjustment_get_value(Handle adjustment)


gtk_adjustment_new

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


gtk_adjustment_set_value

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


gtk_adjustment_value_changed

protected static final void gtk_adjustment_value_changed(Handle adjustment)


handleChanged

public void handleChanged()


removeListener

public void removeListener(AdjustmentListener listener)
Removes a listener

See Also:
addListener(AdjustmentListener)


setValue

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