Download cache - The XML Cover Pages
Transcript
UIML 3.0 Language Specification 6.2.2.4 Defining Legal Event Property Names Via <d-class> Let’s consider our UIML document again. Suppose we want to display the x coordinate of the mouse pointer when it is clicked inside a button. The label on the button will be changed to display the x coordinate. The following UIML document accomplishes this: <uiml> <interface> ... <part class=”Button”> <style><property name=”VALUE”>Press me!</property></style> <behavior> <rule> <condition> <event name=”MouseListener.mouseClicked”/> </condition> <action> <property name=”VALUE”> <property event-class=”MouseListener.mouseClicked” name=”X”/> </property> </action> </rule> </behavior> </part> ... </interface> <peers> <presentation base="Java_1.3_Harmonia_1.0"/> </peers> </uiml> Here are the elements in <presentation> in Java_1.3_Harmonia_1.0.uiml to define the property named X for a mouse click: <uiml> <template .../> <presentation .../> <d-class id="MouseEvent" <d-method <d-method <d-method <d-method <d-method <d-method <d-method Harmonia, Inc. used-in-tag="event" maps-type="class" maps-to="java.awt.event.MouseEvent"> id="source" maps-to="getSource" return-type="java.lang.Object"/> id="id" maps-to="getID" return-type="int"/> id="clickCount" maps-to="getClickCount" return-type="int"/> id="point" maps-to="getPoint" return-type="int"/> id="X" maps-to="getX" return-type="int"/> id="Y" maps-to="getY" return-type="int"/> id="isPopupTrigger" maps-to="getIsPopupTrigger" return-type="boolean"/> Page 84 02/08/2002