- for(Map.Entry<Object, Object> entry : properties.entrySet()) {
- if (entry.getKey() instanceof String && entry.getValue() instanceof String) {
- String key = (String) entry.getKey();
- String value = (String) entry.getValue();
- if (key.equals("reach")) {
- try {
- reach = Integer.valueOf(value);
- } catch (NumberFormatException e) {
- e.printStackTrace();
- reach = 12;
- }
- } else if (key.equals("lineWidth")) {
- try {
- lineWidth = Float.valueOf(value);
- } catch (NumberFormatException e) {
- e.printStackTrace();
- lineWidth = 1.0F;
- }
- }
- }
+ reach = Integer.parseInt((String) properties.computeIfAbsent("reach", a -> "7"));
+ lineWidth = Float.valueOf((String) properties.computeIfAbsent("lineWidth", a -> "1"));
+ {
+ int r, g, b;
+ r = Integer.parseInt((String) properties.computeIfAbsent("yellowColorRed", a -> "255"));
+ g = Integer.parseInt((String) properties.computeIfAbsent("yellowColorGreen", a -> "255"));
+ b = Integer.parseInt((String) properties.computeIfAbsent("yellowColorBlue", a -> "0"));
+ yellowColor = new Color(r, g, b);
+ }
+ {
+ int r, g, b;
+ r = Integer.parseInt((String) properties.computeIfAbsent("redColorRed", a -> "255"));
+ g = Integer.parseInt((String) properties.computeIfAbsent("redColorGreen", a -> "0"));
+ b = Integer.parseInt((String) properties.computeIfAbsent("redColorBlue", a -> "0"));
+ redColor = new Color(r, g, b);