org.gnu.gtk
Class Scale

java.lang.Object
  |
  +--org.gnu.glib.GObject
        |
        +--org.gnu.gtk.GtkObject
              |
              +--org.gnu.gtk.Widget
                    |
                    +--org.gnu.gtk.Range
                          |
                          +--org.gnu.gtk.Scale
Direct Known Subclasses:
HScale, VScale

public abstract class Scale
extends Range

A Scale is a slider control used to select a numeric value. To use it, you'll probably want to investigate the methods on its base class, Range, in addition to the methods for Scale itself. To set the value of a scale, you would normally use Range.setValue(double). To detect changes to the value, add RangeListener object to the widget.

The GtkScale widget is an abstract class, used only for deriving the subclasses HScale and VScale.

See Also:
HScale, VScale

Method Summary
 java.lang.Class getEventListenerClass(java.lang.String signal)
           
 GtkEventType getEventType(java.lang.String signal)
           
static Type getType()
          Retrieve the runtime type used by the GLib library.
 void removeFormatListener()
          Removes the format listener
 void setDigits(int digits)
          Sets the number of decimal places that are displayed in the value.
 void setDrawValue(boolean setting)
          Specifies whether the current value is displayed as a string next to the slider.
 void setFormatListener(ScaleListener listener)
          Sets a listener to be used when a format-value request is called.
 void setValuePosition(PositionType pos)
          Sets the position in which the current value is displayed.
 
Methods inherited from class org.gnu.gtk.Range
addRangeListener, getAdjustment, getInverted, getUpdatePolicy, getValue, removeRangeListener, setAdjustment, setIncrements, setInverted, setRange, setUpdatePolicy, setValue
 
Methods inherited from class org.gnu.gtk.Widget
activate, addListener, addListener, addListener, addListener, addListener, addListener, createContext, createLayout, destroy, draw, drawArea, drawArea, getAccessible, getColormap, getContext, getModifierStyle, getName, getParent, getParentWindow, getPointer, getSensitive, getStyle, getToplevel, grabDefault, grabFocus, hasFocus, hide, hideAll, intersect, isAncestor, makeWidget, modifyStyle, popColormap, pushColormap, realize, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, reparent, setBackgroundColor, setBaseColor, setColormap, setDoubleBuffered, setDragDestination, setDragSource, setFont, setForegroundColor, setMinimumSize, setName, setNoDragDestination, setNoDragSource, setSensitive, setTextColor, shapeCombineMask, show, showAll
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, equals, getData, getHandle, removeEventHandler, setData
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setDigits

public void setDigits(int digits)
Sets the number of decimal places that are displayed in the value. Also causes the value of the adjustment to be rounded off to this number of digits, so the retrieved value matches the value the user saw.

Parameters:
digits - The number of decimal places to display, e.g. use 1 to display 1.0, 2 to display 1.00 etc.

setValuePosition

public void setValuePosition(PositionType pos)
Sets the position in which the current value is displayed.

Parameters:
pos - The position in which the current value is displayed.

setDrawValue

public void setDrawValue(boolean setting)
Specifies whether the current value is displayed as a string next to the slider.

Parameters:
setting - If true, the value is displayed.

setFormatListener

public void setFormatListener(ScaleListener listener)
Sets a listener to be used when a format-value request is called.


removeFormatListener

public void removeFormatListener()
Removes the format listener


getEventListenerClass

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

getEventType

public GtkEventType getEventType(java.lang.String signal)
Overrides:
getEventType in class Range

getType

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


Please send any bug reports, comments, or suggestions for the API or documentation to java-gnome-developer@lists.sf.net