Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.java.awt.peer.gtk
Class GtkToolkit  view GtkToolkit download GtkToolkit.java

java.lang.Object
  extended byjava.awt.Toolkit
      extended bygnu.java.awt.ClasspathToolkit
          extended bygnu.java.awt.peer.gtk.GtkToolkit

public class GtkToolkit
extends gnu.java.awt.ClasspathToolkit

This class accesses a system property called gnu.java.awt.peer.gtk.Graphics. If the property is defined and equal to "Graphics2D", the cairo-based GdkGraphics2D will be used in drawing contexts. Any other value will cause the older GdkGraphics object to be used.


Nested Class Summary
private  class GtkToolkit.LRUCache
           
 
Field Summary
(package private)  java.util.Hashtable containers
           
private  GtkToolkit.LRUCache fontCache
           
private  GtkToolkit.LRUCache imageCache
           
(package private) static java.lang.Thread mainThread
           
private  GtkToolkit.LRUCache metricsCache
           
(package private) static java.awt.EventQueue q
           
(package private) static boolean useGraphics2d
           
(package private) static boolean useGraphics2dSet
           
 
Fields inherited from class java.awt.Toolkit
desktopProperties, desktopPropsSupport
 
Constructor Summary
GtkToolkit()
           
 
Method Summary
 void beep()
          Causes a "beep" tone to be generated.
 int checkImage(java.awt.Image image, int width, int height, java.awt.image.ImageObserver observer)
          Checks the status of specified image as it is being readied for rendering.
protected  java.awt.peer.ButtonPeer createButton(java.awt.Button b)
          Creates a peer object for the specified Button.
protected  java.awt.peer.CanvasPeer createCanvas(java.awt.Canvas c)
          Creates a peer object for the specified Canvas.
protected  java.awt.peer.CheckboxPeer createCheckbox(java.awt.Checkbox cb)
          Creates a peer object for the specified Checkbox.
protected  java.awt.peer.CheckboxMenuItemPeer createCheckboxMenuItem(java.awt.CheckboxMenuItem cmi)
          Creates a peer object for the specified CheckboxMenuItem.
protected  java.awt.peer.ChoicePeer createChoice(java.awt.Choice c)
          Creates a peer object for the specified Choice.
 java.awt.Cursor createCustomCursor(java.awt.Image image, java.awt.Point hotspot, java.lang.String name)
          Creates a new custom cursor object.
protected  java.awt.peer.DialogPeer createDialog(java.awt.Dialog d)
          Creates a peer object for the specified Dialog.
 java.awt.dnd.peer.DragSourceContextPeer createDragSourceContextPeer(java.awt.dnd.DragGestureEvent e)
           
 gnu.java.awt.peer.EmbeddedWindowPeer createEmbeddedWindow(gnu.java.awt.EmbeddedWindow w)
          Creates an embedded window peer, and associates it with an EmbeddedWindow object.
protected  java.awt.peer.FileDialogPeer createFileDialog(java.awt.FileDialog fd)
          Creates a peer object for the specified FileDialog.
 java.awt.Font createFont(int format, java.io.InputStream stream)
          Creates a font, reading the glyph definitions from a stream.
protected  java.awt.peer.FramePeer createFrame(java.awt.Frame f)
          Creates a peer object for the specified Frame.
 java.awt.Image createImage(byte[] imagedata, int imageoffset, int imagelength)
          Creates an image from the specified portion of the byte array passed.
 java.awt.Image createImage(java.awt.image.ImageProducer producer)
          Creates an image using the specified ImageProducer
 java.awt.Image createImage(java.lang.String filename)
           
 java.awt.Image createImage(java.net.URL url)
           
 java.awt.image.ImageProducer createImageProducer(java.net.URL url)
          Creates an ImageProducer from the specified URL.
protected  java.awt.peer.LabelPeer createLabel(java.awt.Label label)
          Creates a peer object for the specified Label.
protected  java.awt.peer.ListPeer createList(java.awt.List list)
          Creates a peer object for the specified List.
protected  java.awt.peer.MenuPeer createMenu(java.awt.Menu m)
          Creates a peer object for the specified Menu.
protected  java.awt.peer.MenuBarPeer createMenuBar(java.awt.MenuBar mb)
          Creates a peer object for the specified MenuBar.
protected  java.awt.peer.MenuItemPeer createMenuItem(java.awt.MenuItem mi)
          Creates a peer object for the specified MenuItem.
protected  java.awt.peer.PanelPeer createPanel(java.awt.Panel p)
          Creates a peer object for the specified Panel.
protected  java.awt.peer.PopupMenuPeer createPopupMenu(java.awt.PopupMenu target)
          Creates a peer object for the specified PopupMenu.
 java.awt.peer.RobotPeer createRobot(java.awt.GraphicsDevice screen)
           
protected  java.awt.peer.ScrollbarPeer createScrollbar(java.awt.Scrollbar sb)
          Creates a peer object for the specified Scrollbar.
protected  java.awt.peer.ScrollPanePeer createScrollPane(java.awt.ScrollPane sp)
          Creates a peer object for the specified ScrollPane.
protected  java.awt.peer.TextAreaPeer createTextArea(java.awt.TextArea ta)
          Creates a peer object for the specified TextArea.
protected  java.awt.peer.TextFieldPeer createTextField(java.awt.TextField tf)
          Creates a peer object for the specified TextField.
protected  java.awt.peer.WindowPeer createWindow(java.awt.Window w)
          Creates a peer object for the specified Window.
 java.awt.Rectangle getBounds()
           
 gnu.java.awt.peer.ClasspathFontPeer getClasspathFontPeer(java.lang.String name, java.util.Map attrs)
          Newer method to produce a peer for a Font object, even though Sun's design claims Font should now be peerless, we do not agree with this model, hence "ClasspathFontPeer".
 gnu.java.awt.peer.ClasspathTextLayoutPeer getClasspathTextLayoutPeer(java.text.AttributedString str, java.awt.font.FontRenderContext frc)
           
 java.awt.image.ColorModel getColorModel()
          Returns the native color model (which isn't the same as the default ARGB color model, but doesn't have to be).
 java.lang.String[] getFontList()
          Returns the names of the available fonts.
 java.awt.FontMetrics getFontMetrics(java.awt.Font font)
          Return the font metrics for the specified font
protected  java.awt.peer.FontPeer getFontPeer(java.lang.String name, int style)
          Creates a peer object for the specified font name.
private  java.awt.peer.FontPeer getFontPeer(java.lang.String name, int style, int size)
          Private method that allows size to be set at initialization time.
 java.awt.Image getImage(java.lang.String filename)
          Returns an image from the specified file, which must be in a recognized format.
 java.awt.Image getImage(java.net.URL url)
          Returns an image from the specified URL, which must be in a recognized format.
 java.awt.GraphicsEnvironment getLocalGraphicsEnvironment()
          Returns a shared instance of the local, platform-specific graphics environment.
 java.awt.PrintJob getPrintJob(java.awt.Frame frame, java.lang.String jobtitle, java.util.Properties props)
          Returns a instance of PrintJob for the specified arguments.
 int getScreenResolution()
          Returns the screen resolution in dots per square inch.
 java.awt.Dimension getScreenSize()
          Returns the dimensions of the screen in pixels.
private  void getScreenSizeDimensions(int[] xy)
           
 java.awt.datatransfer.Clipboard getSystemClipboard()
          Returns the system clipboard.
protected  java.awt.EventQueue getSystemEventQueueImpl()
          Returns the event queue that is suitable for the calling context.
 java.awt.datatransfer.Clipboard getSystemSelection()
          Gets the singleton instance of the system selection as a Clipboard object.
(package private) static void gtkInit(int portableNativeSync)
           
static void gtkMain()
           
private  java.awt.Image imageOrError(java.awt.Image b)
          Helper to return either a Image -- the argument -- or a GtkImage with the errorLoading flag set if the argument is null.
protected  void loadSystemColors(int[] systemColors)
          Copies the current system colors into the specified array.
 java.util.Map mapInputMethodHighlight(java.awt.im.InputMethodHighlight highlight)
           
 boolean prepareImage(java.awt.Image image, int width, int height, java.awt.image.ImageObserver observer)
          Prepares a GtkImage.
 void registerImageIOSpis(javax.imageio.spi.IIORegistry reg)
          Used to register ImageIO SPIs provided by the toolkit.
protected  void setComponentState(java.awt.Component c, GtkComponentPeer cp)
           
 void sync()
          Flushes any buffered data to the screen so that it is in sync with what the AWT system has drawn to it.
static boolean useGraphics2D()
           
 
Methods inherited from class gnu.java.awt.ClasspathToolkit
getFont
 
Methods inherited from class java.awt.Toolkit
addAWTEventListener, addPropertyChangeListener, createComponent, createDragGestureRecognizer, createImage, getAWTEventListeners, getAWTEventListeners, getBestCursorSize, getDefaultToolkit, getDesktopProperty, getLockingKeyState, getMaximumCursorColors, getMenuShortcutKeyMask, getNativeContainer, getPrintJob, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getScreenInsets, getSystemEventQueue, initializeDesktopProperties, isDynamicLayoutActive, isDynamicLayoutSet, isFrameStateSupported, lazilyLoadDesktopProperty, removeAWTEventListener, removePropertyChangeListener, setDesktopProperty, setDynamicLayout, setLockingKeyState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

containers

java.util.Hashtable containers

q

static java.awt.EventQueue q

useGraphics2dSet

static boolean useGraphics2dSet

useGraphics2d

static boolean useGraphics2d

mainThread

static java.lang.Thread mainThread

fontCache

private GtkToolkit.LRUCache fontCache

metricsCache

private GtkToolkit.LRUCache metricsCache

imageCache

private GtkToolkit.LRUCache imageCache
Constructor Detail

GtkToolkit

public GtkToolkit()
Method Detail

useGraphics2D

public static boolean useGraphics2D()

gtkInit

static void gtkInit(int portableNativeSync)

beep

public void beep()
Description copied from class: java.awt.Toolkit
Causes a "beep" tone to be generated.


getScreenSizeDimensions

private void getScreenSizeDimensions(int[] xy)

checkImage

public int checkImage(java.awt.Image image,
                      int width,
                      int height,
                      java.awt.image.ImageObserver observer)
Description copied from class: java.awt.Toolkit
Checks the status of specified image as it is being readied for rendering.


imageOrError

private java.awt.Image imageOrError(java.awt.Image b)
Helper to return either a Image -- the argument -- or a GtkImage with the errorLoading flag set if the argument is null.


createImage

public java.awt.Image createImage(java.lang.String filename)

createImage

public java.awt.Image createImage(java.net.URL url)

createImage

public java.awt.Image createImage(java.awt.image.ImageProducer producer)
Description copied from class: java.awt.Toolkit
Creates an image using the specified ImageProducer


createImage

public java.awt.Image createImage(byte[] imagedata,
                                  int imageoffset,
                                  int imagelength)
Description copied from class: java.awt.Toolkit
Creates an image from the specified portion of the byte array passed. The array must be in a recognized format. Supported formats vary from toolkit to toolkit.


createImageProducer

public java.awt.image.ImageProducer createImageProducer(java.net.URL url)
Creates an ImageProducer from the specified URL. The image is assumed to be in a recognised format.


getColorModel

public java.awt.image.ColorModel getColorModel()
Returns the native color model (which isn't the same as the default ARGB color model, but doesn't have to be).


getFontList

public java.lang.String[] getFontList()
Description copied from class: java.awt.Toolkit
Returns the names of the available fonts.


getFontMetrics

public java.awt.FontMetrics getFontMetrics(java.awt.Font font)
Description copied from class: java.awt.Toolkit
Return the font metrics for the specified font


getImage

public java.awt.Image getImage(java.lang.String filename)
Description copied from class: java.awt.Toolkit
Returns an image from the specified file, which must be in a recognized format. Supported formats vary from toolkit to toolkit.


getImage

public java.awt.Image getImage(java.net.URL url)
Description copied from class: java.awt.Toolkit
Returns an image from the specified URL, which must be in a recognized format. Supported formats vary from toolkit to toolkit.


getPrintJob

public java.awt.PrintJob getPrintJob(java.awt.Frame frame,
                                     java.lang.String jobtitle,
                                     java.util.Properties props)
Description copied from class: java.awt.Toolkit
Returns a instance of PrintJob for the specified arguments.


getScreenResolution

public int getScreenResolution()
Description copied from class: java.awt.Toolkit
Returns the screen resolution in dots per square inch.


getScreenSize

public java.awt.Dimension getScreenSize()
Description copied from class: java.awt.Toolkit
Returns the dimensions of the screen in pixels.


getSystemClipboard

public java.awt.datatransfer.Clipboard getSystemClipboard()
Description copied from class: java.awt.Toolkit
Returns the system clipboard.


getSystemSelection

public java.awt.datatransfer.Clipboard getSystemSelection()
Description copied from class: java.awt.Toolkit
Gets the singleton instance of the system selection as a Clipboard object. The system selection contains the selected text of the last component/widget that had focus and a text selection. The default implementation returns null.


prepareImage

public boolean prepareImage(java.awt.Image image,
                            int width,
                            int height,
                            java.awt.image.ImageObserver observer)
Prepares a GtkImage. For every other kind of Image it just assumes the image is already prepared for rendering.


sync

public void sync()
Description copied from class: java.awt.Toolkit
Flushes any buffered data to the screen so that it is in sync with what the AWT system has drawn to it.


setComponentState

protected void setComponentState(java.awt.Component c,
                                 GtkComponentPeer cp)

createButton

protected java.awt.peer.ButtonPeer createButton(java.awt.Button b)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified Button.


createCanvas

protected java.awt.peer.CanvasPeer createCanvas(java.awt.Canvas c)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified Canvas.


createCheckbox

protected java.awt.peer.CheckboxPeer createCheckbox(java.awt.Checkbox cb)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified Checkbox.


createCheckboxMenuItem

protected java.awt.peer.CheckboxMenuItemPeer createCheckboxMenuItem(java.awt.CheckboxMenuItem cmi)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified CheckboxMenuItem.


createChoice

protected java.awt.peer.ChoicePeer createChoice(java.awt.Choice c)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified Choice.


createDialog

protected java.awt.peer.DialogPeer createDialog(java.awt.Dialog d)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified Dialog.


createFileDialog

protected java.awt.peer.FileDialogPeer createFileDialog(java.awt.FileDialog fd)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified FileDialog.


createFrame

protected java.awt.peer.FramePeer createFrame(java.awt.Frame f)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified Frame.


createLabel

protected java.awt.peer.LabelPeer createLabel(java.awt.Label label)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified Label.


createList

protected java.awt.peer.ListPeer createList(java.awt.List list)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified List.


createMenu

protected java.awt.peer.MenuPeer createMenu(java.awt.Menu m)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified Menu.


createMenuBar

protected java.awt.peer.MenuBarPeer createMenuBar(java.awt.MenuBar mb)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified MenuBar.


createMenuItem

protected java.awt.peer.MenuItemPeer createMenuItem(java.awt.MenuItem mi)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified MenuItem.


createPanel

protected java.awt.peer.PanelPeer createPanel(java.awt.Panel p)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified Panel.


createPopupMenu

protected java.awt.peer.PopupMenuPeer createPopupMenu(java.awt.PopupMenu target)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified PopupMenu.


createScrollPane

protected java.awt.peer.ScrollPanePeer createScrollPane(java.awt.ScrollPane sp)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified ScrollPane.


createScrollbar

protected java.awt.peer.ScrollbarPeer createScrollbar(java.awt.Scrollbar sb)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified Scrollbar.


createTextArea

protected java.awt.peer.TextAreaPeer createTextArea(java.awt.TextArea ta)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified TextArea.


createTextField

protected java.awt.peer.TextFieldPeer createTextField(java.awt.TextField tf)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified TextField.


createWindow

protected java.awt.peer.WindowPeer createWindow(java.awt.Window w)
Description copied from class: java.awt.Toolkit
Creates a peer object for the specified Window.


createEmbeddedWindow

public gnu.java.awt.peer.EmbeddedWindowPeer createEmbeddedWindow(gnu.java.awt.EmbeddedWindow w)
Description copied from class: gnu.java.awt.ClasspathToolkit
Creates an embedded window peer, and associates it with an EmbeddedWindow object.


getFontPeer

protected java.awt.peer.FontPeer getFontPeer(java.lang.String name,
                                             int style)
Deprecated. part of the older "logical font" system in earlier AWT implementations. Our newer Font class uses getClasspathFontPeer.

Description copied from class: java.awt.Toolkit
Creates a peer object for the specified font name.


getFontPeer

private java.awt.peer.FontPeer getFontPeer(java.lang.String name,
                                           int style,
                                           int size)
Private method that allows size to be set at initialization time.


getClasspathFontPeer

public gnu.java.awt.peer.ClasspathFontPeer getClasspathFontPeer(java.lang.String name,
                                                                java.util.Map attrs)
Newer method to produce a peer for a Font object, even though Sun's design claims Font should now be peerless, we do not agree with this model, hence "ClasspathFontPeer".


getClasspathTextLayoutPeer

public gnu.java.awt.peer.ClasspathTextLayoutPeer getClasspathTextLayoutPeer(java.text.AttributedString str,
                                                                            java.awt.font.FontRenderContext frc)

getSystemEventQueueImpl

protected java.awt.EventQueue getSystemEventQueueImpl()
Description copied from class: java.awt.Toolkit
Returns the event queue that is suitable for the calling context.

Despite the word “System” in the name of this method, a toolkit may provide different event queues for each applet. There is no guarantee that the same queue is shared system-wide.

No security checks are performed, which is why this method may only be called by Toolkits.


createCustomCursor

public java.awt.Cursor createCustomCursor(java.awt.Image image,
                                          java.awt.Point hotspot,
                                          java.lang.String name)
Description copied from class: java.awt.Toolkit
Creates a new custom cursor object.


loadSystemColors

protected void loadSystemColors(int[] systemColors)
Description copied from class: java.awt.Toolkit
Copies the current system colors into the specified array. This is the interface used by the SystemColor class. Although this method fills in the array with some default colors a real Toolkit should override this method and provide real system colors for the native GUI platform.


createDragSourceContextPeer

public java.awt.dnd.peer.DragSourceContextPeer createDragSourceContextPeer(java.awt.dnd.DragGestureEvent e)

mapInputMethodHighlight

public java.util.Map mapInputMethodHighlight(java.awt.im.InputMethodHighlight highlight)

getBounds

public java.awt.Rectangle getBounds()

getLocalGraphicsEnvironment

public java.awt.GraphicsEnvironment getLocalGraphicsEnvironment()
Description copied from class: gnu.java.awt.ClasspathToolkit
Returns a shared instance of the local, platform-specific graphics environment.

This method is specific to GNU Classpath. It gets called by the Classpath implementation of GraphicsEnvironment.getLocalGraphcisEnvironment().


createFont

public java.awt.Font createFont(int format,
                                java.io.InputStream stream)
Description copied from class: gnu.java.awt.ClasspathToolkit
Creates a font, reading the glyph definitions from a stream.

This method provides the platform-specific implementation for the static factory method Font.createFont(int, java.io.InputStream)>Font.createFont(int, java.io.InputStream) 55 .


createRobot

public java.awt.peer.RobotPeer createRobot(java.awt.GraphicsDevice screen)
                                    throws java.awt.AWTException

registerImageIOSpis

public void registerImageIOSpis(javax.imageio.spi.IIORegistry reg)
Description copied from class: gnu.java.awt.ClasspathToolkit
Used to register ImageIO SPIs provided by the toolkit.


gtkMain

public static void gtkMain()