java-gnome version 4.0.7

org.gnome.gtk
Class Adjustment

java.lang.Object
  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

An Adjustment object contains an adjustment value with a pair of associated values that determine its lower and upper bound. Also, step and page increments as well as a page size are available. The Adjustment is not a Widget itself, but rather is used in conjunction with other Widgets such as SpinButton, Viewport, Range, HScrollbar, HScale, VScale and TreeView.

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

An Adjustment object does not update its own values. The associated widgets that use the Adjustment are free to change its values though. Associated widgets that use an Adjustment, call the valueChanged() method on the widget, causing a VALUE_CHANGED signal to be emitted.

Since:
4.0.5
Author:
Srichand Pendyala

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.VALUE_CHANGED
          This signal is emitted when Adjustment's value field has been changed.
 
Constructor Summary
Adjustment(double value, double lower, double upper, double stepIncrement, double pageIncrement, double pageSize)
          Create a new Adjustment, with given values for the initial value, the lower and upper bounds, the single step increment values, the page increment values and the page size.
 
Method Summary
 void changed()
          Emits a CHANGED signal from the Adjustment widget.
 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 connect(Adjustment.CHANGED handler)
          Hook up a CHANGED handler.
 void connect(Adjustment.VALUE_CHANGED handler)
          Hook up a VALUE_CHANGED handler.
 double getValue()
          Get the current value of the Adjustment.
 void setValue(double value)
          Set the value of the Adjustment.
 void valueChanged()
          Emits a VALUE_CHANGED signal on the Adjustment.
 
Methods inherited from class org.freedesktop.bindings.Proxy
toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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, the lower and upper bounds, the single step increment values, the page increment values and the page size.

An Adjustment created without passing any arguments to the constructor causes all the parameters to be set to 0.

Parameters:
value - the initial setting for the value property of the Adjustment
lower - the lower bound of the Adjustment
upper - the upper bound of the Adjustment
stepIncrement - the single step increment value of the Adjustment
pageIncrement - the page increment value of the Adjustment
pageSize - the size of the page of the Adjustment
Method Detail

changed

public void changed()
Emits a 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 is changed, the valueChanged() method is called instead.


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 CHANGED signal is emitted if the value is changed.


connect

public void connect(Adjustment.CHANGED handler)
Hook up a CHANGED handler.


connect

public void connect(Adjustment.VALUE_CHANGED handler)
Hook up a VALUE_CHANGED handler.


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().


setValue

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


valueChanged

public void valueChanged()
Emits a VALUE_CHANGED signal on the Adjustment. This method will typically be called by the Widget with which the Adjustment is associated, when it changes the Adjustment's value.



java-gnome