GeoTools

OSGeo

Showing posts with label swing. Show all posts
Showing posts with label swing. Show all posts

Wednesday, September 14, 2011

Help the swing module to speak your language


We are adding support for localized text strings to the gt-swing module to make it easier for you to provide local versions of your applications.

A new LocaleUtils class has been added so that client code doesn't need to worry about the usual Java i18n boiler plate code for loading and caching ResourceBundles etc. Using this class, an application can set a preferred locale at the beginning of a session, prior to constructing any GUI components that will use localized text strings), like this:
LocaleUtils.setLocale(Locale.ITALIAN);

Then, localized text strings are retrieved like this:
String localToolTip = LocaleUtils.getValue("CursorTool", "ZoomInTooltip");

The text strings are stored in properties files as per the usual Java i18n conventions. For the swing module, the properties files are in the org.geotools.swing.locale package and group strings according to component category: e.g. "CursorTool". Adding support for a new language or language variant simply involves adding the appropriate locale to the properties files. LocaleUtils provides support for locales that are only defined for a subset of properties files by allowing the application to specify a list of locales in preference order. For example:
LocaleUtils.setLocale( Arrays.asList( firstPrefLocale, secondPrefLocale, fallbackLocale ) );

How you can help

We need volunteers to help add and review translations. To begin with, we are just adding support for the text strings used within the gt-swing module itself plus a small selection of generally useful strings. Next, we hope to extend the LocaleUtils class so that applications can register their own properties files.

If you would like to help please contact us via the GeoTools User list.

Sunday, August 21, 2011

Current work on the gt-swing module

The gt-swing module, which provides GUI widgets for GeoTools applications, is in transition. This is a technical term for broken - but broken with a mission: gt-swing module is being overhauled to become a fully supported GeoTools module.

What does this mean ?

Well, right now it means that if you want to run any of our tutorial applications you will need to use GeoTools version 8-SNAPSHOT. This is the development version which is updated daily. We wouldn't normally inflict this on those new to the library, but at the moment it is the only way you will get the tutorials to work.

What else does it mean ?

A better gt-swing module with lots of new features, better documentation and easier to understand code. In particular, the JMapPane and JMapFrame classes have been largely re-written and there is a new JLayeredMapPane class to make it easier to do animations and custom graphics over a map display.

When ?

Real Soon Now. Much of the work has already been completed. See the GeoTools issues reporter for a summary.

GeoTools has been so good to me I really want to help: what can I do ?

To date, we've only had enough people-power to work on the trunk sources in the GeoTools code repository (version 8-SNAPSHOT). We are looking for volunteers to help get the gt-swing module working again on the GeoTools stable branch (version 2.7). If you can help, please sing out on the user list. We will like you a lot.