java-gnome version 4.0.19

org.gnome.gtk
Class Paned

Object
  extended by org.freedesktop.bindings.Pointer
      extended by org.freedesktop.bindings.Proxy
          extended by org.gnome.glib.Object
              extended by org.gnome.gtk.Object
                  extended by org.gnome.gtk.Widget
                      extended by org.gnome.gtk.Container
                          extended by org.gnome.gtk.Paned
Direct Known Subclasses:
HPaned, VPaned

public abstract class Paned
extends Container

Base type for Containers that dispose child Widgets in two panes, arranged either horizontally (HPaned) or vertically (VPaned). A Paned will have two children, referred as child 1 and 2.

This Widget is mainly used to divide the Window area in two parts. The user can adjust the size of the panes by dragging the separator that appears between them. This way, the user can choose at any time how much size allocate for each of the two child Widgets.

A typical usage of the Paned Container is to provide some kind of navigator facilities to a application, generally with a list of bookmarks or an index. In those cases, a HPaned is used to divide the application Window in two columns, one at the left, with the index in a TreeView, and another, wider, at the right, with the contents.

Note that Paned should only be used when we really need to allow users to dynamically change the way size is distributed between the two children. Otherwise, a HBox or VBox would be a better choice.

Since:
4.0.7
Author:
Vreixo Formoso

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gnome.gtk.Widget
Widget.ButtonPressEvent, Widget.ButtonReleaseEvent, Widget.EnterNotifyEvent, Widget.ExposeEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.ScrollEvent, Widget.UnmapEvent, Widget.VisibilityNotifyEvent
 
Nested classes/interfaces inherited from class org.gnome.gtk.Object
Object.Destroy
 
Method Summary
 void add1(Widget child)
          Adds a child Widget to the top (in case of VPaned) or to the left (in case of HPaned) pane.
 void add2(Widget child)
          Adds a child Widget to the bottom (in case of VPaned) or to the right (in case of HPaned) pane.
 Widget getChild1()
          Get the child Widget in the top (in case of a VPaned) or in the left (in case of an HPaned) pane.
 Widget getChild2()
          Get the child Widget at the bottom (in case of VPaned) or at the right (in case of HPaned) pane.
 int getPosition()
          Obtains the position of the divider between the two panes.
 void pack1(Widget child, boolean resize, boolean shrink)
          Adds a child Widget to the top (in case of VPaned) or to the left (in case of HPaned) pane.
 void pack2(Widget child, boolean resize, boolean shrink)
          Adds a child Widget to the bottom (in case of a VPaned) or to the right (in case of an HPaned) pane.
 void setPosition(int position)
          Sets the position of the divider between the two panes.
 
Methods inherited from class org.gnome.gtk.Container
add, getChildren, remove, setBorderWidth
 
Methods inherited from class org.gnome.gtk.Widget
activate, addEvents, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getRequisition, getSensitive, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, isSensitive, modifyBackground, modifyBase, modifyFont, modifyText, queueDraw, queueDrawArea, realize, setCanDefault, setCanFocus, setColormap, setEvents, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll
 
Methods inherited from class org.gnome.gtk.Object
connect, destroy
 
Methods inherited from class org.freedesktop.bindings.Pointer
toString
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

add1

public void add1(Widget child)
Adds a child Widget to the top (in case of VPaned) or to the left (in case of HPaned) pane.

This call is equivalent to pack1(child, false, true).

Since:
4.0.7

add2

public void add2(Widget child)
Adds a child Widget to the bottom (in case of VPaned) or to the right (in case of HPaned) pane.

This call is equivalent to pack2(child, false, true).

Since:
4.0.7

getChild1

public Widget getChild1()
Get the child Widget in the top (in case of a VPaned) or in the left (in case of an HPaned) pane.

Since:
4.0.7

getChild2

public Widget getChild2()
Get the child Widget at the bottom (in case of VPaned) or at the right (in case of HPaned) pane.

Since:
4.0.7

getPosition

public int getPosition()
Obtains the position of the divider between the two panes.

Returns:
the position in pixels.

pack1

public void pack1(Widget child,
                  boolean resize,
                  boolean shrink)
Adds a child Widget to the top (in case of VPaned) or to the left (in case of HPaned) pane.

Parameters:
child - the Widget to be added
resize - Whether this pane (and thus its Widget) should be resized when the Paned is resize.
shrink - Whether the user can make the pane smaller than the size requested by the child Widget. This can be useful to let the user hide one of the two panels, but depending of the child Widget type it can lead to poor visual results. Use with caution.
Since:
4.0.7

pack2

public void pack2(Widget child,
                  boolean resize,
                  boolean shrink)
Adds a child Widget to the bottom (in case of a VPaned) or to the right (in case of an HPaned) pane. See pack1() for details.

Since:
4.0.7

setPosition

public void setPosition(int position)
Sets the position of the divider between the two panes.

Note that the main utility of a Paned is to let user to set the position, so in most cases you don't want to call this method. It can be useful to set the initial position, if you feel that the default value chosen by Gtk is not suitable for your application.

Parameters:
position - The position of the divider, in pixels. A negative value means that the position is not being forced.
Since:
4.0.7


java-gnome