UniVista Programmer's Guide

UniVista.support.screens

VariableScreenObject


Intent | Structure | Participants | Sample Code | Known Uses

Intent

Holds a Variable and aggregates calls to its VariableDisplay from the Screen.

Structure

Participants

Sample Code

The property sheet is constructed in the setupPEUI method. The excerpt shows how the Introspector is used to create a BeanInfo class for any VariableBean. This allows the instanciation of customizer, as indicated in the BeanInfo. In addition, the display bean is hooked into the Variable's customizer.
// creating a customizer

public void setupPEUI() {
if (theVar != null) {
super.setupPEUI();

// again, a temp. check
if (theVar instanceof VariableBean) {
try {
String[] path = {"UniVista.beaninfo"};
Introspector.setBeanInfoSearchPath(path);
BeanDescriptor bd = (Introspector.getBeanInfo(theVar.getClass())).getBeanDescriptor();
theVarCustomizer = (VariableBeanCustomizer)((Class)bd.getCustomizerClass()).newInstance();

// we automatically get property change listening hooks internally
theVarCustomizer.setObject((Object)theVar);

if (theVarUI != null) {
theVarCustomizer.setDisplayBeanTarget((Object)theVarUI);
}
theVarCustomizer.setReadOnly(getReadOnly());

propertyFrame.getContentPane().add(theVarCustomizer.getUI(), BorderLayout.CENTER);
propertyFrame.pack();
propertyFrame.setVisible(true);
} catch(Exception e) {
e.printStackTrace();
// may be raised by introspector
}
}
}
}

Known Uses

This class is essential for displaying Variables in Screens. Wherever ScreenObjects are created, this class can be found. For example, the StudyEditor and any LayoutEngines would create these. Also, the RunEngine would indirectly (via Screen) pass calls to these objects so that they could setup their UIs.



Contact the UniVista Team | Main Page | Table of Contents