• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ClasspathToolkit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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 ());
}
 
开发者ID:vilie,项目名称:javify,代码行数:25,代码来源:Robot.java


示例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();
}
 
开发者ID:vilie,项目名称:javify,代码行数:17,代码来源:IIORegistry.java


示例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);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:21,代码来源:CairoGraphics2D.java


示例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 ());
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:25,代码来源:Robot.java


示例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();
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:17,代码来源:IIORegistry.java


示例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);
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:21,代码来源:CairoGraphics2D.java


示例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);
    }
}
 
开发者ID:julianwi,项目名称:awtonandroid,代码行数:21,代码来源:CairoGraphics2D.java


示例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();
}
 
开发者ID:vilie,项目名称:javify,代码行数:15,代码来源:MouseInfo.java


示例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;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:40,代码来源:GraphicsEnvironment.java


示例10: tk

import gnu.java.awt.ClasspathToolkit; //导入依赖的package包/类
static ClasspathToolkit tk()
{
  return (ClasspathToolkit) Toolkit.getDefaultToolkit();
}
 
开发者ID:vilie,项目名称:javify,代码行数:5,代码来源:Font.java


示例11: tk

import gnu.java.awt.ClasspathToolkit; //导入依赖的package包/类
protected static ClasspathToolkit tk()
{
  return (ClasspathToolkit)(Toolkit.getDefaultToolkit ());
}
 
开发者ID:vilie,项目名称:javify,代码行数:5,代码来源:ClasspathFontPeer.java



注:本文中的gnu.java.awt.ClasspathToolkit类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java InternalTimer类代码示例发布时间:2022-05-22
下一篇:
Java WebSSOProfileConsumerImpl类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap