Example usage for java.util Locale PRC

List of usage examples for java.util Locale PRC

Introduction

In this page you can find the example usage for java.util Locale PRC.

Prototype

Locale PRC

To view the source code for java.util Locale PRC.

Click Source Link

Document

Useful constant for country.

Usage

From source file:org.kalypso.util.themes.image.controls.ImageComposite.java

/**
 * This function returns a up to date properties object, containing all serialized image properties.
 * /*from   w w w  .j  a va2 s .c  o m*/
 * @return A up to date properties object, containing all serialized image properties.
 */
public Properties getProperties() {
    /* Create the properties object. */
    final Properties properties = new Properties();

    /* Serialize the properties. */
    final String horizontalProperty = String.format(Locale.PRC, "%d", m_horizontal); //$NON-NLS-1$
    final String verticalProperty = String.format(Locale.PRC, "%d", m_vertical); //$NON-NLS-1$
    // FIXME: put into ThemeUtilities; its always the same in every theme ;-(
    final String backgroundColorProperty = String.format(Locale.PRC, "%d;%d;%d", m_background.red, //$NON-NLS-1$
            m_background.green, m_background.blue);
    String imageUrlProperty = null;
    if (m_imageUrl != null)
        imageUrlProperty = String.format(Locale.PRC, "%s", m_imageUrl); //$NON-NLS-1$

    /* Add the properties. */
    properties.put(PositionUtilities.THEME_PROPERTY_HORIZONTAL_POSITION, horizontalProperty);
    properties.put(PositionUtilities.THEME_PROPERTY_VERTICAL_POSITION, verticalProperty);
    properties.put(ThemeUtilities.THEME_PROPERTY_BACKGROUND_COLOR, backgroundColorProperty);
    properties.put(ImageUtilities.THEME_PROPERTY_IMAGE_URL, ""); //$NON-NLS-1$
    if (imageUrlProperty != null)
        properties.put(ImageUtilities.THEME_PROPERTY_IMAGE_URL, imageUrlProperty);

    return properties;
}

From source file:org.kalypso.util.themes.legend.controls.LegendComposite.java

/**
 * This function returns a up to date properties object, containing all serialized legend properties.
 * /*from   w  w  w .  j  a  v  a2 s .  c o m*/
 * @return A up to date properties object, containing all serialized legend properties.
 */
public Properties getProperties() {
    /* Create the properties object. */
    final Properties properties = new Properties();

    /* Serialize the properties. */
    final String horizontalProperty = String.format(Locale.PRC, "%d", m_horizontal); //$NON-NLS-1$
    final String verticalProperty = String.format(Locale.PRC, "%d", m_vertical); //$NON-NLS-1$
    final String backgroundColorProperty = String.format(Locale.PRC, "%d;%d;%d", m_backgroundColor.red, //$NON-NLS-1$
            m_backgroundColor.green, m_backgroundColor.blue);
    final String insetsProperty = String.format(Locale.PRC, "%d", m_insets); //$NON-NLS-1$
    final List<String> themeIds = new ArrayList<>();
    for (int i = 0; i < m_themeIds.size(); i++) {
        final String id = m_themeIds.get(i);
        themeIds.add(id);
    }
    final String themeIdsProperty = StringUtils.join(themeIds, ";"); //$NON-NLS-1$
    final String fontSizeProperty = String.format(Locale.PRC, "%d", m_fontSize); //$NON-NLS-1$

    /* Add the properties. */
    properties.put(PositionUtilities.THEME_PROPERTY_HORIZONTAL_POSITION, horizontalProperty);
    properties.put(PositionUtilities.THEME_PROPERTY_VERTICAL_POSITION, verticalProperty);
    properties.put(ThemeUtilities.THEME_PROPERTY_BACKGROUND_COLOR, backgroundColorProperty);
    properties.put(LegendUtilities.THEME_PROPERTY_INSETS, insetsProperty);
    properties.put(LegendUtilities.THEME_PROPERTY_THEME_IDS, themeIdsProperty);
    properties.put(LegendUtilities.THEME_PROPERTY_FONT_SIZE, fontSizeProperty);

    return properties;
}

From source file:org.kalypso.util.themes.legend.LegendUtilities.java

/**
 * This function returns a properties object, containing all serialized default legend properties.
 * //from w  w  w  .ja  v  a 2s .  c o m
 * @return A properties object, containing all serialized default legend properties.
 */
public static Properties getDefaultProperties() { /* Create the properties object. */
    final Properties properties = new Properties();

    /* Serialise the properties. */
    final String horizontalProperty = String.format(Locale.PRC, "%d", PositionUtilities.RIGHT); //$NON-NLS-1$
    final String verticalProperty = String.format(Locale.PRC, "%d", PositionUtilities.BOTTOM); //$NON-NLS-1$
    final String backgroundColorProperty = String.format(Locale.PRC, "%d;%d;%d", 255, 255, 255); //$NON-NLS-1$
    final String insetsProperty = String.format(Locale.PRC, "%d", 10); //$NON-NLS-1$
    final String themeIdsProperty = ""; //$NON-NLS-1$
    final String fontSizeProperty = "-1"; //$NON-NLS-1$

    /* Add the properties. */
    properties.put(PositionUtilities.THEME_PROPERTY_HORIZONTAL_POSITION, horizontalProperty);
    properties.put(PositionUtilities.THEME_PROPERTY_VERTICAL_POSITION, verticalProperty);
    properties.put(ThemeUtilities.THEME_PROPERTY_BACKGROUND_COLOR, backgroundColorProperty);
    properties.put(THEME_PROPERTY_INSETS, insetsProperty);
    properties.put(THEME_PROPERTY_THEME_IDS, themeIdsProperty);
    properties.put(THEME_PROPERTY_FONT_SIZE, fontSizeProperty);

    return properties;
}