java-gnome version 4.0.19

org.gnome.gtk
Class Image

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.Misc
                          extended by org.gnome.gtk.Image

public class Image
extends Misc

A Widget that displays an image.

Since:
4.0.3
Author:
Sebastian Mancke, Andrew Cowie, Guillaume Mazoyer

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
 
Constructor Summary
Image()
          Create a new, but empty, Image Widget.
Image(Icon icon, IconSize size)
          Construct a new Image based on an icon which is in the icons theme.
Image(Pixbuf pixbuf)
          Construct a new Image Widget from an image already loaded into a Pixbuf.
Image(Pixmap pixmap, Bitmap mask)
          Construct a new Image based on an existing Pixmap.
Image(Stock stock, IconSize size)
          Construct a new Image based on one of the Stock icons.
Image(String filename)
          Construct a new Image Widget from the image located at the specified path.
 
Method Summary
 void clear()
          Reset this Image to be empty.
 void setImage(Icon icon, IconSize size)
          Specify the icon to be displayed by this Image.
 void setImage(Pixbuf pixbuf)
          Specify the Pixbuf to be presented by this Image.
 void setImage(Stock stock, IconSize size)
          Specify a stock icon to be displayed by this Image.
 void setImage(String filename)
          Specify the filename to load and parse as image data to be displayed in this Image.
 
Methods inherited from class org.gnome.gtk.Misc
getAlignmentX, getAlignmentY, getPaddingX, getPaddingY, setAlignment, setPadding
 
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
 

Constructor Detail

Image

public Image()
Create a new, but empty, Image Widget. You can use the setters on this class to emplace image data later.

Although this can be used as a blank slate upon which you can do arbitrary Cairo drawing in an Widget.ExposeEvent handler, you are better off using DrawingArea for that purpose.

Since:
4.0.7

Image

public Image(Icon icon,
             IconSize size)
Construct a new Image based on an icon which is in the icons theme. As each one actually comes in various sizes, you have to say which variant you want. If, for a reason or another, the icon is not in the theme, a broken icon will be used.

Since:
4.0.17

Image

public Image(Pixbuf pixbuf)
Construct a new Image Widget from an image already loaded into a Pixbuf.

Since:
4.0.5

Image

public Image(Pixmap pixmap,
             Bitmap mask)
Construct a new Image based on an existing Pixmap. Though passing a mask is supported via the mask parameter, you generally just want to mass null.

Since:
4.0.7

Image

public Image(Stock stock,
             IconSize size)
Construct a new Image based on one of the Stock icons. As each one actually comes in various sizes, you have to say which variant you want.

In most cases, you shouldn't need this; most of the special purpose Widgets have constructors which directly use a Stock item (see ImageMenuItem or ToolButton for example) and which will take care of the sizing issues for you.

Since:
4.0.6

Image

public Image(String filename)
Construct a new Image Widget from the image located at the specified path. This always results in a new Image; if the file is not found the Image will be populated with the "broken image" icon.

Method Detail

clear

public void clear()
Reset this Image to be empty.

Since:
4.0.8

setImage

public void setImage(Icon icon,
                     IconSize size)
Specify the icon to be displayed by this Image. See the constructor taking an Icon instance.

Since:
4.0.17

setImage

public void setImage(Pixbuf pixbuf)
Specify the Pixbuf to be presented by this Image.

Since:
4.0.8

setImage

public void setImage(Stock stock,
                     IconSize size)
Specify a stock icon to be displayed by this Image. See the constructor taking a Stock instance.

Since:
4.0.8

setImage

public void setImage(String filename)
Specify the filename to load and parse as image data to be displayed in this Image. See the filename constructor.

Since:
4.0.8


java-gnome