Package org.nxplanner.format

Examples of org.nxplanner.format.DecimalFormat


   private double captionValue;

   public static void main(String[] args) throws IOException {
        JFrame jFrame = new JFrame("Test");
        jFrame.setSize(800, 700);
        ProgressBarImage image = new ProgressBarImage(100, 20, 12.9, Color.BLUE, 16.8, Color.RED, new DecimalFormat(Locale.getDefault(), ""));
        FileOutputStream fos = new FileOutputStream( "c:\\temp\\pic.jpeg" );
        // BufferedOutputStream bos = new BufferedOutputStream( fos );
        image.encodeJPEG( fos, (float) 1.0 );
        fos.flush();
        fos.close();
View Full Code Here


        }
    }

    private ActionForward doUpdateTimeAction(Session session, TimeEditorForm form,
            HttpServletRequest request, ActionMapping actionMapping) throws Exception {
        DecimalFormat decimalParser = new DecimalFormat(request);
        SimpleDateFormat dateTimeFormat = getDateTimeFormat(request);
        SimpleDateFormat dateFormat = getDateFormat(request);
        try {
            List timeEntries = session.find("from timeEntry in class org.nxplanner.domain.TimeEntry " +
                    "where timeEntry.taskId = ? order by timeEntry.reportDate",
                    form.getOid(), Hibernate.STRING);

            double hoursWorked = 0;
            boolean rowDeleted = false;
            for (int i = 0; i < form.getRowcount(); i++) {

                int id = 0;
                if (isPresent(form.getEntryId(i))) {
                    id = Integer.parseInt(form.getEntryId(i));
                }

                if (form.getDeleted(i) != null && form.getDeleted(i).equals("true")) {
                    TimeEntry entry = getEntry(timeEntries, id);
                    session.delete(entry);
                    rowDeleted = true;
                    continue;
                }

                Date startTime = null;
                if (isPresent(form.getStartTime(i))) {
                    startTime = dateTimeFormat.parse(form.getStartTime(i));
                }

                Date endTime = null;
                if (isPresent(form.getEndTime(i))) {
                    endTime = dateTimeFormat.parse(form.getEndTime(i));
                }

                int person1Id = 0;
                if (isPresent(form.getPerson1Id(i))) {
                    person1Id = Integer.parseInt(form.getPerson1Id(i));
                }

                int person2Id = 0;
                if (isPresent(form.getPerson2Id(i))) {
                    person2Id = Integer.parseInt(form.getPerson2Id(i));
                }

                double duration = 0;
                if (isPresent(form.getDuration(i))) {
                    duration = decimalParser.parse(form.getDuration(i));
                }

                Date reportDate = null;
                if (isPresent(form.getReportDate(i))) {
                    reportDate = dateFormat.parse(form.getReportDate(i));
View Full Code Here

    private ActionForward doUpdateEstimateAction(Session session, TimeEditorForm form,
            HttpServletRequest request) throws Exception {
        try {
            Task task = (Task)session.load(Task.class, new Integer(form.getOid()));
            task.setEstimatedHours(new DecimalFormat(request).parse(request.getParameter("estimate")));
            return new ActionForward(request.getParameter("returnto"), true);
        } finally {
            session.flush();
            session.connection().commit();
        }
View Full Code Here

            }

            double duration = 0;
            if (isPresent(getDuration(i))) {
                try {
                    duration = new DecimalFormat(request).parse(getDuration(i));
                } catch (ParseException ex) {
                    errors.add(ActionErrors.GLOBAL_ERROR,
                            new ActionError("edittime.error.unparsable_number"));
                }
            }
View Full Code Here

        support.form = editorForm;
        support.resources.setMessage("format.datetime", DATE_TIME_FORMAT);
        support.resources.setMessage("format.date", DATE_FORMAT);
        support.request.setLocale(LOCALE);
        support.resources.setMessage("format.decimal", DECIMAL_FORMAT);
        decimalFormat = new DecimalFormat(support.request);
        support.mapping.setInput("editor.jsp");
        mockSession = new MockSession();
        mockSession.connectionReturn = support.connection;
        mockSessionFactory = new MockSessionFactory();
        mockSessionFactory.openSessionReturn = mockSession;
View Full Code Here

                                          height,
                                          getBarValue(),
                                          getForegroundColor(),
                                          getMaxValue(),
                                          getBackgroundColor(),
                                          new DecimalFormat((HttpServletRequest) pageContext.getRequest()),
                                          getCaptionValue());
    }
View Full Code Here

TOP

Related Classes of org.nxplanner.format.DecimalFormat

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.