Package br.com.visualmidia.business

Examples of br.com.visualmidia.business.RegistrationMap


      weekDays.add("Domingo");
     
      GD gd = GD.getInstance();
        int startWorkTime = gd.getWorktime("start");
        int endWorkTime = gd.getWorktime("end");
      RegistrationMap registrationMap = system.getRegistratioMap();
      for (int i = 1; i <= weekDays.size() ; i++) {
      for (int hour = startWorkTime; hour <= endWorkTime; hour++) {
        GDDate date = new GDDate();
        date.setWeekDay(i);
        date.setHourOfDay(hour-1);
        int numberOfAppointments = registrationMap.getNumberOfAppointmentsOfTheDay(date);
        int numberOfVacancy = registrationMap.getMaxVacancy(weekDays.get(i-1), String.valueOf(hour));
        int numberOfVacancyWithOutClassRoom = numberOfVacancy - numberOfAppointments;
       
        if(numberOfVacancyWithOutClassRoom < _numberOfComputers && numberOfVacancyWithOutClassRoom > 0) {
          TableItem item = new TableItem(verifyTable, SWT.NONE);
          item.setText(weekDays.get(i-1) + " - " + hour + ":00" + " - N�mero de Alunos: " + (numberOfAppointments - (numberOfVacancy - _numberOfComputers)));
View Full Code Here


        GDSystem.serverIp = serverIp;
    }

    public RegistrationMap getRegistratioMap() {
        if (registrationMap == null)
            registrationMap = new RegistrationMap(me);
        return registrationMap;
    }
View Full Code Here

           
            for (String date : listDate) {
                posX = convert(10);
               
                GDDate actualDate = new GDDate(date);
                RegistrationMap registrationMap = system.getRegistratioMap();
                page.addElement(imageBkg);
                page.addElement(logoImage);
                page.addElement(titleText);
               
                posY += 50;
               
                JRPrintText text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
                text.setText("Data: "+date);
                text.setX(posX);
                text.setY(posY);
                text.setWidth(150);
                text.setHeight(12);
                text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_LEFT);
                text.setLineSpacingFactor(2.0f);
                text.setLeadingOffset(-4.0f);
                text.setStyle(normalStyle);
                page.addElement(text);
               
                text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
                text.setText("Dia da Semana: "+new SimpleDateFormat("EEEEE").format(new GDDate(date).getDate()));
                text.setX(posX+300);
                text.setY(posY);
                text.setWidth(220);
                text.setHeight(12);
                text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_LEFT);
                text.setLineSpacingFactor(2.0f);
                text.setLeadingOffset(-4.0f);
                text.setStyle(normalStyle);
                page.addElement(text);
               
                posY += 17;
               
                text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
                text.setText("Funcionamento: das " + startWorkTime + ":00 �s " + endWorkTime + ":00");
                text.setX(posX);
                text.setY(posY);
                text.setWidth(290);
                text.setHeight(12);
                text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_LEFT);
                text.setLineSpacingFactor(2.0f);
                text.setLeadingOffset(-4.0f);
                text.setStyle(normalStyle);
                page.addElement(text);
               
                text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
                text.setText("Impresso em: "+new GDDate().getFormatedDate());
                text.setX(posX+300);
                text.setY(posY);
                text.setWidth(220);
                text.setHeight(12);
                text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_LEFT);
                text.setLineSpacingFactor(2.0f);
                text.setLeadingOffset(-4.0f);
                text.setStyle(normalStyle);
                page.addElement(text);
               
                posY += 16;
               
                text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
                text.setText("Obs. Marque com \"X\" os alunos faltantes.\n* Aluno de Reposi��o");
                text.setX(posX);
                text.setY(posY);
                text.setWidth(530);
                text.setHeight(26);
                text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_LEFT);
                text.setLineSpacingFactor(2.0f);
                text.setLeadingOffset(-4.0f);
                text.setStyle(normalStyle);
                page.addElement(text);
               
                posY += 23;
                for(int periods=0; periods<3; periods++){
                    String weekDay = new SimpleDateFormat("EEEEE").format(new GDDate(date).getDate()).replace("-feira", "");
                    if(getHourVacancy(weekDay, ((periods+1)*6)+1, ((2+periods)*6))>0){
                        posX = convert(10);
                       
                        JRPrintRectangle rectangle = new JRBasePrintRectangle(jasperPrint.getDefaultStyleProvider());
                        rectangle.setX(posX);
                        rectangle.setY(posY);
                        rectangle.setWidth(535);
                        rectangle.setHeight(14);
                        rectangle.setBackcolor(new Color(153, 153, 153));
                        page.addElement(rectangle);
                       
                        text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
                        text.setText(period.get(periods));
                        text.setX(posX);
                        text.setY(posY);
                        text.setWidth(535);
                        text.setHeight(14);
                        text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_CENTER);
                        text.setLineSpacingFactor(2.0f);
                        text.setLeadingOffset(-4.0f);
                        text.setStyle(boldStyle);
                        page.addElement(text);
                       
                        posY += 14;
                        int posYTemp = 0;
                       
                        for(int hour=(((periods+1)*6)+1); hour<=((2+periods)*6); hour++){
                            if(getMaxVacancy(weekDay, hour)>0){
    //                      if(!isHourVacancy(j)){
                                int numberOfColumns = getHourVacancy(weekDay, ((periods+1)*6)+1, ((2+periods)*6));
                                int width = Math.round(535/numberOfColumns);
                               
                                rectangle = new JRBasePrintRectangle(jasperPrint.getDefaultStyleProvider());
                                rectangle.setX(posX);
                                rectangle.setY(posY);
                                rectangle.setWidth(width);
                                rectangle.setHeight(14);
                                rectangle.setBackcolor(new Color(204, 204, 204));
                                page.addElement(rectangle);
                               
                                text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
                                text.setText(String.valueOf(hour));
                                text.setX(posX);
                                text.setY(posY);
                                text.setWidth(width);
                                text.setHeight(14);
                                text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_CENTER);
                                text.setLineSpacingFactor(2.0f);
                                text.setLeadingOffset(-4.0f);
                                text.setStyle(boldStyle);
                                page.addElement(text);
                               
                                posYTemp =posY;
                                for (int box = 0; box < numberTotalComputers; box++) {
                                    posYTemp +=14;
                                    rectangle = new JRBasePrintRectangle(jasperPrint.getDefaultStyleProvider());
                                    rectangle.setX(posX);
                                    rectangle.setY(posYTemp);
                                    rectangle.setWidth(width);
                                    rectangle.setHeight(14);
                                    page.addElement(rectangle);
                                   
                                    JRPrintLine line = new JRBasePrintLine(jasperPrint.getDefaultStyleProvider());
                                    line.setX(posX+14);
                                    line.setY(posYTemp);
                                    line.setWidth(0);
                                    line.setHeight(14);
                                    page.addElement(line);
                                   
                                }
                               
                                actualDate.setHourOfDay(hour);
                               
                                MergeSortAlgorithm sortAlgorithm = new MergeSortAlgorithm();
                               
                                List<RegistrationAppointment> registrationList = registrationMap.getAppointmentsOnThatWeekDay(actualDate);
                                if(registrationList.size() > 1)
                                    sortAlgorithm.sortRegistrationAppointmentByName(registrationList);
                               
                                posYTemp =posY+2;
                                for (int studentIndex = 0; studentIndex < registrationList.size(); studentIndex++) {
                                    posYTemp +=14;
                                    text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
                                    text.setText(registrationList.get(studentIndex).getRegistration().getStudent().getName());
                                    text.setX(posX+16);
                                    text.setY(posYTemp);
                                    text.setWidth(width-16);
                                    text.setHeight(12);
                                    text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_LEFT);
                                    text.setLineSpacingFactor(2.0f);
                                    text.setLeadingOffset(-4.0f);
                                    text.setStyle(studentNameStyle);
                                    page.addElement(text);
                                }
                               
                                List<RegistrationAppointment> replacementList = registrationMap.getReplacementsOnThatDay(actualDate);
                                if(replacementList.size() > 1)
                                    sortAlgorithm.sortRegistrationAppointmentByName(replacementList);
                               
                                for (int studentIndex = 0; studentIndex < replacementList.size(); studentIndex++) {
                                    posYTemp +=14;
View Full Code Here

      weekDays.add("Domingo");
     
      GD gd = GD.getInstance();
        int startWorkTime = gd.getWorktime("start");
        int endWorkTime = gd.getWorktime("end");
      RegistrationMap registrationMap = system.getRegistratioMap();
      for (int i = 1; i <= weekDays.size() ; i++) {
      for (int hour = startWorkTime; hour <= endWorkTime; hour++) {
        GDDate date = new GDDate();
        date.setWeekDay(i);
        date.setHourOfDay(hour-1);
        int numberOfVacancyWithOutClassRoom = registrationMap.getMaxVacancy(weekDays.get(i-1), String.valueOf(hour)) - registrationMap.getNumberOfAppointmentsOfTheDay(date);
        if(numberOfVacancyWithOutClassRoom < numberOfComputers && numberOfVacancyWithOutClassRoom > 0) {
          return false;
        }
      }
    }
View Full Code Here

TOP

Related Classes of br.com.visualmidia.business.RegistrationMap

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.