Package com.bradrydzewski.gwt.calendar.client

Examples of com.bradrydzewski.gwt.calendar.client.Appointment


    int day = (int) Math.floor(left / gridX);
    day = Math.max(0, day);
    day = Math.min(day, columns-1);

    //get the appointment, create the start & end date
    Appointment appt = ((AppointmentWidget)widget).getAppointment();
    Date start = (Date)date.clone();
    Date end = (Date)date.clone();
   
    start.setDate(start.getDate()+day);
    end.setDate(end.getDate()+day);
   
        start.setHours(0);
        start.setMinutes(0);
        start.setSeconds(0);
        start.setMinutes((intervalStart)*(60/intervalsPerHour));
        end.setHours(0);
        end.setMinutes(0);
        end.setSeconds(0);
        end.setMinutes((intervalStart + intervalSpan)*(60/intervalsPerHour));
   

    appt.setStart(start);
    appt.setEnd(end);
   
   
   
  }
 
View Full Code Here


      }
      highlightedCells = null;

      Draggable draggable = draggableList.get(0);

      Appointment appointment =
         ((AppointmentWidget) context.draggable).getAppointment();

      long originalStartToEndTimeDistance =
         appointment.getEnd().getTime() - appointment.getStart().getTime();

      //get the column and row for the draggable widget
      int row = getRow(context, draggable) - 1;
      int col = getColumn(context, draggable);
      int cell = row * daysPerWeek + col;

      //calculate the new start & end dates
      Date newStart = DateUtils.shiftDate(firstDateDisplayed, cell);
      DateUtils.copyTime(appointment.getStart(), newStart);

      Date newEnd = new Date(newStart.getTime() + originalStartToEndTimeDistance);

      //Set the appointment's new start & end dates
      appointment.setStart(newStart);
      appointment.setEnd(newEnd);
   }
View Full Code Here

  @SuppressWarnings("deprecation")
  public void dragEnd() {
    AppointmentWidget apptWidget = (AppointmentWidget)context.draggable.getParent();
    int apptHeight = apptWidget.getOffsetHeight();
    Appointment appt = apptWidget.getAppointment();
   
   
        //get the start date
        Date end = (Date)appt.getStart().clone();
       
        //get the "top" location of the appointment widget
        float topFloat = DOM.getIntStyleAttribute(apptWidget.getElement(), "top");
       
        //get the grid span
        int intervalStart = Math.round(topFloat / snapSize);
        int intervalSpan = Math.round(apptHeight / snapSize);
       
        //set the end based on the new dragged value
        end.setHours(0);
        end.setMinutes((intervalStart + intervalSpan)*(60/intervalsPerHour));
       
        //update the end
        appt.setEnd(end);
   
    super.dragEnd();
  }
View Full Code Here

    protected abstract ThemeAppointmentStyle getDefaultViewAppointmentStyleForTheme();

    private void doApplyStyleInternal(AppointmentWidget widget, boolean selected) {

    // Extract the Appointment for later reference
    Appointment appointment = widget.getAppointment();
    // Extract the DOM Element for later reference
    Element elem = widget.getElement();
    Element bodyElem = widget.getBody().getElement();
    Element headerElem = widget.getHeader().getElement();
    // Is MultiDay?
    boolean multiDay = appointment.isMultiDay() || appointment.isAllDay();


    //Lookup the style from the map
    ThemeAppointmentStyle style = getViewAppointmentStyleForTheme(appointment);
View Full Code Here

  public void onDoubleClick(Element element, Event event) {

    List<AppointmentWidget> list = findAppointmentWidgetsByElement(element);
    if (!list.isEmpty()) {
      Appointment appt = list.get(0).getAppointment();
      //if (appt.equals(calendarWidget.getSelectedAppointment()))
        calendarWidget.fireOpenEvent(appt);
      // exit out

    } else if (getSettings().getTimeBlockClickNumber() == Click.Double
View Full Code Here

    // Ignore the scroll panel
    if (dayViewBody.getScrollPanel().getElement().equals(element)) {
      return;
    }

        Appointment appt =
          findAppointmentByElement(element);
       
        if (appt!=null) {
          selectAppointment(appt);
        } else if ((getSettings().getTimeBlockClickNumber() == Click.Single
View Full Code Here

      timeBlockClick(x, y);
    }
  }
 
  public void onMouseOver(final Element element, final Event event) {
    Appointment appointment = findAppointmentByElement(element);
    calendarWidget.fireMouseOverEvent(appointment, element);
  }
View Full Code Here

          dragController.setConstrainWidgetToBoundaryPanel(true); //do I need these?
          dragController.setBehaviorMultipleSelection(false);
          dragController.addDragHandler(new DragHandler(){
 
        public void onDragEnd(DragEndEvent event) {
          Appointment appt = ((AppointmentWidget) event.getContext().draggable).getAppointment();
                  calendarWidget.setCommittedAppointment(appt);
                  calendarWidget.fireUpdateEvent(appt);
        }
 
        public void onDragStart(DragStartEvent event) {
          Appointment appt = ((AppointmentWidget) event.getContext().draggable).getAppointment();
          calendarWidget.setRollbackAppointment(appt.clone());
          ((DayViewPickupDragController)dragController).setMaxProxyHeight(getMaxProxyHeight());
        }
 
        public void onPreviewDragEnd(DragEndEvent event)
            throws VetoDragException {
View Full Code Here

    if (resizeController == null) {
      resizeController = new DayViewResizeController(dayViewBody.getGrid().grid);
      resizeController.addDragHandler(new DragHandler(){

        public void onDragEnd(DragEndEvent event) {
          Appointment appt = ((AppointmentWidget) event.getContext().draggable.getParent()).getAppointment();
                    calendarWidget.setCommittedAppointment(appt);
                    calendarWidget.fireUpdateEvent(appt);
        }

        public void onDragStart(DragStartEvent event) {
          calendarWidget
          .setRollbackAppointment(((AppointmentWidget) event
              .getContext().draggable.getParent()).getAppointment()
              .clone());
        }

        public void onPreviewDragEnd(DragEndEvent event)
            throws VetoDragException {}
        public void onPreviewDragStart(DragStartEvent event)
            throws VetoDragException {}
      });
    }
     
    if(proxyResizeController == null) {
      proxyResizeController = new DayViewResizeController(dayViewBody.getGrid().grid);
      proxyResizeController.addDragHandler(new DragHandler(){
        long startTime = 0L;
        int initialX = 0;
        int initialY = 0;
        Date startDate;
       
        public void onDragEnd(DragEndEvent event) {
          long clickTime = System.currentTimeMillis() - startTime;
          int y = event.getContext().mouseY;
          if (clickTime <= 500 && initialY == y) {
            calendarWidget.fireTimeBlockClickEvent(startDate);
          } else {
            Appointment appt = ((AppointmentWidget) event.getContext().draggable.getParent()).getAppointment();
            calendarWidget.fireCreateEvent(appt);           
          }
        }

        public void onDragStart(DragStartEvent event) {
View Full Code Here

      // Adjust the start to the closest interval
      top = (int)Math.floor(
          (float) relativeY / snapSize) * snapSize;

      AppointmentWidget proxy = new AppointmentWidget();
      Appointment app = new Appointment();
      app.setStart(newStartDate);
      app.setEnd(newStartDate);
      proxy.setAppointment(app);
      proxy.setStart(newStartDate);
      proxy.setPixelSize(width, height);
      dayViewBody.getGrid().grid.add(proxy, left, top);
        styleManager.applyStyle(proxy, false);
View Full Code Here

TOP

Related Classes of com.bradrydzewski.gwt.calendar.client.Appointment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.