当前位置: 首页>>代码示例>>Java>>正文


Java DefaultApplication类代码示例

本文整理汇总了Java中org.simplericity.macify.eawt.DefaultApplication的典型用法代码示例。如果您正苦于以下问题:Java DefaultApplication类的具体用法?Java DefaultApplication怎么用?Java DefaultApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DefaultApplication类属于org.simplericity.macify.eawt包,在下文中一共展示了DefaultApplication类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import org.simplericity.macify.eawt.DefaultApplication; //导入依赖的package包/类
public void init() {
    final Application app = new DefaultApplication();

    if (!app.isMac()) {
        logger.debug("Omitting Mac OS initialization, since operating system is not Mac OS");
        return;
    }

    System.setProperty("apple.laf.useScreenMenuBar", "true");

    app.addAboutMenuItem();
    app.setEnabledAboutMenu(true);
    app.addPreferencesMenuItem();
    app.setEnabledPreferencesMenu(true);
    app.addApplicationListener(new DCApplicationListener());
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:17,代码来源:MacOSManager.java

示例2: initAppleExtensions

import org.simplericity.macify.eawt.DefaultApplication; //导入依赖的package包/类
private void initAppleExtensions(Properties settings) throws Exception {


        Application application = new DefaultApplication();

        if (application.isMac()) {
            application.addApplicationListener(this);

            InputStream imageStream = getClass().getClassLoader().getResourceAsStream("META-INF/jettyconsole/background-image.jpg");
            if (imageStream != null) {

                BufferedImage image = ImageIO.read(imageStream);
                BufferedImage icon = new BufferedImage(128, 128, BufferedImage.TYPE_INT_ARGB);

                float imageRatio = (float) image.getWidth() / image.getHeight();

                int width = imageRatio > 1 ? (int) (icon.getWidth() * imageRatio) : icon.getWidth();
                int height = imageRatio < 1 ? (int) (icon.getHeight() / imageRatio) : icon.getHeight();
                int x = icon.getWidth() / 2 - width / 2;
                int y = icon.getHeight() / 2 - height / 2;

                Graphics2D g2 = (Graphics2D) icon.getGraphics();

                g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                RoundRectangle2D.Double rect = new RoundRectangle2D.Double(1, 1, 126, 126, 50, 50);

                g2.setClip(rect);
                g2.drawImage(image, x, y, width, height, null);
                g2.setClip(0, 0, icon.getWidth(), icon.getHeight());
                g2.setColor(Color.DARK_GRAY);
                g2.draw(rect);
                g2.dispose();
                icon.flush();
                application.setApplicationIconImage(icon);
            }

        }
    }
 
开发者ID:eirbjo,项目名称:jetty-console,代码行数:39,代码来源:JettyConsoleStarter.java

示例3: doMacOSXIntegration

import org.simplericity.macify.eawt.DefaultApplication; //导入依赖的package包/类
protected static void doMacOSXIntegration()
{
	Application a = new DefaultApplication();
	a.addApplicationListener(new Launch());
	a.addPreferencesMenuItem();
	a.addAboutMenuItem();
}
 
开发者ID:JackJiang2011,项目名称:DroidUIBuilder,代码行数:8,代码来源:Launch.java


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