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
ef457470
Commit
ef457470
authored
Dec 02, 2019
by
Stefan Schuhbaeck
Committed by
Daniel Lehmberg
Dec 02, 2019
Browse files
call fireChangeViewportEvent from awt Event Thread
parent
b564e158
Changes
2
Hide whitespace changes
Inline
Side-by-side
VadereGui/src/org/vadere/gui/onlinevisualization/model/OnlineVisualizationModel.java
View file @
ef457470
package
org.vadere.gui.onlinevisualization.model
;
import
java.awt.*
;
import
java.awt.geom.Rectangle2D
;
import
java.util.ArrayList
;
import
java.util.Collection
;
...
...
@@ -140,8 +141,12 @@ public class OnlineVisualizationModel extends SimulationModel<DefaultSimulationC
if
(
topography
==
null
)
{
topography
=
observationAreaSnapshot
.
scenario
;
fireChangeViewportEvent
(
new
Rectangle2D
.
Double
(
topography
.
getBounds
().
x
,
topography
.
getBounds
().
y
,
topography
.
getBounds
().
width
,
topography
.
getBounds
().
height
));
// recalculate GUI (fireChangeViewportEvent will synchronize on model which is also
// needed by some awt event. Therefore do this in EDT (Event Dispatching Thread)
EventQueue
.
invokeLater
(()
->
{
fireChangeViewportEvent
(
new
Rectangle2D
.
Double
(
topography
.
getBounds
().
x
,
topography
.
getBounds
().
y
,
topography
.
getBounds
().
width
,
topography
.
getBounds
().
height
));
});
}
else
{
topography
=
observationAreaSnapshot
.
scenario
;
}
...
...
VadereSimulator/src/org/vadere/simulator/control/simulation/Simulation.java
View file @
ef457470
...
...
@@ -247,9 +247,9 @@ public class Simulation {
}
preLoop
();
logger
.
info
(
"preLoop finished."
);
while
(
isRunSimulation
)
{
synchronized
(
this
)
{
while
(
isPaused
)
{
try
{
...
...
Write
Preview
Supports
Markdown
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