satin.uishell
Class AGadget

java.lang.Object
  |
  +--satin.aro.AROobject
        |
        +--satin.aro.AROremoteObject
              |
              +--satin.core.AObject
                    |
                    +--satin.uishell.APane
                          |
                          +--satin.uishell.AGadget
Direct Known Subclasses:
ASlider, SelTCpane

public class AGadget
extends APane

Represents a C++ AGadget object in an ARO server.

Author:
Ed Stauff

Fields inherited from class satin.uishell.APane
uiName
 
Fields inherited from class satin.aro.AROremoteObject
server
 
Fields inherited from class satin.aro.AROobject
id
 
Constructor Summary
AGadget(APane pane)
          Constructs an object representing an AGadget.
AGadget(AROremoteServer rs, AROobjectID id)
          Constructs an object representing an AGadget.
AGadget(AWindow window, java.lang.String paneID)
          Constructs an object representing an AGadget.
 
Method Summary
boolean getEnabled()
          Returns whether the gadget is enabled.
java.lang.String[] getMenuContents()
          Returns an array of strings containing the text of the gadget's menu items.
java.lang.String[] getMenuContents(java.lang.String separator)
          Returns an array of strings containing the text of the gadget's menu items.
int getMenuItem()
          Returns the currently selected item number in the gadget's menu.
int getResourceID()
          Returns the gadget's resource id.
java.lang.String getResourceType()
          Returns the gadget's resource type.
boolean getState()
          Returns whether the state of the gadget.
boolean hasMenu()
          Returns whether the gadget has a menu.
 
Methods inherited from class satin.uishell.APane
doClick, doClick, doClick, doClick, doClick, doClick, getBounds, getClassAndID, getFrame, getLabel, getPaneID, getParent, getSubPanes, getText, getUIname, getWindow, isActive, isVisible, postClickEvent, toString
 
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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AGadget

public AGadget(AROremoteServer rs,
               AROobjectID id)
Constructs an object representing an AGadget.

Parameters:
rs
the ARO server in which the C++ object lives.
id
the ARO object ID of the APane.

AGadget

public AGadget(AWindow window,
               java.lang.String paneID)
        throws java.io.IOException,
               AROexception,
               PaneIDnotFound
Constructs an object representing an AGadget.

Parameters:
window
the pane's parent window.
paneID
the pane ID of the pane.

AGadget

public AGadget(APane pane)
        throws java.io.IOException,
               AROexception
Constructs an object representing an AGadget. Use this constructor to "cast" an APane object to an AGadget object. Throws an assertion if the APane in the application is not a member of the class AGadget.

Parameters:
pane
the pane's parent window.
paneID
the pane ID of the pane.
Method Detail

getState

public boolean getState()
                 throws java.io.IOException,
                        AROexception
Returns whether the state of the gadget. This is a front-end to the C++ method of the same name.

getEnabled

public boolean getEnabled()
                   throws java.io.IOException,
                          AROexception
Returns whether the gadget is enabled. If it is disabled, it is greyed out and its state cannot be modified by the user. This is a front-end to the C++ method of the same name.

getResourceType

public java.lang.String getResourceType()
                                 throws java.io.IOException,
                                        AROexception
Returns the gadget's resource type. The resource type is obtained from the C++ object's itsRsrcType field.

Returns:
the resource type, or an empty string if the gadget has no resource.

getResourceID

public int getResourceID()
                  throws java.io.IOException,
                         AROexception
Returns the gadget's resource id. The resource id is obtained from the C++ object's itsRsrcID field.

Returns:
the resource id, or 0 if the gadget has no resource.

hasMenu

public boolean hasMenu()
                throws java.io.IOException,
                       AROexception
Returns whether the gadget has a menu. This value is obtained from the C++ object's hasMenu field.

Returns:
true if the gadget has a menu, false if it does not.

getMenuItem

public int getMenuItem()
                throws java.io.IOException,
                       AROexception
Returns the currently selected item number in the gadget's menu. Throws an AROexception if the gadget has no menu. This is a front-end to the C++ method of the same name.

Returns:
the menu item number.

getMenuContents

public java.lang.String[] getMenuContents()
                                   throws java.io.IOException,
                                          AROexception
Returns an array of strings containing the text of the gadget's menu items. The items are returned in top-to-bottom order. If the menu is heirarchical, use the other form of getMenuContents; otherwise, the sub-menus will not be included in the returned list. Throws an AROexception if the gadget has no menu. This method does not correspond to any one C++ method.

Returns:
an array containing one string for each item in the gadget's menu.

getMenuContents

public java.lang.String[] getMenuContents(java.lang.String separator)
                                   throws java.io.IOException,
                                          AROexception
Returns an array of strings containing the text of the gadget's menu items. The items are returned in top-to-bottom order. The separator is used to separate the menu items from their parent menu within each string; for example, using a vertical bar as a separator, the File menu in Netscape would include the following: { "New", "New|Navigator Window", "New|Message", "New|Blank Page", "Open Page", "Save As" }. The separator is not used for non-heirarchical menus. Throws an AROexception if the gadget has no menu. This method does not correspond to any one C++ method.

Returns:
an array containing one string for each item in the gadget's menu.
Revision History

7/26/01 - code review.

7/13/01 Ed Stauff - added constructor that takes an APane.

5/1/01 Ed Stauff - replaced Vectors with arrays.

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

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



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