test_class.declarator: holder
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private ScaleInfoHolder holder;
test_class.type: ScaleInfoHolder
test_class.var_name: holder
test_class.declarator: cdpp = new ConfigurationDtoPostProcessor()
test_class.original_string: ConfigurationDtoPostProcessor cdpp = new ConfigurationDtoPostProcessor();
test_class.type: ConfigurationDtoPostProcessor
test_class.var_name: cdpp
test_class.file: impl/src/test/java/org/geomajas/internal/configuration/ScaleInfoEditorTest.java
test_class.identifier: ScaleInfoEditorTest
test_case.body: @Test
  	public void testSetAsText() {
  		ScaleInfoEditor editor = new ScaleInfoEditor();
  		editor.setAsText("1:2000");
  		Object o = editor.getValue();
  		Assert.assertTrue(o instanceof ScaleInfo);
  		ScaleInfo info = (ScaleInfo)o;
  		Assert.assertEquals(1, info.getNumerator(), 0.001);
  		Assert.assertEquals(2000, info.getDenominator(), 0.001);
  		Assert.assertEquals(1.8890, info.getPixelPerUnit(), 0.001);
  	}
test_case.class_method_signature: ScaleInfoEditorTest.testSetAsText()
test_case.full_signature: @Test public void testSetAsText()
test_case.identifier: testSetAsText
test_case.invocations: setAsText getValue assertTrue assertEquals getNumerator assertEquals getDenominator assertEquals getPixelPerUnit
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSetAsText()
focal_class.file: impl/src/main/java/org/geomajas/internal/configuration/ScaleInfoEditor.java
focal_class.identifier: ScaleInfoEditor
focal_class.class_method_signature: ScaleInfoEditor.setAsText(String text)
focal_class.full_signature: @Override public void setAsText(String text)
focal_class.identifier: setAsText
focal_class.modifiers: @Override public
focal_class.parameters: (String text)
focal_class.return: void
focal_class.signature: void setAsText(String text)
focal_class.superclass: extends PropertyEditorSupport
focal_method.body: @Override
  	public void setAsText(String text) throws IllegalArgumentException {
  		// Prepare the string; remove all spaces and all comma's:
  		text = text.replaceAll(" ", "");
  		text = text.replaceAll(",", "");
  
  		int pos = text.indexOf(':');
  		if (pos > 0) {
  			try {
  				double numerator = Double.parseDouble(text.substring(0, pos));
  				double denominator = Double.parseDouble(text.substring(pos + 1));
  				setValue(new ScaleInfo(numerator, denominator));
  			} catch (NumberFormatException e) {
  				throw new IllegalArgumentException("Scale " + text
  						+ " could not be parsed. The following format was expected:" + " (x : y).", e);
  			}
  		} else {
  			try {
  				// Not recommended....
  				setValue(new ScaleInfo(Double.parseDouble(text)));
  			} catch (NumberFormatException e) {
  				throw new IllegalArgumentException("Scale " + text
  						+ " could not be parsed. The following format was expected:" + " (x : y).", e);
  			}
  		}
  	}
focal_method.class_method_signature: ScaleInfoEditor.setAsText(String text)
focal_method.full_signature: @Override public void setAsText(String text)
focal_method.identifier: setAsText
focal_method.invocations: replaceAll replaceAll indexOf parseDouble substring parseDouble substring setValue setValue parseDouble
focal_method.modifiers: @Override public
focal_method.parameters: (String text)
focal_method.return: void
focal_method.signature: void setAsText(String text)