Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
571686f9
Commit
571686f9
authored
Jul 02, 2018
by
Daniel Lehmberg
Browse files
[WIP] further reflection statements were removed
parent
fd2924ab
Pipeline
#59479
passed with stage
in 46 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
VadereGui/src/org/vadere/gui/components/view/ScenarioElementView.java
View file @
571686f9
...
...
@@ -184,8 +184,8 @@ public class ScenarioElementView extends JPanel implements ISelectScenarioElemen
}
else
if
(
scenarioElement
instanceof
Pedestrian
)
{
this
.
txtrTextfiletextarea
.
setText
(
StateJsonConverter
.
serializeObject
(
scenarioElement
));
}
else
{
this
.
txtrTextfiletextarea
.
setText
(
StateJsonConverter
.
serializeObject
(
ReflectionAttributeModifier
.
getAttributes
(
scenarioElement
)));
this
.
txtrTextfiletextarea
.
setText
(
StateJsonConverter
.
serializeObject
(
scenarioElement
.
getAttributes
(
)));
}
}
}
...
...
VadereGui/src/org/vadere/gui/topographycreator/control/ReflectionAttributeModifier.java
View file @
571686f9
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment