/**
  * Mètode que canvia les unitats i mostra les seves dades
  *
  * @param actionEvent
  */
 public void changeUnits(ActionEvent actionEvent) {
   CheckMenuItem men = (CheckMenuItem) actionEvent.getSource();
   switch (men.getId()) {
     case "mts":
       units = 0;
       ipr.setSelected(false);
       break;
     case "ipr":
       units = 1;
       mts.setSelected(false);
       break;
   }
   setData(city, units);
 }
 /**
  * Mètode que canvia la ciutat i mostra les seves dades
  *
  * @param actionEvent
  */
 public void changeCity(ActionEvent actionEvent) {
   CheckMenuItem men = (CheckMenuItem) actionEvent.getSource();
   switch (men.getId()) {
     case "bcn":
       city = "Barcelona";
       mdd.setSelected(false);
       break;
     case "mdd":
       city = "Madrid";
       bcn.setSelected(false);
       break;
   }
   setData(city, units);
 }
Beispiel #3
0
 protected void handleRadioGroups() {
   clearGroups();
   for (int i = 0; i < getItemCount(); i++) {
     Object obj = getItem(i);
     if (obj instanceof CheckMenuItem) {
       CheckMenuItem check = (CheckMenuItem) obj;
       if (check.getGroup() != null) {
         El g = getGroup(check.getGroup());
         Accessibility.setState(
             g.dom, "aria-owns", g.dom.getAttribute("aria-owns") + " " + check.getId());
         if (check.getAriaGroupTitle() != null) {
           g.dom.setTitle(check.getAriaGroupTitle());
         }
       }
     }
   }
 }