satin.uishell
Class AApplication

java.lang.Object
  |
  +--satin.aro.AROobject
        |
        +--satin.aro.AROremoteObject
              |
              +--satin.core.AObject
                    |
                    +--satin.uishell.AApplication
Direct Known Subclasses:
MediaComposerApp

public class AApplication
extends AObject

Represents a C++ AApplication object in an ARO server. There can be at most one AApplication object in a given ARO server.

Author:
Ed Stauff

Fields inherited from class satin.aro.AROremoteObject
server
 
Fields inherited from class satin.aro.AROobject
id
 
Constructor Summary
  AApplication(AROremoteServer rs)
          Constructs an object representing the AApplication in the given ARO server.
protected AApplication(AROremoteServer rs, java.lang.String subrName)
          Constructs an object representing the subclassed AApplication in the given ARO server.
  AApplication(java.lang.String hostName, int port)
          Constructs an object representing the AApplication in the ARO server at the given host and port.
protected AApplication(java.lang.String hostName, int port, java.lang.String subrName)
          Constructs an object representing the subclassed AApplication in the ARO server at the given host and port.
 
Method Summary
void broadcastNickNum(int cmd)
          Tells the application to process a nicknum event.
void broadcastNickNum(int cmd, ModifierKey[] modKeys)
          Tells the application to process a nicknum event.
AWindow getActiveWindow()
          Returns the active window, or null if no window is active in the application.
boolean getDlogBatchMode()
          Gets "batch" mode for simple dialogs.
AWindow getWindow(java.lang.String title)
          Returns the window with the given title.
AWindow[] getWindows()
          Returns all the AWindow objects in the application.
void mouseDown()
          Tells the application to behave as if a mouse down event occurred at the current cursor position.
void mouseUp()
          Tells the application to behave as if a mouse up event occurred at the current cursor position.
void postMouseClickEvent()
          Posts a mouse click event (but doesn't wait for it to be processed).
void postMouseDownEvent()
          Posts a mouse down event (but doesn't wait for it to be processed) This does not correspond to any C++ method, but is a front-end to the Mac OS "PostEvent" call.
void postMouseUpEvent()
          Posts a mouse up event (but doesn't wait for it to be processed) This does not correspond to any C++ method, but is a front-end to the Mac OS "PostEvent" call.
void postNickNumEvent(int cmd)
          Posts a nicknum event (but doesn't wait for it to be processed).
void postNickNumEvent(int cmd, ModifierKey[] modKeys)
          Posts a nicknum event (but doesn't wait for it to be processed).
boolean setDlogBatchMode(boolean on)
          Sets "batch" mode for simple dialogs.
void setNextPopupMenuItemToSelect(int item)
          Set a popup menu item to be selected.
void setNextPopupMenuItemToSelect(java.lang.String item)
          Set a popup menu item to be selected.
AWindow waitForActiveWindow(java.lang.String title, double timeout)
          Waits for the window with the given title to become the active window.
boolean wasPopupMenuItemSelected()
          Returns whether the menu item was selected.
 
Methods inherited from class satin.core.AObject
className, isInstanceOf
 
Methods inherited from class satin.aro.AROremoteObject
equals, exists, getAROclassName
 
Methods inherited from class satin.aro.AROobject
getID, setID, toAROstring, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AApplication

public AApplication(AROremoteServer rs)
             throws java.io.IOException,
                    AROexception
Constructs an object representing the AApplication in the given ARO server. There can be only one AApplication object in an ARO server, so it need not be identified by the caller in any way. The AApplication object is obtained from the server by sending a "GetApplication" request.

Parameters:
rs
the remote server object.
Example of Usage
AROremoteServer s = new AROremoteServer("MyComputer", 12345);
AApplication a = new AApplication(s);

AApplication

public AApplication(java.lang.String hostName,
                    int port)
             throws java.io.IOException,
                    AROexception
Constructs an object representing the AApplication in the ARO server at the given host and port. This constructor instantiates an AROremoteServer object, and stores a reference to it in the server field. It then sends the server a "GetApplication" request to get the (one and only) AApplication object.

Parameters:
hostName
the name of the host system on which the ARO server is running.
port
the port number on which the ARO server is listening.

AApplication

protected AApplication(AROremoteServer rs,
                       java.lang.String subrName)
                throws java.io.IOException,
                       AROexception
Constructs an object representing the subclassed AApplication in the given ARO server. This constructor is provided for use by subclasses where the subclassed AApplication object must be obtained by using an ARO request that is different from the "GetApplication" used by other AApplication constructors.

Parameters:
rs
the remote server object.
subrName
name of an ARO global subroutine to call to get the application object. This subroutine must take no input parameters and return a single object output parameter.
Example of Usage
class MyApp extends AApplication
{
    public MyApp (AROremoteServer s)
    {
        super(s, "GetMyApp");
    }
    // ...
}

AApplication

protected AApplication(java.lang.String hostName,
                       int port,
                       java.lang.String subrName)
                throws java.io.IOException,
                       AROexception
Constructs an object representing the subclassed AApplication in the ARO server at the given host and port. This constructor instantiates an AROremoteServer object, and stores a reference to it in the server field. This constructor is provided for use by subclasses where the subclassed AApplication object must be obtained by using an ARO request that is different from the "GetApplication" used by other AApplication constructors.

Parameters:
hostName
the name of the host system on which the ARO server is running.
port
the port number on which the ARO server is listening.
subrName
name of an ARO global subroutine to call to get the application object. This subroutine must take no input parameters and return a single object output parameter.
Example of Usage
class MyApp extends AApplication
{
    public MyApp (String hostName, int port)
    {
        super(hostName, port, "GetMyApp");
    }
    // ...
}
Method Detail

getWindows

public AWindow[] getWindows()
                     throws java.io.IOException,
                            AROexception
Returns all the AWindow objects in the application. The windows are returned regardless of whether they are currently visible on the screen. This is a front-end to the C++ method of the same name.

Returns:
an array of AWindows.

getWindow

public AWindow getWindow(java.lang.String title)
                  throws java.io.IOException,
                         AROexception,
                         java.lang.Exception
Returns the window with the given title. If no window exists that the given title, null is returned. If more than one window exists with the given title, an exception is thrown.

Parameters:
title
the title of the desired window.

getActiveWindow

public AWindow getActiveWindow()
                        throws java.io.IOException,
                               AROexception,
                               java.lang.Exception
Returns the active window, or null if no window is active in the application. If more than one window is active, an exception is thrown.

waitForActiveWindow

public AWindow waitForActiveWindow(java.lang.String title,
                                   double timeout)
                            throws java.io.IOException,
                                   AROexception,
                                   java.lang.Exception
Waits for the window with the given title to become the active window. If the window doesn't become active within a given time limit, an exception is thrown.

Parameters:
title
the title of the window you're waiting for.
timeout
the maximum number of seconds you're willing to wait.
Returns:
the window you were waiting for.

postMouseClickEvent

public void postMouseClickEvent()
                         throws java.io.IOException,
                                AROexception
Posts a mouse click event (but doesn't wait for it to be processed). This does not correspond to any C++ method, but is a front-end to the Mac OS "PostEvent" call.

postMouseUpEvent

public void postMouseUpEvent()
                      throws java.io.IOException,
                             AROexception
Posts a mouse up event (but doesn't wait for it to be processed) This does not correspond to any C++ method, but is a front-end to the Mac OS "PostEvent" call.

postMouseDownEvent

public void postMouseDownEvent()
                        throws java.io.IOException,
                               AROexception
Posts a mouse down event (but doesn't wait for it to be processed) This does not correspond to any C++ method, but is a front-end to the Mac OS "PostEvent" call.

mouseDown

public void mouseDown()
               throws java.io.IOException,
                      AROexception
Tells the application to behave as if a mouse down event occurred at the current cursor position. This is essentially a front-end to the C++ HandleEvent method, which does not return until the event has been processed.

mouseUp

public void mouseUp()
             throws java.io.IOException,
                    AROexception
Tells the application to behave as if a mouse up event occurred at the current cursor position. This is essentially a front-end to the C++ HandleEvent method, which does not return until the event has been processed.

postNickNumEvent

public void postNickNumEvent(int cmd)
                      throws java.io.IOException,
                             AROexception
Posts a nicknum event (but doesn't wait for it to be processed). A nicknum is an integer associated with most menu items and command buttons. This method, along with broadcastNickNum, provides a "back-door" method of selecting a menu item or clicking on a button. Note that the effect of posting or broadcasting a nicknum usually depends on what window is currently active. In the Media Composer, a complete list of nicknums can be obtained by typing "dumpnicks" in the console. They are also available from satin.mediacomposer.NickNums.

This is a front-end to the C++ method of the same name. The request is only to post the nicknum event for processing during the application's main event loop; unlike broadcastNickNum, it does not wait for the nicknum event to be processed.

Parameters:
cmd
the nicknum (command) number.

postNickNumEvent

public void postNickNumEvent(int cmd,
                             ModifierKey[] modKeys)
                      throws java.io.IOException,
                             AROexception
Posts a nicknum event (but doesn't wait for it to be processed). A nicknum is an integer associated with most menu items and command buttons. This method, along with broadcastNickNum, provides a "back-door" method of selecting a menu item or clicking on a button. Note that the effect of posting or broadcasting a nicknum usually depends on what window is currently active. In the Media Composer, a complete list of nicknums can be obtained by typing "dumpnicks" in the console. They are also available from satin.mediacomposer.NickNums.

This is a front-end to the C++ method of the same name. The request is only to post the nicknum event for processing during the application's main event loop; unlike broadcastNickNum, it does not wait for the nicknum event to be processed.

Parameters:
cmd
the nicknum (command) number.
modKeys
an array of modifier keys.

broadcastNickNum

public void broadcastNickNum(int cmd)
                      throws java.io.IOException,
                             AROexception
Tells the application to process a nicknum event. A nicknum is an integer associated with most menu items and command buttons. This method, along with postNickNumEvent, provides a "back-door" method of selecting a menu item or clicking on a button. Note that the effect of posting or broadcasting a nicknum usually depends on what window is currently active. In the Media Composer, a complete list of nicknums can be obtained by typing "dumpnicks" in the console. They are also available from satin.mediacomposer.NickNums.

This is a front-end to the C++ method of the same name. Unlike postNickNumEvent, this method does not return until the nicknum has been processed.

Parameters:
cmd
the nicknum (command) number.

broadcastNickNum

public void broadcastNickNum(int cmd,
                             ModifierKey[] modKeys)
                      throws java.io.IOException,
                             AROexception
Tells the application to process a nicknum event. A nicknum is an integer associated with most menu items and command buttons. This method, along with postNickNumEvent, provides a "back-door" method of selecting a menu item or clicking on a button. Note that the effect of posting or broadcasting a nicknum usually depends on what window is currently active. In the Media Composer, a complete list of nicknums can be obtained by typing "dumpnicks" in the console. They are also available from satin.mediacomposer.NickNums.

This is a front-end to the C++ method of the same name. Unlike postNickNumEvent, this method does not return until the nicknum has been processed.

Parameters:
cmd
the nicknum (command) number.
modKeys
an array of modifier keys.

setNextPopupMenuItemToSelect

public void setNextPopupMenuItemToSelect(int item)
                                  throws java.io.IOException,
                                         AROexception
Set a popup menu item to be selected. This is a kludge to simulate selecting an item from a popup menu. After calling this method, the next time a popup menu is clicked, instead of displaying the menu, it will pretend that the item specified by this method was selected. Thus, after calling this method, you should immediately click on some popup menu. Each call to this method affects only a single click on a popup menu. The items are numbered starting at 1 (the topmost). The items in a heirarchical menu are numbered top-to-bottom according to a depth-first traversal.

You can select an item by name by using setNextPopupMenuItemToSelect(String). After clicking on the menu, use wasPopupMenuItemSelected to determine whether the item was actually selected.

This ARO request is processed immediately, regardless of the state of the ARO server application.

Parameters:
item
the number of the item to be selected (first = 1).

setNextPopupMenuItemToSelect

public void setNextPopupMenuItemToSelect(java.lang.String item)
                                  throws java.io.IOException,
                                         AROexception
Set a popup menu item to be selected. This is a kludge to simulate selecting an item from a popup menu. After calling this method, the next time a popup menu is clicked, instead of displaying the menu, it will pretend that the item specified by this method was selected. Thus, after calling this method, you should immediately click on some popup menu. Each call to this method affects only a single click on a popup menu. If the menu is heirarchical, you cannot select items in sub-menus by name, you must select them by number. You can select an item by number by using setNextPopupMenuItemToSelect(int). After clicking on the menu, use wasPopupMenuItemSelected to determine whether the item was actually selected.

Parameters:
item
the name of the item to be selected.

wasPopupMenuItemSelected

public boolean wasPopupMenuItemSelected()
                                 throws java.io.IOException,
                                        AROexception
Returns whether the menu item was selected. For use with setNextPopupMenuItemToSelect(String) and setNextPopupMenuItemToSelect(int).

Returns:
true if the item was selected, false if it was not.

getDlogBatchMode

public boolean getDlogBatchMode()
                         throws java.io.IOException,
                                AROexception
Gets "batch" mode for simple dialogs. When "batch" mode is enabled, simple "OK" or "Yes/No" dialogs do not appear. To set this mode, use setDlogBatchMode.

Returns:
true if batch mode is on, false if it is off.

setDlogBatchMode

public boolean setDlogBatchMode(boolean on)
                         throws java.io.IOException,
                                AROexception
Sets "batch" mode for simple dialogs. When "batch" mode is enabled, simple "OK" or "Yes/No" dialogs do not appear. Use this mode only to bypass the startup dialogs when launching the PRODUCT. This mode is also enabled by including "batch" in the "MCinvokeOptions.txt" file.

Parameters:
on
true to enable batch mode, false to disable it.
Returns:
the previous batch mode setting.
Revision History

9/24/01 Ed Stauff - added getActiveWindow.

7/26/01 - code review.

5/23/01 Ed Stauff - added setDlogBatchMode, getDlogBatchMode.

4/6/01 Ed Stauff - changes per review.

3/28/01 Ed Stauff - initial review by Satin team.



Generated on 5/9/2001 19:37 from AApplication.java (PRIVATE SOURCES)