當前位置: 首頁>>代碼示例>>Java>>正文


Java Application.setAboutHandler方法代碼示例

本文整理匯總了Java中com.apple.eawt.Application.setAboutHandler方法的典型用法代碼示例。如果您正苦於以下問題:Java Application.setAboutHandler方法的具體用法?Java Application.setAboutHandler怎麽用?Java Application.setAboutHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.apple.eawt.Application的用法示例。


在下文中一共展示了Application.setAboutHandler方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: integrate

import com.apple.eawt.Application; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
public static void integrate()
{
	try
	{
		Application appleEawtApplication = Application.getApplication();
		appleEawtApplication.setDockIconImage(ImageIO.read(new URL(JavaFxHelper.buildResourcePath("icon.png"))));
		appleEawtApplication.setEnabledAboutMenu(false);
		appleEawtApplication.setAboutHandler(null);
		appleEawtApplication.setEnabledPreferencesMenu(false);
		appleEawtApplication.setPreferencesHandler(null);
	}
	catch (Throwable e)
	{
		e.printStackTrace();
	}
}
 
開發者ID:PolyphasicDevTeam,項目名稱:NoMoreOversleeps,代碼行數:18,代碼來源:AppleHelper.java

示例2: main

import com.apple.eawt.Application; //導入方法依賴的package包/類
public static void main(String[] args) {
    System.setProperty("apple.laf.useScreenMenuBar", "true");
    System.setProperty("apple.awt.application.name", "Lambda");

    InputStream imgStream = Main.class.getResourceAsStream("logo.png");
    BufferedImage myImg = null;
    try {
        myImg = ImageIO.read(imgStream);
    } catch (IOException e) {
        System.out.println("Image not found");
    }

    JFrame app = new LambdaInterpreterGUI();

    Application macApp = Application.getApplication();
    macApp.setAboutHandler(aboutEvent -> JOptionPane.showMessageDialog(app, "Lambda Intrepeter By AUBRY DUBOIS POIVEY SCHERSACH", "About us", JOptionPane.PLAIN_MESSAGE));

    macApp.setDockIconImage(myImg);
    app.setIconImage(myImg);
    app.setVisible(true);
}
 
開發者ID:Tirke,項目名稱:Lambda-Interpreter,代碼行數:22,代碼來源:Main.java

示例3: install

import com.apple.eawt.Application; //導入方法依賴的package包/類
static void install() {
    try {
        Application app = Application.getApplication();
        NbApplicationAdapterJDK8 al = new NbApplicationAdapterJDK8();

        app.setAboutHandler(al);
        app.setOpenFileHandler(al);
        app.setPreferencesHandler(al);
        app.setQuitHandler(al);
    } catch (Throwable ex) {
        ErrorManager.getDefault().notify(ErrorManager.WARNING, ex);
    } finally {
    }
    NbApplicationAdapter.install();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:NbApplicationAdapterJDK8.java

示例4: uninstall

import com.apple.eawt.Application; //導入方法依賴的package包/類
static void uninstall() {
    Application app = Application.getApplication();

    app.setAboutHandler(null);
    app.setOpenFileHandler(null);
    app.setPreferencesHandler(null);
    app.setQuitHandler(null);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:NbApplicationAdapterJDK8.java

示例5: initMac

import com.apple.eawt.Application; //導入方法依賴的package包/類
private void initMac() {
    Application macApplication = Application.getApplication();
    macApplication.setAboutHandler((AppEvent.AboutEvent ae) -> {
        mActionManager.getAction(ActionManager.ABOUT).actionPerformed(null);
    });

    macApplication.setPreferencesHandler((AppEvent.PreferencesEvent pe) -> {
        mActionManager.getAction(ActionManager.OPTIONS).actionPerformed(null);
    });
}
 
開發者ID:trixon,項目名稱:java-mapollage,代碼行數:11,代碼來源:MainFrame.java

示例6: OSXSetup

import com.apple.eawt.Application; //導入方法依賴的package包/類
public void OSXSetup() {
	Application app = Application.getApplication();

	app.setAboutHandler(new AboutHandler() {
		public void handleAbout(AboutEvent ae) {
			about();
		}
	});

	app.setPreferencesHandler(new PreferencesHandler() {
		public void handlePreferences(PreferencesEvent pe) {
			PreferencesDialog.showPreferences(frame);
			//EditPreferences editPreferences = new EditPreferences(frame, async);
			//editPreferences.preferences();
			tree.setExpandibleIcons(!IBioSimPreferences.INSTANCE.isPlusMinusIconsEnabled());
			if (sbolDocument != null) {
				sbolDocument.setDefaultURIprefix(SBOLEditorPreferences.INSTANCE.getUserInfo().getURI().toString());
			}
		}
	});

	app.setQuitHandler(new QuitHandler() {
		public void handleQuitRequestWith(QuitEvent event, QuitResponse response) {
			exit();
		}
	});
}
 
開發者ID:MyersResearchGroup,項目名稱:iBioSim,代碼行數:28,代碼來源:Gui.java

示例7: OpenCardsWrapper4MacOSX

import com.apple.eawt.Application; //導入方法依賴的package包/類
public OpenCardsWrapper4MacOSX() {
    // set some mac-specific properties
    System.setProperty("apple.awt.graphics.EnableQ2DX", "true");
    System.setProperty("apple.laf.useScreenMenuBar", "true");
    System.setProperty("com.apple.mrj.application.apple.menu.about.name", "OpenCards");

    oc = new OpenCards();

    MacAppHandler macAppHandler = new MacAppHandler(oc);

    // create an instance of the Mac Application class, so i can handle the
    // mac quit event with the Mac ApplicationAdapter
    Application macApplication = Application.getApplication();

    // need to enable the preferences option manually
    macApplication.setPreferencesHandler(macAppHandler);
    macApplication.setAboutHandler(macAppHandler);
    macApplication.setQuitHandler(macAppHandler);
    macApplication.setQuitStrategy(QuitStrategy.CLOSE_ALL_WINDOWS);
    macApplication.addAppEventListener(macAppHandler);

    // display the jframe
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            oc.setVisible(true);
            oc.doAfterSetup();
        }
    });
}
 
開發者ID:holgerbrandl,項目名稱:opencards,代碼行數:30,代碼來源:OpenCardsWrapper4MacOSX.java

示例8: setupUserInterfaceForOsx

import com.apple.eawt.Application; //導入方法依賴的package包/類
/**
 * Setup the UI for OS X
 */
private void setupUserInterfaceForOsx() {
    final Application application = Application.getApplication();
    application.disableSuddenTermination();
    application.setAboutHandler(aboutEvent -> showAboutDialog());
    application.setPreferencesHandler(preferencesEvent -> showSettingsDialog());
    application.setQuitHandler((quitEvent, quitResponse) -> {
        if (!beenden(false, false)) {
            quitResponse.cancelQuit();
        } else {
            quitResponse.performQuit();
        }
    });

    //setup the MediathekView Dock Icon
    try {
        final URL url = this.getClass().getResource("/mediathek/res/MediathekView.png");
        final BufferedImage appImage = ImageIO.read(url);
        application.setDockIconImage(appImage);
    } catch (IOException ex) {
        Log.errorLog(165623698, "OS X Application image could not be loaded");
    }

    //Remove all menu items which don´t need to be displayed due to OS X´s native menu support
    if (SystemInfo.isMacOSX()) {
        //Datei->Beenden
        jMenuDatei.remove(jSeparator2);
        jMenuDatei.remove(jMenuItemBeenden);
        //Datei->Einstellungen
        jMenuDatei.remove(jMenuItemEinstellungen);
    }

    setupOsxDockIconBadge();
}
 
開發者ID:mediathekview,項目名稱:MediathekView,代碼行數:37,代碼來源:MediathekGuiMac.java

示例9: App

import com.apple.eawt.Application; //導入方法依賴的package包/類
/** Creates a new {@link App}. */
protected App() {
	if (Platform.isMacintosh()) {
		Application app = Application.getApplication();
		app.setAboutHandler(AboutCommand.INSTANCE);
		app.setPreferencesHandler(PreferencesCommand.INSTANCE);
		app.setOpenFileHandler(OpenCommand.INSTANCE);
		app.setPrintFileHandler(PrintCommand.INSTANCE);
		app.setQuitHandler(QuitCommand.INSTANCE);
		app.setQuitStrategy(QuitStrategy.SYSTEM_EXIT_0);
		app.disableSuddenTermination();
	}
}
 
開發者ID:Ayutac,項目名稱:toolkit,代碼行數:14,代碼來源:App.java

示例10: MacOSAppEventDispatcher

import com.apple.eawt.Application; //導入方法依賴的package包/類
public MacOSAppEventDispatcher(final Application app,
	final EventService eventService)
{
	this.eventService = eventService;
	app.setAboutHandler(this);
	app.setPreferencesHandler(this);
	app.setPrintFileHandler(this);
	app.setQuitHandler(this);
	app.addAppEventListener(this);
	app.setOpenFileHandler(this);
}
 
開發者ID:scijava,項目名稱:scijava-plugins-platforms,代碼行數:12,代碼來源:MacOSAppEventDispatcher.java

示例11: main

import com.apple.eawt.Application; //導入方法依賴的package包/類
public static void main( String[] args )
{
    try {
        // These four lines duplicate ApplicationUI.main()
        String prop = System .getProperty( "user.dir" );
        File workingDir = new File( prop );
        URL codebase = workingDir .toURI() .toURL();
        final ApplicationUI ui = ApplicationUI .initialize( args, codebase );
        
        // Now hook it up to the Finder events
        Application appl = Application .getApplication();
        
        appl .setOpenFileHandler( new OpenFilesHandler()
        {
            public void openFiles( OpenFilesEvent ofe )
            {
                for (Iterator iterator = ofe .getFiles() .iterator(); iterator.hasNext(); ) {
                    File file = (File) iterator.next();
                    ui .openFile( file );
                }
            }
        } );
        
        appl .setAboutHandler( new AboutHandler()
        {
            public void handleAbout( AboutEvent about )
            {
                ui .about();
            }
        } );
        
        appl .setQuitHandler( new QuitHandler()
        {
            public void handleQuitRequestWith( QuitEvent qe, QuitResponse qr )
            {
                if ( ui .quit() )
                    qr .performQuit();
                else
                    qr .cancelQuit();
                    
            }
        } );    

    } catch ( Throwable e ) {
        Logger .getLogger( "com.vzome.platform.mac.Adapter" )
            .log( Level.SEVERE, "problem in main()", e );
    }
}
 
開發者ID:vZome,項目名稱:vzome-desktop,代碼行數:49,代碼來源:Adapter.java

示例12: doInstallAboutHandler

import com.apple.eawt.Application; //導入方法依賴的package包/類
/**
 * When the user requests to view the About screen, invokes the specified
 * handler on the event dispatch thread.
 *
 * @param aboutHandler The handler to invoke.
 * @return <code>true</code> if the handler was successfully installed;
 *     <code>false</code> if the Apple Java extensions cannot be found or
 *     are too old.
 */
protected boolean doInstallAboutHandler(final MacUtils.AboutHandler aboutHandler) {
    Application application = Application.getApplication();
    application.setAboutHandler(aboutEvent -> AwtUtils.doLaterOnEventThread(aboutHandler::aboutRequested));
    return true;
}
 
開發者ID:Captain-Chaos,項目名稱:WorldPainter,代碼行數:15,代碼來源:MacUtilsJava8.java


注:本文中的com.apple.eawt.Application.setAboutHandler方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。