本文整理汇总了Java中gnu.java.awt.ClasspathToolkit类的典型用法代码示例。如果您正苦于以下问题:Java ClasspathToolkit类的具体用法?Java ClasspathToolkit怎么用?Java ClasspathToolkit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClasspathToolkit类属于gnu.java.awt包,在下文中一共展示了ClasspathToolkit类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Robot
import gnu.java.awt.ClasspathToolkit; //导入依赖的package包/类
/**
* Construct a Robot object that operates on the default screen.
*
* @exception AWTException if GraphicsEnvironment.isHeadless()
* returns true or if the X server does not support the XTest
* extension
* @exception SecurityException if createRobot permission is not
* granted
*/
public Robot () throws AWTException
{
if (GraphicsEnvironment.isHeadless ())
throw new AWTException ("Robot: headless graphics environment");
SecurityManager sm = System.getSecurityManager ();
if (sm != null)
sm.checkPermission (new AWTPermission ("createRobot"));
ClasspathToolkit tk = (ClasspathToolkit) Toolkit.getDefaultToolkit ();
// createRobot will throw AWTException if XTest is not supported.
peer = tk.createRobot (GraphicsEnvironment.getLocalGraphicsEnvironment ()
.getDefaultScreenDevice ());
}
示例2: IIORegistry
import gnu.java.awt.ClasspathToolkit; //导入依赖的package包/类
private IIORegistry()
{
super(defaultCategories.iterator());
// XXX: Register built-in Spis here.
registerServiceProvider(new PNGImageReaderSpi()); // Register PNG decoder.
registerServiceProvider(new GIFImageReaderSpi()); // Register GIF decoder.
registerServiceProvider(new BMPImageReaderSpi());
registerServiceProvider(new BMPImageWriterSpi());
Toolkit toolkit = Toolkit.getDefaultToolkit();
if (toolkit instanceof ClasspathToolkit)
((ClasspathToolkit)toolkit).registerImageIOSpis(this);
registerApplicationClasspathSpis();
}
示例3: setFont
import gnu.java.awt.ClasspathToolkit; //导入依赖的package包/类
public void setFont(Font f)
{
// Sun's JDK does not throw NPEs, instead it leaves the current setting
// unchanged. So do we.
if (f == null)
return;
if (f.getPeer() instanceof GdkFontPeer)
font = f;
else
font =
((ClasspathToolkit)(Toolkit.getDefaultToolkit()))
.getFont(f.getName(), f.getAttributes());
GdkFontPeer fontpeer = (GdkFontPeer) getFont().getPeer();
synchronized (fontpeer)
{
cairoSetFont(nativePointer, fontpeer);
}
}
示例4: Robot
import gnu.java.awt.ClasspathToolkit; //导入依赖的package包/类
/**
* Construct a Robot object that operates on the default screen.
*
* @exception AWTException if GraphicsEnvironment.isHeadless()
* returns true or if the X server does not support the XTest
* extension
* @exception SecurityException if createRobot permission is not
* granted
*/
public Robot () throws AWTException
{
if (GraphicsEnvironment.isHeadless ())
throw new AWTException ("Robot: headless graphics environment");
SecurityManager sm = System.getSecurityManager ();
if (sm != null)
sm.checkPermission (new AWTPermission ("createRobot"));
ClasspathToolkit tk = (ClasspathToolkit) Toolkit.getDefaultToolkit ();
// createRobot will throw AWTException if XTest is not supported.
peer = tk.createRobot (GraphicsEnvironment.getLocalGraphicsEnvironment ()
.getDefaultScreenDevice ());
}
示例5: IIORegistry
import gnu.java.awt.ClasspathToolkit; //导入依赖的package包/类
private IIORegistry()
{
super(defaultCategories.iterator());
// XXX: Register built-in Spis here.
registerServiceProvider(new PNGImageReaderSpi()); // Register PNG decoder.
registerServiceProvider(new GIFImageReaderSpi()); // Register GIF decoder.
registerServiceProvider(new BMPImageReaderSpi());
registerServiceProvider(new BMPImageWriterSpi());
Toolkit toolkit = Toolkit.getDefaultToolkit();
if (toolkit instanceof ClasspathToolkit)
((ClasspathToolkit)toolkit).registerImageIOSpis(this);
registerApplicationClasspathSpis();
}
示例6: setFont
import gnu.java.awt.ClasspathToolkit; //导入依赖的package包/类
public void setFont(Font f)
{
// Sun's JDK does not throw NPEs, instead it leaves the current setting
// unchanged. So do we.
if (f == null)
return;
if (f.getPeer() instanceof GdkFontPeer)
font = f;
else
font =
((ClasspathToolkit)(Toolkit.getDefaultToolkit()))
.getFont(f.getName(), f.getAttributes());
GdkFontPeer fontpeer = (GdkFontPeer) getFont().getPeer();
synchronized (fontpeer)
{
cairoSetFont(nativePointer, fontpeer);
}
}
示例7: setFont
import gnu.java.awt.ClasspathToolkit; //导入依赖的package包/类
public void setFont(Font f)
{
// Sun's JDK does not throw NPEs, instead it leaves the current setting
// unchanged. So do we.
if (f == null)
return;
if (f.getPeer() instanceof FreetypeFontPeer)
font = f;
else
font =
((ClasspathToolkit)(Toolkit.getDefaultToolkit()))
.getFont(f.getName(), f.getAttributes());
FreetypeFontPeer fontpeer = (FreetypeFontPeer) getFont().getPeer();
synchronized (fontpeer)
{
cairoSetFont(nativePointer, fontpeer);
}
}
示例8: getNumberOfButtons
import gnu.java.awt.ClasspathToolkit; //导入依赖的package包/类
/**
* Returns the number of mouse buttons, or -1 if no mouse is connected.
* (mentioned in the 1.5 release notes)
*
* @throws HeadlessException if the current GraphicsEnvironment is headless.
* @return an integer number of buttons.
*/
public static int getNumberOfButtons() throws HeadlessException
{
if( GraphicsEnvironment.isHeadless() )
throw new HeadlessException();
return ((ClasspathToolkit)Toolkit.getDefaultToolkit()).
getMouseNumberOfButtons();
}
示例9: getLocalGraphicsEnvironment
import gnu.java.awt.ClasspathToolkit; //导入依赖的package包/类
/**
* Returns the local graphics environment. If the java.awt.graphicsenv
* system property is set, it instantiates the specified class,
* otherwise it assume that the awt toolkit is a ClasspathToolkit
* and delegates to it to create the instance.
*
* @return the local environment
*/
public static GraphicsEnvironment getLocalGraphicsEnvironment()
{
if (localGraphicsEnvironment != null)
return localGraphicsEnvironment;
String graphicsenv = SystemProperties.getProperty("java.awt.graphicsenv",
null);
if (graphicsenv != null)
{
try
{
// We intentionally use the bootstrap class loader.
localGraphicsEnvironment = (GraphicsEnvironment)
Class.forName(graphicsenv).newInstance();
return localGraphicsEnvironment;
}
catch (Exception x)
{
throw (InternalError)
new InternalError("Unable to instantiate java.awt.graphicsenv")
.initCause(x);
}
}
else
{
ClasspathToolkit tk;
tk = ((ClasspathToolkit) Toolkit.getDefaultToolkit());
localGraphicsEnvironment = tk.getLocalGraphicsEnvironment();
return localGraphicsEnvironment;
}
}
示例10: tk
import gnu.java.awt.ClasspathToolkit; //导入依赖的package包/类
static ClasspathToolkit tk()
{
return (ClasspathToolkit) Toolkit.getDefaultToolkit();
}
示例11: tk
import gnu.java.awt.ClasspathToolkit; //导入依赖的package包/类
protected static ClasspathToolkit tk()
{
return (ClasspathToolkit)(Toolkit.getDefaultToolkit ());
}