|
java-gnome version 4.0.15 | ||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectorg.freedesktop.bindings.Pointer
org.freedesktop.bindings.Proxy
org.gnome.glib.Object
org.gnome.gtk.Object
org.gnome.gtk.Adjustment
public class Adjustment
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.
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. |
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 |
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 |
setValue(double value)
Set the value of the Adjustment. |
Methods inherited from class org.freedesktop.bindings.Pointer |
---|
toString |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Adjustment()
public Adjustment(double value, double lower, double upper, double stepIncrement, double pageIncrement, double pageSize)
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).
Method Detail |
---|
public void clampPage(double lower, double upper)
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.Changed
signal is emitted if the
value is changed.
public void connect(Adjustment.Changed handler)
Adjustment.Changed
signal handler.
public void connect(Adjustment.ValueChanged handler)
Adjustment.ValueChanged
signal handler.
public void emitChanged()
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. instead.
public void emitValueChanged()
Adjustment.ValueChanged
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.
public double getLower()
0
.
public double getPageSize()
public double getUpper()
public double getValue()
setValue()
.
public void setValue(double value)
|
![]() java-gnome |
||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |