org.gnu.gtk
Class Range

java.lang.Object
  extended by org.gnu.glib.Struct
      extended by org.gnu.glib.GObject
          extended by org.gnu.gtk.GtkObject
              extended by org.gnu.gtk.Widget
                  extended by org.gnu.gtk.Range
Direct Known Subclasses:
Scale, ScrollBar

public abstract class Range
extends Widget

This is the base class for the group of widgets that involve graphic display and manipulation of a vale bounded within a specific minumum and maximum value.

See Also:
HScale, HScrollBar, VScale, VScrollBar

Method Summary
 void addListener(RangeListener listener)
          Register an object to handle range events.
 void addRangeListener(RangeListener listener)
          Register an object to handle range events.
 Adjustment getAdjustment()
          Get the Adjustment which is the "model" object for Range.
 java.lang.Class getEventListenerClass(java.lang.String signal)
           
 EventType getEventType(java.lang.String signal)
           
 boolean getInverted()
          Gets the vaue set by setInverted(boolean).
static Type getType()
          Retrieve the runtime type used by the GLib library.
 UpdateType getUpdatePolicy()
          Gets the update policy
 double getValue()
          Gets the current value of the range.
 void removeRangeListener(RangeListener listener)
          Removes a listener
 void setAdjustment(Adjustment adjustment)
          Sets the adjustment to be used as the "model" object for this range widget.
 void setIncrements(double step, double page)
          Sets the step and page sizes for the range.
 void setInverted(boolean setting)
          Ranges normally move from lower to higher values as the slider moves from top to bottom or left to right.
 void setRange(double min, double max)
          Sets the allowable values in the Range, and clamps the range value to be between min and max.
 void setUpdatePolicy(UpdateType policy)
          Sets the update policy for the Adjustment
 void setValue(double value)
          Sets the current value of the range; if the value is outside the minimum or maximum range values, it will be clamped to fit inside them.
 
Methods inherited from class org.gnu.gtk.Widget
activate, addAccelerator, addEvents, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, canActivateAccel, createContext, createLayout, draw, drawArea, drawArea, finish, getAccessible, getAllocation, getCanFocus, getColormap, getContext, getData, getDisplay, getDragData, getExtensionEvents, getModifierStyle, getName, getParent, getParentWindow, getPointer, getRootWindow, getScreen, getSensitive, getStyle, getToplevel, getWidget, getWindow, grabDefault, grabFocus, hasFocus, hasScreen, hide, hideAll, highlight, highlight, intersect, isAncestor, makeWidget, modifyStyle, popColormap, pushColormap, realize, removeAccelerator, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, reparent, setBackgroundColor, setBaseColor, setCanFocus, setColormap, setDoubleBuffered, setDragDestination, setDragIcon, setDragIconPixbuf, setDragIconStock, setDragSource, setEvents, setExtensionEvents, setFont, setForegroundColor, setMinimumSize, setName, setNoDragDestination, setNoDragSource, setSensitive, setTextColor, shapeCombineMask, show, showAll, unHighlight, unHighlight
 
Methods inherited from class org.gnu.gtk.GtkObject
destroy, sink
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, collect, freezeNotify, getBooleanProperty, getData, getDoubleProperty, getFloatProperty, getGObjectFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getPixbufProperty, getProperty, getStringProperty, hasProperty, notify, removeEventHandler, removeListener, setBooleanProperty, setData, setDoubleProperty, setFloatProperty, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify
 
Methods inherited from class org.gnu.glib.Struct
equals, getHandle, getNullHandle, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAdjustment

public Adjustment getAdjustment()
Get the Adjustment which is the "model" object for Range.

Returns:
The adjustment model

setUpdatePolicy

public void setUpdatePolicy(UpdateType policy)
Sets the update policy for the Adjustment


setAdjustment

public void setAdjustment(Adjustment adjustment)
Sets the adjustment to be used as the "model" object for this range widget. The adjustment indicates the current range value, the minimum and maximum range values, the step/page increments used for keybindings and scrolling, and the page size. The page size is normally 0 for Scale and nonzero for ScrollBar, and indicates the size of the visible area of the widget being scrolled. The page size affects the size of the scrollbar slider.

Parameters:
adjustment - The model to use

setInverted

public void setInverted(boolean setting)
Ranges normally move from lower to higher values as the slider moves from top to bottom or left to right. Inverted ranges have higher values at the top or on the right rather than on the bottom or left.

Parameters:
setting - TRUE to invert the range

getInverted

public boolean getInverted()
Gets the vaue set by setInverted(boolean).

Returns:
True of the slider is inverted

getUpdatePolicy

public UpdateType getUpdatePolicy()
Gets the update policy

Returns:
The current update policy

getValue

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

Returns:
Current value of the range.

setIncrements

public void setIncrements(double step,
                          double page)
Sets the step and page sizes for the range. The step size is used when the user clicks the ScrollBar arrows or moves Scale via arrow keys. The page size is used for example when moving via Page Up or Page Down keys.

Parameters:
step - Step size
page - Page size

setRange

public void setRange(double min,
                     double max)
Sets the allowable values in the Range, and clamps the range value to be between min and max. (If the range has a non-zero page size, it is clamped between min and max - page-size.)

Parameters:
min - Minimum range value
max - Maximum range value

setValue

public void setValue(double value)
Sets the current value of the range; if the value is outside the minimum or maximum range values, it will be clamped to fit inside them. An event is called if the value changes.

Parameters:
value - The new value of the range

addListener

public void addListener(RangeListener listener)
Register an object to handle range events.

See Also:
RangeListener

addRangeListener

public void addRangeListener(RangeListener listener)
Register an object to handle range events.

See Also:
RangeListener

removeRangeListener

public void removeRangeListener(RangeListener listener)
Removes a listener

See Also:
addRangeListener(RangeListener)

getEventListenerClass

public java.lang.Class getEventListenerClass(java.lang.String signal)
Overrides:
getEventListenerClass in class Widget

getEventType

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

getType

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