Differences

This shows you the differences between two versions of the page.

Link to this comparison view

customui [2011/12/28 15:56]
srdjan.lukovic [Implementation Procedure]
customui [2011/12/28 16:24] (current)
srdjan.lukovic [Architecture]
Line 20: Line 20:
 Figure 1 depicts the described architecture of the SOLoist GUI subsystem. Figure 1 depicts the described architecture of the SOLoist GUI subsystem.
  
-{{ :guienvironment.jpg |Figure 1. SOLoist GUI runtime environment}}+{{:guienvironment.jpg?400|Figure 1. SOLoist GUI runtime environment}}
  
 ====== Implementation Procedure ====== ====== Implementation Procedure ======
Line 130: Line 130:
 public static final String RESULT_COMMAND_COMPONENT_O = "12"; public static final String RESULT_COMMAND_COMPONENT_O = "12";
  
-</code>\\ The values of these constants represent unique identifiers of the pins. The names of these constant fields follow the pattern ''PIN_NAME_COMPONENT_NAME_PIN_DIRECTION''. Furthermore, there are two ''HashMap''s named ''PIN_NAMES'' and ''PIN_IDS''. The former stores the mappings from the fully qualified name to the identifier of each pin of each component, while the latter stores the inverse mapping. You should first create unique ''String'' identifiers for all pins that you created in the component under construction and then put the mappings for them into these two ''HashMap''s on the application startup. The next step shows the use of these constants. Finally, you should make sure that they reside in a class that gets GWT-compiled.+</code> The values of these constants represent unique identifiers of the pins. The names of these constant fields follow the pattern ''PIN_NAME_COMPONENT_NAME_PIN_DIRECTION''. Furthermore, there are two ''HashMap''s named ''PIN_NAMES'' and ''PIN_IDS''. The former stores the mappings from the fully qualified name to the identifier of each pin of each component, while the latter stores the inverse mapping. You should first create unique ''String'' identifiers for all pins that you created in the component under construction and then put the mappings for them into these two ''HashMap''s on the application startup. The next step shows the use of these constants. Finally, you should make sure that they reside in a class that gets GWT-compiled.
   - **Create the client-side controller class.** The controller object is responsible for maintaining the UI representation (through a GWT widget), handling events from the widget, reacting on events on input pins, generating events on output pins, and communicating with the UI component object on the server, if necessary. It is strictly a client-side class – controller objects reside in the web browser. Hence, the controller class needs to be GWT-compiled as well.\\ In order to create a controller class:   - **Create the client-side controller class.** The controller object is responsible for maintaining the UI representation (through a GWT widget), handling events from the widget, reacting on events on input pins, generating events on output pins, and communicating with the UI component object on the server, if necessary. It is strictly a client-side class – controller objects reside in the web browser. Hence, the controller class needs to be GWT-compiled as well.\\ In order to create a controller class:
     - Provide it with a name corresponding to the name of the UI component, for example ''LabelController''.     - Provide it with a name corresponding to the name of the UI component, for example ''LabelController''.
Line 146: Line 146:
    return representative;    return representative;
 } }
-</code>\\ Note that you can access the created widget through the field ''myRepresentative''.+</code> Note that you can access the created widget through the field ''myRepresentative''.
     - Override the ''acceptViaBinding'' method in order to react on events on each of the component’s input pins. Do not forget to react on events received via inherited input pins (from ''GUIComponent'' class). For the ''GUILabelComponent'' example, we could do something like this in order to react on the event on the ''newText'' input pin. In a similar way, you can react on events from all other input pins of this component. In order to send values on output pins, use the method ''sendViaBinding''. <code java>     - Override the ''acceptViaBinding'' method in order to react on events on each of the component’s input pins. Do not forget to react on events received via inherited input pins (from ''GUIComponent'' class). For the ''GUILabelComponent'' example, we could do something like this in order to react on the event on the ''newText'' input pin. In a similar way, you can react on events from all other input pins of this component. In order to send values on output pins, use the method ''sendViaBinding''. <code java>
 @Override @Override
Print/export