AG VLSI Design and Architecture

SFB 501 - Project D1: Application System "Buildings"

PSiGene

Pattern Catalog

[PSiGene]

13.2 Pattern DisplayAttribute

Intent

Visualizing an attribute of an instantiate simulation object in a non graphical object-window, containing text-fields, sliders or buttons.

Motivation

Running a simulation, the attributes of some objects need to be monitored or changed, e.g., the temperature of rooms or radiators.

Applicability

One has to install as many DisplayAttribute Patterns to the target as needed. All values will be displayed in one window. The window-size adjusts with the number of DisplayAttribute Patterns installed.

Structure

With any DisplayAttribute Pattern installed to, the target object will contain a new class-method that returns a subcanvas-specification for the display-window. This specification can be obtained by the CanvasTool delivered with VisualWave or VisualWorks.

With the first DisplayAttribute Pattern the target object will contain the method openObjectWindow and the method objectWindowSpecs . The first method is used by UIBuilding (c.f. documentation of simulator graphic) to open the object-window and activate the display. The second method changes with any DisplayAttribute Pattern installed. It returns a list of all subcanvas-specifications the target contains, i.e., the list elements are the names of the methods that return the specifications.

There are many types of subcanvas-specifications possible, so the Pattern DisplayAttribute is abstract and will not be used itself but as a superclass for other Patterns that affect the object-window. Subclasses are recommended to be named like DisplayValue . They must overwrite the spec-template and the method setupMacros , corresponding to the macros needed.

 

Participants

Objects
Methods

Collaborations

This pattern requires the existence of the UIBuilding classes.

Implementation

openObjectWindow
    "Open an ObjectWindow and display the specs in the array
    objectWindowSpecs."
    | canvas bldr |
    canvas := BuildingObjectCanvas new.
    canvas object: self.
    bldr := canvas openObjectInterface: 
                    self objectWindowSpecs at: self class.
    canvas activate.
    ^bldr
{spec}
    ^self subclassResponsibility
objectWindowSpecs
    "Return an array with specs to display in the ObjectWindow."
    ^#(#{spec}
)

The list returned by this method changes with any installed DisplayAttribute. It returns a list of all subcanvas-specifications the target contains, i.e. the list elements are the names of the methods that return the specifications

Related Patterns

DisplayGraphic, DisplaySlider, DisplayValue.

PEdit description

Pattern DisplayAttribute Category display
    ObjectType use target
    SingleMethod use monitor
        SingleMethod use preset spec
End

previous page next page up   Table of Contents PSiGene