org.gnu.gtk
Class AspectFrame

java.lang.Object
  |
  +--org.gnu.glib.GObject
        |
        +--org.gnu.gtk.GtkObject
              |
              +--org.gnu.gtk.Widget
                    |
                    +--org.gnu.gtk.Container
                          |
                          +--org.gnu.gtk.Bin
                                |
                                +--org.gnu.gtk.Frame
                                      |
                                      +--org.gnu.gtk.AspectFrame

public class AspectFrame
extends Frame

This container widget wraps a single widget in a frame with a label, and imposes an aspect ratio on the child widget. It is useful when you want to pack a widget so that it can be resized but always retain the same aspect ratio.


Constructor Summary
AspectFrame(int handle)
          Construct an AspectFrame using a handle to a native resource.
AspectFrame(java.lang.String label, double xAlign, double yAlign, double ratio, boolean obeyChild)
          Construct a new AspectFrame.
 
Method Summary
static Type getType()
          Retrieve the runtime type used by the GLib library.
 void setAspect(double xAlign, double yAlign, double ratio, boolean obeyChild)
          Set the aspect for an already created AspectFrame.
 
Methods inherited from class org.gnu.gtk.Frame
getLabel, getLabelAlign, getLabelWidget, getShadow, removeLabel, setLabel, setLabelAlign, setLabelWidget, setShadow
 
Methods inherited from class org.gnu.gtk.Bin
getChild
 
Methods inherited from class org.gnu.gtk.Container
add, addListener, getBorderWidth, getEventListenerClass, getEventType, getResizeMode, remove, removeListener, resizeChildren, setBorderWidth, setResizeMode
 
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
 

Constructor Detail

AspectFrame

public AspectFrame(java.lang.String label,
                   double xAlign,
                   double yAlign,
                   double ratio,
                   boolean obeyChild)
Construct a new AspectFrame.

Parameters:
label - The text label for the frame.
xAlign - The horizontal alignment for the child within the allocation of the AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned).
yAlign - The vertical alignment for the child within the allocation of the AspectFrame. This ranges from 0.0 (top aligned) to 1.0 (bottom aligned).
obeyChild - If true the ratio is ignored and the aspect ratio is taken from the requisition of the child.

AspectFrame

public AspectFrame(int handle)
Construct an AspectFrame using a handle to a native resource.

Method Detail

setAspect

public void setAspect(double xAlign,
                      double yAlign,
                      double ratio,
                      boolean obeyChild)
Set the aspect for an already created AspectFrame.

Parameters:
xAlign - The horizontal alignment for the child within the allocation of the AspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned).
yAlign - The vertical alignment for the child within the allocation of the AspectFrame. This ranges from 0.0 (top aligned) to 1.0 (bottom aligned).
obeyChild - If true the ratio is ignored and the aspect ratio is taken from the requisition of the child.

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