Removes parseJSON function.
@@ -56,21 +56,7 @@ public class Screen extends Component implements Receiver<String> {
setBackgroundColor(new Color(45, 45, 45, 255));
if (builder.getJsonObject() != null) {
- parseJSON(builder.getJsonObject());
- }
- }
-
- @Override
- public void receive(final String event, final String data) {
- if (radio != null) {
- if (event.equals("DRAW")) {
- transmitDraw();
- }
- }
- }
-
- private void parseJSON(final @NonNull JSONObject jsonObject) {
- final JSONArray components = (JSONArray) jsonObject.get("components");
+ final JSONArray components = (JSONArray) builder.getJsonObject().get("components");
if (components != null) {
for (final Object obj : components) {
@@ -87,6 +73,16 @@ public class Screen extends Component implements Receiver<String> {
}
}
}
+ }
+
+ @Override
+ public void receive(final String event, final String data) {
+ if (radio != null) {
+ if (event.equals("DRAW")) {
+ transmitDraw();
+ }
+ }
+ }
/**
* Loads an element from it's JSON representation.
