Package ptolemy.gui
Class MacOSXAdapter
- java.lang.Object
-
- ptolemy.gui.MacOSXAdapter
-
- All Implemented Interfaces:
java.lang.reflect.InvocationHandler
public class MacOSXAdapter extends java.lang.Object implements java.lang.reflect.InvocationHandler
Support for Mac OS X specific features such as key bindings. There is no public constructor. Instead, call stati set*Method() methods.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Christopher Brooks, Based on OSXAdapter.java, downloaded from: http://developer.apple.com/library/mac/#samplecode/OSXAdapter/Listings/src_OSXAdapter_java.html on July 26, 2011.
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
Invoke a method.static void
setAboutMethod(Top top, java.lang.reflect.Method aboutMethod)
Set the about menu handler for a Top window.static void
setQuitMethod(Top top, java.lang.reflect.Method quitMethod)
Set the quit handler (Command-q) for a Top window.
-
-
-
Method Detail
-
invoke
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
Invoke a method. This method is part of the java.lang.reflect.InvocationHandler interface.- Specified by:
invoke
in interfacejava.lang.reflect.InvocationHandler
- Parameters:
proxy
- The object upon which the method is invoked.method
- The method to be invoked.args
- The arguments to the method, which must be non-null.- Returns:
- the result, which in this case is always null because the com.apple.eawt.ApplicationListener methods are all void.
- Throws:
java.lang.Throwable
- If the method does not exist or is not accessible or if thrown while invoking the method.
-
setAboutMethod
public static void setAboutMethod(Top top, java.lang.reflect.Method aboutMethod)
Set the about menu handler for a Top window. Under Mac OS X, the About menu may be selected from the application menu, which is in the upper left, next to the apple.- Parameters:
top
- the Top level window to perform the operation.aboutMethod
- The method to invoke in Top, typicallyTop.about()
.
-
setQuitMethod
public static void setQuitMethod(Top top, java.lang.reflect.Method quitMethod)
Set the quit handler (Command-q) for a Top window.- Parameters:
top
- the Top level window to perform the operation.quitMethod
- The method to invoke in Top, typicallyTop.exit()
.
-
-