/** * Constructs a {@code GeographicImageWriter}. * * @param originatingProvider The {@code ImageWriterSpi} that * is constructing this object, or {@code null}. */ protected GeographicImageWriter(final ImageWriterSpi provider) { super(provider); availableLocales = Locales.getAvailableLocales(); }
/** * Constructs a new image reader. * * @param provider The {@link ImageReaderSpi} that is invoking this constructor, * or {@code null} if none. */ protected GeographicImageReader(final ImageReaderSpi provider) { super(provider); availableLocales = Locales.getAvailableLocales(); }
/** * Returns the list of available locales formatted as string in the specified locale. */ public static String[] getAvailableLocales(final Locale locale) { final Locale[] locales = getAvailableLocales(); final String[] display = new String[locales.length]; for (int i=0; i<locales.length; i++) { display[i] = locales[i].getDisplayName(locale); } Arrays.sort(display); return display; }
/** * Returns the list of available locales formatted as string in the specified locale. * * @param locale The locale to use for formatting the strings to be returned. * @return String descriptions of available locales. */ public static String[] getAvailableLocales(final Locale locale) { final Locale[] locales = getAvailableLocales(); final String[] display = new String[locales.length]; for (int i=0; i<locales.length; i++) { display[i] = locales[i].getDisplayName(locale); } Arrays.sort(display); return display; }
/** * Prints the list of available locales. */ public static void main(String[] args) { final Arguments arguments = new Arguments(args); args = arguments.getRemainingArguments(0); final String[] locales = getAvailableLocales(arguments.locale); for (int i=0; i<locales.length; i++) { arguments.out.println(locales[i]); } } }
/** * Prints the list of available locales. * * @param args Command-lines arguments. */ public static void main(String[] args) { final Arguments arguments = new Arguments(args); args = arguments.getRemainingArguments(0); final String[] locales = getAvailableLocales(arguments.locale); for (int i=0; i<locales.length; i++) { arguments.out.println(locales[i]); } } }