/**
   * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
   *     org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
   */
  @Override
  public void event(UserRequest ureq, Component source, Event event) {
    if (event.getCommand().equals("geometry")) {
      String p = ureq.getHttpReq().getParameter("p");
      if (p != null) {
        if (allGeometry.matcher(p).matches()) {
          Matcher m = parseGeometry.matcher(p);

          if (m.find()) offsetX = Integer.parseInt(m.group());
          if (m.find()) offsetY = Integer.parseInt(m.group());
          if (m.find()) width = Integer.parseInt(m.group());
          if (m.find()) height = Integer.parseInt(m.group());

          boolean dirt = wrapper.isDirty();
          wrapper.contextPut("width", width);
          wrapper.contextPut("height", height);
          wrapper.contextPut("offsetX", offsetX);
          wrapper.contextPut("offsetY", offsetY);
          wrapper.setDirty(dirt);
        } else if (posGeometry.matcher(p).matches()) {
          Matcher m = parseGeometry.matcher(p);

          if (m.find()) offsetX = Integer.parseInt(m.group());
          if (m.find()) offsetY = Integer.parseInt(m.group());

          boolean dirt = wrapper.isDirty();
          wrapper.contextPut("offsetX", offsetX);
          wrapper.contextPut("offsetY", offsetY);
          wrapper.setDirty(dirt);
        }
      }
    } else if (source == wrapper) {
      if (event.getCommand().equals("close")) {
        fireEvent(ureq, Event.DONE_EVENT);
      }
    }
  }
  private void updateButtons() {
    if (readOnly) {
      startLink.setVisible(false);
      registerLink.setVisible(false);
      confirmLink.setVisible(false);
      joinLink.setVisible(false);
    } else {
      Date start = meeting.getStartDate();
      Date end = meeting.getEndDate();
      Date now = new Date();
      boolean canStart = (start.compareTo(now) <= 0 && end.compareTo(now) > 0);

      Calendar cal = Calendar.getInstance();
      cal.setTime(start);
      cal.add(Calendar.MINUTE, -60);
      Date startMinusOne = cal.getTime();
      boolean canCoachStart = (startMinusOne.compareTo(now) <= 0 && end.compareTo(now) > 0);

      boolean ended = (end.compareTo(now) <= 0);
      if (administrator || moderator) {
        if (canCoachStart) {
          startLink.setVisible(true);
          registerLink.setVisible(false);
        } else if (ended) {
          startLink.setVisible(false);
          registerLink.setVisible(false);
        } else if (registrant == null) {
          startLink.setVisible(false);
          registerLink.setVisible(true);
        } else {
          startLink.setVisible(false);
          registerLink.setVisible(false);
        }
        confirmLink.setVisible(false);
        joinLink.setVisible(false);
      } else if (ended) {
        registerLink.setVisible(false);
        confirmLink.setVisible(false);
        joinLink.setVisible(false);
      } else if (canStart) {
        if (registrant == null) {
          registerLink.setVisible(false);
          confirmLink.setVisible(false);
          joinLink.setVisible(true);
        } else {
          registerLink.setVisible(false);
          confirmLink.setVisible(false);
          joinLink.setVisible(true);
        }
      } else {
        if (registrant == null) {
          registerLink.setVisible(true);
          confirmLink.setVisible(false);
          joinLink.setVisible(false);
        } else {
          registerLink.setVisible(false);
          confirmLink.setVisible(true);
          joinLink.setVisible(false);
        }
      }
    }
    mainVC.setDirty(true);
  }