Package java.text

Examples of java.text.DateFormatSymbols$DateFormatSymbolsGetter


        else
        {
          final SimpleDateFormat sformat = new SimpleDateFormat(formatString);
          if (locale != null)
          {
            sformat.setDateFormatSymbols(new DateFormatSymbols(locale));
          }
          else
          {
            final ResourceBundleFactory factory = getResourceBundleFactory();
            sformat.setDateFormatSymbols(new DateFormatSymbols(factory.getLocale()));
          }
          format = sformat;
          dateFormat = sformat;
          lastLocale = localeUsed;
        }
View Full Code Here


        formatStringRaw = DEFAULT_FORMAT;
      }
      final Locale locale = runtime.getResourceBundleFactory().getLocale();
      final TimeZone timeZone = runtime.getResourceBundleFactory().getTimeZone();
      final SimpleDateFormat dateFormat = new SimpleDateFormat(String.valueOf(formatStringRaw), locale);
      dateFormat.setDateFormatSymbols(new DateFormatSymbols(locale));
      dateFormat.setTimeZone(timeZone);
      return dateFormat.format(staticValue);
    }
    return ElementTypeUtils.queryFieldName(element);
  }
View Full Code Here

      if (getDomainPeriodCount() > 0 && getDomainTimePeriod() != null)
      {
        if (getDomainTickFormatString() != null)
        {
          final SimpleDateFormat formatter = new SimpleDateFormat
              (getDomainTickFormatString(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
          numberAxis.setTickUnit
              (new DateTickUnit(getDateUnitAsInt(getDomainTimePeriod()), (int) getDomainPeriodCount(), formatter));
        }
        else
        {
          numberAxis.setTickUnit
              (new DateTickUnit(getDateUnitAsInt(getDomainTimePeriod()), (int) getDomainPeriodCount()));
        }
      }
    }

    if (domainAxis != null)
    {
      domainAxis.setLabel(getDomainTitle());
      if (getDomainTitleFont() != null)
      {
        domainAxis.setLabelFont(getDomainTitleFont());
      }
      domainAxis.setVerticalTickLabels(isDomainVerticalTickLabels());
      if (getDomainTickFont() != null)
      {
        domainAxis.setTickLabelFont(getDomainTickFont());
      }
      final int level = getRuntime().getProcessingContext().getCompatibilityLevel();
      if (ClassicEngineBoot.isEnforceCompatibilityFor(level, 3, 8))
      {
        if (getDomainMinimum() != 0)
        {
          domainAxis.setLowerBound(getDomainMinimum());
        }
        if (getDomainMaximum() != 1)
        {
          domainAxis.setUpperBound(getDomainMaximum());
        }
        if (getDomainMinimum() == 0 && getDomainMaximum() == 0)
        {
          domainAxis.setLowerBound(0);
          domainAxis.setUpperBound(1);
          domainAxis.setAutoRange(true);
        }
      }
      else
      {
        domainAxis.setLowerBound(getDomainMinimum());
        domainAxis.setUpperBound(getDomainMaximum());
        domainAxis.setAutoRange(isDomainAxisAutoRange());
      }
    }

    final ValueAxis rangeAxis = plot.getRangeAxis();
    if (rangeAxis instanceof NumberAxis)
    {
      final NumberAxis numberAxis = (NumberAxis) rangeAxis;
      numberAxis.setAutoRangeIncludesZero(isRangeIncludesZero());
      numberAxis.setAutoRangeStickyZero(isRangeStickyZero());

      if (getRangePeriodCount() > 0)
      {
        if (getRangeTickFormat() != null)
        {
          numberAxis.setTickUnit(new NumberTickUnit(getRangePeriodCount(), getRangeTickFormat()));
        }
        else if (getRangeTickFormatString() != null)
        {
          final FastDecimalFormat formatter = new FastDecimalFormat
              (getRangeTickFormatString(), getResourceBundleFactory().getLocale());
          numberAxis.setTickUnit(new FastNumberTickUnit(getRangePeriodCount(), formatter));
        }
        else
        {
          numberAxis.setTickUnit(new FastNumberTickUnit(getRangePeriodCount()));
        }
      }
      else
      {
        if (getRangeTickFormat() != null)
        {
          numberAxis.setNumberFormatOverride(getRangeTickFormat());
        }
        else if (getRangeTickFormatString() != null)
        {
          final DecimalFormat formatter = new DecimalFormat
              (getRangeTickFormatString(), new DecimalFormatSymbols(getResourceBundleFactory().getLocale()));
          numberAxis.setNumberFormatOverride(formatter);
        }
      }
    }
    else if (rangeAxis instanceof DateAxis)
    {
      final DateAxis numberAxis = (DateAxis) rangeAxis;

      if (getRangePeriodCount() > 0 && getRangeTimePeriod() != null)
      {
        if (getRangeTickFormatString() != null)
        {
          final SimpleDateFormat formatter = new SimpleDateFormat
              (getRangeTickFormatString(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
          numberAxis.setTickUnit
              (new DateTickUnit(getDateUnitAsInt(getRangeTimePeriod()), (int) getRangePeriodCount(), formatter));
        }
        else
        {
          numberAxis.setTickUnit
              (new DateTickUnit(getDateUnitAsInt(getRangeTimePeriod()), (int) getRangePeriodCount()));
        }
      }
      else
      {
        if (getRangeTickFormatString() != null)
        {
          final SimpleDateFormat formatter = new SimpleDateFormat
              (getRangeTickFormatString(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
          numberAxis.setDateFormatOverride(formatter);
        }
      }
    }
View Full Code Here

        if (getLinePeriodCount() > 0 && getLineTimePeriod() != null)
        {
          if (getLineTicksLabelFormat() != null)
          {
            final SimpleDateFormat formatter = new SimpleDateFormat
                (getLineTicksLabelFormat(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
            numberAxis.setTickUnit
                (new DateTickUnit(getDateUnitAsInt(getLineTimePeriod()), (int) getLinePeriodCount(), formatter));
          }
          else
          {
            numberAxis.setTickUnit
                (new DateTickUnit(getDateUnitAsInt(getLineTimePeriod()), (int) getLinePeriodCount()));
          }
        }
        else if (getRangeTickFormatString() != null)
        {
          final SimpleDateFormat formatter = new SimpleDateFormat
              (getRangeTickFormatString(), new DateFormatSymbols(getResourceBundleFactory().getLocale()));
          numberAxis.setDateFormatOverride(formatter);
        }
      }

      if (linesAxis != null)
View Full Code Here

   * constructor retrieves current locale and uses it for formatting data
   */
  private Converter() {
    try {
      this.sdf = new SimpleDateFormat("yyyy.MM.dd",
          new DateFormatSymbols(StatisticsManager.getLocale()));
    } catch (NullPointerException e) {
      logger
          .error("Class statistics.hibernate.Converter Error, can't get FacesContext");
    }
  }
View Full Code Here

    int minimum = cal.getActualMinimum(Calendar.DAY_OF_WEEK);

    int monthMax = cal.getActualMaximum(Calendar.MONTH);
    int monthMin = cal.getActualMinimum(Calendar.MONTH);

    DateFormatSymbols symbols = new DateFormatSymbols(locale);
    String[] weekDayLabels = symbols.getWeekdays();
    weekDayLabels = shiftDates(minimum, maximum, weekDayLabels);

    String[] weekDayLabelsShort = symbols.getShortWeekdays();
    weekDayLabelsShort = shiftDates(minimum, maximum, weekDayLabelsShort);

    String[] monthLabels  = symbols.getMonths();
    monthLabels = shiftDates(monthMin, monthMax, monthLabels);

    String[] monthLabelsShort  = symbols.getShortMonths();
    monthLabelsShort = shiftDates(monthMin, monthMax, monthLabelsShort);

    map.put(WEEK_DAY_LABELS, weekDayLabels);
    map.put(WEEK_DAY_LABELS_SHORT, weekDayLabelsShort);
    map.put(MONTH_LABELS, monthLabels);
View Full Code Here

    int minimum = cal.getActualMinimum(Calendar.DAY_OF_WEEK);

    int monthMax = cal.getActualMaximum(Calendar.MONTH);
    int monthMin = cal.getActualMinimum(Calendar.MONTH);

    DateFormatSymbols symbols = new DateFormatSymbols(locale);
    String[] weekDayLabels = ComponentUtil.asArray(calendar
        .getWeekDayLabels());
    if (weekDayLabels == null) {
      weekDayLabels = symbols.getWeekdays();
      weekDayLabels = shiftDates(minimum, maximum, weekDayLabels);
    }

    String[] weekDayLabelsShort = ComponentUtil.asArray(calendar
        .getWeekDayLabelsShort());
    if (weekDayLabelsShort == null) {
      weekDayLabelsShort = symbols.getShortWeekdays();
      weekDayLabelsShort = shiftDates(minimum, maximum,
          weekDayLabelsShort);
    }

    String[] monthLabels = ComponentUtil.asArray(calendar.getMonthLabels());
    if (monthLabels == null) {
      monthLabels = symbols.getMonths();
      monthLabels = shiftDates(monthMin, monthMax, monthLabels);
    }

    String[] monthLabelsShort = ComponentUtil.asArray(calendar
        .getMonthLabelsShort());
    if (monthLabelsShort == null) {
      monthLabelsShort = symbols.getShortMonths();
      monthLabelsShort = shiftDates(monthMin, monthMax, monthLabelsShort);
    }

    map.put(WEEK_DAY_LABELS, weekDayLabels);
    map.put(WEEK_DAY_LABELS_SHORT, weekDayLabelsShort);
View Full Code Here

   String[] shortMonths;

   public DateTimeDateFormat()
   {
      super();
      shortMonths = new DateFormatSymbols().getShortMonths();
   }
View Full Code Here

   String[] shortMonths;

   public DateTimeDateFormat()
   {
      super();
      shortMonths = new DateFormatSymbols().getShortMonths();
   }
View Full Code Here

         // Note that this is a little obtuse.
         // However, it is the best way that anyone can come up with
         // that works with some 1.4 series JVM.
        
         // Get the symbols for the localized pattern
         DateFormatSymbols localizedSymbols = new DateFormatSymbols(locale);
         String localChars = localizedSymbols.getLocalPatternChars();
         if (DEFAULT_PATTERN_CHARS.equals(localChars)) {
             return localizedPattern;
         }
View Full Code Here

TOP

Related Classes of java.text.DateFormatSymbols$DateFormatSymbolsGetter

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.