本文整理匯總了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();
}
}
示例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);
}
示例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();
}
示例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);
}
示例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);
});
}
示例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();
}
});
}
示例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();
}
});
}
示例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();
}
示例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();
}
}
示例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);
}
示例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 );
}
}
示例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;
}