edu.wisc.trace.urcsdk.client.pret
Class AbstractInteractor

java.lang.Object
  extended by edu.wisc.trace.urcsdk.client.pret.AbstractInteractor
All Implemented Interfaces:
IInteractor, ISocketElementListener
Direct Known Subclasses:
BooleanInteractor, DateInteractor, DateTimeInteractor, DayInteractor, DecimalInteractor, DurationInteractor, Group, InputInteractor, ModalDialogInteractor, MonthDayInteractor, MonthInteractor, OutputInteractor, RangeInteractor, Select1Interactor, SelectInteractor, TextAreaInteractor, TimedTriggerInteractor, TimeInteractor, TriggerInteractor, YearInteractor, YearMonthInteractor

public abstract class AbstractInteractor
extends java.lang.Object
implements IInteractor, ISocketElementListener

AbstractInteractor is the abstract form of an interactor. It provides the common functionality that all interactors must possess.

Version:
$Revision: 1.21 $
Author:
Andrew Martin, Trace R&D Center, Created on: Sep 14, 2004

Field Summary
protected  boolean calculable
          The boolean value indicating whether or not this interactor is calculable by the URC.
protected  java.lang.String cohesion
          cohesion is the level of grouping for this interactor.
protected  java.lang.String domain
          id is the String value of this interactors domain as derived from the PreT XML document.
protected  boolean executable
          The boolean value indicating whether or not this interactor is executable by the URC.
protected  java.lang.String id
          id is the String value of this interactors ID as derived from the PreT XML document.
protected  int navindex
          navindex is the int value of this interactor in the tabbing order.
protected  boolean readable
          The boolean value indicating whether or not this interactor is readable by the URC.
protected  ElementRef ref
          ref is the ElementRef object that points to this interactors bound socket element.
protected  org.w3c.dom.Element rootElement
          The DOM Element object that represents the XML element this interactor is built from in the PreT document.
protected  IUISocketElement socketElement
          socketElement is the IUISocketElement representation of this interactor's bound socket element.
protected  Widget widget
          The Widget object that is the renderable component of this interactor.
protected  boolean writeable
          The boolean value indicating whether or not this interactor is writeable by the URC.
 
Constructor Summary
AbstractInteractor()
          Creates a new empty AbstractInteractor.
AbstractInteractor(org.w3c.dom.Element rootElement, IUISocketElement socketElement)
          Creates a new AbstractInteractor instance.
 
Method Summary
 java.lang.String getDomain()
           
 java.lang.String getID()
          Returns the ID of this interactor as found in the PreT document.
 int getNavindex()
          Returns the int value indicating this interactor's navindex (set by setNavindex).
 java.lang.String getPretDomain()
          Returns the domain of this interactor as found in the PreT document.
 ElementRef getRef()
          Returns the ElementRef object that references the socket element bound to this interactor.
 ElementRef getSelfRef()
          Returns the ref of this interactor as found in the PreT document.
 IUISocketElement getSocketElement()
          getSocketElement returns the socket element that is bound to this interactor.
 java.lang.Object getUIComponent()
          getUIComponent returns the UI component that represents this interactor.
 void parse()
          Parses the interactor starting from the root element (specified by called setRootElement).
 void parse(org.w3c.dom.Element rootElement)
          parse parses the XML for this interactor and converts the data into programmatically accessible objects.
 void setCalculable(boolean calculate)
           
 void setID(java.lang.String id)
          Set this interactor's ID.
 void setNavindex(int i)
          Sets the navindex for this interactor.
 void setRootElement(org.w3c.dom.Element rootElement)
          Sets the root element of this interactor for parsing purposes.
 void setSocketElement(IUISocketElement e)
          setIUISocketElement sets the interactor's bound socket element.
 void setWidget(Widget w)
          Sets this interactor's renderable widget to the value specified.
 void updateExecutable(boolean execute)
          Update Executable state of this Interactor
 void updateReadable(boolean read)
          Update Readable state of this Interactor
 void updateResources()
           
 void updateValue()
          updateValue is called to set the value to the latest value of the bound socket element.
 void updateWriteable(boolean write)
          Update Writable state of this Interactor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.String id
id is the String value of this interactors ID as derived from the PreT XML document.


domain

protected java.lang.String domain
id is the String value of this interactors domain as derived from the PreT XML document.


widget

protected Widget widget
The Widget object that is the renderable component of this interactor.


navindex

protected int navindex
navindex is the int value of this interactor in the tabbing order.


cohesion

protected java.lang.String cohesion
cohesion is the level of grouping for this interactor.


ref

protected ElementRef ref
ref is the ElementRef object that points to this interactors bound socket element.


socketElement

protected IUISocketElement socketElement
socketElement is the IUISocketElement representation of this interactor's bound socket element.


rootElement

protected org.w3c.dom.Element rootElement
The DOM Element object that represents the XML element this interactor is built from in the PreT document.


readable

protected boolean readable
The boolean value indicating whether or not this interactor is readable by the URC.


writeable

protected boolean writeable
The boolean value indicating whether or not this interactor is writeable by the URC.


executable

protected boolean executable
The boolean value indicating whether or not this interactor is executable by the URC.


calculable

protected boolean calculable
The boolean value indicating whether or not this interactor is calculable by the URC.

Constructor Detail

AbstractInteractor

public AbstractInteractor(org.w3c.dom.Element rootElement,
                          IUISocketElement socketElement)
                   throws UrcException
Creates a new AbstractInteractor instance.

Parameters:
rootElement - an Element value
socketElement - an IUISocketElement value
Throws:
UrcException

AbstractInteractor

public AbstractInteractor()
Creates a new empty AbstractInteractor. The use of this constructor is discouraged since it is easy to miss the setRootElement and setSocketElement calls that are required to have a functional interactor this way.

Method Detail

getSocketElement

public IUISocketElement getSocketElement()
getSocketElement returns the socket element that is bound to this interactor.

Specified by:
getSocketElement in interface IInteractor
Returns:
an IUISocketElement value

parse

public void parse(org.w3c.dom.Element rootElement)
           throws UrcException
parse parses the XML for this interactor and converts the data into programmatically accessible objects.

Parameters:
rootElement - an Element value
Throws:
UrcException

getNavindex

public int getNavindex()
Description copied from interface: IInteractor
Returns the int value indicating this interactor's navindex (set by setNavindex).

Specified by:
getNavindex in interface IInteractor
Returns:
int indicating this interactor's navindex (set by setNavindex).

getID

public java.lang.String getID()
Returns the ID of this interactor as found in the PreT document.

Returns:
a String value

getPretDomain

public java.lang.String getPretDomain()
Returns the domain of this interactor as found in the PreT document.

Returns:
a String value

getSelfRef

public ElementRef getSelfRef()
Returns the ref of this interactor as found in the PreT document.

Returns:
a String value

getRef

public ElementRef getRef()
Returns the ElementRef object that references the socket element bound to this interactor.

Returns:
a ElementRef value

setSocketElement

public void setSocketElement(IUISocketElement e)
Description copied from interface: IInteractor
setIUISocketElement sets the interactor's bound socket element.

Specified by:
setSocketElement in interface IInteractor
Parameters:
e - the socket element that is to be bound to this interactor.

setNavindex

public void setNavindex(int i)
Description copied from interface: IInteractor
Sets the navindex for this interactor. The navindex is used for determining tabbing order in the interactor's UI.

Specified by:
setNavindex in interface IInteractor
Parameters:
i - an int value indicating this interactor's place in the tabbing order.

updateResources

public void updateResources()

getUIComponent

public java.lang.Object getUIComponent()
Description copied from interface: IInteractor
getUIComponent returns the UI component that represents this interactor. For example, if the UI is Swing, the returned component would be a Swing component such as a JPanel.

Specified by:
getUIComponent in interface IInteractor
Returns:
an Object value that is the UI component to be rendered.

setID

public void setID(java.lang.String id)
Description copied from interface: IInteractor
Set this interactor's ID.

Specified by:
setID in interface IInteractor
Parameters:
id - a String value indicating this interactor's ID.

setWidget

public void setWidget(Widget w)
Description copied from interface: IInteractor
Sets this interactor's renderable widget to the value specified.

Specified by:
setWidget in interface IInteractor
Parameters:
w - a Widget value that is the renderable UI component of this interactor.

updateValue

public void updateValue()
Description copied from interface: ISocketElementListener
updateValue is called to set the value to the latest value of the bound socket element. This should be called by the IUISocketElement when its value is set. This will allow the Widget to be updated to the latest value.

Specified by:
updateValue in interface ISocketElementListener

setRootElement

public void setRootElement(org.w3c.dom.Element rootElement)
Description copied from interface: IInteractor
Sets the root element of this interactor for parsing purposes. Must be a valid interactor element tag.

Specified by:
setRootElement in interface IInteractor
Parameters:
rootElement - a Element object that represents the XML element.

getDomain

public java.lang.String getDomain()

parse

public void parse()
           throws UrcException
Description copied from interface: IInteractor
Parses the interactor starting from the root element (specified by called setRootElement).

Specified by:
parse in interface IInteractor
Throws:
UrcException

setCalculable

public void setCalculable(boolean calculate)

updateReadable

public void updateReadable(boolean read)
Update Readable state of this Interactor

Specified by:
updateReadable in interface ISocketElementListener
Parameters:
read - a Boolean value

updateWriteable

public void updateWriteable(boolean write)
Update Writable state of this Interactor

Specified by:
updateWriteable in interface ISocketElementListener
Parameters:
write - a Boolean value

updateExecutable

public void updateExecutable(boolean execute)
Update Executable state of this Interactor

Specified by:
updateExecutable in interface ISocketElementListener
Parameters:
execute - a Boolean value


Copyright © 2006 Trace R&D Center, University of Wisconsin-Madison. All Rights Reserved.