The name of the initial branch for new projects is now "main" instead of "master". Existing projects remain unchanged. More information: https://doku.lrz.de/display/PUBLIC/GitLab

Commit 571686f9 authored by Daniel Lehmberg's avatar Daniel Lehmberg
Browse files

[WIP] further reflection statements were removed

parent fd2924ab
Pipeline #59479 passed with stage
in 46 seconds
......@@ -185,7 +185,7 @@ public class ScenarioElementView extends JPanel implements ISelectScenarioElemen
this.txtrTextfiletextarea.setText(StateJsonConverter.serializeObject(scenarioElement));
} else {
this.txtrTextfiletextarea.setText(StateJsonConverter
.serializeObject(ReflectionAttributeModifier.getAttributes(scenarioElement)));
.serializeObject(scenarioElement.getAttributes()));
}
}
}
......
......@@ -31,8 +31,11 @@ public class ReflectionAttributeModifier {
double y = shape.getBounds2D().getCenterY();
((AgentWrapper) element).getAgentInitialStore().setPosition(new VPoint(x, y));
} else {
Attributes attributes =
org.vadere.simulator.entrypoints.ReflectionAttributeModifier.getAttributes(element);
Attributes attributes = element.getAttributes(); // replaces Relection code from above
//TODO: issue #91 Cannot easily replace the relection in the following code. Some Attributes classes have a
//TODO: setShape(shape) method such as AttributesStairs, but not all, so there is no guarantee...
//TODO: If there is no field "shape", then only the stacktrace is printed...
field = attributes.getClass().getDeclaredField("shape");
field.setAccessible(true);
field.set(attributes, shape);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment