Package org.jboss.dashboard.domain

Examples of org.jboss.dashboard.domain.CompositeInterval


        for (int i = 0; i < maxNumberOfIntervals; i++) {
            results.add(intervals.get(i));
        }

        // ... and group the rest in a new aggregated interval.
        CompositeInterval compositeInterval = new CompositeInterval();
        ResourceBundle i18n = localeManager.getBundle("org.jboss.dashboard.displayer.messages", LocaleManager.currentLocale());
        compositeInterval.setDescription(i18n.getString(AbstractDomain.I18N_PREFFIX + "finalInterval"), LocaleManager.currentLocale());
        compositeInterval.setDomain(this);

        // Include the aggregated interval only if visible.
        if (!isIntervalHidden(compositeInterval)) {
            Set otherIntervals = new HashSet();
            for (int i = maxNumberOfIntervals; i < intervals.size(); i++) otherIntervals.add(intervals.get(i));
            compositeInterval.setIntervals(otherIntervals);
            results.add(compositeInterval);
        }
        return results;
    }
View Full Code Here


            dateInterval.setMaxDate(minDate);
            dateInterval.setMinDateIncluded(true);
            dateInterval.setMaxDateIncluded(false);

            // New composite interval.
            CompositeInterval compositeMinInterval = new CompositeInterval();
            Locale[] locales = LocaleManager.lookup().getPlatformAvailableLocales();
            for (int i=0; i<locales.length; i++) {
                Locale l = locales[i];
                compositeMinInterval.setDescription("< " + listOfIntervals.get(0).getDescription(l), l);
            }
            Set listOfMinIntervals = new HashSet();
            listOfMinIntervals.add(dateInterval);
            compositeMinInterval.setIntervals(listOfMinIntervals);
            compositeMinInterval.setDomain(this);
            results.add(compositeMinInterval);
        }
        // Add the list of intervals.
        results.addAll(listOfIntervals);

        // If there are values after the maxDate, create the final composite interval.
        if (maxDate != null && absoluteMaxDate != null && absoluteMaxDate.after(maxDate)) {
            // New date interval.
            DateInterval dateInterval = new DateInterval();
            dateInterval.setMinDate(maxDate);
            dateInterval.setMaxDate(absoluteMaxDate);
            dateInterval.setMinDateIncluded(false);
            dateInterval.setMaxDateIncluded(true);

            // New composite interval.
            CompositeInterval compositeMaxInterval = new CompositeInterval();
            Locale[] locales = LocaleManager.lookup().getPlatformAvailableLocales();
            for (int i=0; i<locales.length; i++) {
                Locale l = locales[i];
                compositeMaxInterval.setDescription("> " + listOfIntervals.get(listOfIntervals.size()-1).getDescription(l), l);
            }
            Set listOfMaxIntervals = new HashSet();
            listOfMaxIntervals.add(dateInterval);
            compositeMaxInterval.setIntervals(listOfMaxIntervals);
            compositeMaxInterval.setDomain(this);
            results.add(compositeMaxInterval);
        }
        return results;
    }
View Full Code Here

        if (value instanceof Collection) {
            if (((Collection) value).isEmpty()) return emptyValueString;
            return formatCollection(propertyId, (Collection) value, ", ", null, null, l);
        }
        if (value instanceof CompositeInterval) {
            CompositeInterval ci = (CompositeInterval) value;
            return formatCollection(propertyId, ci.getIntervals(), ", ", null, null, l);
        }
        if (value instanceof Interval) {
            Interval interval = (Interval) value;
            return interval.getDescription(l);
        }
View Full Code Here

            numericInterval.setMaxValue(minValue);
            numericInterval.setMinValueIncluded(true);
            numericInterval.setMaxValueIncluded(false);

            // New composite interval.
            CompositeInterval compositeMinInterval = new CompositeInterval();
            Locale[] locales = LocaleManager.lookup().getPlatformAvailableLocales();
            for (int i=0; i<locales.length; i++) {
                Locale l = locales[i];
                compositeMinInterval.setDescription("< " + ((NumericInterval) listOfIntervals.get(0)).getDescription(l), l);
            }
            Set listOfMinIntervals = new HashSet();
            listOfMinIntervals.add(numericInterval);
            compositeMinInterval.setIntervals(listOfMinIntervals);
            compositeMinInterval.setDomain(this);
            results.add(compositeMinInterval);
        }
        // Add the list of intervals.
        results.addAll(listOfIntervals);

        // If there are values after the maxValue, create the final composite interval.
        if (maxValue != null && absoluteMaxValue.longValue() > maxValue.longValue()) {
            // New date interval.
            NumericInterval numericInterval = new NumericInterval();
            numericInterval.setMinValue(maxValue);
            numericInterval.setMaxValue(absoluteMaxValue);
            numericInterval.setMinValueIncluded(false);
            numericInterval.setMaxValueIncluded(true);

            // New composite interval.
            CompositeInterval compositeMaxInterval = new CompositeInterval();
            Locale[] locales = LocaleManager.lookup().getPlatformAvailableLocales();
            for (int i=0; i<locales.length; i++) {
                Locale l = locales[i];
                compositeMaxInterval.setDescription("> " + ((NumericInterval) listOfIntervals.get(listOfIntervals.size()-1)).getDescription(l), l);
            }
            Set listOfMaxIntervals = new HashSet();
            listOfMaxIntervals.add(numericInterval);
            compositeMaxInterval.setIntervals(listOfMaxIntervals);
            compositeMaxInterval.setDomain(this);
            results.add(compositeMaxInterval);
        }
        return results;
    }
View Full Code Here

                        LabelInterval labelInterval = (LabelInterval) allowedValue;
                        targetRows.addAll(labelInterval.getHolder().rows);
                        filter.removeProperty(propId);
                    }
                    else if (allowedValue instanceof CompositeInterval) {
                        CompositeInterval compositeInterval = (CompositeInterval) allowedValue;
                        if (compositeInterval.getDomain() instanceof LabelDomain) {
                            LabelDomain labelDomain = (LabelDomain) compositeInterval.getDomain();
                            Set<Integer> compositeRows = labelDomain.getRowNumbers(compositeInterval.getIntervals());
                            targetRows.addAll(compositeRows);
                            filter.removeProperty(propId);
                        }
                    }
                }
View Full Code Here

        if (intervalsToShow.size() > maxNumberOfIntervals) {
            Interval[] results = new Interval[maxNumberOfIntervals + 1];
            for (int i = 0; i < maxNumberOfIntervals; i++) results[i] = (Interval) intervalsToShow.get(i);

            // Create a composite interval with the rest values.
            CompositeInterval compositeInterval = new CompositeInterval();
            ResourceBundle i18n = ResourceBundle.getBundle("org.jboss.dashboard.displayer.messages", LocaleManager.currentLocale());
            compositeInterval.setDescription(i18n.getString(AbstractDomain.I18N_PREFFIX + "finalInterval"), LocaleManager.currentLocale());
            Set otherIntervals = new HashSet();
            for (int i = maxNumberOfIntervals; i < intervalsToShow.size(); i++) otherIntervals.add(intervalsToShow.get(i));
            compositeInterval.setIntervals(otherIntervals);
            compositeInterval.setDomain(this);
            results[maxNumberOfIntervals] = compositeInterval;
            return results;
        } else {
            LabelInterval[] results = new LabelInterval[intervalsToShow.size()];
            for (int i = 0; i < intervalsToShow.size(); i++) results[i] = (LabelInterval) intervalsToShow.get(i);
View Full Code Here

            dateInterval.setMaxDate(minDate);
            dateInterval.setMinDateIncluded(true);
            dateInterval.setMaxDateIncluded(false);

            // New composite interval.
            CompositeInterval compositeMinInterval = new CompositeInterval();
            Locale[] locales = LocaleManager.lookup().getPlatformAvailableLocales();
            for (int i=0; i<locales.length; i++) {
                Locale l = locales[i];
                compositeMinInterval.setDescription("< " + listOfIntervals.get(0).getDescription(l), l);
            }
            Set listOfMinIntervals = new HashSet();
            listOfMinIntervals.add(dateInterval);
            compositeMinInterval.setIntervals(listOfMinIntervals);
            compositeMinInterval.setDomain(this);
            intervals.add(compositeMinInterval);
        }
        // Add the list of intervals.
        intervals.addAll(listOfIntervals);

        // If there are values after the maxDate, create the final composite interval.
        if (maxDate != null && absoluteMaxDate != null && absoluteMaxDate.after(maxDate)) {
            // New date interval.
            DateInterval dateInterval = new DateInterval();
            dateInterval.setMinDate(maxDate);
            dateInterval.setMaxDate(absoluteMaxDate);
            dateInterval.setMinDateIncluded(false);
            dateInterval.setMaxDateIncluded(true);

            // New composite interval.
            CompositeInterval compositeMaxInterval = new CompositeInterval();
            Locale[] locales = LocaleManager.lookup().getPlatformAvailableLocales();
            for (int i=0; i<locales.length; i++) {
                Locale l = locales[i];
                compositeMaxInterval.setDescription("> " + listOfIntervals.get(listOfIntervals.size()-1).getDescription(l), l);
            }
            Set listOfMaxIntervals = new HashSet();
            listOfMaxIntervals.add(dateInterval);
            compositeMaxInterval.setIntervals(listOfMaxIntervals);
            compositeMaxInterval.setDomain(this);
            intervals.add(compositeMaxInterval);
        }

        Interval[] results = new Interval[intervals.size()];
        for (int i = 0; i < results.length; i++) results[i] = (Interval) intervals.get(i);
View Full Code Here

            numericInterval.setMaxValue(minValue);
            numericInterval.setMinValueIncluded(true);
            numericInterval.setMaxValueIncluded(false);

            // New composite interval.
            CompositeInterval compositeMinInterval = new CompositeInterval();
            Locale[] locales = LocaleManager.lookup().getPlatformAvailableLocales();
            for (int i=0; i<locales.length; i++) {
                Locale l = locales[i];
                compositeMinInterval.setDescription("< " + ((NumericInterval) listOfIntervals.get(0)).getDescription(l), l);
            }
            Set listOfMinIntervals = new HashSet();
            listOfMinIntervals.add(numericInterval);
            compositeMinInterval.setIntervals(listOfMinIntervals);
            compositeMinInterval.setDomain(this);
            intervals.add(compositeMinInterval);
        }
        // Add the list of intervals.
        intervals.addAll(listOfIntervals);

        // If there are values after the maxValue, create the final composite interval.
        if (maxValue != null && absoluteMaxValue.longValue() > maxValue.longValue()) {
            // New date interval.
            NumericInterval numericInterval = new NumericInterval();
            numericInterval.setMinValue(maxValue);
            numericInterval.setMaxValue(absoluteMaxValue);
            numericInterval.setMinValueIncluded(false);
            numericInterval.setMaxValueIncluded(true);

            // New composite interval.
            CompositeInterval compositeMaxInterval = new CompositeInterval();
            Locale[] locales = LocaleManager.lookup().getPlatformAvailableLocales();
            for (int i=0; i<locales.length; i++) {
                Locale l = locales[i];
                compositeMaxInterval.setDescription("> " + ((NumericInterval) listOfIntervals.get(listOfIntervals.size()-1)).getDescription(l), l);
            }
            Set listOfMaxIntervals = new HashSet();
            listOfMaxIntervals.add(numericInterval);
            compositeMaxInterval.setIntervals(listOfMaxIntervals);
            compositeMaxInterval.setDomain(this);
            intervals.add(compositeMaxInterval);
        }

        Interval[] results = new Interval[intervals.size()];
        for (int i = 0; i < results.length; i++) results[i] = (Interval) intervals.get(i);
View Full Code Here

        for (int i = 0; i < maxNumberOfIntervals; i++) {
            results.add(intervals.get(i));
        }

        // ... and group the rest in a new aggregated interval.
        CompositeInterval compositeInterval = new CompositeInterval();
        ResourceBundle i18n = localeManager.getBundle("org.jboss.dashboard.displayer.messages", LocaleManager.currentLocale());
        compositeInterval.setDescription(i18n.getString(AbstractDomain.I18N_PREFFIX + "finalInterval"), LocaleManager.currentLocale());
        compositeInterval.setDomain(this);

        // Include the aggregated interval only if visible.
        if (!isIntervalHidden(compositeInterval)) {
            Set<Interval> otherIntervals = new HashSet<Interval>();
            for (int i = maxNumberOfIntervals; i < intervals.size(); i++) otherIntervals.add(intervals.get(i));
            compositeInterval.setIntervals(otherIntervals);
            results.add(compositeInterval);
        }
        return results;
    }
View Full Code Here

        for (int i = 0; i < maxNumberOfIntervals; i++) {
            results.add(intervals.get(i));
        }

        // ... and group the rest in a new aggregated interval.
        CompositeInterval compositeInterval = new CompositeInterval();
        ResourceBundle i18n = ResourceBundle.getBundle("org.jboss.dashboard.displayer.messages", LocaleManager.currentLocale());
        compositeInterval.setDescription(i18n.getString(AbstractDomain.I18N_PREFFIX + "finalInterval"), LocaleManager.currentLocale());
        compositeInterval.setDomain(this);

        // Include the aggregated interval only if visible.
        if (!isIntervalHidden(compositeInterval)) {
            Set otherIntervals = new HashSet();
            for (int i = maxNumberOfIntervals; i < intervals.size(); i++) otherIntervals.add(intervals.get(i));
            compositeInterval.setIntervals(otherIntervals);
            results.add(compositeInterval);
        }
        return results;
    }
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.domain.CompositeInterval

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.