Exemple #1
0
  /**
   * Creates a new, empty SessionDescription. The session is set as follows:
   *
   * <p>v=0
   *
   * <p>o=this.createOrigin ("user", InetAddress.getLocalHost().toString());
   *
   * <p>s=-
   *
   * <p>t=0 0
   *
   * @throws SdpException SdpException, - if there is a problem constructing the SessionDescription.
   * @return a new, empty SessionDescription.
   */
  public SessionDescription createSessionDescription() throws SdpException {
    SessionDescriptionImpl sessionDescriptionImpl = new SessionDescriptionImpl();

    ProtoVersionField ProtoVersionField = new ProtoVersionField();
    ProtoVersionField.setVersion(0);
    sessionDescriptionImpl.setVersion(ProtoVersionField);

    OriginField originImpl = null;
    try {
      originImpl =
          (OriginField) this.createOrigin("user", InetAddress.getLocalHost().getHostAddress());
    } catch (UnknownHostException e) {
      e.printStackTrace();
    }
    sessionDescriptionImpl.setOrigin(originImpl);

    SessionNameField sessionNameImpl = new SessionNameField();
    sessionNameImpl.setValue("-");
    sessionDescriptionImpl.setSessionName(sessionNameImpl);

    TimeDescriptionImpl timeDescriptionImpl = new TimeDescriptionImpl();
    TimeField timeImpl = new TimeField();
    timeImpl.setZero();
    timeDescriptionImpl.setTime(timeImpl);
    Vector times = new Vector();
    times.addElement(timeDescriptionImpl);
    sessionDescriptionImpl.setTimeDescriptions(times);

    sessionDescriptionsList.addElement(sessionDescriptionImpl);
    return sessionDescriptionImpl;
  }
Exemple #2
0
 /**
  * Returns TimeDescription unbounded (i.e. "t=0 0");
  *
  * @throws SdpException
  * @return TimeDescription unbounded (i.e. "t=0 0");
  */
 public TimeDescription createTimeDescription() throws SdpException {
   TimeDescriptionImpl timeDescriptionImpl = new TimeDescriptionImpl();
   TimeField timeImpl = new TimeField();
   timeImpl.setZero();
   timeDescriptionImpl.setTime(timeImpl);
   return timeDescriptionImpl;
 }
Exemple #3
0
 /**
  * Returns TimeDescription object with the specified properties.
  *
  * @param start start time.
  * @param stop stop time.
  * @throws SdpException if the parameters are null
  * @return TimeDescription
  */
 public TimeDescription createTimeDescription(Date start, Date stop) throws SdpException {
   TimeDescriptionImpl timeDescriptionImpl = new TimeDescriptionImpl();
   TimeField timeImpl = new TimeField();
   timeImpl.setStart(start);
   timeImpl.setStop(stop);
   timeDescriptionImpl.setTime(timeImpl);
   return timeDescriptionImpl;
 }
 @SuppressWarnings("deprecation")
 private static Date getCombineDate(DateField dateField, TimeField timeField) {
   Date result = null;
   Date date = dateField.getValue();
   Date time = timeField.getValue();
   if (date != null && time != null) {
     result =
         new Date(
             date.getYear(),
             date.getMonth(),
             date.getDate(),
             time.getHours(),
             time.getMinutes(),
             time.getSeconds());
   }
   return result;
 }
  public ArchiveView(final ArchiveHandler archiveHandler, ListStore<Device> deviceStore) {
    this.archiveHandler = archiveHandler;
    deviceStore.addStoreHandlers(deviceStoreHandlers);
    this.deviceStore = deviceStore;

    DeviceProperties deviceProperties = GWT.create(DeviceProperties.class);
    deviceCombo = new ComboBox<Device>(deviceStore, deviceProperties.label());

    // Element that displays the current track color
    styleButtonTrackColor = new TextButton();
    styleButtonTrackColor
        .getElement()
        .getStyle()
        .setProperty("backgroundColor", "#".concat(style.DEFAULT_COLOR));
    styleButtonTrackColor.getElement().getStyle().setCursor(Style.Cursor.TEXT);
    // Menu with the small palette
    smallColorMenu = new ExtColorMenu(ArchiveStyle.COLORS, ArchiveStyle.COLORS);
    smallColorMenu.setColor(ArchiveStyle.DEFAULT_COLOR);
    smallColorMenu
        .getPalette()
        .addValueChangeHandler(
            new ValueChangeHandler<String>() {
              @Override
              public void onValueChange(ValueChangeEvent<String> event) {
                style.setTrackColor(event.getValue());
                smallColorMenu.hide(true);
                fullColorMenu.getPalette().setValue("", false);
                styleButtonTrackColor
                    .getElement()
                    .getStyle()
                    .setProperty("backgroundColor", "#".concat(style.getTrackColor()));
              }
            });
    // Menu with the complete palette
    fullColorMenu = new ColorMenu();
    fullColorMenu
        .getPalette()
        .addValueChangeHandler(
            new ValueChangeHandler<String>() {
              @Override
              public void onValueChange(ValueChangeEvent<String> event) {
                style.setTrackColor(event.getValue());
                fullColorMenu.hide(true);
                smallColorMenu.getPalette().setValue("", false);
                styleButtonTrackColor
                    .getElement()
                    .getStyle()
                    .setProperty("backgroundColor", "#".concat(style.getTrackColor()));
              }
            });
    // Markers
    routeMarkersType = new Menu();
    for (Object[] obj :
        new Object[][] {
          {i18n.noMarkers(), null},
          {i18n.standardMarkers(), PositionIconType.iconArchive},
          {i18n.reducedMarkers(), PositionIconType.dotArchive}
        }) {
      CheckMenuItem item = new CheckMenuItem((String) obj[0]);
      final PositionIconType iconType = (PositionIconType) obj[1];
      item.setGroup("markers");
      item.setChecked(
          iconType == ApplicationContext.getInstance().getUserSettings().getArchiveMarkerType());
      if (item.isChecked()) {
        style.setIconType(iconType);
      }
      item.addSelectionHandler(
          new SelectionHandler<Item>() {
            @Override
            public void onSelection(SelectionEvent<Item> event) {
              style.setIconType(iconType);
              archiveHandler.onChangeArchiveMarkerType(iconType);
            }
          });
      routeMarkersType.add(item);
    }

    devicesTabs =
        new TabPanel(GWT.<TabPanel.TabPanelAppearance>create(BlueTabPanelBottomAppearance.class));
    archivePanels = new HashMap<Long, ArchivePanel>();

    uiBinder.createAndBindUi(this);

    markersMenu.setText(i18n.overlayType(UserSettings.OverlayType.MARKERS));

    // Initialize with current time
    long min = 60 * 1000;
    Date now = new Date();
    Date to = new Date(((now.getTime() + 15 * min) / (15 * min)) * 15 * min);
    Date from = new Date(to.getTime() - 60 * min);
    fromDate.setValue(from);
    fromTime.setValue(from);
    toDate.setValue(to);
    toTime.setValue(to);
  }
Exemple #6
0
 /**
  * Returns an unbounded Time specification (i.e., "t=0 0").
  *
  * @throws SdpException
  * @return an unbounded Time specification (i.e., "t=0 0").
  */
 public Time createTime() throws SdpException {
   TimeField timeImpl = new TimeField();
   timeImpl.setZero();
   return timeImpl;
 }
Exemple #7
0
 /**
  * Returns a Time specification with the specified start and stop times.
  *
  * @param start start time
  * @param stop stop time
  * @throws SdpException if the parameters are null
  * @return a Time specification with the specified start and stop times.
  */
 public Time createTime(Date start, Date stop) throws SdpException {
   TimeField timeImpl = new TimeField();
   timeImpl.setStart(start);
   timeImpl.setStop(stop);
   return timeImpl;
 }