org.gnu.gtk
Class Scale

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
                      extended by 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
 boolean getDrawValue()
          Returns whether the current value is displayed as a string next to the slider.
 java.lang.Class getEventListenerClass(java.lang.String signal)
           
 EventType getEventType(java.lang.String signal)
           
 Layout getLayout()
          Gets the Layout used to display the scale.
 int getLayoutOffsetX()
          Obtains the X coordinate where the scale will draw the Layout representing the text in the scale.
 int getLayoutOffsetY()
          Obtains the Y coordinate where the scale will draw the Layout representing the text in the scale.
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
addListener, addRangeListener, getAdjustment, getInverted, getUpdatePolicy, getValue, removeRangeListener, setAdjustment, setIncrements, setInverted, setRange, setUpdatePolicy, setValue
 
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

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.

getDrawValue

public boolean getDrawValue()
Returns whether the current value is displayed as a string next to the slider.


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 EventType getEventType(java.lang.String signal)
Overrides:
getEventType in class Range

getLayout

public Layout getLayout()
Gets the Layout used to display the scale.

Returns:
The Layout for this scale, or NULL if the getDrawValue() is FALSE.

getLayoutOffsetX

public int getLayoutOffsetX()
Obtains the X coordinate where the scale will draw the Layout representing the text in the scale.

If getDrawValue() is FALSE, the return value is undefined.


getLayoutOffsetY

public int getLayoutOffsetY()
Obtains the Y coordinate where the scale will draw the Layout representing the text in the scale.

If getDrawValue() is FALSE, the return value is undefined.


getType

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