VRJConfig UI API
v2.0


org.vrjuggler.vrjconfig.commoneditors.devicegraph
Class GraphHelpers

java.lang.Object
  extended by org.vrjuggler.vrjconfig.commoneditors.devicegraph.GraphHelpers
All Implemented Interfaces:
EditorConstants

public abstract class GraphHelpers
extends Object
implements EditorConstants

A collection of helper functions that can be helpful in extending JGraph.

The basic structure of a device graph is relatively straightfoward. There are three types of cells: edges, proxy vertices, and device vertices. Edges must always be of type ProxyToDeviceEdge. Proxy vertices have the following characteristics:

Device vertices, on the other hand, have these characteristics:

The functions included in this class take care of all the details related to creating and connecting cells. In particular, there are functions that know about all the default device and device proxy config element types in VR Juggler and know how to create cells and proxies for those types.

See Also:
DeviceInfo, ProxyInfo, UnitInfo, ProxyToDeviceEdge, DefaultGraphCell, DefaultPort

Field Summary
 
Fields inherited from interface org.vrjuggler.vrjconfig.commoneditors.EditorConstants
ACCUM_ALPHA_SIZE_PROPERTY, ACCUM_BLUE_SIZE_PROPERTY, ACCUM_GREEN_SIZE_PROPERTY, ACCUM_RED_SIZE_PROPERTY, ACTIVE_PROPERTY, ALIAS_TYPE, ANALOG_COUNT_PROPERTY, ANALOG_DEVICE_TYPE, ANALOG_FIRST_PROPERTY, ANALOG_PROXY_TYPE, AUX_BUFFER_COUNT_PROPERTY, BACK_VALUE_INDEX, BASE_FRAME_PROXY_PROPERTY, BORDER_PROPERTY, BUTTON_COUNT_PROPERTY, CAMERA_POS_PROPERTY, CLUSTER_NODE_TYPE, COLOR_ALPHA_SIZE_PROPERTY, COLOR_BLUE_SIZE_PROPERTY, COLOR_GREEN_SIZE_PROPERTY, COLOR_RED_SIZE_PROPERTY, COMMAND_DEVICE_TYPE, COMMON_IMG_ROOT, CUSTOM_SCALE_PROPERTY, DATA_GLOVE_TYPE, DECREMENT_KEYPRESS_PROPERTY, DEFAULT_SIMULATOR_TYPE, DEPTH_BUFFER_SIZE_PROPERTY, DEVICE_PROPERTY, DEVICE_UNITS_PROPERTY, DIGITAL_COUNT_PROPERTY, DIGITAL_DEVICE_TYPE, DIGITAL_FIRST_PROPERTY, DIGITAL_PROXY_TYPE, DIRECTX_JOYSTICK_TYPE, DISPLAY_WINDOW_TYPE, DISPLAY_WINDOWS_PROPERTY, DOWN_VALUE_INDEX, DTK_TYPE, FASTRAK_TYPE, FIRST_MOUSE_BUTTON, FLOCK_TYPE, FORWARD_VALUE_INDEX, FRAME_BUFFER_PROPERTY, FSAA_ENABLE_PROPERTY, GLOVE_DEVICE_TYPE, HEAD_POSITION_PROPERTY, HIDE_MOUSE_PROPERTY, IBOX_TYPE, INCREMENT_KEYPRESS_PROPERTY, INPUT_AREA_TYPE, INPUT_DEVICE_TYPE, INPUT_WINDOW_TYPE, INTEROCULAR_DISTANCE_PROPERTY, INTERSENSE_API_TYPE, INTERSENSE_STATION_TYPE, INTERSENSE_TYPE, KEY_0_INT_VALUE, KEY_0_STRING_VALUE, KEY_1_INT_VALUE, KEY_1_STRING_VALUE, KEY_2_INT_VALUE, KEY_2_STRING_VALUE, KEY_3_INT_VALUE, KEY_3_STRING_VALUE, KEY_4_INT_VALUE, KEY_4_STRING_VALUE, KEY_5_INT_VALUE, KEY_5_STRING_VALUE, KEY_6_INT_VALUE, KEY_6_STRING_VALUE, KEY_7_INT_VALUE, KEY_7_STRING_VALUE, KEY_8_INT_VALUE, KEY_8_STRING_VALUE, KEY_9_INT_VALUE, KEY_9_STRING_VALUE, KEY_A_INT_VALUE, KEY_A_STRING_VALUE, KEY_B_INT_VALUE, KEY_B_STRING_VALUE, KEY_C_INT_VALUE, KEY_C_STRING_VALUE, KEY_D_INT_VALUE, KEY_D_STRING_VALUE, KEY_DOWN_INT_VALUE, KEY_DOWN_STRING_VALUE, KEY_E_INT_VALUE, KEY_E_STRING_VALUE, KEY_ESC_INT_VALUE, KEY_ESC_STRING_VALUE, KEY_F_INT_VALUE, KEY_F_STRING_VALUE, KEY_G_INT_VALUE, KEY_G_STRING_VALUE, KEY_H_INT_VALUE, KEY_H_STRING_VALUE, KEY_I_INT_VALUE, KEY_I_STRING_VALUE, KEY_J_INT_VALUE, KEY_J_STRING_VALUE, KEY_K_INT_VALUE, KEY_K_STRING_VALUE, KEY_L_INT_VALUE, KEY_L_STRING_VALUE, KEY_LEFT_INT_VALUE, KEY_LEFT_STRING_VALUE, KEY_M_INT_VALUE, KEY_M_STRING_VALUE, KEY_MODIFIER_PAIR_TYPE, KEY_N_INT_VALUE, KEY_N_STRING_VALUE, KEY_NONE_INT_VALUE, KEY_NONE_STRING_VALUE, KEY_O_INT_VALUE, KEY_O_STRING_VALUE, KEY_P_INT_VALUE, KEY_P_STRING_VALUE, KEY_PAIR_PROPERTY, KEY_PROPERTY, KEY_Q_INT_VALUE, KEY_Q_STRING_VALUE, KEY_R_INT_VALUE, KEY_R_STRING_VALUE, KEY_RIGHT_INT_VALUE, KEY_RIGHT_STRING_VALUE, KEY_S_INT_VALUE, KEY_S_STRING_VALUE, KEY_T_INT_VALUE, KEY_T_STRING_VALUE, KEY_U_INT_VALUE, KEY_U_STRING_VALUE, KEY_UP_INT_VALUE, KEY_UP_STRING_VALUE, KEY_V_INT_VALUE, KEY_V_STRING_VALUE, KEY_W_INT_VALUE, KEY_W_STRING_VALUE, KEY_X_INT_VALUE, KEY_X_STRING_VALUE, KEY_Y_INT_VALUE, KEY_Y_STRING_VALUE, KEY_Z_INT_VALUE, KEY_Z_STRING_VALUE, KEYBOARD_MOUSE_DEVICE_TYPE, KEYBOARD_MOUSE_PROXY_PTR_PROPERTY, KEYBOARD_MOUSE_PROXY_TYPE, KEYBOARD_MOUSE_PTR_PROPERTY, LAST_MOUSE_BUTTON, LEFT_VALUE_INDEX, LINUX_JOYDEV_TYPE, LOCK_KEY_PROPERTY, LOWER_LEFT_CORNER_PROPERTY, LOWER_RIGHT_CORNER_PROPERTY, MODIFIER_KEY_PROPERTY, MODKEY_ALT_INT_VALUE, MODKEY_ALT_STRING_VALUE, MODKEY_ANY_INT_VALUE, MODKEY_ANY_STRING_VALUE, MODKEY_CTRL_INT_VALUE, MODKEY_CTRL_STRING_VALUE, MODKEY_NONE_INT_VALUE, MODKEY_NONE_STRING_VALUE, MODKEY_SHIFT_INT_VALUE, MODKEY_SHIFT_STRING_VALUE, MOTION_STAR_TYPE, MOUSE_BUT1_INT_VALUE, MOUSE_BUT1_STRING_VALUE, MOUSE_BUT2_INT_VALUE, MOUSE_BUT2_STRING_VALUE, MOUSE_BUT3_INT_VALUE, MOUSE_BUT3_STRING_VALUE, MOUSE_NEGX_INT_VALUE, MOUSE_NEGX_STRING_VALUE, MOUSE_NEGY_INT_VALUE, MOUSE_NEGY_STRING_VALUE, MOUSE_POSX_INT_VALUE, MOUSE_POSX_STRING_VALUE, MOUSE_POSY_INT_VALUE, MOUSE_POSY_STRING_VALUE, OPENGL_FRAME_BUFFER_TYPE, ORIGIN_PROPERTY, PINCH_GLOVE_TYPE, POSITION_FILTERS_PROPERTY, POSITION_PROXY_TYPE, POSITION_TRANSFORM_FILTER_TYPE, POSITIONAL_DEVICE_TYPE, POST_ROTATION_PROPERTY, POST_TRANSLATION_PROPERTY, PRE_ROTATION_PROPERTY, PRE_TRANSLATION_PROPERTY, PROXY_PROPERTY, PROXY_TYPE, PUCK_DEVICE_TYPE, RELATIVE_PROXY_PROPERTY, RIGHT_VALUE_INDEX, ROTATE_CLOCKWISE_VALUE_INDEX, ROTATE_COUNTER_CLOCKWISE_VALUE_INDEX, ROTATE_DOWN_VALUE_INDEX, ROTATE_LEFT_VALUE_INDEX, ROTATE_RIGHT_VALUE_INDEX, ROTATE_UP_VALUE_INDEX, SERIAL_ENCODER_TYPE, SIM_ANALOG_DEVICE_TYPE, SIM_DIGITAL_DEVICE_TYPE, SIM_POS_DEVICE_TYPE, SIM_RELATIVE_POS_DEVICE_TYPE, SIMULATOR_PLUGIN_PROPERTY, SIMULATOR_VIEWPORT_TYPE, SIMULATOR_VIEWPORTS_PROPERTY, SIZE_PROPERTY, SLEEP_TIME_PROPERTY, START_LOCKED_PROPERTY, STATIONS_PROPERTY, STENCIL_BUFFER_SIZE_PROPERTY, STEREO_PROPERTY, STRING_DEVICE_TYPE, SURFACE_VIEWPORT_TYPE, SURFACE_VIEWPORTS_PROPERTY, TRACKD_API_CONTROLLER_TYPE, TRACKD_API_SENSOR_TYPE, TRACKD_CONTROLLER_TYPE, TRACKD_SENSOR_TYPE, TRACKED_PROPERTY, TRACKER_COUNT_PROPERTY, TRACKER_PROXY_PROPERTY, UNIT_PROPERTY, UP_VALUE_INDEX, UPPER_LEFT_CORNER_PROPERTY, UPPER_RIGHT_CORNER_PROPERTY, USE_ANALOG_PROPERTY, USE_DIGITAL_PROPERTY, USER_PROPERTY, USER_TYPE, VERTICAL_FOV_PROPERTY, VIEW_PROPERTY, VISUAL_ID_PROPERTY, VRPN_TYPE, WAND_POS_PROPERTY
 
Constructor Summary
GraphHelpers()
           
 
Method Summary
static void addDevicePorts(DefaultGraphCell cell, Integer unitType, int numUnits)
          Adds the given number of ports to the given graph cell as children.
static boolean autoSizeCellView(Dimension size, CellView view, Hashtable table)
          Changes the size of the given CellView reference to be the given dimensions.
static void autoSizeCellView(JGraph graph, Dimension size, CellView view)
          Changes the size of the given CellView reference to be the given dimensions.
static boolean checkProxyDeviceConnection(ProxyInfo proxyInfo, BaseDeviceInfo deviceInfo, UnitInfo unitInfo)
          Determines whether the given proxy and device can be connected through the given device unit.
static DefaultEdge connectProxyToDevice(DefaultGraphCell proxyCell, DefaultGraphCell deviceCell, ConnectionSet cs, Map attributes)
          Creates a connection between proxyCell and deviceCell using the appropriate port in deviceCell.
static DefaultEdge connectProxyToDevice(DefaultPort proxyPort, DefaultPort devicePort, ConnectionSet cs, Map attributes)
          Creates a connection between proxyPort and devicePort.
static DefaultGraphCell createBaseDeviceCell(BaseDeviceInfo devInfo, Map attributes, int x, int y, boolean autoSize)
          Creates a basic device graph cell by creating an attribute map using org.vrjuggler.vrjconfig.commoneditors.DeviceGraph.createDeviceAttributes() and the given parameters.
static DefaultGraphCell createDeviceCell(ConfigElement devElt, ConfigContext context, int numUnits, Map attributes, int x, int y, boolean autoSize)
          Creates a new graph cell for the given config element that is used to configure an input device.
static DefaultGraphCell createDeviceCell(ConfigElement devElt, ConfigContext context, List proxyTypes, Map attributes, int x, int y, boolean autoSize)
          Creates a new graph cell for the given config element that is used to configure an input device using "artificial" input sources (units).
static DefaultGraphCell createDeviceCell(ConfigElement devElt, ConfigContext context, Map attributes)
          Creates a new graph cell for the given config element that is used to configure an input device.
static DefaultGraphCell createDeviceCell(ConfigElement devElt, ConfigContext context, Map attributes, int x, int y, boolean autoSize)
          Creates a new graph cell for the given config element that is used to configure an input device, which has exactly one input source (unit) at all times.
static DefaultGraphCell createDeviceCell(ConfigElement devElt, ConfigContext context, String unitPropName, Map attributes, int x, int y, boolean autoSize)
          Creates a new graph cell for the given config element that is used to configure an input device.
static DefaultPort createDevicePort(Integer unitType, int unitNumber)
          Creates a new port for a device cell.
static DefaultPort createDevicePort(Integer unitType, Integer unitNumber)
          Creates a new port for a device cell.
static DefaultPort createDevicePort(UnitInfo unitInfo)
          Creates a new port for a device cell.
static DefaultGraphCell createProxyCell(ConfigElement proxyElt, ConfigContext context, List aliases, Map attributes)
          Creates a new graph cell for the given config element that is used to configure a device proxy.
static DefaultGraphCell createProxyCell(ConfigElement proxyElt, ConfigContext context, List aliases, Map attributes, int x, int y, boolean autoSize)
          Creates a graph cell for a device proxy that has a single port as a child.
static void registerGraphCellCreator(ConfigDefinition def, DeviceGraphCellCreator c)
          Registers the given device graph cell creator as the creator for the given config definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphHelpers

public GraphHelpers()
Method Detail

registerGraphCellCreator

public static void registerGraphCellCreator(ConfigDefinition def,
                                            DeviceGraphCellCreator c)
Registers the given device graph cell creator as the creator for the given config definition. Subsequent calls to createDeviceCell(ConfigElement,ConfigContext,Map) will be able to create device graph cells for the given config definition.

Parameters:
def - the config definition that uniquely identifies which creator to be used
c - the device graph cell creator
See Also:
createDeviceCell(ConfigElement,ConfigContext,Map)

autoSizeCellView

public static void autoSizeCellView(JGraph graph,
                                    Dimension size,
                                    CellView view)
Changes the size of the given CellView reference to be the given dimensions. The graph cell associated with the given view must be in the given graph. If the cell view is resized successfully, an edit is posted with the graph's layout cache, and the graph is repainted.

Parameters:
graph - the graph that knows about the cell view and its cell
size - the new dimensions for the cell view
view - the cell view to be resized
See Also:
autoSizeCellView(Dimension,CellView,Hashtable)

autoSizeCellView

public static boolean autoSizeCellView(Dimension size,
                                       CellView view,
                                       Hashtable table)
Changes the size of the given CellView reference to be the given dimensions. The resizing is done by modifying the bounds in the cell view's attributes. The position of the cell view is left unchanged, but the width and height are changed to the values given in size. The new attributes are placed into the given Hashtable object using the view's cell as the key.

Parameters:
size - the new dimensions for the cell view
view - the cell view to be resized
table - a non-null hashtable used for storing the modified cell view attributes
See Also:
GraphConstants.setBounds(Map,Rectangle2D), CellView.getCell()

createDeviceCell

public static DefaultGraphCell createDeviceCell(ConfigElement devElt,
                                                ConfigContext context,
                                                Map attributes)
Creates a new graph cell for the given config element that is used to configure an input device. Pluggable "creators" are used to construct the appropriate DefaultGraphCell instance (with its ports) that is returned. The creator to use is determined using the config definition of the given config element. This method is intended to be used for ensuring correct and easy graph cell creation for config elements used to configure devices. Creators must be registered prior to calling this function.

Parameters:
devElt - the config element for the device being represented by the vertex cell to be created
context - the config context where devElt exists
attributes - the attribute map where the vertex cell's default attribute map will be stored by this function
Throws:
IllegalArgumentException - thrown when the graph cell cannot be created due to one of two causes: there is no creator known for the config definition of devElt or the registered creator failed
See Also:
registerGraphCellCreator(ConfigDefinition,DeviceGraphCellCreator)

createDeviceCell

public static DefaultGraphCell createDeviceCell(ConfigElement devElt,
                                                ConfigContext context,
                                                Map attributes,
                                                int x,
                                                int y,
                                                boolean autoSize)
Creates a new graph cell for the given config element that is used to configure an input device, which has exactly one input source (unit) at all times. The number of units indicates how many ports the new graph cell should have initially.

Parameters:
devElt - the config element for the device being represented by the vertex cell to be created
context - the config context where devElt exists
attributes - the attribute map where the vertex cell's default attribute map will be stored by this function
x - the X coordinate for the initial positionaing of the new vertex
y - the Y coordinate for the initial positionaing of the new vertex
autoSize - flag indicating whether the new cell should be auto-sized
See Also:
createDeviceCell(ConfigElement,ConfigContext,int,Map,int,int,boolean), createBaseDeviceCell(BaseDeviceInfo,Map,int,int,boolean)

createDeviceCell

public static DefaultGraphCell createDeviceCell(ConfigElement devElt,
                                                ConfigContext context,
                                                String unitPropName,
                                                Map attributes,
                                                int x,
                                                int y,
                                                boolean autoSize)
Creates a new graph cell for the given config element that is used to configure an input device. The number of units is determined based on the value of unitPropName. If it is non-null, then devElt is queried for the number of values of the named property. Further, a non-null value for unitPropName indicates that the number of values is variable. If unitPropName is null, then the number of units is set to 1 and is treated as non-variable. The number of units indicates how many ports the new graph cell should have initially.

Parameters:
devElt - the config element for the device being represented by the vertex cell to be created
context - the config context where devElt exists
unitPropName - the name of the property that indicates the number of available units for the represented device
attributes - the attribute map where the vertex cell's default attribute map will be stored by this function
x - the X coordinate for the initial positionaing of the new vertex
y - the Y coordinate for the initial positionaing of the new vertex
autoSize - flag indicating whether the new cell should be auto-sized
See Also:
createBaseDeviceCell(BaseDeviceInfo,Map,int,int,boolean)

createDeviceCell

public static DefaultGraphCell createDeviceCell(ConfigElement devElt,
                                                ConfigContext context,
                                                int numUnits,
                                                Map attributes,
                                                int x,
                                                int y,
                                                boolean autoSize)
Creates a new graph cell for the given config element that is used to configure an input device. The number of units (specified by the numUnits parameter) indicates the fixed number of ports the new graph cell has.

Parameters:
devElt - the config element for the device being represented by the vertex cell to be created
context - the config context where devElt exists
numUnits - the fixed number of units this device has
attributes - the attribute map where the vertex cell's default attribute map will be stored by this function
x - the X coordinate for the initial positionaing of the new vertex
y - the Y coordinate for the initial positionaing of the new vertex
autoSize - flag indicating whether the new cell should be auto-sized
See Also:
createBaseDeviceCell(BaseDeviceInfo,Map,int,int,boolean)

createDeviceCell

public static DefaultGraphCell createDeviceCell(ConfigElement devElt,
                                                ConfigContext context,
                                                List proxyTypes,
                                                Map attributes,
                                                int x,
                                                int y,
                                                boolean autoSize)
Creates a new graph cell for the given config element that is used to configure an input device using "artificial" input sources (units).

Parameters:
devElt - the config element for the device being represented by the vertex cell to be created
context - the config context where devElt exists
proxyTypes - the list of proxy types that can point at the device
attributes - the attribute map where the vertex cell's default attribute map will be stored by this function
x - the X coordinate for the initial positionaing of the new vertex
y - the Y coordinate for the initial positionaing of the new vertex
autoSize - flag indicating whether the new cell should be auto-sized
See Also:
createBaseDeviceCell(BaseDeviceInfo,Map,int,int,boolean)

createBaseDeviceCell

public static DefaultGraphCell createBaseDeviceCell(BaseDeviceInfo devInfo,
                                                    Map attributes,
                                                    int x,
                                                    int y,
                                                    boolean autoSize)
Creates a basic device graph cell by creating an attribute map using org.vrjuggler.vrjconfig.commoneditors.DeviceGraph.createDeviceAttributes() and the given parameters. The freshly created attribute map is stored in the given attribute map using the new DefaultGraphCell instance as its key. In general, user code should not be using this method directly, but it is made public so that instances of DeviceGraphCellCreator can utilize it when necessary.

Parameters:
devInfo - the informational object describing the device
attributes - the attribute map where the vertex cell's default attribute map will be stored by this function
x - the X coordinate for the initial positionaing of the new vertex
y - the Y coordinate for the initial positionaing of the new vertex
autoSize - flag indicating whether the new cell should be auto-sized
See Also:
DeviceGraph.createDeviceAttributes(int,int,boolean), DeviceGraphCellCreator, GraphConstants, AttributeMap

addDevicePorts

public static void addDevicePorts(DefaultGraphCell cell,
                                  Integer unitType,
                                  int numUnits)
Adds the given number of ports to the given graph cell as children. The ports are all created using createDevicePort(Integer,int).

Parameters:
cell - the device graph cell to which the ports will be added
unitType - the type of the input source (unit) for the new ports
numUnits - the number of ports that will be addded
See Also:
createDevicePort(Integer,int)

createProxyCell

public static DefaultGraphCell createProxyCell(ConfigElement proxyElt,
                                               ConfigContext context,
                                               List aliases,
                                               Map attributes)
Creates a new graph cell for the given config element that is used to configure a device proxy. The parameters to use for creating the appropriate DefaultGraphCell (with its ports) are determined based on the type of the config element passed in. This method is intended to be used for ensuring correct and easy graph cell creation for config elements used to configure proxies. However, the config element type must be known a priori in order for this method to be able to do its job.

Parameters:
proxyElt - the config element for the device proxy being represented by the vertex cell to be created
context - the config context where proxyElt exists
aliases - all the aliases (zero or more) that exist for proxyElt
attributes - the attribute map where the vertex cell's default attribute map will be stored by this function
Throws:
IllegalArgumentException - thrown when the type of proxyElt is unknown to this method, thus preventing correct creation of a DefaultGraphCell instance.

createProxyCell

public static DefaultGraphCell createProxyCell(ConfigElement proxyElt,
                                               ConfigContext context,
                                               List aliases,
                                               Map attributes,
                                               int x,
                                               int y,
                                               boolean autoSize)
Creates a graph cell for a device proxy that has a single port as a child. The initial attribute map used for the graph cell is created using org.vrjuggler.vrjconfig.commoneditors.DeviceGraph.createProxyAttributes(), and it is stored in the given attribute map.

Parameters:
proxyElt - the config element for the device proxy being represented by the vertex cell to be created
context - the config context where proxyElt exists
aliases - all the aliases (zero or more) that exist for proxyElt
attributes - the attribute map where the vertex cell's default attribute map will be stored by this function
x - the X coordinate for the initial positionaing of the new vertex
y - the Y coordinate for the initial positionaing of the new vertex
autoSize - flag indicating whether the new cell should be auto-sized
See Also:
DeviceGraph.createProxyAttributes(int,int,boolean)

connectProxyToDevice

public static DefaultEdge connectProxyToDevice(DefaultGraphCell proxyCell,
                                               DefaultGraphCell deviceCell,
                                               ConnectionSet cs,
                                               Map attributes)
                                        throws NoSuchPortException
Creates a connection between proxyCell and deviceCell using the appropriate port in deviceCell. The port to use is determined by the user object contained in proxyCell, which must be of type ProxyInfo. The proxy cell's user object will contain the ConfigElement for the proxy, which in turn provides a unit number for the device to which the proxy should refer. The proxy config element and the device config element will remain unchanged.

Throws:
NoSuchPortException - thrown If the two cells cannot be connected because no appropriate port exists in deviceCell
See Also:
ProxyInfo, createProxyCell(ConfigElement,ConfigContext,List,Map,int,int,boolean)

connectProxyToDevice

public static DefaultEdge connectProxyToDevice(DefaultPort proxyPort,
                                               DefaultPort devicePort,
                                               ConnectionSet cs,
                                               Map attributes)
                                        throws IllegalArgumentException
Creates a connection between proxyPort and devicePort. The parent of the proxy port must contain a ProxyInfo object, and the parent of the device port must contain a DeviceInfo object. The config element in the ProxyInfo object is changed to reflect the connection.

Throws:
IllegalArgumentException - thrown If the two ports cannot be connected as a result of a unit type mismatch between the proxy's allowed type and the device port's unit type
See Also:
createProxyCell(ConfigElement,ConfigContext,List,Map,int,int,boolean)

createDevicePort

public static DefaultPort createDevicePort(Integer unitType,
                                           int unitNumber)
Creates a new port for a device cell. The port will be used to represent the input source (unit) described by the given parameters.

Parameters:
unitType - the type of input source for the new port
unitNumber - the index of this input source in the device

createDevicePort

public static DefaultPort createDevicePort(Integer unitType,
                                           Integer unitNumber)
Creates a new port for a device cell. The port will be used to represent the input source (unit) described by the given parameters.

Parameters:
unitType - the type of input source for the new port
unitNumber - the index of this input source in the device

createDevicePort

public static DefaultPort createDevicePort(UnitInfo unitInfo)
Creates a new port for a device cell. The port will be used to represent the input source (unit) described by the given parameter.

Parameters:
unitInfo - a UnitInfo object containing the information necessary to create a new port for the device cell that accurately represents the input source

checkProxyDeviceConnection

public static boolean checkProxyDeviceConnection(ProxyInfo proxyInfo,
                                                 BaseDeviceInfo deviceInfo,
                                                 UnitInfo unitInfo)
Determines whether the given proxy and device can be connected through the given device unit.


VRJConfig UI API
v2.0


Copyright © 1998–2005 Iowa State University. All rights reserved.