java-gnome version 4.0.19

org.gnome.gtk
Class Adjustment

Object
  extended by org.freedesktop.bindings.Pointer
      extended by org.freedesktop.bindings.Proxy
          extended by org.gnome.glib.Object
              extended by org.gnome.gtk.Object
                  extended by org.gnome.gtk.Adjustment

public class Adjustment
extends Object

Data concerning a value with a pair of associated values that determine its lower and upper limits. Also, step and page increments as well as a page size are available. Adjustment is not a Widget itself; Adjustments are used by certain Widgets such as SpinButton, VScale and HScale, etc. More commonly, though, you encounter Adjustment objects as the mechanism controlling the position of VScrollbars and HScrollbars as seen in TreeView, TextView, and other Containers packed into a ScrolledWindow.

A single Adjustment object can be shared by more than one Widget. Thus if you need to have multiple Widgets behave similarly with respect to say vertical scrolling, a single Adjustment object will do.

An Adjustment does not update its own values. Associated Widgets that use an Adjustment call the emitValueChanged() method on the widget, causing a Adjustment.ValueChanged signal which in turn is what drives GTK's internal scrolling behaviours. You can react to it too.

Since:
4.0.5
Author:
Srichand Pendyala, Andrew Cowie

Nested Class Summary
static interface Adjustment.Changed
          This signal is emitted when one or more of Adjustment's fields, other than the value field have been changed.
static interface Adjustment.ValueChanged
          This signal is emitted when Adjustment's value field has been changed.
 
Nested classes/interfaces inherited from class org.gnome.gtk.Object
Object.Destroy
 
Constructor Summary
Adjustment()
          Create an Adjustment with all parameters set to initial values of 0.
Adjustment(double value, double lower, double upper, double stepIncrement, double pageIncrement, double pageSize)
          Create a new Adjustment, with given values for the initial value value, the lower and upper bounds, the single step increment, page increment and the page size properties.
 
Method Summary
 void clampPage(double lower, double upper)
          Update the Adjustment's value, to ensure that the bound, defined by lower and upper, is in the current page.
 void configure(double value, double lower, double upper, double stepIncrement, double pageIncrement, double pageSize)
          Change all the configuration values and the data value.
 void connect(Adjustment.Changed handler)
          Hook up an Adjustment.Changed signal handler.
 void connect(Adjustment.ValueChanged handler)
          Hook up an Adjustment.ValueChanged signal handler.
 void emitChanged()
          Emits a Adjustment.Changed signal from the Adjustment widget.
 void emitValueChanged()
          Emits a Adjustment.ValueChanged signal on the Adjustment.
 double getLower()
          Get the lower bound of the Adjustment.
 double getPageSize()
          Get the current value of the page-size property of this Adjustment.
 double getUpper()
          Get the upper bound of the Adjustment.
 double getValue()
          Get the current value of the Adjustment.
 void setLower(double lower)
          Set the lower bound of this Adjustment.
 void setUpper(double upper)
          Set the upper bound of this Adjustment.
 void setValue(double value)
          Set the value of the Adjustment.
 
Methods inherited from class org.gnome.gtk.Object
connect, destroy
 
Methods inherited from class org.freedesktop.bindings.Pointer
toString
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Adjustment

public Adjustment()
Create an Adjustment with all parameters set to initial values of 0.

Since:
4.0.10

Adjustment

public Adjustment(double value,
                  double lower,
                  double upper,
                  double stepIncrement,
                  double pageIncrement,
                  double pageSize)
Create a new Adjustment, with given values for the initial value value, the lower and upper bounds, the single step increment, page increment and the page size properties.

Be aware that pageSize must be set to zero if this Adjustment is representing a single scalar value (ie, if it is going to be the Adjustment backing a SpinButton or Scale).

Since:
4.0.5
Method Detail

clampPage

public void clampPage(double lower,
                      double upper)
Update the Adjustment's value, to ensure that the bound, defined by lower and upper, is in the current page. Thus, it will lie between value and value + pageSize that you set in the constructor. If the bound is larger than the page size, then only the start of it will be in the current page.

As always, a Adjustment.ValueChanged signal is emitted if the value is changed.

Since:
4.0.5

configure

public void configure(double value,
                      double lower,
                      double upper,
                      double stepIncrement,
                      double pageIncrement,
                      double pageSize)
Change all the configuration values and the data value.

This is available as as a single method rather than a series of individual setters because each invocation of a setter causes Adjustment.Changed to be emitted, and generally you'd only want one per sequence of property changes.

Since:
4.0.17

connect

public void connect(Adjustment.Changed handler)
Hook up an Adjustment.Changed signal handler.


connect

public void connect(Adjustment.ValueChanged handler)
Hook up an Adjustment.ValueChanged signal handler.

Since:
4.0.5

emitChanged

public void emitChanged()
Emits a Adjustment.Changed signal from the Adjustment widget. This method will typically be called by the Widget with which the Adjustment is associated when it changes any of Adjustment's properties, other than value.

If you have changed value, then emitValueChanged() is the method you want to change instead.

Since:
4.0.8

emitValueChanged

public void emitValueChanged()
Emits a Adjustment.ValueChanged signal on the Adjustment. This method is probably unnecessary, since calling setValue() will result in the signal being raised.

Since:
4.0.8

getLower

public double getLower()
Get the lower bound of the Adjustment. This is the minimum value that the value property can range to. In a VScrollbar, it is the top end of the scrollbar trough, which you can reasonably expect to be 0.

Since:
4.0.10

getPageSize

public double getPageSize()
Get the current value of the page-size property of this Adjustment. For a VScrollbar, this is the (vertical) height of the slider control.

Since:
4.0.10

getUpper

public double getUpper()
Get the upper bound of the Adjustment. This is the maximum value that the value property can range to. In a VScrollbar, it is the (maximum) height that is represents the value at the bottom end of the scrollbar trough.

Since:
4.0.10

getValue

public double getValue()
Get the current value of the Adjustment. This value is always guaranteed to lie between upper and lower. To set this value, see setValue().

Since:
4.0.5

setLower

public void setLower(double lower)
Set the lower bound of this Adjustment. Most of the time people start their ranges at 0.0 and leave it that way, so you probably won't need this much.

Use configure() if changing more than one property at a time.

Since:
4.0.17

setUpper

public void setUpper(double upper)
Set the upper bound of this Adjustment.

Use configure() if changing more than one property at a time.

Since:
4.0.17

setValue

public void setValue(double value)
Set the value of the Adjustment. This value is bounded between the upper and lower properties of the Adjustment. Any attempt to set the value outside of these bounds is ignored.

Since:
4.0.5


java-gnome