arlut.csd.JDataComponent
Class JValueObject

java.lang.Object
  |
  +--arlut.csd.JDataComponent.JValueObject

public class JValueObject
extends java.lang.Object

A client-side message object used to pass status updates from GUI components in the arlut.csd.JDataComponent package to their containers. JValueObject supports passing information about scalar and vector value change operations, as well as pop-up menus and error messages.

Note that we came up with this message type before Sun introduced the 1.1 AWT event model. Great minds... ;-)


Field Summary
static int ADD
          Vector add/scalar operation.
static int ADDVECTOR
          Vector add/vector operation.
static int DELETE
          Vector delete scalar operation, requires index to be set.
static int DELETEVECTOR
          Vector delete vector operation, requires index to be set.
static int ERROR
          Error message return operation.
static int FIRST
          Boundary guard for acceptable operation types.
private  int index
          Index used to indicate what value of a vector is being modified by this message.
static int INSERT
          Vector insert operation, requires both value and index to be set.
static int LAST
          Boundary guard for acceptable operation types.
static int MOVE
          Used to signal an item being moved in a list.
static int NONE
          The operation value to use when you're not using a JValueObject.
private  int operationValue
          An enumerated operation type indicator.
private  java.lang.Object parameter
          An auxiliary value used for some kinds of operation types.
static int PARAMETER
          Used to pass action commands (as from pop-up menu activity) from GUI components.
static int SET
          Scalar value set operation.
private  java.awt.Component source
          The arlut.csd.JDataComponent GUI component that originated this message.
static int SPECIAL
          Use this for those hacks
private  java.lang.Object value
          A multi-purpose value object.
 
Constructor Summary
JValueObject(java.awt.Component source, int index, int operation)
          Constructor for a simple vector change message.
JValueObject(java.awt.Component source, int index, int operation, int targetIndex)
          Constructor for a vector move message.
JValueObject(java.awt.Component source, int index, int operation, java.lang.Object value)
          Constructor for a simple vector change message.
JValueObject(java.awt.Component source, int index, int operation, java.lang.Object value, java.lang.Object parameter)
          Generic constructor
JValueObject(java.awt.Component source, java.lang.Object value)
          Constructor for a simple value-set message.
JValueObject(java.awt.Component source, java.lang.Object value, int operation)
          Constructor for a simple single-value message.
 
Method Summary
 int getIndex()
          Returns the index of an item operated on in a vector component.
 int getOperationType()
          Returns the type of operation encoded by this message.
 java.lang.Object getParameter()
          Returns an auxiliary value.
 java.awt.Component getSource()
          Returns the arlut.csd.JDataComponent GUI component that originated this message.
 java.lang.Object getValue()
          Returns the value of the object being affected by this message.
 java.lang.String toString()
          Method to get a human-readable description of the event carried by this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FIRST

public static final int FIRST
Boundary guard for acceptable operation types.

See Also:
Constant Field Values

ADD

public static final int ADD
Vector add/scalar operation. Also used to indicate item selection in JstringListBox.

See Also:
Constant Field Values

ADDVECTOR

public static final int ADDVECTOR
Vector add/vector operation. Also used to indicate item selection in JstringListBox.

See Also:
Constant Field Values

INSERT

public static final int INSERT
Vector insert operation, requires both value and index to be set. Also used to indicate item double-click in JstringListBox.

See Also:
Constant Field Values

DELETE

public static final int DELETE
Vector delete scalar operation, requires index to be set.

See Also:
Constant Field Values

DELETEVECTOR

public static final int DELETEVECTOR
Vector delete vector operation, requires index to be set.

See Also:
Constant Field Values

SET

public static final int SET
Scalar value set operation. Requires value to be set.

See Also:
Constant Field Values

NONE

public static final int NONE
The operation value to use when you're not using a JValueObject.

See Also:
Constant Field Values

ERROR

public static final int ERROR
Error message return operation. Requires value to be set to a string describing the error.

See Also:
Constant Field Values

SPECIAL

public static final int SPECIAL
Use this for those hacks

See Also:
Constant Field Values

PARAMETER

public static final int PARAMETER
Used to pass action commands (as from pop-up menu activity) from GUI components.

See Also:
Constant Field Values

MOVE

public static final int MOVE
Used to signal an item being moved in a list.

See Also:
Constant Field Values

LAST

public static final int LAST
Boundary guard for acceptable operation types.

See Also:
Constant Field Values

source

private java.awt.Component source
The arlut.csd.JDataComponent GUI component that originated this message.


operationValue

private int operationValue
An enumerated operation type indicator. Should be one of ADD, INSERT, DELETE, SET, ERROR, SPECIAL, and PARAMETER.


value

private java.lang.Object value
A multi-purpose value object. Interpreted differently for different operation types.


parameter

private java.lang.Object parameter
An auxiliary value used for some kinds of operation types. Often used to indicate ActionCommands for pop-up menus attached to arlut.csd.JDataComponent GUI components.


index

private int index
Index used to indicate what value of a vector is being modified by this message.

Constructor Detail

JValueObject

public JValueObject(java.awt.Component source,
                    java.lang.Object value)
Constructor for a simple value-set message.

Parameters:
source - arlut.csd.JDataComponent GUI component originating message
value - Value being set by the originating GUI component

JValueObject

public JValueObject(java.awt.Component source,
                    java.lang.Object value,
                    int operation)
Constructor for a simple single-value message.

Parameters:
source - arlut.csd.JDataComponent GUI component originating message
value - Value being set by the originating GUI component
operation - Operation type, one of ADD, INSERT, DELETE, SET, ERROR, SPECIAL, PARAMETER, MOVE.

JValueObject

public JValueObject(java.awt.Component source,
                    int index,
                    int operation)
Constructor for a simple vector change message.

Parameters:
source - arlut.csd.JDataComponent GUI component originating message
index - index of vector connected to arlut.csd.JDataComponent GUI component being changed.
operation - Operation type, one of ADD, INSERT, DELETE, SET, ERROR, SPECIAL, PARAMETER, MOVE.

JValueObject

public JValueObject(java.awt.Component source,
                    int index,
                    int operation,
                    java.lang.Object value)
Constructor for a simple vector change message.

Parameters:
source - arlut.csd.JDataComponent GUI component originating message
index - index of vector connected to arlut.csd.JDataComponent GUI component being changed.
value - Value being set by the originating GUI component
operation - Operation type, one of ADD, INSERT, DELETE, SET, ERROR, SPECIAL, PARAMETER, MOVE.

JValueObject

public JValueObject(java.awt.Component source,
                    int index,
                    int operation,
                    int targetIndex)
Constructor for a vector move message.

Parameters:
source - arlut.csd.JDataComponent GUI component originating message
index - index of vector connected to arlut.csd.JDataComponent GUI component being changed.
operation - Operation type, one of ADD, INSERT, DELETE, SET, ERROR, SPECIAL, PARAMETER, MOVE.

JValueObject

public JValueObject(java.awt.Component source,
                    int index,
                    int operation,
                    java.lang.Object value,
                    java.lang.Object parameter)
Generic constructor

Parameters:
source - arlut.csd.JDataComponent GUI component originating message
index - index of vector connected to arlut.csd.JDataComponent GUI component being changed.
value - Value being set by the originating GUI component
operation - Operation type, one of ADD, INSERT, DELETE, SET, ERROR, SPECIAL, PARAMETER.
parameter - Auxiliary object value, used when passing pop-up menu information.
Method Detail

getSource

public java.awt.Component getSource()
Returns the arlut.csd.JDataComponent GUI component that originated this message.


getParameter

public java.lang.Object getParameter()
Returns an auxiliary value. Used for passing information about pop-up menu items, but may be used for different purposes if needed.


getIndex

public int getIndex()
Returns the index of an item operated on in a vector component.


getValue

public java.lang.Object getValue()
Returns the value of the object being affected by this message.


getOperationType

public int getOperationType()
Returns the type of operation encoded by this message.


toString

public java.lang.String toString()
Method to get a human-readable description of the event carried by this object

Overrides:
toString in class java.lang.Object