Example usage for java.util Locale GERMANY

List of usage examples for java.util Locale GERMANY

Introduction

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

Prototype

Locale GERMANY

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

Click Source Link

Document

Useful constant for country.

Usage

From source file:de.kletterfreak98.xmass.ui.BMIChart.java

public BMIChart(String title, TimeSeries values) {
    super(title);
    setIconImage(//from   w w  w  . ja  v a 2 s . c o m
            new ImageIcon(getClass().getClassLoader().getResource("de/kletterfreak98/xmass/resources/fav.png"))
                    .getImage());

    // create a title...
    final String chartTitle = strings.getString("bmicourse");
    final XYDataset dataset = new TimeSeriesCollection(values);

    final JFreeChart chart = ChartFactory.createTimeSeriesChart(chartTitle, strings.getString("date"),
            strings.getString("bmi"), dataset, false, true, false);

    final XYPlot plot = chart.getXYPlot();
    plot.setDataset(1, new TimeSeriesCollection(values));
    plot.mapDatasetToRangeAxis(1, 1);
    final XYItemRenderer renderer = plot.getRenderer();
    renderer.setToolTipGenerator(StandardXYToolTipGenerator.getTimeSeriesInstance());
    if (renderer instanceof StandardXYItemRenderer) {
        final StandardXYItemRenderer rr = (StandardXYItemRenderer) renderer;
        rr.setShapesFilled(true);
    }

    final StandardXYItemRenderer renderer2 = new StandardXYItemRenderer();
    renderer2.setSeriesPaint(0, Color.black);
    renderer.setToolTipGenerator(StandardXYToolTipGenerator.getTimeSeriesInstance());
    plot.setRenderer(1, renderer2);

    final DateAxis axis = (DateAxis) plot.getDomainAxis();
    SimpleDateFormat sdf;
    if (Main.settings.getLang().equals(Locale.GERMANY)) {
        sdf = new SimpleDateFormat("dd.MM.yyyy");
    } else {
        sdf = new SimpleDateFormat("MM/dd/yyyy");
    }
    axis.setDateFormatOverride(sdf);

    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
    JPanel panel = new JPanel();
    JButton close = new JButton(strings.getString("close"));
    close.setPreferredSize(new Dimension(close.getWidth(), 30));
    close.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            dispose();
        }
    });
    panel.setLayout(new BorderLayout());
    panel.add(chartPanel, BorderLayout.CENTER);
    panel.add(close, BorderLayout.SOUTH);
    panel.setPreferredSize(new java.awt.Dimension(500, 270));
    setContentPane(panel);
    setUndecorated(true);
}

From source file:com.mobileman.projecth.web.service.LocaleService.java

/**
 * @return/*from w w w.  j a va 2 s .  c om*/
 */
public String getMedicationFrequencyOneTime() {
    return messageSource.getMessage("medication.frequeency.one-time", null, Locale.GERMANY);
}

From source file:org.openestate.io.is24_csv.Is24CsvFormat.java

public static Number parseNumber(String value, boolean integerOnly) throws NumberFormatException {
    return NumberUtils.parseNumber(value, integerOnly, Locale.GERMANY, Locale.ENGLISH);
}

From source file:com.mobileman.projecth.web.service.LocaleService.java

/**
 * @return// ww  w. ja  v a  2s  .  c o  m
 */
public String getMedicationFrequencyDaily() {
    return messageSource.getMessage("medication.frequeency.daily", null, Locale.GERMANY);
}

From source file:de.perdian.commons.i18n.polyglot.PolyglotImplTest.java

@Test
public void testGetMetaWithDefault() {

    PolyglotImpl<ExamplePolyglotWithDefault> polyglotImpl = new PolyglotImpl<>();
    polyglotImpl.setInstanceClass(ExamplePolyglotWithDefault.class);
    polyglotImpl.setMessageSource(new StaticMessageSource());
    PolyglotMeta polyglotMeta = polyglotImpl.getMeta(Locale.GERMANY);

    Assert.assertEquals(Locale.GERMANY, polyglotMeta.getLocale());
    Assert.assertEquals(1, polyglotMeta.getKeys().size());
    Assert.assertEquals(0, polyglotMeta.getMissingValueKeys().size());
    Assert.assertTrue(polyglotMeta.getKeys().containsAll(Arrays.asList("key")));

}

From source file:com.mobileman.projecth.business.MedicationServiceTest.java

/**
 * /*from   w ww.  jav a  2  s.c  om*/
 * @throws Exception
 */
@Test
public void findByNameOrPzn() throws Exception {
    List<Medication> medications = medicationService.findAllByNameOrPzn("Kort 1", Locale.getDefault());
    assertTrue(medications.isEmpty());

    medications = medicationService.findAllByNameOrPzn("Kort 1", Locale.GERMANY);
    assertEquals(1, medications.size());
    assertEquals("Kort 1", medications.get(0).getName());

    medications = medicationService.findAllByNameOrPzn("Kort", Locale.GERMANY);
    assertEquals(4, medications.size());

    medications = medicationService.findAllByNameOrPzn("2758099", Locale.GERMANY);
    assertEquals(1, medications.size());
}

From source file:de.interseroh.report.domain.visitors.RequestParamsBuilderTest.java

private Date fixedDate() {
    Calendar calendar = Calendar.getInstance(Locale.GERMANY);
    calendar.set(2015, 8, 5, 21, 12, 23);
    return new Date(calendar.getTimeInMillis());
}

From source file:org.opendatakit.utilities.LocalizationUtilsTest.java

@Test
public void testNormalizeDisplayName() throws JsonProcessingException {
    Map<String, Object> langMap = new TreeMap<String, Object>();
    langMap.put("en_US", "This is a test");
    langMap.put("en_GB", "Test is This");
    langMap.put("en", "Huh Test");
    langMap.put("fr", "Je suis");
    langMap.put("default", "No way!");
    Map<String, Object> topMap = new TreeMap<String, Object>();
    topMap.put("text", langMap);
    String value = ODKFileUtils.mapper.writeValueAsString(topMap);

    Locale defaultLocale;//from   w w w .  ja va  2 s . c om
    String full_locale;
    String match;

    Locale.setDefault(Locale.US);
    defaultLocale = Locale.getDefault();
    full_locale = defaultLocale.getLanguage() + "_" + defaultLocale.getCountry();
    match = LocalizationUtils.getLocalizedDisplayName(appName, tableId, full_locale, value);
    assertEquals("This is a test", match);

    Locale.setDefault(Locale.UK);
    defaultLocale = Locale.getDefault();
    full_locale = defaultLocale.getLanguage() + "_" + defaultLocale.getCountry();
    match = LocalizationUtils.getLocalizedDisplayName(appName, tableId, full_locale, value);
    assertEquals("Test is This", match);

    Locale.setDefault(Locale.CANADA);
    defaultLocale = Locale.getDefault();
    full_locale = defaultLocale.getLanguage() + "_" + defaultLocale.getCountry();
    match = LocalizationUtils.getLocalizedDisplayName(appName, tableId, full_locale, value);
    assertEquals("Huh Test", match);

    Locale.setDefault(Locale.CANADA_FRENCH);
    defaultLocale = Locale.getDefault();
    full_locale = defaultLocale.getLanguage() + "_" + defaultLocale.getCountry();
    match = LocalizationUtils.getLocalizedDisplayName(appName, tableId, full_locale, value);
    assertEquals("Je suis", match);

    Locale.setDefault(Locale.GERMANY);
    defaultLocale = Locale.getDefault();
    full_locale = defaultLocale.getLanguage() + "_" + defaultLocale.getCountry();
    match = LocalizationUtils.getLocalizedDisplayName(appName, tableId, full_locale, value);
    assertEquals("No way!", match);

    Locale.setDefault(Locale.US);
}

From source file:com.mobileman.projecth.business.patient.PatientMedicationServiceTest.java

/**
 * // w ww  . j a  v  a2s  .  c  om
 * @throws Exception
 */
@Test
public void addConsumedMedicationWeekly() throws Exception {

    int oldSize = patientMedicationDao.findAll().size();

    Patient patient = (Patient) userService.findUserByLogin("sysuser1");
    assertNotNull(patient);
    Medication medication = medicationService.findByName("Kort 2", Locale.GERMANY).get(0);

    Disease disease = diseaseService.findByCode(DiseaseCodes.RHEUMA_CODE);
    assertNotNull(disease);

    DateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy");
    Date startDate = dateFormat.parse("1.11.2010");
    Date endDate = dateFormat.parse("28.11.2010");

    patientMedicationService.addConsumedMedication(patient.getId(), disease.getId(), medication.getId(), 2.0d,
            MedicationFrequency.WEEKLY, startDate, endDate, null);
    assertEquals(oldSize + 4, patientMedicationDao.findAll().size());

}

From source file:org.opendatakit.common.android.utilities.ODKDataUtilsTest.java

@Test
public void testNormalizeDisplayName2() {
    Map<String, Object> langMap = new TreeMap<String, Object>();
    langMap.put("en_US", "This is a test");
    langMap.put("en_GB", "Test is This");
    langMap.put("en", "Huh Test");
    langMap.put("fr", "Je suis");
    langMap.put("default", "No way!");

    String match;//w  w  w. java 2 s .  co  m

    Locale.setDefault(Locale.US);
    match = ODKDataUtils.getLocalizedDisplayName(langMap);
    assertEquals("This is a test", match);

    Locale.setDefault(Locale.UK);
    match = ODKDataUtils.getLocalizedDisplayName(langMap);
    assertEquals("Test is This", match);

    Locale.setDefault(Locale.CANADA);
    match = ODKDataUtils.getLocalizedDisplayName(langMap);
    assertEquals("Huh Test", match);

    Locale.setDefault(Locale.CANADA_FRENCH);
    match = ODKDataUtils.getLocalizedDisplayName(langMap);
    assertEquals("Je suis", match);

    Locale.setDefault(Locale.GERMANY);
    match = ODKDataUtils.getLocalizedDisplayName(langMap);
    assertEquals("No way!", match);

    Locale.setDefault(Locale.US);
}