Package java.text

Examples of java.text.DecimalFormat.applyLocalizedPattern()


        // if some constructors default pattern to null, it makes only sense
        // to handle null pattern gracefully
        if (pattern != null) {
            if (locPattern) {
                formatter.applyLocalizedPattern(pattern);
            } else {
                formatter.applyPattern(pattern);
            }
        } else {
            log.debug("No pattern provided, using default.");
View Full Code Here


        DecimalFormat numberFormat = (DecimalFormat) NumberFormat.getInstance(locale);

        // if some constructors default pattern to null, it makes only sense to handle null pattern gracefully
        if (pattern != null) {
            if (locPattern) {
                numberFormat.applyLocalizedPattern(pattern);
            } else {
                numberFormat.applyPattern(pattern);
            }
        } else {
            log.debug("No pattern provided, using default.");
View Full Code Here

    private DecimalFormat getDecimalFormat(Locale locale, String pattern) {

        DecimalFormat numberFormat = (DecimalFormat) NumberFormat.getInstance(locale);

        if (locPattern) {
            numberFormat.applyLocalizedPattern(pattern);
        }
        else {
            numberFormat.applyPattern(pattern);
        }
View Full Code Here

    public void setElementPattern(final String pattern, final boolean localized) {
        final Format format = elementFormat;
        if (format instanceof DecimalFormat) {
            final DecimalFormat df = (DecimalFormat) format;
            if (localized) {
                df.applyLocalizedPattern(pattern);
            } else {
                df.applyPattern(pattern);
            }
        } else if (format instanceof SimpleDateFormat) {
            final SimpleDateFormat df = (SimpleDateFormat) format;
View Full Code Here

                df.applyPattern(pattern);
            }
        } else if (format instanceof SimpleDateFormat) {
            final SimpleDateFormat df = (SimpleDateFormat) format;
            if (localized) {
                df.applyLocalizedPattern(pattern);
            } else {
                df.applyPattern(pattern);
            }
        } else if (format instanceof AngleFormat) {
            ((AngleFormat) format).applyPattern(pattern);
View Full Code Here

    // draw vectors
    drawVectors();
    // draw color bar
    if (settings.vectorShowColorBar) {
      DecimalFormat df = new DecimalFormat();
      df.applyLocalizedPattern(settings.vectorColorBarFormatString);
      int lvls = settings.vectorColorLevels;
      float cMin = settings.vectorMultiColorMin;
      float cMax = settings.vectorMultiColorMax;
      if (settings.vectorBackgroundColorCoding) {
        cMin = settings.vectorBackgroundColorCodingMin;
View Full Code Here

        DecimalFormat numberFormat = (DecimalFormat) NumberFormat.getInstance(locale);

        // if some constructors default pattern to null, it makes only sense to handle null pattern gracefully
        if (pattern != null) {
            if (locPattern) {
                numberFormat.applyLocalizedPattern(pattern);
            } else {
                numberFormat.applyPattern(pattern);
            }
        } else {
            log.warn("No pattern provided, using default.");
View Full Code Here

        // DecimalFormat is not thread safe so best to construct one each time
        DecimalFormat formatter = (DecimalFormat) DecimalFormat.getInstance(locale);
        // if some constructors default pattern to null, it makes only sense to handle null pattern gracefully
        if (pattern != null) {
            if (locPattern) {
                formatter.applyLocalizedPattern(pattern);
            } else {
                formatter.applyPattern(pattern);
            }
        } else {
            log.warn("No pattern provided, using default.");
View Full Code Here

        final DecimalFormat format = (DecimalFormat) super.createObject();
        if (getParameter("pattern") != null) {
            format.applyPattern((String) getParameter("pattern"));
        }
        if (getParameter("localizedPattern") != null) {
            format.applyLocalizedPattern((String) getParameter("localizedPattern"));
        }
        return format;
    }
}
View Full Code Here

            symbols = new DecimalFormatSymbols(locale);
        }
       
        DecimalFormat format = (DecimalFormat) NumberFormat.getInstance();
        format.setDecimalFormatSymbols(symbols);
        format.applyLocalizedPattern(pattern);
        return format.format(number);
    }

    private void assertArgCount(int count) {
        if (getArgumentCount() != count) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.