Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
java.awt.Toolkit
gnu.java.awt.ClasspathToolkit
gnu.awt.xlib.XToolkit
public class XToolkit
extends ClasspathToolkit
Field Summary |
Fields inherited from class java.awt.Toolkit | |
desktopProperties , desktopPropsSupport |
Constructor Summary | |
|
Method Summary | |
void |
|
int |
|
protected ButtonPeer |
|
protected CanvasPeer |
|
protected CheckboxPeer |
|
protected CheckboxMenuItemPeer |
|
protected ChoicePeer |
|
protected DialogPeer |
|
DragGestureRecognizer |
|
DragSourceContextPeer | |
EmbeddedWindowPeer |
|
protected FileDialogPeer |
|
Font |
|
protected FramePeer |
|
Image |
|
Image |
|
Image |
|
Image |
|
protected LabelPeer |
|
protected ListPeer |
|
protected MenuPeer |
|
protected MenuBarPeer |
|
protected MenuItemPeer |
|
protected PanelPeer |
|
protected PopupMenuPeer |
|
RobotPeer |
|
protected ScrollPanePeer |
|
protected ScrollbarPeer |
|
protected TextAreaPeer |
|
protected TextFieldPeer |
|
protected WindowPeer |
|
void | |
ClasspathFontPeer |
|
ClasspathTextLayoutPeer | |
ColorModel |
|
String[] |
|
FontMetrics |
|
protected FontPeer |
|
Image | |
Image | |
GraphicsEnvironment |
|
PrintJob |
|
int |
|
Dimension |
|
Clipboard |
|
protected EventQueue |
|
void |
|
Map |
|
boolean | |
boolean |
|
void |
|
void |
Methods inherited from class gnu.java.awt.ClasspathToolkit | |
createEmbeddedWindow , createFont , createRobot , getClasspathFontPeer , getClasspathTextLayoutPeer , getFont , getLocalGraphicsEnvironment , registerImageIOSpis |
Methods inherited from class java.lang.Object | |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
public int checkImage(Image image, int width, int height, ImageObserver observer)
Checks the status of specified image as it is being readied for rendering.
- Overrides:
- checkImage in interface Toolkit
- Parameters:
image
- The image to prepare for rendering.width
- The width of the image.height
- The height of the image.observer
- The observer to receive events about the preparation process.
- Returns:
- A union of the bitmasks from
java.awt.image.ImageObserver
that indicates the current state of the imaging readying process.
protected ButtonPeer createButton(Button frontend)
Creates a peer object for the specifiedButton
.
- Overrides:
- createButton in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
Button
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
protected CanvasPeer createCanvas(Canvas frontend)
Creates a peer object for the specifiedCanvas
.
- Overrides:
- createCanvas in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
Canvas
object.
protected CheckboxPeer createCheckbox(Checkbox frontend)
Creates a peer object for the specifiedCheckbox
.
- Overrides:
- createCheckbox in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
Checkbox
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
protected CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem frontend)
Creates a peer object for the specifiedCheckboxMenuItem
.
- Overrides:
- createCheckboxMenuItem in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
CheckboxMenuItem
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
protected ChoicePeer createChoice(Choice frontend)
Creates a peer object for the specifiedChoice
.
- Overrides:
- createChoice in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
Choice
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
protected DialogPeer createDialog(Dialog frontend)
Creates a peer object for the specifiedDialog
.
- Overrides:
- createDialog in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified font name.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
public DragGestureRecognizer createDragGestureRecognizer(Class abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl)
- Overrides:
- createDragGestureRecognizer in interface Toolkit
- Since:
- 1.3
public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException
- Overrides:
- createDragSourceContextPeer in interface Toolkit
- Since:
- 1.3
public EmbeddedWindowPeer createEmbeddedWindow(EmbeddedWindow w)
Creates an embedded window peer, and associates it with an EmbeddedWindow object.
- Overrides:
- createEmbeddedWindow in interface ClasspathToolkit
- Parameters:
w
- The embedded window with which to associate a peer.
protected FileDialogPeer createFileDialog(FileDialog frontend)
Creates a peer object for the specifiedFileDialog
.
- Overrides:
- createFileDialog in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
FileDialog
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
public Font createFont(int format, InputStream stream)
Creates a font, reading the glyph definitions from a stream. This method provides the platform-specific implementation for the static factory methodFont.createFont(int,InputStream)
.
- Overrides:
- createFont in interface ClasspathToolkit
- Parameters:
format
- the format of the font data, such asFont.TRUETYPE_FONT
. An implementation may ignore this argument if it is able to automatically recognize the font format from the provided data.stream
- an input stream from where the font data is read in. The stream will be advanced to the position after the font data, but not closed.
- Throws:
IllegalArgumentException
- ifformat
is not supported.
protected FramePeer createFrame(Frame frontend)
Creates a peer object for the specifiedFrame
.
- Overrides:
- createFrame in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
Frame
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
public Image createImage(byte[] imagedata, int imageoffset, int imagelength)
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.
- Overrides:
- createImage in interface Toolkit
- Parameters:
- Returns:
- The created image.
public Image createImage(ImageProducer producer)
Creates an image using the specifiedImageProducer
- Overrides:
- createImage in interface Toolkit
- Parameters:
producer
- TheImageProducer
to create the image from.
- Returns:
- The created image.
protected LabelPeer createLabel(Label frontend)
Creates a peer object for the specifiedLabel
.
- Overrides:
- createLabel in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
Label
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
protected ListPeer createList(List frontend)
Creates a peer object for the specifiedList
.
- Overrides:
- createList in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
List
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
protected MenuPeer createMenu(Menu frontend)
Creates a peer object for the specifiedMenu
.
- Overrides:
- createMenu in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
Menu
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
protected MenuBarPeer createMenuBar(MenuBar frontend)
Creates a peer object for the specifiedMenuBar
.
- Overrides:
- createMenuBar in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
MenuBar
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
protected MenuItemPeer createMenuItem(MenuItem frontend)
Creates a peer object for the specifiedMenuItem
.
- Overrides:
- createMenuItem in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
MenuItem
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
protected PanelPeer createPanel(Panel frontend)
Creates a peer object for the specifiedPanel
.
- Overrides:
- createPanel in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
Panel
object.
protected PopupMenuPeer createPopupMenu(PopupMenu frontend)
Creates a peer object for the specifiedPopupMenu
.
- Overrides:
- createPopupMenu in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
PopupMenu
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
public RobotPeer createRobot(GraphicsDevice screen) throws AWTException
- Overrides:
- createRobot in interface ClasspathToolkit
protected ScrollPanePeer createScrollPane(ScrollPane frontend)
Creates a peer object for the specifiedScrollPane
.
- Overrides:
- createScrollPane in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
ScrollPane
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
protected ScrollbarPeer createScrollbar(Scrollbar frontend)
Creates a peer object for the specifiedScrollbar
.
- Overrides:
- createScrollbar in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
Scrollbar
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
protected TextAreaPeer createTextArea(TextArea frontend)
Creates a peer object for the specifiedTextArea
.
- Overrides:
- createTextArea in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
TextArea
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
protected TextFieldPeer createTextField(TextField frontend)
Creates a peer object for the specifiedTextField
.
- Overrides:
- createTextField in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
TextField
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
protected WindowPeer createWindow(Window frontend)
Creates a peer object for the specifiedWindow
.
- Overrides:
- createWindow in interface Toolkit
- Parameters:
- Returns:
- The peer for the specified
Window
object.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
public ClasspathFontPeer getClasspathFontPeer(String name, Map attrs)
Acquires an appropriateClasspathFontPeer
, for use in classpath's implementation ofFont
.
- Overrides:
- getClasspathFontPeer in interface ClasspathToolkit
- Parameters:
name
- The logical name of the font. This may be either a face name or a logical font name, or may even be null. A default implementation of name decoding is provided inClasspathFontPeer
, but may be overridden in other toolkits.attrs
- Any extraTextAttribute
attributes this font peer should have, such as size, weight, family name, or transformation.
public ClasspathTextLayoutPeer getClasspathTextLayoutPeer(AttributedString str, FontRenderContext frc)
- Overrides:
- getClasspathTextLayoutPeer in interface ClasspathToolkit
public ColorModel getColorModel()
Returns the color model of the screen.
- Overrides:
- getColorModel in interface Toolkit
- Returns:
- The color model of the screen.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
public String[] getFontList()
Deprecated.
Returns the names of the available fonts.
- Overrides:
- getFontList in interface Toolkit
- Returns:
- The names of the available fonts.
public FontMetrics getFontMetrics(Font font)
Deprecated.
Return the font metrics for the specified font
- Overrides:
- getFontMetrics in interface Toolkit
- Parameters:
- Returns:
- The requested font metrics.
protected FontPeer getFontPeer(String name, int style)
Deprecated.
Creates a peer object for the specified font name.
- Overrides:
- getFontPeer in interface Toolkit
- Parameters:
name
- The font to create the peer for.style
- The font style to create the peer for.
- Returns:
- The peer for the specified font name.
public Image getImage(String filename)
Returns an image from the specified file, which must be in a recognized format. Supported formats vary from toolkit to toolkit.
- Returns:
- name The name of the file to read the image from.
public Image getImage(URL url)
Returns an image from the specified URL, which must be in a recognized format. Supported formats vary from toolkit to toolkit.
- Returns:
- url The URl to read the image from.
public GraphicsEnvironment getLocalGraphicsEnvironment()
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 ofGraphicsEnvironment.getLocalGraphcisEnvironment()
.
- Overrides:
- getLocalGraphicsEnvironment in interface ClasspathToolkit
public PrintJob getPrintJob(Frame frame, String title, Properties props)
Returns a instance ofPrintJob
for the specified arguments.
- Overrides:
- getPrintJob in interface Toolkit
- Parameters:
frame
- The window initiating the print job.title
- The print job title.props
- The print job properties.
- Returns:
- The requested print job, or
null
if the job was cancelled.
- Throws:
NullPointerException
- If frame is null, or GraphicsEnvironment.isHeadless() returns true.SecurityException
- If this thread is not allowed to initiate a print job request.
public int getScreenResolution()
Returns the screen resolution in dots per square inch.
- Overrides:
- getScreenResolution in interface Toolkit
- Returns:
- The screen resolution in dots per square inch.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
public Dimension getScreenSize()
Returns the dimensions of the screen in pixels.
- Overrides:
- getScreenSize in interface Toolkit
- Returns:
- The dimensions of the screen in pixels.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
public Clipboard getSystemClipboard()
Returns the system clipboard.
- Overrides:
- getSystemClipboard in interface Toolkit
- Returns:
- THe system clipboard.
- Throws:
HeadlessException
- If GraphicsEnvironment.isHeadless() is true.
protected EventQueue getSystemEventQueueImpl()
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.
- Overrides:
- getSystemEventQueueImpl in interface Toolkit
- See Also:
Toolkit.getSystemEventQueue()
public void iterateNativeQueue(EventQueue locked, boolean block)
Checks the native event queue for events. If blocking, waits until an event is available before returning, unless interrupted by wakeNativeQueue. If non-blocking, returns immediately even if no event is available.
- Parameters:
locked
- The calling EventQueueblock
- If true, waits for a native event before returning
public Map mapInputMethodHighlight(InputMethodHighlight highlight)
- Overrides:
- mapInputMethodHighlight in interface Toolkit
- Since:
- 1.3
public boolean prepareImage(Image image, int width, int height, ImageObserver observer)
Readies an image to be rendered on the screen. The width and height values can be set to the default sizes for the image by passing -1 in those parameters.
- Overrides:
- prepareImage in interface Toolkit
- Parameters:
image
- The image to prepare for rendering.width
- The width of the image.height
- The height of the image.observer
- The observer to receive events about the preparation process.
- Returns:
true
if the image is already prepared for rendering,false
otherwise.
public void sync()
Flushes any buffered data to the screen so that it is in sync with what the AWT system has drawn to it.