Differences

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

Link to this comparison view

google_maps [2012/04/10 13:19]
srdjan.lukovic [Live example]
google_maps [2012/07/09 10:56] (current)
srdjan.lukovic [GUI Code]
Line 28: Line 28:
  
 import rs.sol.sampleapps.House; import rs.sol.sampleapps.House;
-import rs.sol.soloist.server.builtindomains.builtindatatypes.Text; 
 import rs.sol.soloist.server.guiconfiguration.components.GUIHTMLComponent; import rs.sol.soloist.server.guiconfiguration.components.GUIHTMLComponent;
 import rs.sol.soloist.server.guiconfiguration.components.GUILabelComponent; import rs.sol.soloist.server.guiconfiguration.components.GUILabelComponent;
 import rs.sol.soloist.server.guiconfiguration.components.GUIPanelComponent; import rs.sol.soloist.server.guiconfiguration.components.GUIPanelComponent;
 import rs.sol.soloist.server.guiconfiguration.construction.GUIComponentBinding; import rs.sol.soloist.server.guiconfiguration.construction.GUIComponentBinding;
-import rs.sol.soloist.server.guiconfiguration.elementcomponents.GUICollectionInput+import rs.sol.soloist.server.guiconfiguration.elementcomponents.GUIEdit
-import rs.sol.soloist.server.guiconfiguration.elementcomponents.GUIElementComponent; +import rs.sol.soloist.server.guiconfiguration.elementcomponents.GUIInput;
-import rs.sol.soloist.server.guiconfiguration.elementcomponents.GUISuggestWidget; +
-import rs.sol.soloist.server.guiconfiguration.layout.TableLayoutData;+
 import rs.sol.soloist.server.guiconfiguration.nonvisualcompoments.GUIFindAllInstancesSAPComponent; import rs.sol.soloist.server.guiconfiguration.nonvisualcompoments.GUIFindAllInstancesSAPComponent;
 import rs.sol.soloist.server.uml.concepts.runtime.ISlot; import rs.sol.soloist.server.uml.concepts.runtime.ISlot;
Line 42: Line 39:
 public class GoogleMapsFragment { public class GoogleMapsFragment {
  
- private ISlot<Text> house;+ private ISlot<?> house;
  private GUIPanelComponent rootPanel;  private GUIPanelComponent rootPanel;
  
  public GoogleMapsFragment(GUIPanelComponent rootPanel) {  public GoogleMapsFragment(GUIPanelComponent rootPanel) {
  this.rootPanel = rootPanel;  this.rootPanel = rootPanel;
- this.house = rootPanel.input;+ this.house = rootPanel.opRelay1();
  init();  init();
  }  }
Line 54: Line 51:
  houseLocationDetails();  houseLocationDetails();
   
- GUIElementComponent coordinates = GUIElementComponent.createSlotEditor(rootPanel, House.PROPERTIES.coordinates, house); + GUIEdit coordinates = GUIEdit.createField(rootPanel, House.PROPERTIES.coordinates); 
- coordinates.styleName.set(Text.fromString("#coordinatesH"));+ GUIComponentBinding.create(house, coordinates.ipElement()); 
 + coordinates.setStyle("#coordinatesH");
  GUIHTMLComponent.create(rootPanel, "<div id=\"map_canvasH\"></div>");  GUIHTMLComponent.create(rootPanel, "<div id=\"map_canvasH\"></div>");
  
  GUIHTMLComponent html1 = GUIHTMLComponent.create(rootPanel, "");  GUIHTMLComponent html1 = GUIHTMLComponent.create(rootPanel, "");
- html1.styleName.set(Text.fromString("#tab1886H"));+ html1.setStyle("#tab1886H");
   
- GUIComponentBinding.create(house, html1.html);+ GUIComponentBinding.create(house, html1.ipHTML());
  }  }
  
  private void houseLocationDetails() {  private void houseLocationDetails() {
  GUIPanelComponent table = GUIPanelComponent.createTable(rootPanel);  GUIPanelComponent table = GUIPanelComponent.createTable(rootPanel);
- table.styleName.set(Text.fromString("form"));+ table.setStyle("form");
   
  int row = 0, col = 0;  int row = 0, col = 0;
- GUILabelComponent.create(table, "House", row, col++).styleName.set(Text.fromString("formLabel")); + GUILabelComponent.create(table, "House", row, col++).setStyle("formLabel"); 
- GUILabelComponent.create(table, "Address", row, col++).styleName.set(Text.fromString("formLabel")); + GUILabelComponent.create(table, "Address", row, col++).setStyle("formLabel"); 
- GUILabelComponent.create(table, "City", row, col++).styleName.set(Text.fromString("formLabel")); + GUILabelComponent.create(table, "City", row, col++).setStyle("formLabel"); 
- GUILabelComponent.create(table, "Country", row, col++).styleName.set(Text.fromString("formLabel"));+ GUILabelComponent.create(table, "Country", row, col++).setStyle("formLabel");
   
- GUIFindAllInstancesSAPComponent allHouses = GUIFindAllInstancesSAPComponent.create(rootPanel, House.FQ_TYPE_NAME); + GUIFindAllInstancesSAPComponent allHouses = GUIFindAllInstancesSAPComponent.create(rootPanel, House.CLASSIFIER); 
- GUIElementComponent suggestBox = GUIElementComponent.createInput(table, new GUISuggestWidget(), new GUICollectionInput()); + GUIInput suggestBox = GUIInput.createSuggest(table); 
- GUIComponentBinding.create(allHouses.valueGUICollectionInput.get(suggestBox).collection);+ GUIComponentBinding.create(allHouses.opValue()suggestBox.ipCollection());
   
- GUIElementComponent seAddress = GUIElementComponent.createSlotEditor(table, House.PROPERTIES.address, house); + GUIEdit seAddress = GUIEdit.createField(table, House.PROPERTIES.address); 
- seAddress.styleName.set(Text.fromString("#addressH")); + GUIComponentBinding.create(house, seAddress.ipElement()); 
- GUIElementComponent seCity = GUIElementComponent.createSlotEditor(table, House.PROPERTIES.city, house); + seAddress.setStyle("#addressH"); 
- seCity.styleName.set(Text.fromString("#cityH")); +  
- GUIElementComponent seCountry = GUIElementComponent.createSlotEditor(table, House.PROPERTIES.country, house); + GUIEdit seCity = GUIEdit.createField(table, House.PROPERTIES.city); 
- seCountry.styleName.set(Text.fromString("#countryH"));+ GUIComponentBinding.create(house, seCity.ipElement()); 
 + seCity.setStyle("#cityH"); 
 + 
 + GUIEdit seCountry = GUIEdit.createField(table, House.PROPERTIES.country); 
 + GUIComponentBinding.create(house, seCountry.ipElement()); 
 + seCountry.setStyle("#countryH");
   
  row++; col = 0;  row++; col = 0;
- TableLayoutData.setRowColumn(suggestBox, row, col++); + suggestBox.setRowColumn(row, col++); 
- TableLayoutData.setRowColumn(seAddress, row, col++); + seAddress.setRowColumn(row, col++); 
- TableLayoutData.setRowColumn(seCity, row, col++); + seCity.setRowColumn(row, col++); 
- TableLayoutData.setRowColumn(seCountry, row, col++);+ seCountry.setRowColumn(row, col++);
   
- GUIComponentBinding.create(suggestBox.value, rootPanel.input);+ GUIComponentBinding.create(suggestBox.opValue(), rootPanel.ipRelay1());
  }  }
   
Line 104: Line 107:
 import rs.sol.soloist.helpers.init.Initializer; import rs.sol.soloist.helpers.init.Initializer;
 import rs.sol.soloist.helpers.init.InitializerFailedException; import rs.sol.soloist.helpers.init.InitializerFailedException;
-import rs.sol.soloist.server.builtindomains.builtindatatypes.Text; 
 import rs.sol.soloist.server.guiconfiguration.components.GUIApplicationComponent; import rs.sol.soloist.server.guiconfiguration.components.GUIApplicationComponent;
 import rs.sol.soloist.server.guiconfiguration.components.GUILabelComponent; import rs.sol.soloist.server.guiconfiguration.components.GUILabelComponent;
Line 120: Line 122:
  public void init() throws InitializerFailedException {  public void init() throws InitializerFailedException {
  GUIApplicationComponent application = new GUIApplicationComponent();  GUIApplicationComponent application = new GUIApplicationComponent();
- application.name.set(Text.fromString("GMapsSample"));+ application.setName("GMapsSample");
  SoloistServiceServlet.registerApplication(application);  SoloistServiceServlet.registerApplication(application);
- application.context.set(createContextAndStyles());+ application.setContext(createContextAndStyles());
   
  GUIPanelComponent root = GUIPanelComponent.createFlow(application);  GUIPanelComponent root = GUIPanelComponent.createFlow(application);
   
  GUILabelComponent title = GUILabelComponent.create(root, "Google Maps");  GUILabelComponent title = GUILabelComponent.create(root, "Google Maps");
- title.styleName.set(Text.fromString("titleStyle"));+ title.setStyle("titleStyle");
   
  GUIPanelComponent topPanel = GUIPanelComponent.createFlow(root);  GUIPanelComponent topPanel = GUIPanelComponent.createFlow(root);
- topPanel.styleName.set(Text.fromString("topPanel"));+ topPanel.setStyle("topPanel");
  
  new GoogleMapsFragment(topPanel);  new GoogleMapsFragment(topPanel);
Line 137: Line 139:
  private GUIContext createContextAndStyles() {  private GUIContext createContextAndStyles() {
  GUIContext context = new GUIContext();  GUIContext context = new GUIContext();
- context.supercontext.set(DefaultContextInit.getRoot());+ DefaultContextInit.getRoot().addContext(context);
  
  GUIObjectSetting person = GUIObjectSetting.create(context, House.CLASSIFIER);  GUIObjectSetting person = GUIObjectSetting.create(context, House.CLASSIFIER);
Print/export