org.gnu.gtk

Class Frame

Known Direct Subclasses:
AspectFrame

public class Frame
extends Bin

The Frame widget is a Bin that surrounds its child with a decorative frame and an optional label. If present, the label is drawn in the gap in the top side of the frame by default.

Constructor Summary

Frame()
Creates a new frame with no label
Frame(Handle handle)
Construct a frame using a handle to a native resource.
Frame(String label)
Creates a new frame, with the text of label being displayed in the top left.

Method Summary

static Frame
getFrame(Handle handle)
Internal static factory method to be used by Java-Gnome only.
String
getLabel()
Returns the text of the label which is being displayed at the top of the frame.
double
getLabelAlign()
Returns a number representing the alignment of the label
Widget
getLabelWidget()
Returns the widget being used as the label of the frame.
ShadowType
getShadow()
Returns the shadow type in use
static Type
getType()
Retrieve the runtime type used by the GLib library.
void
removeLabel()
Removes the label from the frame
void
setLabel(String label)
Changes the label which is displayed in the frame border.
void
setLabelAlign(double align)
Sets the alignment of the label widget along the top edge of the frame.
void
setLabelWidget(Widget labelWidget)
Sets the widget to use as the label for the frame.
void
setShadow(ShadowType shadowType)
Sets the ShadowType to be displayed for the frame.

Methods inherited from class org.gnu.gtk.Bin

getChild, getType

Methods inherited from class org.gnu.gtk.Container

add, addListener, getBooleanChildProperty, getBorderWidth, getChildProperty, getChildren, getEventListenerClass, getEventType, getIntChildProperty, getResizeMode, getType, remove, removeListener, resizeChildren, setBooleanChildProperty, setBorderWidth, setChildProperty, setIntChildProperty, setResizeMode

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, getEventListenerClass, getEventType, getExtensionEvents, getModifierStyle, getName, getParent, getParentWindow, getPointer, getRootWindow, getScreen, getSensitive, getStyle, getToplevel, getType, 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, getType, sink

Methods inherited from class org.gnu.glib.GObject

addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, collect, freezeNotify, getBooleanProperty, getData, getDoubleProperty, getEventListenerClass, getEventType, getFloatProperty, getGObjectFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getPixbufProperty, getProperty, getStringProperty, hasProperty, notify, removeEventHandler, removeListener, setBooleanProperty, setData, setDoubleProperty, setFloatProperty, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify

Constructor Details

Frame

public Frame()
Creates a new frame with no label

Frame

public Frame(Handle handle)
Construct a frame using a handle to a native resource.

Frame

public Frame(String label)
Creates a new frame, with the text of label being displayed in the top left.
Parameters:
label - Text to be displayed in the border of the frame.

Method Details

getFrame

public static Frame getFrame(Handle handle)
Internal static factory method to be used by Java-Gnome only.

getLabel

public String getLabel()
Returns the text of the label which is being displayed at the top of the frame.
Returns:
The text of the label for the frame, if any.

getLabelAlign

public double getLabelAlign()
Returns a number representing the alignment of the label
Returns:
The alignment of the label on the top of the frame.

getLabelWidget

public Widget getLabelWidget()
Returns the widget being used as the label of the frame. If the frame has just been constructed with a label string, then this will be a Label widget. This method allows you to customise the widget.
Returns:
The widget currently being used as the label.

getShadow

public ShadowType getShadow()
Returns the shadow type in use
Returns:
shadowType the shadow type being displayed

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.
Overrides:
getType in interface Bin

removeLabel

public void removeLabel()
Removes the label from the frame

setLabel

public void setLabel(String label)
Changes the label which is displayed in the frame border.
Parameters:
label - The text to display

setLabelAlign

public void setLabelAlign(double align)
Sets the alignment of the label widget along the top edge of the frame. A vale of 0.0 means full left align; 0.5 means centered; 1.0 is full right align
Parameters:
align - A number representing the alignment of the label.

setLabelWidget

public void setLabelWidget(Widget labelWidget)
Sets the widget to use as the label for the frame. If you want a simple label, use the setLabel(String) method
Parameters:
labelWidget - The widget to use in the label position of the frame.

setShadow

public void setShadow(ShadowType shadowType)
Sets the ShadowType to be displayed for the frame.
Parameters:
shadowType - the shadow type to be used.