Package org.apache.myfaces.custom.schedule.model

Examples of org.apache.myfaces.custom.schedule.model.Interval


        boolean renderGutter = true;

        while (intervalIt.hasNext())
        {
            Interval interval = (Interval) intervalIt.next();
            int intervalHeight = calcRowHeight(rowHeight, interval.getDuration()) - 1;

            // Don't render rows where the timespan is too small
            if (intervalHeight <= 0)
            {
                continue;
            }

            if (!renderGutter)
            {
                renderGutter = true;
                continue;
            }

            writer.startElement(HTML.TR_ELEM, schedule);

            int gutterHeight = intervalHeight;

            if (day.getIntervals() == null && interval.getStartMinutes(getTimeZone(schedule)) == 0)
            {
                gutterHeight = (gutterHeight * 2) + 1;
                renderGutter = false;
            }                   

            //write the hours of the day on the left
            //this only happens on even rows, or every hour
            writer.startElement(HTML.TD_ELEM, schedule);
            writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "gutter"), null);
            writer.writeAttribute(
                    HTML.STYLE_ATTR,
                    "height: " + gutterHeight
                    + "px; border-style: none; border-width: 0px; overflow: hidden; padding: 0px",
                    null);
            if (interval.getDuration() >= HalfHourInterval.HALF_HOUR)
            {
                if (!useIntervalLabels || interval.getLabel() == null)
                {
                    writer.startElement(HTML.SPAN_ELEM, schedule);
                    writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
                            renderGutter ? "minutes" : "hours"), null);
                    writer.writeAttribute(HTML.STYLE_ATTR,
                            "vertical-align: top; height: 100%; padding: 0px;",
                            null);
                    writer.writeText(hourFormater.format(interval.getStartTime()), null);
                    writer.endElement(HTML.SPAN_ELEM);
                }
                writer.startElement(HTML.SPAN_ELEM, schedule);
                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
                "minutes"), null);
                writer.writeAttribute(HTML.STYLE_ATTR,
                        "vertical-align: top; height: 100%; padding: 0px;",
                        null);
                if (useIntervalLabels && interval.getLabel() != null)
                {
                    writer.writeText(interval.getLabel(), null);
                }
                else
                {
                    writer.writeText((renderGutter ? minuteFormater : shortMinuteFormater).format(interval.getStartTime()), null);
                }
                writer.endElement(HTML.SPAN_ELEM);
            }
            writer.endElement(HTML.TD_ELEM);
            writer.endElement(HTML.TR_ELEM);
View Full Code Here


            Iterator intervalIt = day.getIntervals(startHour, endHour).iterator();
            boolean even = false;

            while (intervalIt.hasNext())
            {
                Interval interval = (Interval) intervalIt.next();
                int intervalHeight = calcRowHeight(rowHeight, interval.getDuration()) - 1;

                // Don't render rows where the timespan is too small
                if (intervalHeight <= 0)
                {
                    continue;
                }

                writer.startElement(HTML.TR_ELEM, schedule);

                writer.startElement(HTML.TD_ELEM, schedule);
                writer.writeAttribute(HTML.CLASS_ATTR, getCellClass(schedule,
                        day, even, interval.getStartHours(getTimeZone(schedule))), null);
                writer.writeAttribute(HTML.STYLE_ATTR,
                        "overflow: hidden; height: " + intervalHeight + "px;", null);
                if (!repeatedIntervals && interval.getLabel() != null)
                {
                    writer.write(interval.getLabel());
                }
                writer.endElement(HTML.TD_ELEM);

                writer.endElement(HTML.TR_ELEM);
View Full Code Here

        boolean renderGutter = true;

        while (intervalIt.hasNext())
        {
            Interval interval = (Interval) intervalIt.next();
            int intervalHeight = calcRowHeight(rowHeight, interval.getDuration()) - 1;

            // Don't render rows where the timespan is too small
            if (intervalHeight <= 0)
            {
                continue;
            }

            if (!renderGutter)
            {
                renderGutter = true;
                continue;
            }

            writer.startElement(HTML.TR_ELEM, schedule);

            int gutterHeight = intervalHeight;

            if (day.getIntervals() == null && interval.getStartMinutes(getTimeZone(schedule)) == 0)
            {
                gutterHeight = (gutterHeight * 2) + 1;
                renderGutter = false;
            }                   

            //write the hours of the day on the left
            //this only happens on even rows, or every hour
            writer.startElement(HTML.TD_ELEM, schedule);
            writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "gutter"), null);
            writer.writeAttribute(
                    HTML.STYLE_ATTR,
                    "height: " + gutterHeight
                    + "px; border-style: none; border-width: 0px; overflow: hidden; padding: 0px",
                    null);
            if (interval.getDuration() >= HalfHourInterval.HALF_HOUR)
            {
                if (!useIntervalLabels || interval.getLabel() == null)
                {
                    writer.startElement(HTML.SPAN_ELEM, schedule);
                    writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
                            renderGutter ? "minutes" : "hours"), null);
                    writer.writeAttribute(HTML.STYLE_ATTR,
                            "vertical-align: top; height: 100%; padding: 0px;",
                            null);
                    writer.writeText(hourFormater.format(interval.getStartTime()), null);
                    writer.endElement(HTML.SPAN_ELEM);
                }
                writer.startElement(HTML.SPAN_ELEM, schedule);
                writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule,
                "minutes"), null);
                writer.writeAttribute(HTML.STYLE_ATTR,
                        "vertical-align: top; height: 100%; padding: 0px;",
                        null);
                if (useIntervalLabels && interval.getLabel() != null)
                {
                    writer.writeText(interval.getLabel(), null);
                }
                else
                {
                    writer.writeText((renderGutter ? minuteFormater : shortMinuteFormater).format(interval.getStartTime()), null);
                }
                writer.endElement(HTML.SPAN_ELEM);
            }
            writer.endElement(HTML.TD_ELEM);
        }
View Full Code Here

            Iterator intervalIt = day.getIntervals(startHour, endHour).iterator();
            boolean even = false;

            while (intervalIt.hasNext())
            {
                Interval interval = (Interval) intervalIt.next();
                int intervalHeight = calcRowHeight(rowHeight, interval.getDuration()) - 1;

                // Don't render rows where the timespan is too small
                if (intervalHeight <= 0)
                {
                    continue;
                }

                writer.startElement(HTML.TR_ELEM, schedule);

                writer.startElement(HTML.TD_ELEM, schedule);
                writer.writeAttribute(HTML.CLASS_ATTR, getCellClass(schedule,
                        day, even, interval.getStartHours(getTimeZone(schedule))), null);
                writer.writeAttribute(HTML.STYLE_ATTR,
                        "overflow: hidden; height: " + intervalHeight + "px;", null);
                if (!repeatedIntervals && interval.getLabel() != null)
                {
                    writer.write(interval.getLabel());
                }
                writer.endElement(HTML.TD_ELEM);

                writer.endElement(HTML.TR_ELEM);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.custom.schedule.model.Interval

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.